diff options
author | Kinglong Mee <kinglongmee@gmail.com> | 2017-02-25 06:53:39 -0500 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2017-02-27 13:07:47 -0500 |
commit | ced2c7ea8e99b46755a270872cd5ba61c27cffad (patch) | |
tree | 35fb8c20a172d24422d53738c878f16721b059dd /fs/f2fs/f2fs.h | |
parent | 727ebb091e1778cc3a4842ae04f8f54da111eee0 (diff) |
f2fs: new helper cur_cp_crc() getting crc in f2fs_checkpoint
There are four places that getting the crc value in f2fs_checkpoint,
just add a new helper cur_cp_crc for them.
Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/f2fs.h')
-rw-r--r-- | fs/f2fs/f2fs.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 633f2efc8c17..4d332b396384 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h | |||
@@ -1126,6 +1126,12 @@ static inline unsigned long long cur_cp_version(struct f2fs_checkpoint *cp) | |||
1126 | return le64_to_cpu(cp->checkpoint_ver); | 1126 | return le64_to_cpu(cp->checkpoint_ver); |
1127 | } | 1127 | } |
1128 | 1128 | ||
1129 | static inline __u64 cur_cp_crc(struct f2fs_checkpoint *cp) | ||
1130 | { | ||
1131 | size_t crc_offset = le32_to_cpu(cp->checksum_offset); | ||
1132 | return le32_to_cpu(*((__le32 *)((unsigned char *)cp + crc_offset))); | ||
1133 | } | ||
1134 | |||
1129 | static inline bool __is_set_ckpt_flags(struct f2fs_checkpoint *cp, unsigned int f) | 1135 | static inline bool __is_set_ckpt_flags(struct f2fs_checkpoint *cp, unsigned int f) |
1130 | { | 1136 | { |
1131 | unsigned int ckpt_flags = le32_to_cpu(cp->ckpt_flags); | 1137 | unsigned int ckpt_flags = le32_to_cpu(cp->ckpt_flags); |