diff options
| author | Kinglong Mee <kinglongmee@gmail.com> | 2017-02-25 19:53:39 +0800 |
|---|---|---|
| committer | Mister Oyster <oysterized@gmail.com> | 2017-04-13 12:35:03 +0200 |
| commit | d7459ffee9d77c6947d47da2c0d12b58eadb7c5b (patch) | |
| tree | bb3470ade51acba22c04ededddfdee9afa3c6c0e /fs/f2fs/node.c | |
| parent | e8f8b0cfa3ced92a4afb67f23bc89635c6be81c4 (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/node.c')
| -rw-r--r-- | fs/f2fs/node.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index 4ab14589f..e25fc8932 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -2482,9 +2482,6 @@ static int __get_nat_bitmaps(struct f2fs_sb_info *sbi) unsigned int nat_bits_bytes = nm_i->nat_blocks / BITS_PER_BYTE; unsigned int i; __u64 cp_ver = cur_cp_version(ckpt); - size_t crc_offset = le32_to_cpu(ckpt->checksum_offset); - __u64 crc = le32_to_cpu(*((__le32 *) - ((unsigned char *)ckpt + crc_offset))); block_t nat_bits_addr; if (!enabled_nat_bits(sbi, NULL)) @@ -2507,7 +2504,7 @@ static int __get_nat_bitmaps(struct f2fs_sb_info *sbi) f2fs_put_page(page, 1); } - cp_ver |= (crc << 32); + cp_ver |= (cur_cp_crc(ckpt) << 32); if (cpu_to_le64(cp_ver) != *(__le64 *)nm_i->nat_bits) { disable_nat_bits(sbi, true); return 0; |
