diff options
author | Christoph Hellwig <hch@lst.de> | 2011-07-23 11:37:31 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2011-07-25 14:30:23 -0400 |
commit | 4e34e719e457f2e031297175410fc0bd4016a085 (patch) | |
tree | ab969a371e0d2efc6bfbf503ca6cdfce3af3bf6c /fs/jffs2/acl.c | |
parent | edde854e8bb34a7f32fa993d721f1da0faf64165 (diff) |
fs: take the ACL checks to common code
Replace the ->check_acl method with a ->get_acl method that simply reads an
ACL from disk after having a cache miss. This means we can replace the ACL
checking boilerplate code with a single implementation in namei.c.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/jffs2/acl.c')
-rw-r--r-- | fs/jffs2/acl.c | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/fs/jffs2/acl.c b/fs/jffs2/acl.c index 5783ed81171b..27c511a1cf05 100644 --- a/fs/jffs2/acl.c +++ b/fs/jffs2/acl.c | |||
@@ -156,7 +156,7 @@ static void *jffs2_acl_to_medium(const struct posix_acl *acl, size_t *size) | |||
156 | return ERR_PTR(-EINVAL); | 156 | return ERR_PTR(-EINVAL); |
157 | } | 157 | } |
158 | 158 | ||
159 | static struct posix_acl *jffs2_get_acl(struct inode *inode, int type) | 159 | struct posix_acl *jffs2_get_acl(struct inode *inode, int type) |
160 | { | 160 | { |
161 | struct posix_acl *acl; | 161 | struct posix_acl *acl; |
162 | char *value = NULL; | 162 | char *value = NULL; |
@@ -259,22 +259,6 @@ static int jffs2_set_acl(struct inode *inode, int type, struct posix_acl *acl) | |||
259 | return rc; | 259 | return rc; |
260 | } | 260 | } |
261 | 261 | ||
262 | int jffs2_check_acl(struct inode *inode, int mask) | ||
263 | { | ||
264 | struct posix_acl *acl; | ||
265 | int rc; | ||
266 | |||
267 | acl = jffs2_get_acl(inode, ACL_TYPE_ACCESS); | ||
268 | if (IS_ERR(acl)) | ||
269 | return PTR_ERR(acl); | ||
270 | if (acl) { | ||
271 | rc = posix_acl_permission(inode, acl, mask); | ||
272 | posix_acl_release(acl); | ||
273 | return rc; | ||
274 | } | ||
275 | return -EAGAIN; | ||
276 | } | ||
277 | |||
278 | int jffs2_init_acl_pre(struct inode *dir_i, struct inode *inode, mode_t *i_mode) | 262 | int jffs2_init_acl_pre(struct inode *dir_i, struct inode *inode, mode_t *i_mode) |
279 | { | 263 | { |
280 | struct posix_acl *acl; | 264 | struct posix_acl *acl; |