fs/9p: Add v9fs_dentry2v9ses
Add the new static inline and use the same Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com> Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
This commit is contained in:
parent
7add697a3d
commit
42869c8ada
6 changed files with 16 additions and 11 deletions
|
@ -262,7 +262,7 @@ static int v9fs_xattr_get_acl(struct dentry *dentry, const char *name,
|
||||||
if (strcmp(name, "") != 0)
|
if (strcmp(name, "") != 0)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
v9ses = v9fs_inode2v9ses(dentry->d_inode);
|
v9ses = v9fs_dentry2v9ses(dentry);
|
||||||
/*
|
/*
|
||||||
* We allow set/get/list of acl when access=client is not specified
|
* We allow set/get/list of acl when access=client is not specified
|
||||||
*/
|
*/
|
||||||
|
@ -312,7 +312,7 @@ static int v9fs_xattr_set_acl(struct dentry *dentry, const char *name,
|
||||||
if (strcmp(name, "") != 0)
|
if (strcmp(name, "") != 0)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
v9ses = v9fs_inode2v9ses(dentry->d_inode);
|
v9ses = v9fs_dentry2v9ses(dentry);
|
||||||
/*
|
/*
|
||||||
* set the attribute on the remote. Without even looking at the
|
* set the attribute on the remote. Without even looking at the
|
||||||
* xattr value. We leave it to the server to validate
|
* xattr value. We leave it to the server to validate
|
||||||
|
|
|
@ -134,7 +134,7 @@ static struct p9_fid *v9fs_fid_lookup_with_uid(struct dentry *dentry,
|
||||||
struct v9fs_session_info *v9ses;
|
struct v9fs_session_info *v9ses;
|
||||||
struct p9_fid *fid, *old_fid = NULL;
|
struct p9_fid *fid, *old_fid = NULL;
|
||||||
|
|
||||||
v9ses = v9fs_inode2v9ses(dentry->d_inode);
|
v9ses = v9fs_dentry2v9ses(dentry);
|
||||||
access = v9ses->flags & V9FS_ACCESS_MASK;
|
access = v9ses->flags & V9FS_ACCESS_MASK;
|
||||||
fid = v9fs_fid_find(dentry, uid, any);
|
fid = v9fs_fid_find(dentry, uid, any);
|
||||||
if (fid)
|
if (fid)
|
||||||
|
@ -237,7 +237,7 @@ struct p9_fid *v9fs_fid_lookup(struct dentry *dentry)
|
||||||
int any, access;
|
int any, access;
|
||||||
struct v9fs_session_info *v9ses;
|
struct v9fs_session_info *v9ses;
|
||||||
|
|
||||||
v9ses = v9fs_inode2v9ses(dentry->d_inode);
|
v9ses = v9fs_dentry2v9ses(dentry);
|
||||||
access = v9ses->flags & V9FS_ACCESS_MASK;
|
access = v9ses->flags & V9FS_ACCESS_MASK;
|
||||||
switch (access) {
|
switch (access) {
|
||||||
case V9FS_ACCESS_SINGLE:
|
case V9FS_ACCESS_SINGLE:
|
||||||
|
@ -290,7 +290,7 @@ struct p9_fid *v9fs_writeback_fid(struct dentry *dentry)
|
||||||
struct p9_fid *fid;
|
struct p9_fid *fid;
|
||||||
struct v9fs_session_info *v9ses;
|
struct v9fs_session_info *v9ses;
|
||||||
|
|
||||||
v9ses = v9fs_inode2v9ses(dentry->d_inode);
|
v9ses = v9fs_dentry2v9ses(dentry);
|
||||||
fid = v9fs_fid_clone_with_uid(dentry, 0);
|
fid = v9fs_fid_clone_with_uid(dentry, 0);
|
||||||
if (IS_ERR(fid))
|
if (IS_ERR(fid))
|
||||||
goto error_out;
|
goto error_out;
|
||||||
|
|
|
@ -174,6 +174,11 @@ static inline struct v9fs_session_info *v9fs_inode2v9ses(struct inode *inode)
|
||||||
return (inode->i_sb->s_fs_info);
|
return (inode->i_sb->s_fs_info);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline struct v9fs_session_info *v9fs_dentry2v9ses(struct dentry *dentry)
|
||||||
|
{
|
||||||
|
return dentry->d_sb->s_fs_info;
|
||||||
|
}
|
||||||
|
|
||||||
static inline int v9fs_proto_dotu(struct v9fs_session_info *v9ses)
|
static inline int v9fs_proto_dotu(struct v9fs_session_info *v9ses)
|
||||||
{
|
{
|
||||||
return v9ses->flags & V9FS_PROTO_2000U;
|
return v9ses->flags & V9FS_PROTO_2000U;
|
||||||
|
|
|
@ -936,7 +936,7 @@ v9fs_vfs_getattr(struct vfsmount *mnt, struct dentry *dentry,
|
||||||
|
|
||||||
P9_DPRINTK(P9_DEBUG_VFS, "dentry: %p\n", dentry);
|
P9_DPRINTK(P9_DEBUG_VFS, "dentry: %p\n", dentry);
|
||||||
err = -EPERM;
|
err = -EPERM;
|
||||||
v9ses = v9fs_inode2v9ses(dentry->d_inode);
|
v9ses = v9fs_dentry2v9ses(dentry);
|
||||||
if (v9ses->cache == CACHE_LOOSE || v9ses->cache == CACHE_FSCACHE) {
|
if (v9ses->cache == CACHE_LOOSE || v9ses->cache == CACHE_FSCACHE) {
|
||||||
generic_fillattr(dentry->d_inode, stat);
|
generic_fillattr(dentry->d_inode, stat);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -977,7 +977,7 @@ static int v9fs_vfs_setattr(struct dentry *dentry, struct iattr *iattr)
|
||||||
return retval;
|
return retval;
|
||||||
|
|
||||||
retval = -EPERM;
|
retval = -EPERM;
|
||||||
v9ses = v9fs_inode2v9ses(dentry->d_inode);
|
v9ses = v9fs_dentry2v9ses(dentry);
|
||||||
fid = v9fs_fid_lookup(dentry);
|
fid = v9fs_fid_lookup(dentry);
|
||||||
if(IS_ERR(fid))
|
if(IS_ERR(fid))
|
||||||
return PTR_ERR(fid);
|
return PTR_ERR(fid);
|
||||||
|
@ -1139,7 +1139,7 @@ static int v9fs_readlink(struct dentry *dentry, char *buffer, int buflen)
|
||||||
|
|
||||||
P9_DPRINTK(P9_DEBUG_VFS, " %s\n", dentry->d_name.name);
|
P9_DPRINTK(P9_DEBUG_VFS, " %s\n", dentry->d_name.name);
|
||||||
retval = -EPERM;
|
retval = -EPERM;
|
||||||
v9ses = v9fs_inode2v9ses(dentry->d_inode);
|
v9ses = v9fs_dentry2v9ses(dentry);
|
||||||
fid = v9fs_fid_lookup(dentry);
|
fid = v9fs_fid_lookup(dentry);
|
||||||
if (IS_ERR(fid))
|
if (IS_ERR(fid))
|
||||||
return PTR_ERR(fid);
|
return PTR_ERR(fid);
|
||||||
|
|
|
@ -395,7 +395,7 @@ v9fs_vfs_getattr_dotl(struct vfsmount *mnt, struct dentry *dentry,
|
||||||
|
|
||||||
P9_DPRINTK(P9_DEBUG_VFS, "dentry: %p\n", dentry);
|
P9_DPRINTK(P9_DEBUG_VFS, "dentry: %p\n", dentry);
|
||||||
err = -EPERM;
|
err = -EPERM;
|
||||||
v9ses = v9fs_inode2v9ses(dentry->d_inode);
|
v9ses = v9fs_dentry2v9ses(dentry);
|
||||||
if (v9ses->cache == CACHE_LOOSE || v9ses->cache == CACHE_FSCACHE) {
|
if (v9ses->cache == CACHE_LOOSE || v9ses->cache == CACHE_FSCACHE) {
|
||||||
generic_fillattr(dentry->d_inode, stat);
|
generic_fillattr(dentry->d_inode, stat);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -452,7 +452,7 @@ int v9fs_vfs_setattr_dotl(struct dentry *dentry, struct iattr *iattr)
|
||||||
p9attr.mtime_nsec = iattr->ia_mtime.tv_nsec;
|
p9attr.mtime_nsec = iattr->ia_mtime.tv_nsec;
|
||||||
|
|
||||||
retval = -EPERM;
|
retval = -EPERM;
|
||||||
v9ses = v9fs_inode2v9ses(dentry->d_inode);
|
v9ses = v9fs_dentry2v9ses(dentry);
|
||||||
fid = v9fs_fid_lookup(dentry);
|
fid = v9fs_fid_lookup(dentry);
|
||||||
if (IS_ERR(fid))
|
if (IS_ERR(fid))
|
||||||
return PTR_ERR(fid);
|
return PTR_ERR(fid);
|
||||||
|
|
|
@ -262,7 +262,7 @@ static int v9fs_statfs(struct dentry *dentry, struct kstatfs *buf)
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
v9ses = v9fs_inode2v9ses(dentry->d_inode);
|
v9ses = v9fs_dentry2v9ses(dentry);
|
||||||
if (v9fs_proto_dotl(v9ses)) {
|
if (v9fs_proto_dotl(v9ses)) {
|
||||||
res = p9_client_statfs(fid, &rs);
|
res = p9_client_statfs(fid, &rs);
|
||||||
if (res == 0) {
|
if (res == 0) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue