linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [PATCH] f2fs: use cur_map instead of ckpt_map
@ 2018-04-09 11:36 Yunlei He
  2018-04-10  2:44 ` Chao Yu
  0 siblings, 1 reply; 3+ messages in thread
From: Yunlei He @ 2018-04-09 11:36 UTC (permalink / raw)
  To: jaegeuk, yuchao0, linux-f2fs-devel; +Cc: zhangdianfang

This patch use cur_map instead of ckpt_map for easy to
understand, no functional change.

Signed-off-by: Yunlei He <heyunlei@huawei.com>
---
 fs/f2fs/segment.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index 5854cc4..f5d0499 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -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 <=
-- 
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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] f2fs: use cur_map instead of ckpt_map
  2018-04-09 11:36 [PATCH] f2fs: use cur_map instead of ckpt_map Yunlei He
@ 2018-04-10  2:44 ` Chao Yu
  2018-04-10  2:55   ` heyunlei
  0 siblings, 1 reply; 3+ messages in thread
From: Chao Yu @ 2018-04-10  2:44 UTC (permalink / raw)
  To: Yunlei He, jaegeuk, linux-f2fs-devel; +Cc: zhangdianfang

On 2018/4/9 19:36, Yunlei He wrote:
> This patch use cur_map instead of ckpt_map for 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,

> 
> Signed-off-by: Yunlei He <heyunlei@huawei.com>
> ---
>  fs/f2fs/segment.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
> index 5854cc4..f5d0499 100644
> --- a/fs/f2fs/segment.c
> +++ b/fs/f2fs/segment.c
> @@ -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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] f2fs: use cur_map instead of ckpt_map
  2018-04-10  2:44 ` Chao Yu
@ 2018-04-10  2:55   ` heyunlei
  0 siblings, 0 replies; 3+ messages in thread
From: heyunlei @ 2018-04-10  2:55 UTC (permalink / raw)
  To: Yuchao (T), jaegeuk@kernel.org,
	linux-f2fs-devel@lists.sourceforge.net
  Cc: Zhangdianfang (Euler)



>-----Original Message-----
>From: Yuchao (T)
>Sent: Tuesday, April 10, 2018 10:45 AM
>To: heyunlei; jaegeuk@kernel.org; linux-f2fs-devel@lists.sourceforge.net
>Cc: Wangbintian; Zhangdianfang (Euler)
>Subject: Re: [f2fs-dev][PATCH] f2fs: use cur_map instead of ckpt_map
>
>On 2018/4/9 19:36, Yunlei He wrote:
>> This patch use cur_map instead of ckpt_map for 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?

Okay, I'll do it. 

Thanks.
>
>Thanks,
>
>>
>> Signed-off-by: Yunlei He <heyunlei@huawei.com>
>> ---
>>  fs/f2fs/segment.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
>> index 5854cc4..f5d0499 100644
>> --- a/fs/f2fs/segment.c
>> +++ b/fs/f2fs/segment.c
>> @@ -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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-04-10  2:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-09 11:36 [PATCH] f2fs: use cur_map instead of ckpt_map Yunlei He
2018-04-10  2:44 ` Chao Yu
2018-04-10  2:55   ` heyunlei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).