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

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

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

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

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

示例1: SYSCALL_DEFINE3

SYSCALL_DEFINE3(llistxattr, const char __user *, pathname, char __user *, list,		size_t, size){	struct path path;	ssize_t error;	error = user_lpath(pathname, &path);	if (error)		return error;	error = listxattr(path.dentry, list, size);	path_put(&path);	return error;}
开发者ID:khenam,项目名称:ardrone-kernel,代码行数:13,


示例2: SYSCALL_DEFINE4

SYSCALL_DEFINE4(lgetxattr, const char __user *, pathname,		const char __user *, name, void __user *, value, size_t, size){	struct path path;	ssize_t error;	error = user_lpath(pathname, &path);	if (error)		return error;	error = getxattr(path.dentry, name, value, size);	path_put(&path);	return error;}
开发者ID:khenam,项目名称:ardrone-kernel,代码行数:13,


示例3: SYSCALL_DEFINE2

SYSCALL_DEFINE2(lremovexattr, const char __user *, pathname,		const char __user *, name){	struct path path;	int error;	error = user_lpath(pathname, &path);	if (error)		return error;	error = mnt_want_write(path.mnt);	if (!error) {		error = removexattr(path.dentry, name);		mnt_drop_write(path.mnt);	}	path_put(&path);	return error;}
开发者ID:khenam,项目名称:ardrone-kernel,代码行数:17,


示例4: SYSCALL_DEFINE3

SYSCALL_DEFINE3(lchown, const char __user *, filename, uid_t, user, gid_t, group){	struct path path;	int error;	error = user_lpath(filename, &path);	if (error)		goto out;	error = mnt_want_write(path.mnt);	if (error)		goto out_release;	error = chown_common(&path, user, group);	mnt_drop_write(path.mnt);out_release:	path_put(&path);out:	return error;}
开发者ID:boa19861105,项目名称:Blackout-Monarudo,代码行数:18,


示例5: SYSCALL_DEFINE5

SYSCALL_DEFINE5(lsetxattr, const char __user *, pathname,		const char __user *, name, const void __user *, value,		size_t, size, int, flags){	struct path path;	int error;	error = user_lpath(pathname, &path);	if (error)		return error;	error = mnt_want_write(path.mnt);	if (!error) {		error = setxattr(path.dentry, name, value, size, flags);		mnt_drop_write(path.mnt);	}	path_put(&path);	return error;}
开发者ID:khenam,项目名称:ardrone-kernel,代码行数:18,


示例6: sys_lchown

asmlinkage long sys_lchown(const char __user * filename, uid_t user, gid_t group){	struct path path;	int error;	error = user_lpath(filename, &path);	if (error)		goto out;	error = mnt_want_write(path.mnt);	if (error)		goto out_release;	error = chown_common(path.dentry, user, group);	mnt_drop_write(path.mnt);out_release:	path_put(&path);out:	return error;}
开发者ID:mpalmer,项目名称:linux-2.6,代码行数:18,


示例7: coda_pioctl

static int coda_pioctl(struct inode * inode, struct file * filp,                        unsigned int cmd, unsigned long user_data){	struct path path;        int error;	struct PioctlData data;        struct inode *target_inode = NULL;        struct coda_inode_info *cnp;        /* get the Pioctl data arguments from user space */        if (copy_from_user(&data, (void __user *)user_data, sizeof(data))) {	    return -EINVAL;	}               /*          * Look up the pathname. Note that the pathname is in          * user memory, and namei takes care of this         */        if (data.follow) {                error = user_path(data.path, &path);	} else {	        error = user_lpath(data.path, &path);	}			if ( error ) {		return error;        } else {		target_inode = path.dentry->d_inode;	}		/* return if it is not a Coda inode */	if ( target_inode->i_sb != inode->i_sb ) {		path_put(&path);	        return  -EINVAL;	}	/* now proceed to make the upcall */        cnp = ITOC(target_inode);	error = venus_pioctl(inode->i_sb, &(cnp->c_fid), cmd, &data);	path_put(&path);        return error;}
开发者ID:johnny,项目名称:CobraDroidBeta,代码行数:44,


示例8: xfs_find_handle

