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/ceph | |
parent | 34286d6662308d82aed891852d04c7c3a2649b16 (diff) |
fs: provide rcu-walk aware permission i_ops
Signed-off-by: Nick Piggin <npiggin@kernel.dk>
Diffstat (limited to 'fs/ceph')
-rw-r--r-- | fs/ceph/inode.c | 11 | ||||
-rw-r--r-- | fs/ceph/super.h | 2 |
2 files changed, 9 insertions, 4 deletions
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index 47f8c8baf3b5..e61de4f7b99d 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c | |||
@@ -1781,12 +1781,17 @@ int ceph_do_getattr(struct inode *inode, int mask) | |||
1781 | * Check inode permissions. We verify we have a valid value for | 1781 | * Check inode permissions. We verify we have a valid value for |
1782 | * the AUTH cap, then call the generic handler. | 1782 | * the AUTH cap, then call the generic handler. |
1783 | */ | 1783 | */ |
1784 | int ceph_permission(struct inode *inode, int mask) | 1784 | int ceph_permission(struct inode *inode, int mask, unsigned int flags) |
1785 | { | 1785 | { |
1786 | int err = ceph_do_getattr(inode, CEPH_CAP_AUTH_SHARED); | 1786 | int err; |
1787 | |||
1788 | if (flags & IPERM_FLAG_RCU) | ||
1789 | return -ECHILD; | ||
1790 | |||
1791 | err = ceph_do_getattr(inode, CEPH_CAP_AUTH_SHARED); | ||
1787 | 1792 | ||
1788 | if (!err) | 1793 | if (!err) |
1789 | err = generic_permission(inode, mask, NULL); | 1794 | err = generic_permission(inode, mask, flags, NULL); |
1790 | return err; | 1795 | return err; |
1791 | } | 1796 | } |
1792 | 1797 | ||
diff --git a/fs/ceph/super.h b/fs/ceph/super.h index 7f01728a4657..4553d8829edb 100644 --- a/fs/ceph/super.h +++ b/fs/ceph/super.h | |||
@@ -665,7 +665,7 @@ extern void ceph_queue_invalidate(struct inode *inode); | |||
665 | extern void ceph_queue_writeback(struct inode *inode); | 665 | extern void ceph_queue_writeback(struct inode *inode); |
666 | 666 | ||
667 | extern int ceph_do_getattr(struct inode *inode, int mask); | 667 | extern int ceph_do_getattr(struct inode *inode, int mask); |
668 | extern int ceph_permission(struct inode *inode, int mask); | 668 | extern int ceph_permission(struct inode *inode, int mask, unsigned int flags); |
669 | extern int ceph_setattr(struct dentry *dentry, struct iattr *attr); | 669 | extern int ceph_setattr(struct dentry *dentry, struct iattr *attr); |
670 | extern int ceph_getattr(struct vfsmount *mnt, struct dentry *dentry, | 670 | extern int ceph_getattr(struct vfsmount *mnt, struct dentry *dentry, |
671 | struct kstat *stat); | 671 | struct kstat *stat); |