diff options
author | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-08-09 02:03:21 -0400 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-08-09 02:25:37 -0400 |
commit | d71b5564c0da4f652af2e4ca9d3c22b9c960ec1f (patch) | |
tree | d869cc779ae463c7769aa640e849b90ffd71f52a /fs/f2fs/f2fs.h | |
parent | e518ff81c337e39b9b63d92ba41e4512521d7c9c (diff) |
f2fs: introduce cur_cp_version function to reduce code size
This patch introduces a new inline function, cur_cp_version, to reduce redundant
codes.
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs/f2fs.h')
-rw-r--r-- | fs/f2fs/f2fs.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index c1c9670e642f..5348b63adbe9 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h | |||
@@ -503,6 +503,11 @@ static inline void F2FS_RESET_SB_DIRT(struct f2fs_sb_info *sbi) | |||
503 | sbi->s_dirty = 0; | 503 | sbi->s_dirty = 0; |
504 | } | 504 | } |
505 | 505 | ||
506 | static inline unsigned long long cur_cp_version(struct f2fs_checkpoint *cp) | ||
507 | { | ||
508 | return le64_to_cpu(cp->checkpoint_ver); | ||
509 | } | ||
510 | |||
506 | static inline bool is_set_ckpt_flags(struct f2fs_checkpoint *cp, unsigned int f) | 511 | static inline bool is_set_ckpt_flags(struct f2fs_checkpoint *cp, unsigned int f) |
507 | { | 512 | { |
508 | unsigned int ckpt_flags = le32_to_cpu(cp->ckpt_flags); | 513 | unsigned int ckpt_flags = le32_to_cpu(cp->ckpt_flags); |
@@ -691,7 +696,7 @@ static inline block_t __start_cp_addr(struct f2fs_sb_info *sbi) | |||
691 | { | 696 | { |
692 | block_t start_addr; | 697 | block_t start_addr; |
693 | struct f2fs_checkpoint *ckpt = F2FS_CKPT(sbi); | 698 | struct f2fs_checkpoint *ckpt = F2FS_CKPT(sbi); |
694 | unsigned long long ckpt_version = le64_to_cpu(ckpt->checkpoint_ver); | 699 | unsigned long long ckpt_version = cur_cp_version(ckpt); |
695 | 700 | ||
696 | start_addr = le32_to_cpu(F2FS_RAW_SUPER(sbi)->cp_blkaddr); | 701 | start_addr = le32_to_cpu(F2FS_RAW_SUPER(sbi)->cp_blkaddr); |
697 | 702 | ||