Re: [f2fs-dev] [PATCH v2] f2fs: introduce two helper functions for the largest cached extent

2023-07-25 Thread Chao Liu
On 7月 26 09:24, Chao Yu wrote: > On 2023/7/25 9:36, Chao Liu wrote: > > From: Chao Liu > > > > This patch is a cleanup: > > 1. Merge __drop_largest_extent() since it has only one caller. > > 2. Introduce __unlock_tree_with_checking_largest() and > >

[f2fs-dev] [PATCH v2] f2fs: introduce two helper functions for the largest cached extent

2023-07-24 Thread Chao Liu
From: Chao Liu This patch is a cleanup: 1. Merge __drop_largest_extent() since it has only one caller. 2. Introduce __unlock_tree_with_checking_largest() and __drop_largest_extent() to help manage largest and largest_update in extent_tree. Signed-off-by: Chao Liu --- v2: Make sure et

[f2fs-dev] [PATCH] f2fs: introduce two helper functions for the largest cached extent

2023-07-18 Thread Chao Liu
From: Chao Liu This patch is a cleanup: 1. Merge __drop_largest_extent() since it has only one caller. 2. Introduce __notify_largest_extent_updated() and __drop_largest_extent() to help manage largest and largest_update in extent_tree. Signed-off-by: Chao Liu --- fs/f2fs/extent_cache.c

[f2fs-dev] [PATCH RESEND] f2fs: fix to remove F2FS_COMPR_FL and tag F2FS_NOCOMP_FL at the same time

2022-07-25 Thread Chao Liu
From: Chao Liu If the inode has the compress flag, it will fail to use 'chattr -c +m' to remove its compress flag and tag no compress flag. However, the same command will be successful when executed again, as shown below: $ touch foo.txt $ chattr +c foo.txt $ chattr -c +m foo.tx

[f2fs-dev] [PATCH v2] f2fs: allow compression of files without blocks

2022-07-07 Thread Chao Liu
From: Chao Liu Files created by truncate(1) have a size but no blocks, so they can be allowed to enable compression. Signed-off-by: Chao Liu --- v2: - update commit message: truncate -> truncate(1) fs/f2fs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f

Re: [f2fs-dev] [PATCH] f2fs: allow compression of files without blocks

2022-07-07 Thread Chao Liu
On Wed, Jul 06, 2022 at 10:27:44PM +0800, Chao Yu wrote: > On 2022/6/23 12:24, Chao Liu wrote: > > On Wed, Jun 22, 2022 at 08:50:33PM +0800, Chao Yu wrote: > > > On 2022/6/21 14:42, Chao Liu wrote: > > > > From: Chao Liu > > > > > > > > F

Re: [f2fs-dev] [PATCH] f2fs: allow compression of files without blocks

2022-07-05 Thread Chao Liu
Ping. On Thu, Jun 23, 2022 at 12:24:04PM +0800, Chao Liu wrote: > On Wed, Jun 22, 2022 at 08:50:33PM +0800, Chao Yu wrote: > > On 2022/6/21 14:42, Chao Liu wrote: > > > From: Chao Liu > > > > > > Files created by truncate have a size but no blocks, so > &

Re: [f2fs-dev] [PATCH] f2fs: fix to remove F2FS_COMPR_FL and tag F2FS_NOCOMP_FL at the same time

2022-07-05 Thread Chao Liu
Ping. On Thu, Jun 23, 2022 at 12:44:40PM +0800, Chao Liu wrote: > On Wed, Jun 22, 2022 at 09:42:13PM +0800, Chao Yu wrote: > > On 2022/6/21 14:48, Chao Liu wrote: > > > From: Chao Liu > > > > > > If the inode has the compress flag, it will fail to use > &g

Re: [f2fs-dev] [PATCH] f2fs: fix to remove F2FS_COMPR_FL and tag F2FS_NOCOMP_FL at the same time

2022-06-22 Thread Chao Liu
On Wed, Jun 22, 2022 at 09:42:13PM +0800, Chao Yu wrote: > On 2022/6/21 14:48, Chao Liu wrote: > > From: Chao Liu > > > > If the inode has the compress flag, it will fail to use > > 'chattr -c +m' to remove its compress flag and tag no compress flag.

Re: [f2fs-dev] [PATCH] f2fs: allow compression of files without blocks

2022-06-22 Thread Chao Liu
On Wed, Jun 22, 2022 at 08:50:33PM +0800, Chao Yu wrote: > On 2022/6/21 14:42, Chao Liu wrote: > > From: Chao Liu > > > > Files created by truncate have a size but no blocks, so > > I didn't get it, how can we create file by truncation... I'm sorry I didn

[f2fs-dev] [PATCH] f2fs: fix to remove F2FS_COMPR_FL and tag F2FS_NOCOMP_FL at the same time

2022-06-20 Thread Chao Liu
From: Chao Liu If the inode has the compress flag, it will fail to use 'chattr -c +m' to remove its compress flag and tag no compress flag. However, the same command will be successful when executed again, as shown below: $ touch foo.txt $ chattr +c foo.txt $ chattr -c +m foo.tx