/* * xfs_find_handle maps from userspace xfs_fsop_handlereq structure to * a file or fs handle. * * XFS_IOC_PATH_TO_FSHANDLE *    returns fs handle for a mount point or path within that mount point * XFS_IOC_FD_TO_HANDLE *    returns full handle for a FD opened in user space * XFS_IOC_PATH_TO_HANDLE *    returns full handle for a path */intxfs_find_handle(	unsigned int		cmd,	xfs_fsop_handlereq_t	*hreq){	int			hsize;	xfs_handle_t		handle;	struct inode		*inode;	struct fd		f = {NULL};	struct path		path;	int			error;	struct xfs_inode	*ip;	if (cmd == XFS_IOC_FD_TO_HANDLE) {		f = fdget(hreq->fd);		if (!f.file)			return -EBADF;		inode = file_inode(f.file);	} else {		error = user_lpath((const char __user *)hreq->path, &path);		if (error)			return error;		inode = d_inode(path.dentry);	}	ip = XFS_I(inode);	/*	 * We can only generate handles for inodes residing on a XFS filesystem,	 * and only for regular files, directories or symbolic links.	 */	error = -EINVAL;	if (inode->i_sb->s_magic != XFS_SB_MAGIC)		goto out_put;	error = -EBADF;	if (!S_ISREG(inode->i_mode) &&	    !S_ISDIR(inode->i_mode) &&	    !S_ISLNK(inode->i_mode))		goto out_put;	memcpy(&handle.ha_fsid, ip->i_mount->m_fixedfsid, sizeof(xfs_fsid_t));	if (cmd == XFS_IOC_PATH_TO_FSHANDLE) {		/*		 * This handle only contains an fsid, zero the rest.		 */		memset(&handle.ha_fid, 0, sizeof(handle.ha_fid));		hsize = sizeof(xfs_fsid_t);	} else {		handle.ha_fid.fid_len = sizeof(xfs_fid_t) -					sizeof(handle.ha_fid.fid_len);		handle.ha_fid.fid_pad = 0;		handle.ha_fid.fid_gen = ip->i_d.di_gen;		handle.ha_fid.fid_ino = ip->i_ino;		hsize = XFS_HSIZE(handle);	}	error = -EFAULT;	if (copy_to_user(hreq->ohandle, &handle, hsize) ||	    copy_to_user(hreq->ohandlen, &hsize, sizeof(__s32)))		goto out_put;	error = 0; out_put:	if (cmd == XFS_IOC_FD_TO_HANDLE)		fdput(f);	else		path_put(&path);	return error;}
开发者ID:19Dan01,项目名称:linux,代码行数:84,


示例9: xfs_find_handle

/* * xfs_find_handle maps from userspace xfs_fsop_handlereq structure to * a file or fs handle. * * XFS_IOC_PATH_TO_FSHANDLE *    returns fs handle for a mount point or path within that mount point * XFS_IOC_FD_TO_HANDLE *    returns full handle for a FD opened in user space * XFS_IOC_PATH_TO_HANDLE *    returns full handle for a path */STATIC intxfs_find_handle(	unsigned int		cmd,	void			__user *arg){	int			hsize;	xfs_handle_t		handle;	xfs_fsop_handlereq_t	hreq;	struct inode		*inode;	if (copy_from_user(&hreq, arg, sizeof(hreq)))		return -XFS_ERROR(EFAULT);	memset((char *)&handle, 0, sizeof(handle));	switch (cmd) {	case XFS_IOC_PATH_TO_FSHANDLE:	case XFS_IOC_PATH_TO_HANDLE: {		struct path path;		int error = user_lpath((const char __user *)hreq.path, &path);		if (error)			return error;		ASSERT(path.dentry);		ASSERT(path.dentry->d_inode);		inode = igrab(path.dentry->d_inode);		path_put(&path);		break;	}	case XFS_IOC_FD_TO_HANDLE: {		struct file	*file;		file = fget(hreq.fd);		if (!file)		    return -EBADF;		ASSERT(file->f_path.dentry);		ASSERT(file->f_path.dentry->d_inode);		inode = igrab(file->f_path.dentry->d_inode);		fput(file);		break;	}	default:		ASSERT(0);		return -XFS_ERROR(EINVAL);	}	if (inode->i_sb->s_magic != XFS_SB_MAGIC) {		/* we're not in XFS anymore, Toto */		iput(inode);		return -XFS_ERROR(EINVAL);	}	switch (inode->i_mode & S_IFMT) {	case S_IFREG:	case S_IFDIR:	case S_IFLNK:		break;	default:		iput(inode);		return -XFS_ERROR(EBADF);	}	/* now we can grab the fsid */	memcpy(&handle.ha_fsid, XFS_I(inode)->i_mount->m_fixedfsid,			sizeof(xfs_fsid_t));	hsize = sizeof(xfs_fsid_t);	if (cmd != XFS_IOC_PATH_TO_FSHANDLE) {		xfs_inode_t	*ip = XFS_I(inode);		int		lock_mode;		/* need to get access to the xfs_inode to read the generation */		lock_mode = xfs_ilock_map_shared(ip);		/* fill in fid section of handle from inode */		handle.ha_fid.fid_len = sizeof(xfs_fid_t) -					sizeof(handle.ha_fid.fid_len);		handle.ha_fid.fid_pad = 0;		handle.ha_fid.fid_gen = ip->i_d.di_gen;		handle.ha_fid.fid_ino = ip->i_ino;		xfs_iunlock_map_shared(ip, lock_mode);		hsize = XFS_HSIZE(handle);	}//.........这里部分代码省略.........
开发者ID:LouZiffer,项目名称:m900_kernel_cupcake-SDX,代码行数:101,



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


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