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/nilfs2 | |
parent | 34286d6662308d82aed891852d04c7c3a2649b16 (diff) |
fs: provide rcu-walk aware permission i_ops
Signed-off-by: Nick Piggin <npiggin@kernel.dk>
Diffstat (limited to 'fs/nilfs2')
-rw-r--r-- | fs/nilfs2/inode.c | 10 | ||||
-rw-r--r-- | fs/nilfs2/nilfs.h | 2 |
2 files changed, 8 insertions, 4 deletions
diff --git a/fs/nilfs2/inode.c b/fs/nilfs2/inode.c index 71d4bc8464e0..77b48c8fab17 100644 --- a/fs/nilfs2/inode.c +++ b/fs/nilfs2/inode.c | |||
@@ -785,15 +785,19 @@ out_err: | |||
785 | return err; | 785 | return err; |
786 | } | 786 | } |
787 | 787 | ||
788 | int nilfs_permission(struct inode *inode, int mask) | 788 | int nilfs_permission(struct inode *inode, int mask, unsigned int flags) |
789 | { | 789 | { |
790 | struct nilfs_root *root = NILFS_I(inode)->i_root; | 790 | struct nilfs_root *root; |
791 | |||
792 | if (flags & IPERM_FLAG_RCU) | ||
793 | return -ECHILD; | ||
791 | 794 | ||
795 | root = NILFS_I(inode)->i_root; | ||
792 | if ((mask & MAY_WRITE) && root && | 796 | if ((mask & MAY_WRITE) && root && |
793 | root->cno != NILFS_CPTREE_CURRENT_CNO) | 797 | root->cno != NILFS_CPTREE_CURRENT_CNO) |
794 | return -EROFS; /* snapshot is not writable */ | 798 | return -EROFS; /* snapshot is not writable */ |
795 | 799 | ||
796 | return generic_permission(inode, mask, NULL); | 800 | return generic_permission(inode, mask, flags, NULL); |
797 | } | 801 | } |
798 | 802 | ||
799 | int nilfs_load_inode_block(struct nilfs_sb_info *sbi, struct inode *inode, | 803 | int nilfs_load_inode_block(struct nilfs_sb_info *sbi, struct inode *inode, |
diff --git a/fs/nilfs2/nilfs.h b/fs/nilfs2/nilfs.h index f7560da5a567..0ca98823db59 100644 --- a/fs/nilfs2/nilfs.h +++ b/fs/nilfs2/nilfs.h | |||
@@ -256,7 +256,7 @@ extern void nilfs_update_inode(struct inode *, struct buffer_head *); | |||
256 | extern void nilfs_truncate(struct inode *); | 256 | extern void nilfs_truncate(struct inode *); |
257 | extern void nilfs_evict_inode(struct inode *); | 257 | extern void nilfs_evict_inode(struct inode *); |
258 | extern int nilfs_setattr(struct dentry *, struct iattr *); | 258 | extern int nilfs_setattr(struct dentry *, struct iattr *); |
259 | int nilfs_permission(struct inode *inode, int mask); | 259 | int nilfs_permission(struct inode *inode, int mask, unsigned int flags); |
260 | extern int nilfs_load_inode_block(struct nilfs_sb_info *, struct inode *, | 260 | extern int nilfs_load_inode_block(struct nilfs_sb_info *, struct inode *, |
261 | struct buffer_head **); | 261 | struct buffer_head **); |
262 | extern int nilfs_inode_dirty(struct inode *); | 262 | extern int nilfs_inode_dirty(struct inode *); |