aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-01-31 12:58:16 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2013-02-26 02:46:06 -0500
commitbe308f07964a597ea1806a0c02477a383b92f53a (patch)
tree9dd3220096d6b399978fbe48267a20339778c4e0
parent0f235caeaed6bbde6d455e172a83fa693ca485a1 (diff)
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>
-rw-r--r--fs/9p/acl.c6
-rw-r--r--fs/9p/acl.h4
-rw-r--r--fs/9p/vfs_inode_dotl.c19
3 files changed, 13 insertions, 16 deletions
diff --git a/fs/9p/acl.c b/fs/9p/acl.c
index 506d8af26a1f..81ae143ff3f7 100644
--- a/fs/9p/acl.c
+++ b/fs/9p/acl.c
@@ -147,17 +147,13 @@ err_free_out:
147 return retval; 147 return retval;
148} 148}
149 149
150int v9fs_acl_chmod(struct dentry *dentry) 150int v9fs_acl_chmod(struct inode *inode, struct p9_fid *fid)
151{ 151{
152 int retval = 0; 152 int retval = 0;
153 struct posix_acl *acl; 153 struct posix_acl *acl;
154 struct inode *inode = dentry->d_inode;
155 struct p9_fid *fid = v9fs_fid_lookup(dentry);
156 154
157 if (S_ISLNK(inode->i_mode)) 155 if (S_ISLNK(inode->i_mode))
158 return -EOPNOTSUPP; 156 return -EOPNOTSUPP;
159 if (IS_ERR(fid))
160 return PTR_ERR(fid);
161 acl = v9fs_get_cached_acl(inode, ACL_TYPE_ACCESS); 157 acl = v9fs_get_cached_acl(inode, ACL_TYPE_ACCESS);
162 if (acl) { 158 if (acl) {
163 retval = posix_acl_chmod(&acl, GFP_KERNEL, inode->i_mode); 159 retval = posix_acl_chmod(&acl, GFP_KERNEL, inode->i_mode);
diff --git a/fs/9p/acl.h b/fs/9p/acl.h
index 559556411965..3a609c57b6ea 100644
--- a/fs/9p/acl.h
+++ b/fs/9p/acl.h
@@ -17,7 +17,7 @@
17#ifdef CONFIG_9P_FS_POSIX_ACL 17#ifdef CONFIG_9P_FS_POSIX_ACL
18extern int v9fs_get_acl(struct inode *, struct p9_fid *); 18extern int v9fs_get_acl(struct inode *, struct p9_fid *);
19extern struct posix_acl *v9fs_iop_get_acl(struct inode *inode, int type); 19extern struct posix_acl *v9fs_iop_get_acl(struct inode *inode, int type);
20extern int v9fs_acl_chmod(struct dentry *); 20extern int v9fs_acl_chmod(struct inode *, struct p9_fid *);
21extern int v9fs_set_create_acl(struct dentry *, 21extern int v9fs_set_create_acl(struct dentry *,
22 struct posix_acl **, struct posix_acl **); 22 struct posix_acl **, struct posix_acl **);
23extern int v9fs_acl_mode(struct inode *dir, umode_t *modep, 23extern 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)
28{ 28{
29 return 0; 29 return 0;
30} 30}
31static inline int v9fs_acl_chmod(struct dentry *dentry) 31static inline int v9fs_acl_chmod(struct inode *inode, struct p9_fid *fid)
32{ 32{
33 return 0; 33 return 0;
34} 34}
diff --git a/fs/9p/vfs_inode_dotl.c b/fs/9p/vfs_inode_dotl.c
index 40895546e103..44485f353f19 100644
--- a/fs/9p/vfs_inode_dotl.c
+++ b/fs/9p/vfs_inode_dotl.c
@@ -567,10 +567,11 @@ int v9fs_vfs_setattr_dotl(struct dentry *dentry, struct iattr *iattr)
567 struct v9fs_session_info *v9ses; 567 struct v9fs_session_info *v9ses;
568 struct p9_fid *fid; 568 struct p9_fid *fid;
569 struct p9_iattr_dotl p9attr; 569 struct p9_iattr_dotl p9attr;
570 struct inode *inode = dentry->d_inode;
570 571
571 p9_debug(P9_DEBUG_VFS, "\n"); 572 p9_debug(P9_DEBUG_VFS, "\n");
572 573
573 retval = inode_change_ok(dentry->d_inode, iattr); 574 retval = inode_change_ok(inode, iattr);
574 if (retval) 575 if (retval)
575 return retval; 576 return retval;
576 577
@@ -591,23 +592,23 @@ int v9fs_vfs_setattr_dotl(struct dentry *dentry, struct iattr *iattr)
591 return PTR_ERR(fid); 592 return PTR_ERR(fid);
592 593
593 /* Write all dirty data */ 594 /* Write all dirty data */
594 if (S_ISREG(dentry->d_inode->i_mode)) 595 if (S_ISREG(inode->i_mode))
595 filemap_write_and_wait(dentry->d_inode->i_mapping); 596 filemap_write_and_wait(inode->i_mapping);
596 597
597 retval = p9_client_setattr(fid, &p9attr); 598 retval = p9_client_setattr(fid, &p9attr);
598 if (retval < 0) 599 if (retval < 0)
599 return retval; 600 return retval;
600 601
601 if ((iattr->ia_valid & ATTR_SIZE) && 602 if ((iattr->ia_valid & ATTR_SIZE) &&
602 iattr->ia_size != i_size_read(dentry->d_inode)) 603 iattr->ia_size != i_size_read(inode))
603 truncate_setsize(dentry->d_inode, iattr->ia_size); 604 truncate_setsize(inode, iattr->ia_size);
604 605
605 v9fs_invalidate_inode_attr(dentry->d_inode); 606 v9fs_invalidate_inode_attr(inode);
606 setattr_copy(dentry->d_inode, iattr); 607 setattr_copy(inode, iattr);
607 mark_inode_dirty(dentry->d_inode); 608 mark_inode_dirty(inode);
608 if (iattr->ia_valid & ATTR_MODE) { 609 if (iattr->ia_valid & ATTR_MODE) {
609 /* We also want to update ACL when we update mode bits */ 610 /* We also want to update ACL when we update mode bits */
610 retval = v9fs_acl_chmod(dentry); 611 retval = v9fs_acl_chmod(inode, fid);
611 if (retval < 0) 612 if (retval < 0)
612 return retval; 613 return retval;
613 } 614 }