[PATCH v4 01/10] erofs-utils: lib: fix dirent type of whiteout in tarerofs

2023-08-23 Thread Jingbo Xu
Set the correct dirent type for whiteout. Fixes: 95d315fd7958 ("erofs-utils: introduce tarerofs") Signed-off-by: Jingbo Xu --- lib/tar.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/tar.c b/lib/tar.c index 42590d2..328ab98 100644 --- a/lib/tar.c +++ b/lib/tar.c @@ -694,6 +694,7 @@

[PATCH v4 00/10] erofs-utils: mkfs: introduce rebuild mode

2023-08-23 Thread Jingbo Xu
v4: - patch 2: the original two v3 patches[1][2] are merged as patch 2; also update commit message - patch 10: newly added; introduce "--keep-whiteout=[0|1]" option for tarfs and rebuild mode controlling whether whiteout files are kept in the generated image. - patch 9: add documentation for

[PATCH v4 02/10] erofs-utils: lib: keep erofs_init_devices in sync with kernel

2023-08-23 Thread Jingbo Xu
Keep erofs_init_devices() in sync with kernel erofs_scan_devices()[1], which scans the devtable (if any) automatically if sbi->extra_devices is not explicitly specified. Also fix the missing le32_to_cpu() when parsing the device slot. Read and cache the number of blocks of each device for later

[PATCH v4 04/10] erofs-utils: lib: make erofs_get_unhashed_chunk() global

2023-08-23 Thread Jingbo Xu
... so that it could be called from outside blobchunk.c later. Signed-off-by: Jingbo Xu --- include/erofs/blobchunk.h | 2 ++ lib/blobchunk.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/erofs/blobchunk.h b/include/erofs/blobchunk.h index

[PATCH v4 03/10] erofs-utils: lib: add list_splice_tail() helper

2023-08-23 Thread Jingbo Xu
Add list_splice_tail() helper. Reviewed-by: Gao Xiang Signed-off-by: Jingbo Xu --- include/erofs/list.h | 20 1 file changed, 20 insertions(+) diff --git a/include/erofs/list.h b/include/erofs/list.h index 3f5da1a..d7a9fee 100644 --- a/include/erofs/list.h +++

[PATCH v4 06/10] erofs-utils: lib: add erofs_insert_ihash() helper

2023-08-23 Thread Jingbo Xu
Add erofs_insert_ihash() helper inserting inode into inode hash table. Also add prototypes of erofs_iget() and erofs_iget_by_nid() in the header file. Signed-off-by: Jingbo Xu --- include/erofs/inode.h | 3 +++ lib/inode.c | 10 +++--- 2 files changed, 10 insertions(+), 3

[PATCH v4 05/10] erofs-utils: lib: add erofs_read_xattrs_from_disk() helper

2023-08-23 Thread Jingbo Xu
Add erofs_read_xattrs_from_disk() helper reading extended attributes from disk, add checking if it's an opaque directory. Move all xattr name related macros to xattr.c and introduce erofs_set_opaque_xattr() helper to hide all these details. Signed-off-by: Jingbo Xu --- include/erofs/internal.h

[PATCH v4 07/10] erofs-utils: lib: add erofs_rebuild_get_dentry() helper

2023-08-23 Thread Jingbo Xu
Rename tarerofs_get_dentry() to erofs_rebuild_get_dentry(). Also make `whout` and 'opq' parameter optional when `aufs` is false. Signed-off-by: Jingbo Xu --- include/erofs/rebuild.h | 19 +++ lib/Makefile.am | 3 +- lib/rebuild.c | 117

[PATCH v4 08/10] erofs-utils: lib: add erofs_rebuild_load_tree() helper

2023-08-23 Thread Jingbo Xu
Add erofs_rebuild_load_tree() helper loading inode tree from given erofs image, and making it merged into a given inode tree in an overlayfs like model. Since we need to read the content of the symlink file from disk when loading tree, add dependency on zlib_LIBS for mkfs.erofs. Also rename

[PATCH v4 10/10] erofs-utils: mkfs: add --keep-whiteout option for tarfs and rebuild mode

2023-08-23 Thread Jingbo Xu
Add "--keep-whiteout=[0|1]" option for tarfs and rebuild mode, controlling whether whiteout files are kept in the generated image. This option is enabled by default for both tarfs and rebuild mode, i.e. as if "--keep-whiteout=1" is specified by default. To hide whiteout files, specify

[PATCH v4 09/10] erofs-utils: mkfs: introduce rebuild mode

