• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ build_open_flags函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: do_sys_open

long do_sys_open(int dfd, const char __user *filename, int flags, umode_t mode)
{
	struct open_flags op;
	int fd = build_open_flags(flags, mode, &op);
	struct filename *tmp;

	if (fd)
		return fd;

	tmp = getname(filename);
	if (IS_ERR(tmp))
		return PTR_ERR(tmp);

	fd = get_unused_fd_flags(flags);
	if (fd >= 0) {
		struct file *f = do_filp_open(dfd, tmp, &op);
		if (IS_ERR(f)) {
			put_unused_fd(fd);
			fd = PTR_ERR(f);
		} else {
			fsnotify_open(f);
			fd_install(fd, f);
		}
	}
	putname(tmp);
	return fd;
}
开发者ID:wpwrak,项目名称:ben-wpan-linux,代码行数:27,代码来源:open.c


示例2: do_sys_open

long do_sys_open(int dfd, const char __user *filename, int flags, umode_t mode)
{
	struct open_flags op;
	int lookup = build_open_flags(flags, mode, &op);
	char *tmp = getname(filename);
	int fd = PTR_ERR(tmp);

	if (!IS_ERR(tmp)) {
		fd = get_unused_fd_flags(flags);
		if (fd >= 0) {
			struct file *f = do_filp_open(dfd, tmp, &op, lookup);
			if (IS_ERR(f)) {
				put_unused_fd(fd);
				fd = PTR_ERR(f);
			} else {
				fsnotify_open(f);
				fd_install(fd, f);
				/* LGE_CHANGE_S
				 *
				 * do read/mmap profiling during booting
				 * in order to use the data as readahead args
				 *
				 * [email protected] 20120503
				 */
				sreadahead_prof( f, 0, 0);
				/* LGE_CHANGE_E */
			}
		}
		putname(tmp);
	}
	return fd;
}
开发者ID:adyjl,项目名称:DORIMANX_LG_STOCK_LP_KERNEL,代码行数:32,代码来源:open.c


示例3: do_sys_open

long do_sys_open(int dfd, const char __user *filename, int flags, int mode)
{
	struct open_flags op;
	int lookup = build_open_flags(flags, mode, &op);
	char *tmp = getname(filename);
	int fd = PTR_ERR(tmp);

	if (!IS_ERR(tmp)) {
		fd = get_unused_fd_flags(flags);
		if (fd >= 0) {
			struct file *f = do_filp_open(dfd, tmp, &op, lookup);
			if (IS_ERR(f)) {
				put_unused_fd(fd);
				fd = PTR_ERR(f);
			} else {
				fsnotify_open(f);
				fd_install(fd, f);
//ASUS_BSP +++ Jimmy,Josh "remove fuse"
				if(strcmp(f->f_vfsmnt->mnt_mountpoint->d_iname,"sdcard")==0){
					chown_common(&(f->f_path),-1,1015);
				}
//ASUS_BSP --- Jimmy,Josh "remove fuse"
			}
		}
		putname(tmp);
	}
	return fd;
}
开发者ID:SmokyBob,项目名称:android_kernel_asus_padfone2,代码行数:28,代码来源:open.c


示例4: do_sys_open

long do_sys_open(int dfd, const char __user *filename, int flags, umode_t mode)
{
	struct open_flags op;
	int lookup = build_open_flags(flags, mode, &op);
	char *tmp = getname(filename);
	int fd = PTR_ERR(tmp);
	if (!IS_ERR(tmp)) {
		fd = get_unused_fd_flags(flags);
		if (fd >= 0) {
			struct file *f = do_filp_open(dfd, tmp, &op, lookup);
			if (IS_ERR(f)) {
				put_unused_fd(fd);
				fd = PTR_ERR(f);
			} else {
				fsnotify_open(f);
				fd_install(fd, f);
                /*             
                  
                                                        
                                                             
                  
                                                  
                 */
                sreadahead_prof( f, 0, 0);
                /*              */

			}
		}
		putname(tmp);
	}
	return fd;
}
开发者ID:That-Kurt,项目名称:kk_mt6577,代码行数:32,代码来源:open.c


示例5: build_open_flags

struct file *file_open_root(struct dentry *dentry, struct vfsmount *mnt,
			    const char *filename, int flags, umode_t mode)
{
	struct open_flags op;
	int err = build_open_flags(flags, mode, &op);
	if (err)
		return ERR_PTR(err);
	return do_file_open_root(dentry, mnt, filename, &op);
}
开发者ID:krzk,项目名称:linux,代码行数:9,代码来源:open.c


示例6: build_open_flags

struct file *file_open_root(struct dentry *dentry, struct vfsmount *mnt,
			    const char *filename, int flags)
{
	struct open_flags op;
	int err = build_open_flags(flags, 0, &op);
	if (err)
		return ERR_PTR(err);
	if (flags & O_CREAT)
		return ERR_PTR(-EINVAL);
	return do_file_open_root(dentry, mnt, filename, &op);
}
开发者ID:shinsec,项目名称:linux-parrot,代码行数:11,代码来源:open.c


