[f2fs-dev] [PATCH] f2fs: optimize the way of traversing free_nid_bitmap

2017-11-07 Thread Fan Li
o one third of its original. Signed-off-by: Fan li --- fs/f2fs/node.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index fef5c68..d234c6e 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -1955,6 +1955,7 @@ static

RE: [f2fs-dev] [PATCH] f2fs: keep scanning until enough free nids are acquired

2017-11-06 Thread Fan Li
> -Original Message- > From: Jaegeuk Kim [mailto:jaeg...@kernel.org] > Sent: Tuesday, November 07, 2017 11:41 AM > To: Fan Li > Cc: 'Chao Yu'; 'Chao Yu'; linux-kernel@vger.kernel.org; > linux-f2fs-de...@lists.sourceforge.net > Subject: Re: [f2

[f2fs-dev] [PATCH] f2fs: keep scanning until enough free nids are acquired

2017-11-06 Thread Fan Li
thout solving the shortage of the free nids. This patch fixes that. Signed-off-by: Fan li --- fs/f2fs/node.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index 3d0d1be..5cef118 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -2010,7 +2

RE: [f2fs-dev] [PATCH RESEND] f2fs: modify the procedure of scan free nid

2017-11-05 Thread Fan Li
> -Original Message- > From: Chao Yu [mailto:c...@kernel.org] > Sent: Friday, November 03, 2017 9:16 PM > To: Fan Li; 'Chao Yu'; 'Jaegeuk Kim' > Cc: linux-kernel@vger.kernel.org; linux-f2fs-de...@lists.sourceforge.net > Subject: Re: [f2fs-dev] [PATCH

RE: [f2fs-dev] [PATCH RESEND] f2fs: modify the procedure of scan free nid

2017-11-03 Thread Fan Li
> -Original Message- > From: Chao Yu [mailto:yuch...@huawei.com] > Sent: Friday, November 03, 2017 4:54 PM > To: Fan Li; 'Chao Yu'; 'Jaegeuk Kim' > Cc: linux-kernel@vger.kernel.org; linux-f2fs-de...@lists.sourceforge.net > Subject: Re: [f2fs-dev] [PA

[f2fs-dev] [PATCH RESEND] f2fs: modify the procedure of scan free nid

2017-11-03 Thread Fan Li
, which means all free nids before next_scan_nid are already in free list; and use next_scan_nid as the end of the range since all free nids which are scanned in scan_free_nid_bits must be smaller next_scan_nid. Signed-off-by: Fan li --- fs/f2fs/f2fs.h | 1 + fs/f2f

[f2fs-dev] [PATCH] f2fs: save a multiplication for last_nid calculation

2017-11-01 Thread Fan Li
Use a slightly easier way to calculate last_nid. Signed-off-by: Fan li --- fs/f2fs/node.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index 7834097..55ab330 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -2642,7 +2642,7 @@ static

RE: [f2fs-dev] [PATCH] f2fs: modify the procedure of scan free nid

2017-11-01 Thread Fan Li
> -Original Message- > From: Chao Yu [mailto:c...@kernel.org] > Sent: Wednesday, November 01, 2017 8:47 PM > To: Fan Li; 'Jaegeuk Kim' > Cc: linux-kernel@vger.kernel.org; linux-f2fs-de...@lists.sourceforge.net > Subject: Re: [f2fs-dev] [PATCH] f2fs: modify th

RE: [f2fs-dev] [PATCH] f2fs: modify the procedure of scan free nid

2017-11-01 Thread Fan Li
> -Original Message- > From: Chao Yu [mailto:c...@kernel.org] > Sent: Tuesday, October 31, 2017 10:32 PM > To: Fan Li; 'Jaegeuk Kim' > Cc: linux-kernel@vger.kernel.org; linux-f2fs-de...@lists.sourceforge.net > Subject: Re: [f2fs-dev] [PATCH] f2fs: modify th

[f2fs-dev] [PATCH] f2fs: modify the procedure of scan free nid

2017-10-31 Thread Fan Li
in free list; and use next_scan_nid as the end of the range since all free nids which are scanned must be smaller next_scan_nid. Signed-off-by: Fan li --- fs/f2fs/f2fs.h | 1 + fs/f2fs/node.c | 30 ++ 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/fs/

RE: [f2fs-dev] [PATCH] f2fs: add a function to move nid

2017-10-30 Thread Fan Li
> -Original Message- > From: Jaegeuk Kim [mailto:jaeg...@kernel.org] > Sent: Monday, October 30, 2017 5:30 PM > To: Chao Yu > Cc: Fan Li; 'Chao Yu'; linux-kernel@vger.kernel.org; > linux-f2fs-de...@lists.sourceforge.net > Subject: Re: [f2fs-dev] [PATCH] f

[f2fs-dev] [PATCH] f2fs: optimize __update_nat_bits

2017-10-30 Thread Fan Li
It's better that we don't assume @start_nid is the first nid of the nat block it's in. 3. Use " if (nat_blk->entries[i].block_addr != NULL_ADDR)" to explicitly comfirm the value of block_addr use constant to make sure the codes is right, even if the value of NULL_ADDR

[f2fs-dev] [PATCH] f2fs: add a function to move nid

2017-10-28 Thread Fan Li
This patch add a new function to move nid from one state to another. Move operation is heavily used, by adding a new function for it we can cut down some branches from several flow. Signed-off-by: Fan li --- fs/f2fs/node.c | 51 ++- 1 file

[f2fs-dev] [PATCH] f2fs: fix bugs and simplify codes of f2fs_fiemap

2015-12-26 Thread Fan Li
isize, it will also return the extent beyond isize, which is outside the range. Signed-off-by: Fan li --- fs/f2fs/data.c | 80 +++- 1 file changed, 27 insertions(+), 53 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 5c43b2d

[f2fs-dev] [PATCH] f2fs: optimize the flow of f2fs_map_blocks

2015-12-16 Thread Fan Li
check map->m_len right after it changes to avoid excess call to update dnode_of_data. Signed-off-by: Fan li --- fs/f2fs/data.c | 69 +--- 1 file changed, 36 insertions(+), 33 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c in

[f2fs-dev] [PATCH] f2fs: fix to reset variable correctlly

2015-12-15 Thread Fan Li
f2fs_map_blocks will set m_flags and m_len to 0, so we don't need to reset m_flags ourselves, but have to reset m_len to correct value before use it again. Signed-off-by: Fan li --- fs/f2fs/file.c |9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/fs/f2fs/fil

[f2fs-dev] [PATCH] f2fs: optimize __find_rev_next_bit

2015-11-11 Thread Fan Li
1. Skip __reverse_ulong if the bitmap is empty. 2. Reduce branches and codes. According to my test, the performance of this new version is 5% higher on an empty bitmap of 64bytes, and remains about the same in the worst scenario. Signed-off-by: Fan li --- fs/f2fs/segment.c | 46

RE: [f2fs-dev] [PATCH] f2fs: refactor __find_rev_next_{zero}_bit

2015-11-05 Thread Fan Li
In bitmaps of f2fs, bytes are sorted in ascending order, but bits in a byte are sorted in descending order. It seems to be the reason why __reverse_ulong is needed. May I ask why f2fs bitmap apply such order? > -Original Message- > From: Jaegeuk Kim [mailto:jaeg...@kernel.org] > Sent: F

[f2fs-dev][PATCH]f2fs: merge pages with the same sync_mode flag

2013-12-09 Thread Fan Li
:00 2001 From: Fan Li Date: Mon, 9 Dec 2013 11:25:17 +0800 Subject: [PATCH] merge pages with the same sync_mode flag Signed-off-by: Fan Li --- fs/f2fs/data.c| 18 ++ fs/f2fs/f2fs.h|8 +--- fs/f2fs/gc.c |6 +- fs/f2fs/segment.

[f2fs-dev] [PATCH V2] f2fs: change the method of calculating the number summary blocks

2013-10-29 Thread Fan Li
compacted like they should. Besides, when writing summary blocks into pages, if remain space in a page isn't big enough for one f2fs_summary, it will be left unused, current code seems not to take it into account. Signed-off-by: Fan Li --- fs/f2fs/segment.c | 14 ++ 1

RE: [f2fs-dev] [PATCH] f2fs: change the method of calculating the number summary blocks

2013-10-29 Thread Fan Li
> Hi, > > 2013-10-28 (월), 08:54 +0000, Fan Li: > > "There is a HTML error in the previous email, so I send this one.If you > already received this before, please ignore it.Sorry for the inconvenience" > > > > This patch change the method of calculating th

[f2fs-dev] [PATCH] f2fs: change the method of calculating the number summary blocks

2013-10-28 Thread Fan Li
ct f2fs_summary can't be split to two pages, so it could take more space than the sum of its size, the current version seems not to take it into account. Signed-off-by: Fan Li --- fs/f2fs/segment.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/fs/f2fs