diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-07-23 00:18:02 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2011-07-25 14:27:30 -0400 |
commit | bc26ab5f65ae41b71df86ea46df3c3833d1d8d83 (patch) | |
tree | 85bbc4e0da4fac99ccf31b3609c61e2b148a8498 /fs/9p | |
parent | 4482a087d4c5a6ffbc385c56b4a4e2f694d9fd5d (diff) |
kill boilerplate around posix_acl_chmod_masq()
new helper: posix_acl_chmod(&acl, gfp, mode). Replaces acl with modified
clone or with NULL if that has failed; returns 0 or -ve on error. All
callers of posix_acl_chmod_masq() switched to that - they'd been doing
exactly the same thing.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/9p')
-rw-r--r-- | fs/9p/acl.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/fs/9p/acl.c b/fs/9p/acl.c index df4d7a171d7f..d7211e28c0d1 100644 --- a/fs/9p/acl.c +++ b/fs/9p/acl.c | |||
@@ -162,21 +162,18 @@ err_free_out: | |||
162 | int v9fs_acl_chmod(struct dentry *dentry) | 162 | int v9fs_acl_chmod(struct dentry *dentry) |
163 | { | 163 | { |
164 | int retval = 0; | 164 | int retval = 0; |
165 | struct posix_acl *acl, *clone; | 165 | struct posix_acl *acl; |
166 | struct inode *inode = dentry->d_inode; | 166 | struct inode *inode = dentry->d_inode; |
167 | 167 | ||
168 | if (S_ISLNK(inode->i_mode)) | 168 | if (S_ISLNK(inode->i_mode)) |
169 | return -EOPNOTSUPP; | 169 | return -EOPNOTSUPP; |
170 | acl = v9fs_get_cached_acl(inode, ACL_TYPE_ACCESS); | 170 | acl = v9fs_get_cached_acl(inode, ACL_TYPE_ACCESS); |
171 | if (acl) { | 171 | if (acl) { |
172 | clone = posix_acl_clone(acl, GFP_KERNEL); | 172 | retval = posix_acl_chmod(&acl, GFP_KERNEL, inode->i_mode); |
173 | if (retval) | ||
174 | return retval; | ||
175 | retval = v9fs_set_acl(dentry, ACL_TYPE_ACCESS, acl); | ||
173 | posix_acl_release(acl); | 176 | posix_acl_release(acl); |
174 | if (!clone) | ||
175 | return -ENOMEM; | ||
176 | retval = posix_acl_chmod_masq(clone, inode->i_mode); | ||
177 | if (!retval) | ||
178 | retval = v9fs_set_acl(dentry, ACL_TYPE_ACCESS, clone); | ||
179 | posix_acl_release(clone); | ||
180 | } | 177 | } |
181 | return retval; | 178 | return retval; |
182 | } | 179 | } |