2023-08-23 Thread Jingbo Xu
Introduce a new rebuild mode merging multiple erofs images generated from either tarerfs index mode (--tar=i): mkfs.erofs --tar=i --aufs layer0.erofs layer0.tar ... mkfs.erofs --tar=i --aufs layerN.erofs layerN.tar mkfs.erofs merge.erofs layerN.erofs ...

[PATCH v7] erofs-utils: add support for fuse 2/3 lowlevel API

2023-08-23 Thread Li Yiyan
Add support for the fuse low-level API in erofsfuse, proven correct in 22 test cases. Lowlevel API offers improved performance compared to the high-level API, while maintaining compatibility with fuse version 2(>=2.6) and 3 (>=3.0). Dataset: linux 5.15 Compression algorithm: -z4hc,12 Additional

[PATCH v3 0/29] block: Make blkdev_get_by_*() return handle

2023-08-23 Thread Jan Kara
Hello, this is a v3 of the patch series which implements the idea of blkdev_get_by_*() calls returning bdev_handle which is then passed to blkdev_put() [1]. This makes the get and put calls for bdevs more obviously matching and allows us to propagate context from get to put without having to

[PATCH 21/29] erofs: Convert to use bdev_open_by_path()

2023-08-23 Thread Jan Kara
Convert erofs to use bdev_open_by_path() and pass the handle around. CC: Gao Xiang CC: Chao Yu CC: linux-erofs@lists.ozlabs.org Acked-by: Christoph Hellwig Acked-by: Gao Xiang Signed-off-by: Jan Kara --- fs/erofs/data.c | 4 ++-- fs/erofs/internal.h | 2 +- fs/erofs/super.c| 20

Re: [PATCH v4 01/10] erofs-utils: lib: fix dirent type of whiteout in tarerofs

2023-08-23 Thread Gao Xiang
On 2023/8/23 15:15, Jingbo Xu wrote: Set the correct dirent type for whiteout. Fixes: 95d315fd7958 ("erofs-utils: introduce tarerofs") Signed-off-by: Jingbo Xu Reviewed-by: Gao Xiang Thanks, Gao Xiang

Re: [PATCH v4 02/10] erofs-utils: lib: keep erofs_init_devices in sync with kernel

2023-08-23 Thread Gao Xiang
On 2023/8/23 15:15, Jingbo Xu wrote: Keep erofs_init_devices() in sync with kernel erofs_scan_devices()[1], which scans the devtable (if any) automatically if sbi->extra_devices is not explicitly specified. Also fix the missing le32_to_cpu() when parsing the device slot. Read and cache the

Re: [PATCH v4 08/10] erofs-utils: lib: add erofs_rebuild_load_tree() helper

2023-08-23 Thread Gao Xiang
On 2023/8/23 15:15, Jingbo Xu wrote: Add erofs_rebuild_load_tree() helper loading inode tree from given erofs image, and making it merged into a given inode tree in an overlayfs like model. Since we need to read the content of the symlink file from disk when loading tree, add dependency on

Re: [PATCH 2/3] erofs: add necessary kmem_cache_create flags for erofs inode cache

2023-08-23 Thread Chao Yu
On 2023/8/15 17:48, Ferry Meng wrote: To improve memory access efficiency and enable statistics functionality, add SLAB_MEM_SPREAD and SLAB_ACCOUNT flag during erofs_icachep's allocation time. Signed-off-by: Ferry Meng Reviewed-by: Chao Yu Thanks,

Re: [PATCH 3/3] erofs: remove redundant erofs_fs_type declaration in super.c

2023-08-23 Thread Chao Yu
On 2023/8/15 17:48, Ferry Meng wrote: As erofs_fs_type has been declared in internal.h, there is no use to declare repeatedly in super.c. Signed-off-by: Ferry Meng Reviewed-by: Chao Yu Thanks,

Re: [PATCH 1/8] erofs: simplify z_erofs_read_fragment()

2023-08-23 Thread Chao Yu
On 2023/8/17 16:28, Gao Xiang wrote: A trivial cleanup to make the fragment handling logic more clear. Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks,

Re: [PATCH 2/8] erofs: avoid obsolete {collector,collection} terms

2023-08-23 Thread Chao Yu
On 2023/8/17 16:28, Gao Xiang wrote: {collector,collection} were once reserved in order to indicate different runtime logical extent instance of multi-reference pclusters. However, de-duplicated decompression has been landed in a more flexable way, thus `struct z_erofs_collection` was formally

Re: [PATCH 3/8] erofs: move preparation logic into z_erofs_pcluster_begin()

