diff options
author | Nick Piggin <npiggin@kernel.dk> | 2011-01-07 01:49:58 -0500 |
---|---|---|
committer | Nick Piggin <npiggin@kernel.dk> | 2011-01-07 01:50:29 -0500 |
commit | b74c79e99389cd79b31fcc08f82c24e492e63c7e (patch) | |
tree | 763c6b412517306670bc625e90035f2d16bb739f /fs/afs | |
parent | 34286d6662308d82aed891852d04c7c3a2649b16 (diff) |
fs: provide rcu-walk aware permission i_ops
Signed-off-by: Nick Piggin <npiggin@kernel.dk>
Diffstat (limited to 'fs/afs')
-rw-r--r-- | fs/afs/internal.h | 2 | ||||
-rw-r--r-- | fs/afs/security.c | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/fs/afs/internal.h b/fs/afs/internal.h index cca8eef736fc..6d4bc1c8ff60 100644 --- a/fs/afs/internal.h +++ b/fs/afs/internal.h | |||
@@ -624,7 +624,7 @@ extern void afs_clear_permits(struct afs_vnode *); | |||
624 | extern void afs_cache_permit(struct afs_vnode *, struct key *, long); | 624 | extern void afs_cache_permit(struct afs_vnode *, struct key *, long); |
625 | extern void afs_zap_permits(struct rcu_head *); | 625 | extern void afs_zap_permits(struct rcu_head *); |
626 | extern struct key *afs_request_key(struct afs_cell *); | 626 | extern struct key *afs_request_key(struct afs_cell *); |
627 | extern int afs_permission(struct inode *, int); | 627 | extern int afs_permission(struct inode *, int, unsigned int); |
628 | 628 | ||
629 | /* | 629 | /* |
630 | * server.c | 630 | * server.c |
diff --git a/fs/afs/security.c b/fs/afs/security.c index bb4ed144d0e4..f44b9d355377 100644 --- a/fs/afs/security.c +++ b/fs/afs/security.c | |||
@@ -285,13 +285,16 @@ static int afs_check_permit(struct afs_vnode *vnode, struct key *key, | |||
285 | * - AFS ACLs are attached to directories only, and a file is controlled by its | 285 | * - AFS ACLs are attached to directories only, and a file is controlled by its |
286 | * parent directory's ACL | 286 | * parent directory's ACL |
287 | */ | 287 | */ |
288 | int afs_permission(struct inode *inode, int mask) | 288 | int afs_permission(struct inode *inode, int mask, unsigned int flags) |
289 | { | 289 | { |
290 | struct afs_vnode *vnode = AFS_FS_I(inode); | 290 | struct afs_vnode *vnode = AFS_FS_I(inode); |
291 | afs_access_t uninitialized_var(access); | 291 | afs_access_t uninitialized_var(access); |
292 | struct key *key; | 292 | struct key *key; |
293 | int ret; | 293 | int ret; |
294 | 294 | ||
295 | if (flags & IPERM_FLAG_RCU) | ||
296 | return -ECHILD; | ||
297 | |||
295 | _enter("{{%x:%u},%lx},%x,", | 298 | _enter("{{%x:%u},%lx},%x,", |
296 | vnode->fid.vid, vnode->fid.vnode, vnode->flags, mask); | 299 | vnode->fid.vid, vnode->fid.vnode, vnode->flags, mask); |
297 | 300 | ||
@@ -347,7 +350,7 @@ int afs_permission(struct inode *inode, int mask) | |||
347 | } | 350 | } |
348 | 351 | ||
349 | key_put(key); | 352 | key_put(key); |
350 | ret = generic_permission(inode, mask, NULL); | 353 | ret = generic_permission(inode, mask, flags, NULL); |
351 | _leave(" = %d", ret); | 354 | _leave(" = %d", ret); |
352 | return ret; | 355 | return ret; |
353 | 356 | ||