您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ time_to_jiffies函数代码示例

51自学网 2021-06-03 08:50:53
  C++
这篇教程C++ time_to_jiffies函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中time_to_jiffies函数的典型用法代码示例。如果您正苦于以下问题:C++ time_to_jiffies函数的具体用法?C++ time_to_jiffies怎么用?C++ time_to_jiffies使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了time_to_jiffies函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: fuse_change_timeout

/* * Set dentry and possibly attribute timeouts from the lookup/mk* * replies */static void fuse_change_timeout(struct dentry *entry, struct fuse_entry_out *o){	entry->d_time = time_to_jiffies(o->entry_valid, o->entry_valid_nsec);	if (entry->d_inode)		get_fuse_inode(entry->d_inode)->i_time =			time_to_jiffies(o->attr_valid, o->attr_valid_nsec);}
开发者ID:JBTech,项目名称:ralink_rt5350,代码行数:11,


示例2: fuse_setattr

/* * Set attributes, and at the same time refresh them. * * Truncation is slightly complicated, because the 'truncate' request * may fail, in which case we don't want to touch the mapping. * vmtruncate() doesn't allow for this case, so do the rlimit checking * and the actual truncation by hand. */static int fuse_setattr(struct dentry *entry, struct iattr *attr){	struct inode *inode = entry->d_inode;	struct fuse_conn *fc = get_fuse_conn(inode);	struct fuse_inode *fi = get_fuse_inode(inode);	struct fuse_req *req;	struct fuse_setattr_in inarg;	struct fuse_attr_out outarg;	int err;	int is_truncate = 0;	if (fc->flags & FUSE_DEFAULT_PERMISSIONS) {		err = inode_change_ok(inode, attr);		if (err)			return err;	}	if (attr->ia_valid & ATTR_SIZE) {		unsigned long limit;		is_truncate = 1;		limit = current->signal->rlim[RLIMIT_FSIZE].rlim_cur;		if (limit != RLIM_INFINITY && attr->ia_size > (loff_t) limit) {			send_sig(SIGXFSZ, current, 0);			return -EFBIG;		}	}	req = fuse_get_req(fc);	if (IS_ERR(req))		return PTR_ERR(req);	memset(&inarg, 0, sizeof(inarg));	iattr_to_fattr(attr, &inarg);	req->in.h.opcode = FUSE_SETATTR;	req->in.h.nodeid = get_node_id(inode);	req->in.numargs = 1;	req->in.args[0].size = sizeof(inarg);	req->in.args[0].value = &inarg;	req->out.numargs = 1;	req->out.args[0].size = sizeof(outarg);	req->out.args[0].value = &outarg;	request_send(fc, req);	err = req->out.h.error;	fuse_put_request(fc, req);	if (!err) {		if ((inode->i_mode ^ outarg.attr.mode) & S_IFMT) {			make_bad_inode(inode);			err = -EIO;		} else {			if (is_truncate)				fuse_vmtruncate(inode, outarg.attr.size);			fuse_change_attributes(inode, &outarg.attr);			fi->i_time = time_to_jiffies(outarg.attr_valid,						     outarg.attr_valid_nsec);		}	} else if (err == -EINTR)		fuse_invalidate_attr(inode);	return err;}
开发者ID:jameshilliard,项目名称:20-4-4,代码行数:68,


示例3: fuse_do_getattr