2023-08-23 Thread Chao Yu
On 2023/8/17 16:28, Gao Xiang wrote: Some preparation logic should be part of z_erofs_pcluster_begin() instead of z_erofs_do_read_page(). Let's move now. Signed-off-by: Gao Xiang --- fs/erofs/zdata.c | 59 +--- 1 file changed, 26 insertions(+),

Re: [PATCH 4/8] erofs: tidy up z_erofs_do_read_page()

2023-08-23 Thread Chao Yu
On 2023/8/17 16:28, Gao Xiang wrote: - Fix a typo: spiltted => split; - Move !EROFS_MAP_MAPPED and EROFS_MAP_FRAGMENT upwards; - Increase `split` in advance to avoid unnecessary repeat. Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks,

Re: [PATCH 5/8] erofs: drop z_erofs_page_mark_eio()

2023-08-23 Thread Chao Yu
On 2023/8/17 16:28, Gao Xiang wrote: It can be folded into z_erofs_onlinepage_endio() to simplify the code. Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks,

Re: [PATCH 6/8] erofs: get rid of fe->backmost for cache decompression

2023-08-23 Thread Chao Yu
On 2023/8/17 16:28, Gao Xiang wrote: EROFS_MAP_FULL_MAPPED is more accurate to decide if caching the last incomplete pcluster for later read or not. Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks,

Re: [PATCH 3/8] erofs: move preparation logic into z_erofs_pcluster_begin()

2023-08-23 Thread Gao Xiang
On 2023/8/23 23:05, Chao Yu wrote: On 2023/8/17 16:28, Gao Xiang wrote: Some preparation logic should be part of z_erofs_pcluster_begin() instead of z_erofs_do_read_page().  Let's move now. Signed-off-by: Gao Xiang ---   fs/erofs/zdata.c | 59

Re: [PATCH 7/8] erofs: adapt folios for z_erofs_readahead()

2023-08-23 Thread Chao Yu
On 2023/8/17 16:28, Gao Xiang wrote: It's a straight-forward conversion except that readahead_folio() will do folio_put() in advance but it doesn't matter since folios are still locked. As before, since file-backed folios (pages for now) are locked, so we could temporarily use folio->private as

Re: [PATCH 8/8] erofs: adapt folios for z_erofs_read_folio()

2023-08-23 Thread Chao Yu
On 2023/8/17 16:28, Gao Xiang wrote: It's a straight-forward conversion and no logic changes (except that it renames the corresponding tracepoint.) Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks,

Re: [PATCH] erofs: refine warning messages for data I/Os

2023-08-23 Thread Chao Yu
On 2023/8/9 14:06, Ferry Meng wrote: Don't warn users since -EINTR is returned due to user interruption. Also suppress warning messages of readmore. Signed-off-by: Ferry Meng Reviewed-by: Chao Yu Thanks,

Re: [PATCH 1/3] erofs: clean up redundant comment and adjust code alignment

2023-08-23 Thread Chao Yu
On 2023/8/15 17:48, Ferry Meng wrote: Remove some redundant comments in erofs/super.c, and avoid unncessary line breaks for cleanup. Signed-off-by: Ferry Meng Reviewed-by: Chao Yu Thanks,

Re: [v2] erofs: don't warn dedupe and fragments features anymore

2023-08-23 Thread Chao Yu
On 2023/8/21 12:22, Gao Xiang wrote: The subject should be: [PATCH v2] erofs: don't warn dedupe and fragments features anymore but it's not really needed to resend. On 2023/8/21 12:17, sunshijie wrote: The `dedupe` and `fragments` features have been merged for a year.  They are mostly stable

Re: [PATCH] erofs: release ztailpacking pclusters properly

2023-08-23 Thread Chao Yu
On 2023/8/22 19:05, Jingbo Xu wrote: Currently ztailpacking pclusters are chained with FOLLOWED_NOINPLACE and not recorded into the managed_pslots XArray. After commit 7674a42f35ea ("erofs: use struct lockref to replace handcrafted approach"), ztailpacking pclusters won't be freed with

[PATCH v5 06/45] erofs: dynamically allocate the erofs-shrinker

2023-08-23 Thread Qi Zheng via Linux-erofs
Use new APIs to dynamically allocate the erofs-shrinker. Signed-off-by: Qi Zheng Reviewed-by: Muchun Song CC: Gao Xiang CC: Chao Yu CC: Yue Hu CC: Jeffle Xu CC: linux-erofs@lists.ozlabs.org --- fs/erofs/utils.c | 20 +--- 1 file changed, 13 insertions(+), 7 deletions(-)