示例7: build_open_flags

struct file *file_open_root(struct dentry *dentry, struct vfsmount *mnt,
			    const char *filename, int flags)
{
	struct open_flags op;
	int lookup = build_open_flags(flags, 0, &op);
	if (flags & O_CREAT)
		return ERR_PTR(-EINVAL);
	if (!filename && (flags & O_DIRECTORY))
		if (!dentry->d_inode->i_op->lookup)
			return ERR_PTR(-ENOTDIR);
	return do_file_open_root(dentry, mnt, filename, &op, lookup);
}
开发者ID:boa19861105,项目名称:Blackout-Monarudo,代码行数:12,代码来源:open.c


示例8: do_sys_open

long do_sys_open(int dfd, const char __user *filename, int flags, umode_t mode)
{
	struct open_flags op;
	int lookup = build_open_flags(flags, mode, &op);
	char *tmp = getname(filename);
	int fd = PTR_ERR(tmp);
#if IO_LOGGER_ENABLE

	unsigned long long time1 = 0,timeoffset = 0;
	bool add_trace_e = false;
#endif
	if (!IS_ERR(tmp)) {
#if IO_LOGGER_ENABLE
		if(unlikely(en_IOLogger())){
			if(!memcmp(tmp,"/data",5)||!memcmp(tmp,"/system",7)){
				add_trace_e = true;
				time1 = sched_clock();
				AddIOTrace(IO_LOGGER_MSG_VFS_OPEN_INTFS,do_sys_open,tmp);
			}
		}
		
#endif
		fd = get_unused_fd_flags(flags);
		if (fd >= 0) {
			struct file *f = do_filp_open(dfd, tmp, &op, lookup);
			if (IS_ERR(f)) {
				put_unused_fd(fd);
				fd = PTR_ERR(f);
			} else {
				fsnotify_open(f);
				fd_install(fd, f);
			}
		}
#if IO_LOGGER_ENABLE
			if(unlikely(en_IOLogger()) && add_trace_e){
				timeoffset = sched_clock() - time1;
				add_trace_e = false;
				if(BEYOND_TRACE_LOG_TIME(timeoffset))
				{
					 AddIOTrace(IO_LOGGER_MSG_VFS_OPEN_INTFS_END,do_sys_open,tmp,timeoffset);	
					 if(BEYOND_DUMP_LOG_TIME(timeoffset))
						DumpIOTrace(timeoffset);
					
				}
			}
#endif
		putname(tmp);
	}
	return fd;
}
开发者ID:Lesozav25,项目名称:ZOPO-TSN,代码行数:50,代码来源:open.c


示例9: do_sys_open

long do_sys_open(int dfd, const char __user *filename, int flags, umode_t mode)
{
	struct open_flags op;
	int lookup = build_open_flags(flags, mode, &op);
	char *tmp = getname(filename);
	int fd = PTR_ERR(tmp);

	if (!IS_ERR(tmp)) {
#if (IO_TEST_DEBUG)
		if(!(flags & O_DIRECTORY)&& strstr(filename, "_quadrant_.tmp"))
		{
			if (flags&0x00000001)
			{
				io_w_test_count = (io_w_test_count + 1)%10;
				flags = 0x00000042;
			}
			else
			{
				flags = 0x00000002;
			}
		}
#endif
		fd = get_unused_fd_flags(flags);
		if (fd >= 0) {
			struct file *f = do_filp_open(dfd, tmp, &op, lookup);
			if (IS_ERR(f)) {
				put_unused_fd(fd);
				fd = PTR_ERR(f);
			} else {
				fsnotify_open(f);
				fd_install(fd, f);
			}
		}
		putname(tmp);
	}
	return fd;
}
开发者ID:GREYFOXRGR,项目名称:BPI-M3-bsp,代码行数:37,代码来源:open.c


示例10: build_open_flags

/**
 * file_open_name - open file and return file pointer
 *
 * @name:	struct filename containing path to open
 * @flags:	open flags as per the open(2) second argument
 * @mode:	mode for the new file if O_CREAT is set, else ignored
 *
 * This is the helper to open a file from kernelspace if you really
 * have to.  But in generally you should not do this, so please move
 * along, nothing to see here..
 */
struct file *file_open_name(struct filename *name, int flags, umode_t mode)
{
	struct open_flags op;
	int err = build_open_flags(flags, mode, &op);
	return err ? ERR_PTR(err) : do_filp_open(AT_FDCWD, name, &op);
}
开发者ID:wpwrak,项目名称:ben-wpan-linux,代码行数:17,代码来源:open.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ build_pointer_type函数代码示例发布时间:2022-05-30
下一篇:
C++ build_function_type_list函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap