f2fs: do not discard data protected by the previous checkpoint
authorJaegeuk Kim <jaegeuk@kernel.org>
Mon, 27 Oct 2014 20:54:27 +0000 (13:54 -0700)
committerJaegeuk Kim <jaegeuk@kernel.org>
Tue, 4 Nov 2014 00:07:38 +0000 (16:07 -0800)
We should not discard any data protected by the previous checkpoint all
the time.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/segment.c

index d391a5913c792a06f0c80f68ee8ffa1da7bb0fb7..06dda733f958bba67814dbb4ddee3d955fd98c30 100644 (file)
@@ -517,7 +517,7 @@ static void add_discard_addrs(struct f2fs_sb_info *sbi, struct cp_control *cpc)
 
        /* SIT_VBLOCK_MAP_SIZE should be multiple of sizeof(unsigned long) */
        for (i = 0; i < entries; i++)
-               dmap[i] = (cur_map[i] ^ ckpt_map[i]) & ckpt_map[i];
+               dmap[i] = ~(cur_map[i] | ckpt_map[i]);
 
        while (force || SM_I(sbi)->nr_discards <= SM_I(sbi)->max_discards) {
                start = __find_rev_next_bit(dmap, max_blocks, end + 1);
This page took 0.027935 seconds and 5 git commands to generate.