diff options
author | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2009-11-12 13:10:21 -0500 |
---|---|---|
committer | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2009-11-19 20:05:48 -0500 |
commit | 7b16c8a211c87d465c48ea324928f8057590b853 (patch) | |
tree | 3afd724d8d6240516d58793d8c3f373ca16e4f40 /fs/nilfs2/sufile.c | |
parent | fd66c0d5c377ee8146909d0eb9258539e4b0f293 (diff) |
nilfs2: unfold nilfs_sufile_block_get_header function
This unfolds the nilfs_sufile_block_get_header() function for
simplicity.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Diffstat (limited to 'fs/nilfs2/sufile.c')
-rw-r--r-- | fs/nilfs2/sufile.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/fs/nilfs2/sufile.c b/fs/nilfs2/sufile.c index b344f27238f0..88344728f216 100644 --- a/fs/nilfs2/sufile.c +++ b/fs/nilfs2/sufile.c | |||
@@ -62,14 +62,6 @@ nilfs_sufile_segment_usages_in_block(const struct inode *sufile, __u64 curr, | |||
62 | max - curr + 1); | 62 | max - curr + 1); |
63 | } | 63 | } |
64 | 64 | ||
65 | static inline struct nilfs_sufile_header * | ||
66 | nilfs_sufile_block_get_header(const struct inode *sufile, | ||
67 | struct buffer_head *bh, | ||
68 | void *kaddr) | ||
69 | { | ||
70 | return kaddr + bh_offset(bh); | ||
71 | } | ||
72 | |||
73 | static struct nilfs_segment_usage * | 65 | static struct nilfs_segment_usage * |
74 | nilfs_sufile_block_get_segment_usage(const struct inode *sufile, __u64 segnum, | 66 | nilfs_sufile_block_get_segment_usage(const struct inode *sufile, __u64 segnum, |
75 | struct buffer_head *bh, void *kaddr) | 67 | struct buffer_head *bh, void *kaddr) |
@@ -270,7 +262,7 @@ int nilfs_sufile_alloc(struct inode *sufile, __u64 *segnump) | |||
270 | if (ret < 0) | 262 | if (ret < 0) |
271 | goto out_sem; | 263 | goto out_sem; |
272 | kaddr = kmap_atomic(header_bh->b_page, KM_USER0); | 264 | kaddr = kmap_atomic(header_bh->b_page, KM_USER0); |
273 | header = nilfs_sufile_block_get_header(sufile, header_bh, kaddr); | 265 | header = kaddr + bh_offset(header_bh); |
274 | ncleansegs = le64_to_cpu(header->sh_ncleansegs); | 266 | ncleansegs = le64_to_cpu(header->sh_ncleansegs); |
275 | last_alloc = le64_to_cpu(header->sh_last_alloc); | 267 | last_alloc = le64_to_cpu(header->sh_last_alloc); |
276 | kunmap_atomic(kaddr, KM_USER0); | 268 | kunmap_atomic(kaddr, KM_USER0); |
@@ -302,8 +294,7 @@ int nilfs_sufile_alloc(struct inode *sufile, __u64 *segnump) | |||
302 | kunmap_atomic(kaddr, KM_USER0); | 294 | kunmap_atomic(kaddr, KM_USER0); |
303 | 295 | ||
304 | kaddr = kmap_atomic(header_bh->b_page, KM_USER0); | 296 | kaddr = kmap_atomic(header_bh->b_page, KM_USER0); |
305 | header = nilfs_sufile_block_get_header( | 297 | header = kaddr + bh_offset(header_bh); |
306 | sufile, header_bh, kaddr); | ||
307 | le64_add_cpu(&header->sh_ncleansegs, -1); | 298 | le64_add_cpu(&header->sh_ncleansegs, -1); |
308 | le64_add_cpu(&header->sh_ndirtysegs, 1); | 299 | le64_add_cpu(&header->sh_ndirtysegs, 1); |
309 | header->sh_last_alloc = cpu_to_le64(segnum); | 300 | header->sh_last_alloc = cpu_to_le64(segnum); |
@@ -515,7 +506,7 @@ int nilfs_sufile_get_stat(struct inode *sufile, struct nilfs_sustat *sustat) | |||
515 | goto out_sem; | 506 | goto out_sem; |
516 | 507 | ||
517 | kaddr = kmap_atomic(header_bh->b_page, KM_USER0); | 508 | kaddr = kmap_atomic(header_bh->b_page, KM_USER0); |
518 | header = nilfs_sufile_block_get_header(sufile, header_bh, kaddr); | 509 | header = kaddr + bh_offset(header_bh); |
519 | sustat->ss_nsegs = nilfs_sufile_get_nsegments(sufile); | 510 | sustat->ss_nsegs = nilfs_sufile_get_nsegments(sufile); |
520 | sustat->ss_ncleansegs = le64_to_cpu(header->sh_ncleansegs); | 511 | sustat->ss_ncleansegs = le64_to_cpu(header->sh_ncleansegs); |
521 | sustat->ss_ndirtysegs = le64_to_cpu(header->sh_ndirtysegs); | 512 | sustat->ss_ndirtysegs = le64_to_cpu(header->sh_ndirtysegs); |