diff options
author | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2009-06-07 12:39:31 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2009-06-11 21:36:18 -0400 |
commit | 6dd4740662405a68bb229ac2b9e0aeaaf2188bf2 (patch) | |
tree | 36e6ae2a095613be1c36e8828ee9471e60c09de6 /fs/nilfs2/the_nilfs.h | |
parent | 3f82ff55168e92859119bf348e9e0bd6714d2fea (diff) |
nilfs2: simplify remaining sget() use
This simplifies the test function passed on the remaining sget()
callsite in nilfs.
Instead of checking mount type (i.e. ro-mount/rw-mount/snapshot mount)
in the test function passed to sget(), this patch first looks up the
nilfs_sb_info struct which the given mount type matches, and then
acquires the super block instance holding the nilfs_sb_info.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/nilfs2/the_nilfs.h')
-rw-r--r-- | fs/nilfs2/the_nilfs.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/nilfs2/the_nilfs.h b/fs/nilfs2/the_nilfs.h index 99f7e29a5335..be4c040fd629 100644 --- a/fs/nilfs2/the_nilfs.h +++ b/fs/nilfs2/the_nilfs.h | |||
@@ -201,6 +201,7 @@ void put_nilfs(struct the_nilfs *); | |||
201 | int init_nilfs(struct the_nilfs *, struct nilfs_sb_info *, char *); | 201 | int init_nilfs(struct the_nilfs *, struct nilfs_sb_info *, char *); |
202 | int load_nilfs(struct the_nilfs *, struct nilfs_sb_info *); | 202 | int load_nilfs(struct the_nilfs *, struct nilfs_sb_info *); |
203 | int nilfs_count_free_blocks(struct the_nilfs *, sector_t *); | 203 | int nilfs_count_free_blocks(struct the_nilfs *, sector_t *); |
204 | struct nilfs_sb_info *nilfs_find_sbinfo(struct the_nilfs *, int, __u64); | ||
204 | int nilfs_checkpoint_is_mounted(struct the_nilfs *, __u64, int); | 205 | int nilfs_checkpoint_is_mounted(struct the_nilfs *, __u64, int); |
205 | int nilfs_near_disk_full(struct the_nilfs *); | 206 | int nilfs_near_disk_full(struct the_nilfs *); |
206 | void nilfs_fall_back_super_block(struct the_nilfs *); | 207 | void nilfs_fall_back_super_block(struct the_nilfs *); |
@@ -243,6 +244,12 @@ nilfs_detach_writer(struct the_nilfs *nilfs, struct nilfs_sb_info *sbi) | |||
243 | mutex_unlock(&nilfs->ns_writer_mutex); | 244 | mutex_unlock(&nilfs->ns_writer_mutex); |
244 | } | 245 | } |
245 | 246 | ||
247 | static inline void nilfs_put_sbinfo(struct nilfs_sb_info *sbi) | ||
248 | { | ||
249 | if (!atomic_dec_and_test(&sbi->s_count)) | ||
250 | kfree(sbi); | ||
251 | } | ||
252 | |||
246 | static inline void | 253 | static inline void |
247 | nilfs_get_segment_range(struct the_nilfs *nilfs, __u64 segnum, | 254 | nilfs_get_segment_range(struct the_nilfs *nilfs, __u64 segnum, |
248 | sector_t *seg_start, sector_t *seg_end) | 255 | sector_t *seg_start, sector_t *seg_end) |