aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jfs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2011-07-23 00:18:02 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2011-07-25 14:27:30 -0400
commitbc26ab5f65ae41b71df86ea46df3c3833d1d8d83 (patch)
tree85bbc4e0da4fac99ccf31b3609c61e2b148a8498 /fs/jfs
parent4482a087d4c5a6ffbc385c56b4a4e2f694d9fd5d (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/jfs')
-rw-r--r--fs/jfs/acl.c31
1 files changed, 14 insertions, 17 deletions
diff --git a/fs/jfs/acl.c b/fs/jfs/acl.c
index ead200eef5e4..89ced71e225a 100644
--- a/fs/jfs/acl.c
+++ b/fs/jfs/acl.c
@@ -177,8 +177,9 @@ cleanup:
177 177
178int jfs_acl_chmod(struct inode *inode) 178int jfs_acl_chmod(struct inode *inode)
179{ 179{
180 struct posix_acl *acl, *clone; 180 struct posix_acl *acl;
181 int rc; 181 int rc;
182 tid_t tid;
182 183
183 if (S_ISLNK(inode->i_mode)) 184 if (S_ISLNK(inode->i_mode))
184 return -EOPNOTSUPP; 185 return -EOPNOTSUPP;
@@ -187,22 +188,18 @@ int jfs_acl_chmod(struct inode *inode)
187 if (IS_ERR(acl) || !acl) 188 if (IS_ERR(acl) || !acl)
188 return PTR_ERR(acl); 189 return PTR_ERR(acl);
189 190
190 clone = posix_acl_clone(acl, GFP_KERNEL); 191 rc = posix_acl_chmod(&acl, GFP_KERNEL, inode->i_mode);
191 posix_acl_release(acl); 192 if (rc)
192 if (!clone) 193 return rc;
193 return -ENOMEM;
194
195 rc = posix_acl_chmod_masq(clone, inode->i_mode);
196 if (!rc) {
197 tid_t tid = txBegin(inode->i_sb, 0);
198 mutex_lock(&JFS_IP(inode)->commit_mutex);
199 rc = jfs_set_acl(tid, inode, ACL_TYPE_ACCESS, clone);
200 if (!rc)
201 rc = txCommit(tid, 1, &inode, 0);
202 txEnd(tid);
203 mutex_unlock(&JFS_IP(inode)->commit_mutex);
204 }
205 194
206 posix_acl_release(clone); 195 tid = txBegin(inode->i_sb, 0);
196 mutex_lock(&JFS_IP(inode)->commit_mutex);
197 rc = jfs_set_acl(tid, inode, ACL_TYPE_ACCESS, acl);
198 if (!rc)
199 rc = txCommit(tid, 1, &inode, 0);
200 txEnd(tid);
201 mutex_unlock(&JFS_IP(inode)->commit_mutex);
202
203 posix_acl_release(acl);
207 return rc; 204 return rc;
208} 205}