diff options
author | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2010-08-15 10:33:57 -0400 |
---|---|---|
committer | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2010-10-22 20:24:35 -0400 |
commit | dc3d3b810a644dfa329efaa230cd514226f8981d (patch) | |
tree | e0a2c2bfb3edb6b1fa4383cb2d1f52adb653c9e2 /fs/nilfs2/nilfs.h | |
parent | fd52202930b7e8db48bee5a6fc6b1f438e822a23 (diff) |
nilfs2: deny write access to inodes in snapshots
Snapshots of nilfs are read-only.
After super block instances (sb) will be unified, nilfs will need to
check write access by a way other than implicit test with
IS_RDONLY(inode). This is because IS_RDONLY() refers to MS_RDONLY bit
of inode->i_sb->s_flags and it will become inaccurate after the
unification of sb.
To prepare for the issue, this uses i_op->permission to deny write
access to inodes in snapshots.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Diffstat (limited to 'fs/nilfs2/nilfs.h')
-rw-r--r-- | fs/nilfs2/nilfs.h | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/nilfs2/nilfs.h b/fs/nilfs2/nilfs.h index 3870c109aba3..cf5507a2a178 100644 --- a/fs/nilfs2/nilfs.h +++ b/fs/nilfs2/nilfs.h | |||
@@ -201,12 +201,9 @@ static inline struct inode *nilfs_dat_inode(const struct the_nilfs *nilfs) | |||
201 | */ | 201 | */ |
202 | #ifdef CONFIG_NILFS_POSIX_ACL | 202 | #ifdef CONFIG_NILFS_POSIX_ACL |
203 | #error "NILFS: not yet supported POSIX ACL" | 203 | #error "NILFS: not yet supported POSIX ACL" |
204 | extern int nilfs_permission(struct inode *, int, struct nameidata *); | ||
205 | extern int nilfs_acl_chmod(struct inode *); | 204 | extern int nilfs_acl_chmod(struct inode *); |
206 | extern int nilfs_init_acl(struct inode *, struct inode *); | 205 | extern int nilfs_init_acl(struct inode *, struct inode *); |
207 | #else | 206 | #else |
208 | #define nilfs_permission NULL | ||
209 | |||
210 | static inline int nilfs_acl_chmod(struct inode *inode) | 207 | static inline int nilfs_acl_chmod(struct inode *inode) |
211 | { | 208 | { |
212 | return 0; | 209 | return 0; |
@@ -256,6 +253,7 @@ extern void nilfs_update_inode(struct inode *, struct buffer_head *); | |||
256 | extern void nilfs_truncate(struct inode *); | 253 | extern void nilfs_truncate(struct inode *); |
257 | extern void nilfs_evict_inode(struct inode *); | 254 | extern void nilfs_evict_inode(struct inode *); |
258 | extern int nilfs_setattr(struct dentry *, struct iattr *); | 255 | extern int nilfs_setattr(struct dentry *, struct iattr *); |
256 | int nilfs_permission(struct inode *inode, int mask); | ||
259 | extern int nilfs_load_inode_block(struct nilfs_sb_info *, struct inode *, | 257 | extern int nilfs_load_inode_block(struct nilfs_sb_info *, struct inode *, |
260 | struct buffer_head **); | 258 | struct buffer_head **); |
261 | extern int nilfs_inode_dirty(struct inode *); | 259 | extern int nilfs_inode_dirty(struct inode *); |