[f2fs-dev] [PATCH] f2fs: allow compression of files without blocks

2022-06-20 Thread Chao Liu
From: Chao Liu Files created by truncate have a size but no blocks, so they can be allowed to enable compression. Signed-off-by: Chao Liu --- fs/f2fs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 2d1114b0ceef..daaa0dfd2d2e

Re: [f2fs-dev] [PATCH v2] docs: filesystems: f2fs: fix description about compress ioctl

2022-06-13 Thread Chao Liu
On Mon, Jun 13, 2022 at 11:23:07AM -0600, Jonathan Corbet wrote: > Chao Liu writes: > > > On Mon, Jun 13, 2022 at 04:37:01AM +0100, Matthew Wilcox wrote: > >> On Mon, Jun 13, 2022 at 10:08:00AM +0800, Chao Liu wrote: > >> > v2: > >> > - s/file size/f

Re: [f2fs-dev] [PATCH v2] docs: filesystems: f2fs: fix description about compress ioctl

2022-06-13 Thread Chao Liu
On Mon, Jun 13, 2022 at 04:37:01AM +0100, Matthew Wilcox wrote: > On Mon, Jun 13, 2022 at 10:08:00AM +0800, Chao Liu wrote: > > v2: > > - s/file size/filesize/ > > Why would you change it to be wrong? > This is a suggestion from Chao Yu. Maybe he has some other considerat

[f2fs-dev] [PATCH v2] docs: filesystems: f2fs: fix description about compress ioctl

2022-06-12 Thread Chao Liu
From: Chao Liu Since commit c61404153eb6 ("f2fs: introduce FI_COMPRESS_RELEASED instead of using IMMUTABLE bit"), we no longer use the IMMUTABLE bit to prevent writing data for compression. Let's correct the corresponding documentation. BTW, this patch fixes some alignmen

[f2fs-dev] [PATCH] docs: filesystems: f2fs: fix description about compress ioctl

2022-06-02 Thread Chao Liu
From: Chao Liu Since commit c61404153eb6 ("f2fs: introduce FI_COMPRESS_RELEASED instead of using IMMUTABLE bit"), we no longer use the IMMUTABLE bit to prevent writing data for compression. Let's correct the corresponding documentation. BTW, this patch fixes some alignmen

[f2fs-dev] [PATCH] f2fs: refine comments for inline flags

2022-06-02 Thread Chao Liu
From: Chao Liu Currently, we use f2fs_has_inline_xattr() to check whether the inode can store inline xattr. However, it might be misinterpreted as the inode has at least one inline xattr. The same is true for f2fs_has_inline_data() and f2fs_has_inline_dentry(). To be more intuitive and specific

[f2fs-dev] [PATCH RESEND] f2fs: make f2fs_read_inline_data() more readable

2022-05-19 Thread Chao Liu
From: Chao Liu In f2fs_read_inline_data(), it is confused with checking of inline_data flag, as we checked it before calling. So this patch add some comments for f2fs_has_inline_data(). Signed-off-by: Chao Liu --- fs/f2fs/f2fs.h | 4 1 file changed, 4 insertions(+) diff --git a/fs/f2fs

Re: [f2fs-dev] [PATCH] f2fs: make f2fs_read_inline_data() more readable

2022-05-18 Thread Chao Liu
On Wed, May 18, 2022 at 11:23 PM Chao Yu wrote: > > On 2022/5/18 10:33, Chao Liu wrote: > > In f2fs_read_inline_data(), it is confused with checking of > > inline_data flag, as we checked it before calling. So this > > patch add some comments for f2fs_has_inline_data(

[f2fs-dev] [PATCH] resize.f2fs: add option to manually specify new overprovision

2021-07-22 Thread Chao Liu
Make.f2fs supports manually specifying overprovision, and we expect resize.f2fs to support it as well. This change add a new '-o' option to manually specify overprovision. Signed-off-by: Chao Liu --- fsck/main.c | 8 ++-- fsck/resize.c | 9 - 2 files changed, 14 insert

Re: [f2fs-dev] [PATCH] resize.f2fs: add option to manually specify new overprovision

2021-07-22 Thread Chao Liu
Sorry, I forgot to add the f2fs-dev label. I will send it again later. On Fri, Jul 23, 2021 at 11:46 AM Chao Liu wrote: > > Make.f2fs supports manually specifying overprovision, and we expect > resize.f2fs to support it as well. > > This change add a new '-o' o

[f2fs-dev] [PATCH] resize.f2fs: add option to manually specify new overprovision

2021-07-22 Thread Chao Liu
Make.f2fs supports manually specifying overprovision, and we expect resize.f2fs to support it as well. This change add a new '-o' option to manually specify overprovision. Signed-off-by: Chao Liu --- fsck/main.c | 8 ++-- fsck/resize.c | 9 - 2 files changed, 14 insert