int fuse_do_getattr(struct inode *inode){	int err;	struct fuse_attr_out arg;	struct fuse_conn *fc = get_fuse_conn(inode);	struct fuse_req *req = fuse_get_request(fc);	if (!req)		return -EINTR;	req->in.h.opcode = FUSE_GETATTR;	req->in.h.nodeid = get_node_id(inode);	req->inode = inode;	req->out.numargs = 1;	req->out.args[0].size = sizeof(arg);	req->out.args[0].value = &arg;	request_send(fc, req);	err = req->out.h.error;	fuse_put_request(fc, req);	if (!err) {		if ((inode->i_mode ^ arg.attr.mode) & S_IFMT) {#ifndef KERNEL_2_6_12_PLUS			if (get_node_id(inode) != FUSE_ROOT_ID)				make_bad_inode(inode);#else			make_bad_inode(inode);#endif			err = -EIO;		} else {			struct fuse_inode *fi = get_fuse_inode(inode);			fuse_change_attributes(inode, &arg.attr);			fi->i_time = time_to_jiffies(arg.attr_valid,						     arg.attr_valid_nsec);		}	}	return err;}
开发者ID:JBTech,项目名称:ralink_rt5350,代码行数:36,


示例4: entry_attr_timeout

u64 entry_attr_timeout(struct fuse_entry_out *o){	return time_to_jiffies(o->attr_valid, o->attr_valid_nsec);}
开发者ID:Anjali05,项目名称:linux,代码行数:4,


示例5: fuse_setattr

/* * Set attributes, and at the same time refresh them. * * Truncation is slightly complicated, because the 'truncate' request * may fail, in which case we don't want to touch the mapping. * vmtruncate() doesn't allow for this case, so do the rlimit checking * and the actual truncation by hand. */static int fuse_setattr(struct dentry *entry, struct iattr *attr){	struct inode *inode = entry->d_inode;	struct fuse_conn *fc = get_fuse_conn(inode);	struct fuse_inode *fi = get_fuse_inode(inode);	struct fuse_req *req;	struct fuse_setattr_in inarg;	struct fuse_attr_out outarg;	int err;	int is_truncate = 0;	if (!fuse_allow_task(fc, current))		return -EACCES;	if (fc->flags & FUSE_DEFAULT_PERMISSIONS) {		err = inode_change_ok(inode, attr);		if (err)			return err;	}	if (attr->ia_valid & ATTR_SIZE) {		unsigned long limit;		is_truncate = 1;		if (IS_SWAPFILE(inode))			return -ETXTBSY;#ifdef KERNEL_2_6_10_PLUS		limit = current->signal->rlim[RLIMIT_FSIZE].rlim_cur;#else		limit = current->rlim[RLIMIT_FSIZE].rlim_cur;#endif		if (limit != RLIM_INFINITY && attr->ia_size > (loff_t) limit) {			send_sig(SIGXFSZ, current, 0);			return -EFBIG;		}	}	req = fuse_get_req(fc);	if (IS_ERR(req))		return PTR_ERR(req);	memset(&inarg, 0, sizeof(inarg));	iattr_to_fattr(attr, &inarg);	/* Defend against future expansion of ATTR_FILE use */	if (S_ISDIR(inode->i_mode))		inarg.valid &= ~FATTR_FH;	req->in.h.opcode = FUSE_SETATTR;	req->in.h.nodeid = get_node_id(inode);	req->in.numargs = 1;	req->in.args[0].size = sizeof(inarg);	req->in.args[0].value = &inarg;	req->out.numargs = 1;	req->out.args[0].size = sizeof(outarg);	req->out.args[0].value = &outarg;	request_send(fc, req);	err = req->out.h.error;	fuse_put_request(fc, req);	if (!err) {		if ((inode->i_mode ^ outarg.attr.mode) & S_IFMT) {#ifndef KERNEL_2_6_12_PLUS			if (get_node_id(inode) != FUSE_ROOT_ID)				make_bad_inode(inode);#else			make_bad_inode(inode);#endif			err = -EIO;		} else {			if (is_truncate)				fuse_vmtruncate(inode, outarg.attr.size);			fuse_change_attributes(inode, &outarg.attr);			fi->i_time = time_to_jiffies(outarg.attr_valid,						     outarg.attr_valid_nsec);		}	} else if (err == -EINTR)		fuse_invalidate_attr(inode);	return err;}
开发者ID:1x23,项目名称:unifi-gpl,代码行数:85,



注:本文中的time_to_jiffies函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ time_type函数代码示例
C++ time_t函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。