fs/9p: Add OS dependent open flags in 9p protocol
Some of the flags are OS/arch dependent we add a 9p protocol value which maps to asm-generic/fcntl.h values in Linux Based on the original patch from Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
This commit is contained in:

committed by
Eric Van Hensbergen

parent
b49d8b5d70
commit
f88657ce3f
@@ -552,6 +552,19 @@ v9fs_inode_from_fid(struct v9fs_session_info *v9ses, struct p9_fid *fid,
|
||||
return inode;
|
||||
}
|
||||
|
||||
/**
|
||||
* v9fs_at_to_dotl_flags- convert Linux specific AT flags to
|
||||
* plan 9 AT flag.
|
||||
* @flags: flags to convert
|
||||
*/
|
||||
static int v9fs_at_to_dotl_flags(int flags)
|
||||
{
|
||||
int rflags = 0;
|
||||
if (flags & AT_REMOVEDIR)
|
||||
rflags |= P9_DOTL_AT_REMOVEDIR;
|
||||
return rflags;
|
||||
}
|
||||
|
||||
/**
|
||||
* v9fs_remove - helper function to remove files and directories
|
||||
* @dir: directory inode that is being deleted
|
||||
@@ -579,7 +592,8 @@ static int v9fs_remove(struct inode *dir, struct dentry *dentry, int flags)
|
||||
return retval;
|
||||
}
|
||||
if (v9fs_proto_dotl(v9ses))
|
||||
retval = p9_client_unlinkat(dfid, dentry->d_name.name, flags);
|
||||
retval = p9_client_unlinkat(dfid, dentry->d_name.name,
|
||||
v9fs_at_to_dotl_flags(flags));
|
||||
if (retval == -EOPNOTSUPP) {
|
||||
/* Try the one based on path */
|
||||
v9fid = v9fs_fid_clone(dentry);
|
||||
|
Reference in New Issue
Block a user