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/btrfs | |
parent | 34286d6662308d82aed891852d04c7c3a2649b16 (diff) |
fs: provide rcu-walk aware permission i_ops
Signed-off-by: Nick Piggin <npiggin@kernel.dk>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/acl.c | 6 | ||||
-rw-r--r-- | fs/btrfs/ctree.h | 2 | ||||
-rw-r--r-- | fs/btrfs/inode.c | 7 |
3 files changed, 10 insertions, 5 deletions
diff --git a/fs/btrfs/acl.c b/fs/btrfs/acl.c index 2222d161c7b6..cb518a4b917c 100644 --- a/fs/btrfs/acl.c +++ b/fs/btrfs/acl.c | |||
@@ -185,13 +185,15 @@ static int btrfs_xattr_acl_set(struct dentry *dentry, const char *name, | |||
185 | return ret; | 185 | return ret; |
186 | } | 186 | } |
187 | 187 | ||
188 | int btrfs_check_acl(struct inode *inode, int mask) | 188 | int btrfs_check_acl(struct inode *inode, int mask, unsigned int flags) |
189 | { | 189 | { |
190 | struct posix_acl *acl; | 190 | struct posix_acl *acl; |
191 | int error = -EAGAIN; | 191 | int error = -EAGAIN; |
192 | 192 | ||
193 | acl = btrfs_get_acl(inode, ACL_TYPE_ACCESS); | 193 | if (flags & IPERM_FLAG_RCU) |
194 | return -ECHILD; | ||
194 | 195 | ||
196 | acl = btrfs_get_acl(inode, ACL_TYPE_ACCESS); | ||
195 | if (IS_ERR(acl)) | 197 | if (IS_ERR(acl)) |
196 | return PTR_ERR(acl); | 198 | return PTR_ERR(acl); |
197 | if (acl) { | 199 | if (acl) { |
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index af52f6d7a4d8..a142d204b526 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
@@ -2544,7 +2544,7 @@ int btrfs_sync_fs(struct super_block *sb, int wait); | |||
2544 | 2544 | ||
2545 | /* acl.c */ | 2545 | /* acl.c */ |
2546 | #ifdef CONFIG_BTRFS_FS_POSIX_ACL | 2546 | #ifdef CONFIG_BTRFS_FS_POSIX_ACL |
2547 | int btrfs_check_acl(struct inode *inode, int mask); | 2547 | int btrfs_check_acl(struct inode *inode, int mask, unsigned int flags); |
2548 | #else | 2548 | #else |
2549 | #define btrfs_check_acl NULL | 2549 | #define btrfs_check_acl NULL |
2550 | #endif | 2550 | #endif |
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 63e4546b478a..5cf0db0081f9 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -7211,11 +7211,14 @@ static int btrfs_set_page_dirty(struct page *page) | |||
7211 | return __set_page_dirty_nobuffers(page); | 7211 | return __set_page_dirty_nobuffers(page); |
7212 | } | 7212 | } |
7213 | 7213 | ||
7214 | static int btrfs_permission(struct inode *inode, int mask) | 7214 | static int btrfs_permission(struct inode *inode, int mask, unsigned int flags) |
7215 | { | 7215 | { |
7216 | if (flags & IPERM_FLAG_RCU) | ||
7217 | return -ECHILD; | ||
7218 | |||
7216 | if ((BTRFS_I(inode)->flags & BTRFS_INODE_READONLY) && (mask & MAY_WRITE)) | 7219 | if ((BTRFS_I(inode)->flags & BTRFS_INODE_READONLY) && (mask & MAY_WRITE)) |
7217 | return -EACCES; | 7220 | return -EACCES; |
7218 | return generic_permission(inode, mask, btrfs_check_acl); | 7221 | return generic_permission(inode, mask, flags, btrfs_check_acl); |
7219 | } | 7222 | } |
7220 | 7223 | ||
7221 | static const struct inode_operations btrfs_dir_inode_operations = { | 7224 | static const struct inode_operations btrfs_dir_inode_operations = { |