diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-09-20 02:55:10 +0200 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-09-30 19:05:46 +0200 |
commit | a468f0ef516fda9c7d91bb550d458e853d76955e (patch) | |
tree | 87906aa2c4e349c0b04e8276de05cf956887e150 /fs/f2fs/segment.c | |
parent | f2fs: preallocate blocks for encrypted file (diff) | |
download | linux-a468f0ef516fda9c7d91bb550d458e853d76955e.tar.xz linux-a468f0ef516fda9c7d91bb550d458e853d76955e.zip |
f2fs: use crc and cp version to determine roll-forward recovery
Previously, we used cp_version only to detect recoverable dnodes.
In order to avoid same garbage cp_version, we needed to truncate the next
dnode during checkpoint, resulting in additional discard or data write.
If we can distinguish this by using crc in addition to cp_version, we can
remove this overhead.
There is backward compatibility concern where it changes node_footer layout.
So, this patch introduces a new checkpoint flag, CP_CRC_RECOVERY_FLAG, to
detect new layout. New layout will be activated only when this flag is set.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/segment.c')
-rw-r--r-- | fs/f2fs/segment.c | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index c4d0472cf47d..2d23d7b17d6c 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -669,28 +669,6 @@ static int f2fs_issue_discard(struct f2fs_sb_info *sbi, return __f2fs_issue_discard_async(sbi, start, len, GFP_NOFS, 0); } -bool discard_next_dnode(struct f2fs_sb_info *sbi, block_t blkaddr) -{ - int err = -EOPNOTSUPP; - - if (test_opt(sbi, DISCARD)) { - struct seg_entry *se = get_seg_entry(sbi, - GET_SEGNO(sbi, blkaddr)); - unsigned int offset = GET_BLKOFF_FROM_SEG0(sbi, blkaddr); - - if (f2fs_test_bit(offset, se->discard_map)) - return false; - - err = f2fs_issue_discard(sbi, blkaddr, 1); - } - - if (err) { - update_meta_page(sbi, NULL, blkaddr); - return true; - } - return false; -} - static void __add_discard_entry(struct f2fs_sb_info *sbi, struct cp_control *cpc, struct seg_entry *se, unsigned int start, unsigned int end) |