9p: switch v9fs_acl_chmod() from dentry to inode+fid
caller has both, might as well pass them explicitly. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
0f235caeae
commit
be308f0796
|
@ -147,17 +147,13 @@ err_free_out:
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
int v9fs_acl_chmod(struct dentry *dentry)
|
int v9fs_acl_chmod(struct inode *inode, struct p9_fid *fid)
|
||||||
{
|
{
|
||||||
int retval = 0;
|
int retval = 0;
|
||||||
struct posix_acl *acl;
|
struct posix_acl *acl;
|
||||||
struct inode *inode = dentry->d_inode;
|
|
||||||
struct p9_fid *fid = v9fs_fid_lookup(dentry);
|
|
||||||
|
|
||||||
if (S_ISLNK(inode->i_mode))
|
if (S_ISLNK(inode->i_mode))
|
||||||
return -EOPNOTSUPP;
|
return -EOPNOTSUPP;
|
||||||
if (IS_ERR(fid))
|
|
||||||
return PTR_ERR(fid);
|
|
||||||
acl = v9fs_get_cached_acl(inode, ACL_TYPE_ACCESS);
|
acl = v9fs_get_cached_acl(inode, ACL_TYPE_ACCESS);
|
||||||
if (acl) {
|
if (acl) {
|
||||||
retval = posix_acl_chmod(&acl, GFP_KERNEL, inode->i_mode);
|
retval = posix_acl_chmod(&acl, GFP_KERNEL, inode->i_mode);
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
#ifdef CONFIG_9P_FS_POSIX_ACL
|
#ifdef CONFIG_9P_FS_POSIX_ACL
|
||||||
extern int v9fs_get_acl(struct inode *, struct p9_fid *);
|
extern int v9fs_get_acl(struct inode *, struct p9_fid *);
|
||||||
extern struct posix_acl *v9fs_iop_get_acl(struct inode *inode, int type);
|
extern struct posix_acl *v9fs_iop_get_acl(struct inode *inode, int type);
|
||||||
extern int v9fs_acl_chmod(struct dentry *);
|
extern int v9fs_acl_chmod(struct inode *, struct p9_fid *);
|
||||||
extern int v9fs_set_create_acl(struct dentry *,
|
extern int v9fs_set_create_acl(struct dentry *,
|
||||||
struct posix_acl **, struct posix_acl **);
|
struct posix_acl **, struct posix_acl **);
|
||||||
extern int v9fs_acl_mode(struct inode *dir, umode_t *modep,
|
extern int v9fs_acl_mode(struct inode *dir, umode_t *modep,
|
||||||
|
@ -28,7 +28,7 @@ static inline int v9fs_get_acl(struct inode *inode, struct p9_fid *fid)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
static inline int v9fs_acl_chmod(struct dentry *dentry)
|
static inline int v9fs_acl_chmod(struct inode *inode, struct p9_fid *fid)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -567,10 +567,11 @@ int v9fs_vfs_setattr_dotl(struct dentry *dentry, struct iattr *iattr)
|
||||||
struct v9fs_session_info *v9ses;
|
struct v9fs_session_info *v9ses;
|
||||||
struct p9_fid *fid;
|
struct p9_fid *fid;
|
||||||
struct p9_iattr_dotl p9attr;
|
struct p9_iattr_dotl p9attr;
|
||||||
|
struct inode *inode = dentry->d_inode;
|
||||||
|
|
||||||
p9_debug(P9_DEBUG_VFS, "\n");
|
p9_debug(P9_DEBUG_VFS, "\n");
|
||||||
|
|
||||||
retval = inode_change_ok(dentry->d_inode, iattr);
|
retval = inode_change_ok(inode, iattr);
|
||||||
if (retval)
|
if (retval)
|
||||||
return retval;
|
return retval;
|
||||||
|
|
||||||
|
@ -591,23 +592,23 @@ int v9fs_vfs_setattr_dotl(struct dentry *dentry, struct iattr *iattr)
|
||||||
return PTR_ERR(fid);
|
return PTR_ERR(fid);
|
||||||
|
|
||||||
/* Write all dirty data */
|
/* Write all dirty data */
|
||||||
if (S_ISREG(dentry->d_inode->i_mode))
|
if (S_ISREG(inode->i_mode))
|
||||||
filemap_write_and_wait(dentry->d_inode->i_mapping);
|
filemap_write_and_wait(inode->i_mapping);
|
||||||
|
|
||||||
retval = p9_client_setattr(fid, &p9attr);
|
retval = p9_client_setattr(fid, &p9attr);
|
||||||
if (retval < 0)
|
if (retval < 0)
|
||||||
return retval;
|
return retval;
|
||||||
|
|
||||||
if ((iattr->ia_valid & ATTR_SIZE) &&
|
if ((iattr->ia_valid & ATTR_SIZE) &&
|
||||||
iattr->ia_size != i_size_read(dentry->d_inode))
|
iattr->ia_size != i_size_read(inode))
|
||||||
truncate_setsize(dentry->d_inode, iattr->ia_size);
|
truncate_setsize(inode, iattr->ia_size);
|
||||||
|
|
||||||
v9fs_invalidate_inode_attr(dentry->d_inode);
|
v9fs_invalidate_inode_attr(inode);
|
||||||
setattr_copy(dentry->d_inode, iattr);
|
setattr_copy(inode, iattr);
|
||||||
mark_inode_dirty(dentry->d_inode);
|
mark_inode_dirty(inode);
|
||||||
if (iattr->ia_valid & ATTR_MODE) {
|
if (iattr->ia_valid & ATTR_MODE) {
|
||||||
/* We also want to update ACL when we update mode bits */
|
/* We also want to update ACL when we update mode bits */
|
||||||
retval = v9fs_acl_chmod(dentry);
|
retval = v9fs_acl_chmod(inode, fid);
|
||||||
if (retval < 0)
|
if (retval < 0)
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue