f2fs: use cur_map instead of ckpt_map
PATCH 1/1 f2fs: use cur_map instead of ckpt_map
This patch use cur_map instead of ckpt_map for easy to understand, no functional change.
--- fs/f2fs/segment.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/f2fs/segment.c +1 -1
@@ -1559,7 +1559,7 @@ static bool 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] = force ? ~ckpt_map[i] & ~discard_map[i] : + dmap[i] = force ? ~cur_map[i] & ~discard_map[i] : (cur_map[i] ^ ckpt_map[i]) & ckpt_map[i]; while (force || SM_I(sbi)->dcc_info->nr_discards <=
Signature · 6 lines
1.9.1 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Quoted 2 lines · Yunlei He
This patch use
cur_mapinstead ofckpt_mapfor easy to understand, no functional change.
Actually, it does change the logic, but I think it can fix a issue..
In flush_sit_entries::add_discard_addrs path, cur_map and ckpt_map are the same, but in exist_trim_candidates::add_discard_addrs, cur_map is updated one, and newer than ckpt_map, so we need to use cur_map to check whether there are discard candidates.
Can you change commit message as described above and resend the patch?
Thanks,
Quoted 12 lines
Signed-off-by Yunlei He <[email protected]>--- fs/f2fs/segment.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/f2fs/segment.c +0
-0
fs/f2fs/segment.c static bool add_discard_addrs(struct f2fs_sb_info *sbi, struct cp_control *cpc, · line 1565
Quoted 8 lines
fs/f2fs/segment.c +1
-1@@ -1559,7 +1559,7 @@ static bool 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] = force ? ~ckpt_map[i] & ~discard_map[i] : + dmap[i] = force ? ~cur_map[i] & ~discard_map[i] : (cur_map[i] ^ ckpt_map[i]) & ckpt_map[i]; while (force || SM_I(sbi)->dcc_info->nr_discards <=
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Quoted 13 lines
-----Original Message-----
From: Yuchao (T)
Sent: Tuesday, April 10, 2018 10:45 AM
To: heyunlei; [email protected]; [email protected]
Cc: Wangbintian; Zhangdianfang (Euler)
Subject: Re: [f2fs-dev][PATCH] f2fs: usecur_mapinstead ofckpt_mapQuoted 2 lines · Yunlei He
This patch use
cur_mapinstead ofckpt_mapfor easy to understand, no functional change.
Quoted 8 lines
Actually, it does change the logic, but I think it can fix a issue..
In
flush_sit_entries::add_discard_addrspath,cur_mapandckpt_mapare the same, but inexist_trim_candidates::add_discard_addrs,cur_mapis updated one, and newer thanckpt_map, so we need to usecur_mapto check whether there are discard candidates.Can you change commit message as described above and resend the patch?
Okay, I'll do it.
Thanks.
Quoted 15 lines
Thanks,
Quoted 12 lines
Signed-off-by Yunlei He <[email protected]>--- fs/f2fs/segment.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/f2fs/segment.c +0
-0@@ -1559,7 +1559,7 @@ static bool add_discard_addrs(struct f2fs_sb_info *sbi, struct cp_control *cpc,
Quoted 8 lines
fs/f2fs/segment.c static bool add_discard_addrs(struct f2fs_sb_info *sbi, struct cp_control *cpc, · line 1565
Quoted 8 lines
fs/f2fs/segment.c +1
-1/* SIT_VBLOCK_MAP_SIZE should be multiple of sizeof(unsigned long) */ for (i =0 ; i < entries; i++) - dmap[i] = force ? ~ckpt_map[i] & ~discard_map[i] : + dmap[i] = force ? ~cur_map[i] & ~discard_map[i] : (cur_map[i] ^ ckpt_map[i]) & ckpt_map[i]; while (force || SM_I(sbi)->dcc_info->nr_discards <=
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot