2023-02-04 09:31:08

by Gao Xiang

[permalink] [raw]
Subject: [PATCH 1/6] erofs: get rid of erofs_inode_datablocks()

erofs_inode_datablocks() has the only one caller, let's just get
rid of it entirely. No logic changes.

Signed-off-by: Gao Xiang <[email protected]>
---
fs/erofs/internal.h | 6 ------
fs/erofs/namei.c | 18 +++++-------------
2 files changed, 5 insertions(+), 19 deletions(-)

diff --git a/fs/erofs/internal.h b/fs/erofs/internal.h
index 08ba817d6551..c18af21ba9c4 100644
--- a/fs/erofs/internal.h
+++ b/fs/erofs/internal.h
@@ -344,12 +344,6 @@ static inline erofs_off_t erofs_iloc(struct inode *inode)
(EROFS_I(inode)->nid << sbi->islotbits);
}

-static inline unsigned long erofs_inode_datablocks(struct inode *inode)
-{
- /* since i_size cannot be changed */
- return DIV_ROUND_UP(inode->i_size, EROFS_BLKSIZ);
-}
-
static inline unsigned int erofs_bitrange(unsigned int value, unsigned int bit,
unsigned int bits)
{
diff --git a/fs/erofs/namei.c b/fs/erofs/namei.c
index b64a108fac92..966eabc61c13 100644
--- a/fs/erofs/namei.c
+++ b/fs/erofs/namei.c
@@ -5,7 +5,6 @@
* Copyright (C) 2022, Alibaba Cloud
*/
#include "xattr.h"
-
#include <trace/events/erofs.h>

struct erofs_qstr {
@@ -87,19 +86,13 @@ static struct erofs_dirent *find_target_dirent(struct erofs_qstr *name,
return ERR_PTR(-ENOENT);
}

-static void *find_target_block_classic(struct erofs_buf *target,
- struct inode *dir,
- struct erofs_qstr *name,
- int *_ndirents)
+static void *erofs_find_target_block(struct erofs_buf *target,
+ struct inode *dir, struct erofs_qstr *name, int *_ndirents)
{
- unsigned int startprfx, endprfx;
- int head, back;
+ int head = 0, back = DIV_ROUND_UP(dir->i_size, EROFS_BLKSIZ) - 1;
+ unsigned int startprfx = 0, endprfx = 0;
void *candidate = ERR_PTR(-ENOENT);

- startprfx = endprfx = 0;
- head = 0;
- back = erofs_inode_datablocks(dir) - 1;
-
while (head <= back) {
const int mid = head + (back - head) / 2;
struct erofs_buf buf = __EROFS_BUF_INITIALIZER;
@@ -180,8 +173,7 @@ int erofs_namei(struct inode *dir, const struct qstr *name, erofs_nid_t *nid,
qn.end = name->name + name->len;

ndirents = 0;
-
- de = find_target_block_classic(&buf, dir, &qn, &ndirents);
+ de = erofs_find_target_block(&buf, dir, &qn, &ndirents);
if (IS_ERR(de))
return PTR_ERR(de);

--
2.24.4



2023-02-04 09:31:08

by Gao Xiang

[permalink] [raw]
Subject: [PATCH 4/6] erofs: move zdata.h into zdata.c

Definitions in zdata.h are only used in zdata.c and for internal
use only. No logic changes.

Signed-off-by: Gao Xiang <[email protected]>
---
fs/erofs/zdata.c | 166 +++++++++++++++++++++++++++++++++++++++++++-
fs/erofs/zdata.h | 177 -----------------------------------------------
2 files changed, 165 insertions(+), 178 deletions(-)
delete mode 100644 fs/erofs/zdata.h

diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c
index ae97e3b627cb..384f64292f73 100644
--- a/fs/erofs/zdata.c
+++ b/fs/erofs/zdata.c
@@ -4,13 +4,177 @@
* https://www.huawei.com/
* Copyright (C) 2022 Alibaba Cloud
*/
-#include "zdata.h"
#include "compress.h"
#include <linux/prefetch.h>
#include <linux/psi.h>

#include <trace/events/erofs.h>

+#define Z_EROFS_PCLUSTER_MAX_PAGES (Z_EROFS_PCLUSTER_MAX_SIZE / PAGE_SIZE)
+#define Z_EROFS_INLINE_BVECS 2
+
+/*
+ * let's leave a type here in case of introducing
+ * another tagged pointer later.
+ */
+typedef void *z_erofs_next_pcluster_t;
+
+struct z_erofs_bvec {
+ struct page *page;
+ int offset;
+ unsigned int end;
+};
+
+#define __Z_EROFS_BVSET(name, total) \
+struct name { \
+ /* point to the next page which contains the following bvecs */ \
+ struct page *nextpage; \
+ struct z_erofs_bvec bvec[total]; \
+}
+__Z_EROFS_BVSET(z_erofs_bvset,);
+__Z_EROFS_BVSET(z_erofs_bvset_inline, Z_EROFS_INLINE_BVECS);
+
+/*
+ * Structure fields follow one of the following exclusion rules.
+ *
+ * I: Modifiable by initialization/destruction paths and read-only
+ * for everyone else;
+ *
+ * L: Field should be protected by the pcluster lock;
+ *
+ * A: Field should be accessed / updated in atomic for parallelized code.
+ */
+struct z_erofs_pcluster {
+ struct erofs_workgroup obj;
+ struct mutex lock;
+
+ /* A: point to next chained pcluster or TAILs */
+ z_erofs_next_pcluster_t next;
+
+ /* L: the maximum decompression size of this round */
+ unsigned int length;
+
+ /* L: total number of bvecs */
+ unsigned int vcnt;
+
+ /* I: page offset of start position of decompression */
+ unsigned short pageofs_out;
+
+ /* I: page offset of inline compressed data */
+ unsigned short pageofs_in;
+
+ union {
+ /* L: inline a certain number of bvec for bootstrap */
+ struct z_erofs_bvset_inline bvset;
+
+ /* I: can be used to free the pcluster by RCU. */
+ struct rcu_head rcu;
+ };
+
+ union {
+ /* I: physical cluster size in pages */
+ unsigned short pclusterpages;
+
+ /* I: tailpacking inline compressed size */
+ unsigned short tailpacking_size;
+ };
+
+ /* I: compression algorithm format */
+ unsigned char algorithmformat;
+
+ /* L: whether partial decompression or not */
+ bool partial;
+
+ /* L: indicate several pageofs_outs or not */
+ bool multibases;
+
+ /* A: compressed bvecs (can be cached or inplaced pages) */
+ struct z_erofs_bvec compressed_bvecs[];
+};
+
+/* let's avoid the valid 32-bit kernel addresses */
+
+/* the chained workgroup has't submitted io (still open) */
+#define Z_EROFS_PCLUSTER_TAIL ((void *)0x5F0ECAFE)
+/* the chained workgroup has already submitted io */
+#define Z_EROFS_PCLUSTER_TAIL_CLOSED ((void *)0x5F0EDEAD)
+
+#define Z_EROFS_PCLUSTER_NIL (NULL)
+
+struct z_erofs_decompressqueue {
+ struct super_block *sb;
+ atomic_t pending_bios;
+ z_erofs_next_pcluster_t head;
+
+ union {
+ struct completion done;
+ struct work_struct work;
+ } u;
+ bool eio, sync;
+};
+
+static inline bool z_erofs_is_inline_pcluster(struct z_erofs_pcluster *pcl)
+{
+ return !pcl->obj.index;
+}
+
+static inline unsigned int z_erofs_pclusterpages(struct z_erofs_pcluster *pcl)
+{
+ if (z_erofs_is_inline_pcluster(pcl))
+ return 1;
+ return pcl->pclusterpages;
+}
+
+/*
+ * bit 30: I/O error occurred on this page
+ * bit 0 - 29: remaining parts to complete this page
+ */
+#define Z_EROFS_PAGE_EIO (1 << 30)
+
+static inline void z_erofs_onlinepage_init(struct page *page)
+{
+ union {
+ atomic_t o;
+ unsigned long v;
+ } u = { .o = ATOMIC_INIT(1) };
+
+ set_page_private(page, u.v);
+ smp_wmb();
+ SetPagePrivate(page);
+}
+
+static inline void z_erofs_onlinepage_split(struct page *page)
+{
+ atomic_inc((atomic_t *)&page->private);
+}
+
+static inline void z_erofs_page_mark_eio(struct page *page)
+{
+ int orig;
+
+ do {
+ orig = atomic_read((atomic_t *)&page->private);
+ } while (atomic_cmpxchg((atomic_t *)&page->private, orig,
+ orig | Z_EROFS_PAGE_EIO) != orig);
+}
+
+static inline void z_erofs_onlinepage_endio(struct page *page)
+{
+ unsigned int v;
+
+ DBG_BUGON(!PagePrivate(page));
+ v = atomic_dec_return((atomic_t *)&page->private);
+ if (!(v & ~Z_EROFS_PAGE_EIO)) {
+ set_page_private(page, 0);
+ ClearPagePrivate(page);
+ if (!(v & Z_EROFS_PAGE_EIO))
+ SetPageUptodate(page);
+ unlock_page(page);
+ }
+}
+
+#define Z_EROFS_ONSTACK_PAGES 32
+
/*
* since pclustersize is variable for big pcluster feature, introduce slab
* pools implementation for different pcluster sizes.
diff --git a/fs/erofs/zdata.h b/fs/erofs/zdata.h
deleted file mode 100644
index f196a729c7e8..000000000000
--- a/fs/erofs/zdata.h
+++ /dev/null
@@ -1,177 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * Copyright (C) 2018 HUAWEI, Inc.
- * https://www.huawei.com/
- */
-#ifndef __EROFS_FS_ZDATA_H
-#define __EROFS_FS_ZDATA_H
-
-#include "internal.h"
-
-#define Z_EROFS_PCLUSTER_MAX_PAGES (Z_EROFS_PCLUSTER_MAX_SIZE / PAGE_SIZE)
-#define Z_EROFS_INLINE_BVECS 2
-
-/*
- * let's leave a type here in case of introducing
- * another tagged pointer later.
- */
-typedef void *z_erofs_next_pcluster_t;
-
-struct z_erofs_bvec {
- struct page *page;
- int offset;
- unsigned int end;
-};
-
-#define __Z_EROFS_BVSET(name, total) \
-struct name { \
- /* point to the next page which contains the following bvecs */ \
- struct page *nextpage; \
- struct z_erofs_bvec bvec[total]; \
-}
-__Z_EROFS_BVSET(z_erofs_bvset,);
-__Z_EROFS_BVSET(z_erofs_bvset_inline, Z_EROFS_INLINE_BVECS);
-
-/*
- * Structure fields follow one of the following exclusion rules.
- *
- * I: Modifiable by initialization/destruction paths and read-only
- * for everyone else;
- *
- * L: Field should be protected by the pcluster lock;
- *
- * A: Field should be accessed / updated in atomic for parallelized code.
- */
-struct z_erofs_pcluster {
- struct erofs_workgroup obj;
- struct mutex lock;
-
- /* A: point to next chained pcluster or TAILs */
- z_erofs_next_pcluster_t next;
-
- /* L: the maximum decompression size of this round */
- unsigned int length;
-
- /* L: total number of bvecs */
- unsigned int vcnt;
-
- /* I: page offset of start position of decompression */
- unsigned short pageofs_out;
-
- /* I: page offset of inline compressed data */
- unsigned short pageofs_in;
-
- union {
- /* L: inline a certain number of bvec for bootstrap */
- struct z_erofs_bvset_inline bvset;
-
- /* I: can be used to free the pcluster by RCU. */
- struct rcu_head rcu;
- };
-
- union {
- /* I: physical cluster size in pages */
- unsigned short pclusterpages;
-
- /* I: tailpacking inline compressed size */
- unsigned short tailpacking_size;
- };
-
- /* I: compression algorithm format */
- unsigned char algorithmformat;
-
- /* L: whether partial decompression or not */
- bool partial;
-
- /* L: indicate several pageofs_outs or not */
- bool multibases;
-
- /* A: compressed bvecs (can be cached or inplaced pages) */
- struct z_erofs_bvec compressed_bvecs[];
-};
-
-/* let's avoid the valid 32-bit kernel addresses */
-
-/* the chained workgroup has't submitted io (still open) */
-#define Z_EROFS_PCLUSTER_TAIL ((void *)0x5F0ECAFE)
-/* the chained workgroup has already submitted io */
-#define Z_EROFS_PCLUSTER_TAIL_CLOSED ((void *)0x5F0EDEAD)
-
-#define Z_EROFS_PCLUSTER_NIL (NULL)
-
-struct z_erofs_decompressqueue {
- struct super_block *sb;
- atomic_t pending_bios;
- z_erofs_next_pcluster_t head;
-
- union {
- struct completion done;
- struct work_struct work;
- } u;
-
- bool eio, sync;
-};
-
-static inline bool z_erofs_is_inline_pcluster(struct z_erofs_pcluster *pcl)
-{
- return !pcl->obj.index;
-}
-
-static inline unsigned int z_erofs_pclusterpages(struct z_erofs_pcluster *pcl)
-{
- if (z_erofs_is_inline_pcluster(pcl))
- return 1;
- return pcl->pclusterpages;
-}
-
-/*
- * bit 30: I/O error occurred on this page
- * bit 0 - 29: remaining parts to complete this page
- */
-#define Z_EROFS_PAGE_EIO (1 << 30)
-
-static inline void z_erofs_onlinepage_init(struct page *page)
-{
- union {
- atomic_t o;
- unsigned long v;
- } u = { .o = ATOMIC_INIT(1) };
-
- set_page_private(page, u.v);
- smp_wmb();
- SetPagePrivate(page);
-}
-
-static inline void z_erofs_onlinepage_split(struct page *page)
-{
- atomic_inc((atomic_t *)&page->private);
-}
-
-static inline void z_erofs_page_mark_eio(struct page *page)
-{
- int orig;
-
- do {
- orig = atomic_read((atomic_t *)&page->private);
- } while (atomic_cmpxchg((atomic_t *)&page->private, orig,
- orig | Z_EROFS_PAGE_EIO) != orig);
-}
-
-static inline void z_erofs_onlinepage_endio(struct page *page)
-{
- unsigned int v;
-
- DBG_BUGON(!PagePrivate(page));
- v = atomic_dec_return((atomic_t *)&page->private);
- if (!(v & ~Z_EROFS_PAGE_EIO)) {
- set_page_private(page, 0);
- ClearPagePrivate(page);
- if (!(v & Z_EROFS_PAGE_EIO))
- SetPageUptodate(page);
- unlock_page(page);
- }
-}
-
-#define Z_EROFS_ONSTACK_PAGES 32
-
-#endif
--
2.24.4


2023-02-04 09:31:12

by Gao Xiang

[permalink] [raw]
Subject: [PATCH 6/6] erofs: tidy up internal.h

Reorder internal.h code so that removing unneeded macros and more.
No logic changes.

Signed-off-by: Gao Xiang <[email protected]>
---
fs/erofs/internal.h | 84 +++++++++++++++------------------------------
1 file changed, 28 insertions(+), 56 deletions(-)

diff --git a/fs/erofs/internal.h b/fs/erofs/internal.h
index c18af21ba9c4..48a2f33de15a 100644
--- a/fs/erofs/internal.h
+++ b/fs/erofs/internal.h
@@ -377,12 +377,6 @@ struct page *erofs_grab_cache_page_nowait(struct address_space *mapping,
readahead_gfp_mask(mapping) & ~__GFP_RECLAIM);
}

-extern const struct super_operations erofs_sops;
-extern struct file_system_type erofs_fs_type;
-
-extern const struct address_space_operations erofs_raw_access_aops;
-extern const struct address_space_operations z_erofs_aops;
-
/* Has a disk mapping */
#define EROFS_MAP_MAPPED 0x0001
/* Located in metadata (could be copied from bd_inode) */
@@ -407,7 +401,6 @@ struct erofs_map_blocks {
unsigned int m_flags;
};

-/* Flags used by erofs_map_blocks_flatmode() */
#define EROFS_GET_BLOCKS_RAW 0x0001
/*
* Used to get the exact decompressed length, e.g. fiemap (consider lookback
@@ -425,24 +418,6 @@ enum {
Z_EROFS_COMPRESSION_RUNTIME_MAX
};

-/* zmap.c */
-extern const struct iomap_ops z_erofs_iomap_report_ops;
-
-#ifdef CONFIG_EROFS_FS_ZIP
-int z_erofs_fill_inode(struct inode *inode);
-int z_erofs_map_blocks_iter(struct inode *inode,
- struct erofs_map_blocks *map,
- int flags);
-#else
-static inline int z_erofs_fill_inode(struct inode *inode) { return -EOPNOTSUPP; }
-static inline int z_erofs_map_blocks_iter(struct inode *inode,
- struct erofs_map_blocks *map,
- int flags)
-{
- return -EOPNOTSUPP;
-}
-#endif /* !CONFIG_EROFS_FS_ZIP */
-
struct erofs_map_dev {
struct erofs_fscache *m_fscache;
struct block_device *m_bdev;
@@ -453,8 +428,27 @@ struct erofs_map_dev {
unsigned int m_deviceid;
};

-/* data.c */
+extern struct file_system_type erofs_fs_type;
+extern const struct super_operations erofs_sops;
+
+extern const struct address_space_operations erofs_raw_access_aops;
+extern const struct address_space_operations z_erofs_aops;
+extern const struct address_space_operations erofs_fscache_access_aops;
+
+extern const struct inode_operations erofs_generic_iops;
+extern const struct inode_operations erofs_symlink_iops;
+extern const struct inode_operations erofs_fast_symlink_iops;
+extern const struct inode_operations erofs_dir_iops;
+
extern const struct file_operations erofs_file_fops;
+extern const struct file_operations erofs_dir_fops;
+
+extern const struct iomap_ops z_erofs_iomap_report_ops;
+
+/* flags for erofs_fscache_register_cookie() */
+#define EROFS_REG_COOKIE_NEED_INODE 1
+#define EROFS_REG_COOKIE_NEED_NOEXIST 2
+
void erofs_unmap_metabuf(struct erofs_buf *buf);
void erofs_put_metabuf(struct erofs_buf *buf);
void *erofs_bread(struct erofs_buf *buf, struct inode *inode,
@@ -466,26 +460,13 @@ int erofs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
u64 start, u64 len);
int erofs_map_blocks(struct inode *inode,
struct erofs_map_blocks *map, int flags);
-
-/* inode.c */
-extern const struct inode_operations erofs_generic_iops;
-extern const struct inode_operations erofs_symlink_iops;
-extern const struct inode_operations erofs_fast_symlink_iops;
-
struct inode *erofs_iget(struct super_block *sb, erofs_nid_t nid);
int erofs_getattr(struct user_namespace *mnt_userns, const struct path *path,
struct kstat *stat, u32 request_mask,
unsigned int query_flags);
-
-/* namei.c */
-extern const struct inode_operations erofs_dir_iops;
-
int erofs_namei(struct inode *dir, const struct qstr *name,
erofs_nid_t *nid, unsigned int *d_type);

-/* dir.c */
-extern const struct file_operations erofs_dir_fops;
-
static inline void *erofs_vm_map_ram(struct page **pages, unsigned int count)
{
int retried = 0;
@@ -501,23 +482,19 @@ static inline void *erofs_vm_map_ram(struct page **pages, unsigned int count)
return NULL;
}

-/* pcpubuf.c */
void *erofs_get_pcpubuf(unsigned int requiredpages);
void erofs_put_pcpubuf(void *ptr);
int erofs_pcpubuf_growsize(unsigned int nrpages);
void erofs_pcpubuf_init(void);
void erofs_pcpubuf_exit(void);

-/* sysfs.c */
int erofs_register_sysfs(struct super_block *sb);
void erofs_unregister_sysfs(struct super_block *sb);
int __init erofs_init_sysfs(void);
void erofs_exit_sysfs(void);

-/* utils.c / zdata.c */
struct page *erofs_allocpage(struct page **pagepool, gfp_t gfp);
-static inline void erofs_pagepool_add(struct page **pagepool,
- struct page *page)
+static inline void erofs_pagepool_add(struct page **pagepool, struct page *page)
{
set_page_private(page, (unsigned long)*pagepool);
*pagepool = page;
@@ -543,6 +520,9 @@ int erofs_try_to_free_cached_page(struct page *page);
int z_erofs_load_lz4_config(struct super_block *sb,
struct erofs_super_block *dsb,
struct z_erofs_lz4_cfgs *lz4, int len);
+int z_erofs_fill_inode(struct inode *inode);
+int z_erofs_map_blocks_iter(struct inode *inode, struct erofs_map_blocks *map,
+ int flags);
#else
static inline void erofs_shrinker_register(struct super_block *sb) {}
static inline void erofs_shrinker_unregister(struct super_block *sb) {}
@@ -560,6 +540,7 @@ static inline int z_erofs_load_lz4_config(struct super_block *sb,
}
return 0;
}
+static inline int z_erofs_fill_inode(struct inode *inode) { return -EOPNOTSUPP; }
#endif /* !CONFIG_EROFS_FS_ZIP */

#ifdef CONFIG_EROFS_FS_ZIP_LZMA
@@ -580,23 +561,15 @@ static inline int z_erofs_load_lzma_config(struct super_block *sb,
}
return 0;
}
-#endif /* !CONFIG_EROFS_FS_ZIP */
+#endif /* !CONFIG_EROFS_FS_ZIP_LZMA */

-/* flags for erofs_fscache_register_cookie() */
-#define EROFS_REG_COOKIE_NEED_INODE 1
-#define EROFS_REG_COOKIE_NEED_NOEXIST 2
-
-/* fscache.c */
#ifdef CONFIG_EROFS_FS_ONDEMAND
int erofs_fscache_register_fs(struct super_block *sb);
void erofs_fscache_unregister_fs(struct super_block *sb);

struct erofs_fscache *erofs_fscache_register_cookie(struct super_block *sb,
- char *name,
- unsigned int flags);
+ char *name, unsigned int flags);
void erofs_fscache_unregister_cookie(struct erofs_fscache *fscache);
-
-extern const struct address_space_operations erofs_fscache_access_aops;
#else
static inline int erofs_fscache_register_fs(struct super_block *sb)
{
@@ -606,8 +579,7 @@ static inline void erofs_fscache_unregister_fs(struct super_block *sb) {}

static inline
struct erofs_fscache *erofs_fscache_register_cookie(struct super_block *sb,
- char *name,
- unsigned int flags)
+ char *name, unsigned int flags)
{
return ERR_PTR(-EOPNOTSUPP);
}
--
2.24.4


2023-02-04 09:31:12

by Gao Xiang

[permalink] [raw]
Subject: [PATCH 5/6] erofs: get rid of z_erofs_do_map_blocks() forward declaration

The code can be neater without forward declarations. Let's
get rid of z_erofs_do_map_blocks() forward declaration.

Signed-off-by: Gao Xiang <[email protected]>
---
fs/erofs/zmap.c | 242 ++++++++++++++++++++++++------------------------
1 file changed, 119 insertions(+), 123 deletions(-)

diff --git a/fs/erofs/zmap.c b/fs/erofs/zmap.c
index 3aeffc762b2f..8bf6d30518b6 100644
--- a/fs/erofs/zmap.c
+++ b/fs/erofs/zmap.c
@@ -7,10 +7,6 @@
#include <asm/unaligned.h>
#include <trace/events/erofs.h>

-static int z_erofs_do_map_blocks(struct inode *inode,
- struct erofs_map_blocks *map,
- int flags);
-
int z_erofs_fill_inode(struct inode *inode)
{
struct erofs_inode *const vi = EROFS_I(inode);
@@ -29,125 +25,6 @@ int z_erofs_fill_inode(struct inode *inode)
return 0;
}

-static int z_erofs_fill_inode_lazy(struct inode *inode)
-{
- struct erofs_inode *const vi = EROFS_I(inode);
- struct super_block *const sb = inode->i_sb;
- int err, headnr;
- erofs_off_t pos;
- struct erofs_buf buf = __EROFS_BUF_INITIALIZER;
- void *kaddr;
- struct z_erofs_map_header *h;
-
- if (test_bit(EROFS_I_Z_INITED_BIT, &vi->flags)) {
- /*
- * paired with smp_mb() at the end of the function to ensure
- * fields will only be observed after the bit is set.
- */
- smp_mb();
- return 0;
- }
-
- if (wait_on_bit_lock(&vi->flags, EROFS_I_BL_Z_BIT, TASK_KILLABLE))
- return -ERESTARTSYS;
-
- err = 0;
- if (test_bit(EROFS_I_Z_INITED_BIT, &vi->flags))
- goto out_unlock;
-
- pos = ALIGN(erofs_iloc(inode) + vi->inode_isize + vi->xattr_isize, 8);
- kaddr = erofs_read_metabuf(&buf, sb, erofs_blknr(pos), EROFS_KMAP);
- if (IS_ERR(kaddr)) {
- err = PTR_ERR(kaddr);
- goto out_unlock;
- }
-
- h = kaddr + erofs_blkoff(pos);
- /*
- * if the highest bit of the 8-byte map header is set, the whole file
- * is stored in the packed inode. The rest bits keeps z_fragmentoff.
- */
- if (h->h_clusterbits >> Z_EROFS_FRAGMENT_INODE_BIT) {
- vi->z_advise = Z_EROFS_ADVISE_FRAGMENT_PCLUSTER;
- vi->z_fragmentoff = le64_to_cpu(*(__le64 *)h) ^ (1ULL << 63);
- vi->z_tailextent_headlcn = 0;
- goto done;
- }
- vi->z_advise = le16_to_cpu(h->h_advise);
- vi->z_algorithmtype[0] = h->h_algorithmtype & 15;
- vi->z_algorithmtype[1] = h->h_algorithmtype >> 4;
-
- headnr = 0;
- if (vi->z_algorithmtype[0] >= Z_EROFS_COMPRESSION_MAX ||
- vi->z_algorithmtype[++headnr] >= Z_EROFS_COMPRESSION_MAX) {
- erofs_err(sb, "unknown HEAD%u format %u for nid %llu, please upgrade kernel",
- headnr + 1, vi->z_algorithmtype[headnr], vi->nid);
- err = -EOPNOTSUPP;
- goto out_put_metabuf;
- }
-
- vi->z_logical_clusterbits = LOG_BLOCK_SIZE + (h->h_clusterbits & 7);
- if (!erofs_sb_has_big_pcluster(EROFS_SB(sb)) &&
- vi->z_advise & (Z_EROFS_ADVISE_BIG_PCLUSTER_1 |
- Z_EROFS_ADVISE_BIG_PCLUSTER_2)) {
- erofs_err(sb, "per-inode big pcluster without sb feature for nid %llu",
- vi->nid);
- err = -EFSCORRUPTED;
- goto out_put_metabuf;
- }
- if (vi->datalayout == EROFS_INODE_FLAT_COMPRESSION &&
- !(vi->z_advise & Z_EROFS_ADVISE_BIG_PCLUSTER_1) ^
- !(vi->z_advise & Z_EROFS_ADVISE_BIG_PCLUSTER_2)) {
- erofs_err(sb, "big pcluster head1/2 of compact indexes should be consistent for nid %llu",
- vi->nid);
- err = -EFSCORRUPTED;
- goto out_put_metabuf;
- }
-
- if (vi->z_advise & Z_EROFS_ADVISE_INLINE_PCLUSTER) {
- struct erofs_map_blocks map = {
- .buf = __EROFS_BUF_INITIALIZER
- };
-
- vi->z_idata_size = le16_to_cpu(h->h_idata_size);
- err = z_erofs_do_map_blocks(inode, &map,
- EROFS_GET_BLOCKS_FINDTAIL);
- erofs_put_metabuf(&map.buf);
-
- if (!map.m_plen ||
- erofs_blkoff(map.m_pa) + map.m_plen > EROFS_BLKSIZ) {
- erofs_err(sb, "invalid tail-packing pclustersize %llu",
- map.m_plen);
- err = -EFSCORRUPTED;
- }
- if (err < 0)
- goto out_put_metabuf;
- }
-
- if (vi->z_advise & Z_EROFS_ADVISE_FRAGMENT_PCLUSTER &&
- !(h->h_clusterbits >> Z_EROFS_FRAGMENT_INODE_BIT)) {
- struct erofs_map_blocks map = {
- .buf = __EROFS_BUF_INITIALIZER
- };
-
- vi->z_fragmentoff = le32_to_cpu(h->h_fragmentoff);
- err = z_erofs_do_map_blocks(inode, &map,
- EROFS_GET_BLOCKS_FINDTAIL);
- erofs_put_metabuf(&map.buf);
- if (err < 0)
- goto out_put_metabuf;
- }
-done:
- /* paired with smp_mb() at the beginning of the function */
- smp_mb();
- set_bit(EROFS_I_Z_INITED_BIT, &vi->flags);
-out_put_metabuf:
- erofs_put_metabuf(&buf);
-out_unlock:
- clear_and_wake_up_bit(EROFS_I_BL_Z_BIT, &vi->flags);
- return err;
-}
-
struct z_erofs_maprecorder {
struct inode *inode;
struct erofs_map_blocks *map;
@@ -729,6 +606,125 @@ static int z_erofs_do_map_blocks(struct inode *inode,
return err;
}

+static int z_erofs_fill_inode_lazy(struct inode *inode)
+{
+ struct erofs_inode *const vi = EROFS_I(inode);
+ struct super_block *const sb = inode->i_sb;
+ int err, headnr;
+ erofs_off_t pos;
+ struct erofs_buf buf = __EROFS_BUF_INITIALIZER;
+ void *kaddr;
+ struct z_erofs_map_header *h;
+
+ if (test_bit(EROFS_I_Z_INITED_BIT, &vi->flags)) {
+ /*
+ * paired with smp_mb() at the end of the function to ensure
+ * fields will only be observed after the bit is set.
+ */
+ smp_mb();
+ return 0;
+ }
+
+ if (wait_on_bit_lock(&vi->flags, EROFS_I_BL_Z_BIT, TASK_KILLABLE))
+ return -ERESTARTSYS;
+
+ err = 0;
+ if (test_bit(EROFS_I_Z_INITED_BIT, &vi->flags))
+ goto out_unlock;
+
+ pos = ALIGN(erofs_iloc(inode) + vi->inode_isize + vi->xattr_isize, 8);
+ kaddr = erofs_read_metabuf(&buf, sb, erofs_blknr(pos), EROFS_KMAP);
+ if (IS_ERR(kaddr)) {
+ err = PTR_ERR(kaddr);
+ goto out_unlock;
+ }
+
+ h = kaddr + erofs_blkoff(pos);
+ /*
+ * if the highest bit of the 8-byte map header is set, the whole file
+ * is stored in the packed inode. The rest bits keeps z_fragmentoff.
+ */
+ if (h->h_clusterbits >> Z_EROFS_FRAGMENT_INODE_BIT) {
+ vi->z_advise = Z_EROFS_ADVISE_FRAGMENT_PCLUSTER;
+ vi->z_fragmentoff = le64_to_cpu(*(__le64 *)h) ^ (1ULL << 63);
+ vi->z_tailextent_headlcn = 0;
+ goto done;
+ }
+ vi->z_advise = le16_to_cpu(h->h_advise);
+ vi->z_algorithmtype[0] = h->h_algorithmtype & 15;
+ vi->z_algorithmtype[1] = h->h_algorithmtype >> 4;
+
+ headnr = 0;
+ if (vi->z_algorithmtype[0] >= Z_EROFS_COMPRESSION_MAX ||
+ vi->z_algorithmtype[++headnr] >= Z_EROFS_COMPRESSION_MAX) {
+ erofs_err(sb, "unknown HEAD%u format %u for nid %llu, please upgrade kernel",
+ headnr + 1, vi->z_algorithmtype[headnr], vi->nid);
+ err = -EOPNOTSUPP;
+ goto out_put_metabuf;
+ }
+
+ vi->z_logical_clusterbits = LOG_BLOCK_SIZE + (h->h_clusterbits & 7);
+ if (!erofs_sb_has_big_pcluster(EROFS_SB(sb)) &&
+ vi->z_advise & (Z_EROFS_ADVISE_BIG_PCLUSTER_1 |
+ Z_EROFS_ADVISE_BIG_PCLUSTER_2)) {
+ erofs_err(sb, "per-inode big pcluster without sb feature for nid %llu",
+ vi->nid);
+ err = -EFSCORRUPTED;
+ goto out_put_metabuf;
+ }
+ if (vi->datalayout == EROFS_INODE_FLAT_COMPRESSION &&
+ !(vi->z_advise & Z_EROFS_ADVISE_BIG_PCLUSTER_1) ^
+ !(vi->z_advise & Z_EROFS_ADVISE_BIG_PCLUSTER_2)) {
+ erofs_err(sb, "big pcluster head1/2 of compact indexes should be consistent for nid %llu",
+ vi->nid);
+ err = -EFSCORRUPTED;
+ goto out_put_metabuf;
+ }
+
+ if (vi->z_advise & Z_EROFS_ADVISE_INLINE_PCLUSTER) {
+ struct erofs_map_blocks map = {
+ .buf = __EROFS_BUF_INITIALIZER
+ };
+
+ vi->z_idata_size = le16_to_cpu(h->h_idata_size);
+ err = z_erofs_do_map_blocks(inode, &map,
+ EROFS_GET_BLOCKS_FINDTAIL);
+ erofs_put_metabuf(&map.buf);
+
+ if (!map.m_plen ||
+ erofs_blkoff(map.m_pa) + map.m_plen > EROFS_BLKSIZ) {
+ erofs_err(sb, "invalid tail-packing pclustersize %llu",
+ map.m_plen);
+ err = -EFSCORRUPTED;
+ }
+ if (err < 0)
+ goto out_put_metabuf;
+ }
+
+ if (vi->z_advise & Z_EROFS_ADVISE_FRAGMENT_PCLUSTER &&
+ !(h->h_clusterbits >> Z_EROFS_FRAGMENT_INODE_BIT)) {
+ struct erofs_map_blocks map = {
+ .buf = __EROFS_BUF_INITIALIZER
+ };
+
+ vi->z_fragmentoff = le32_to_cpu(h->h_fragmentoff);
+ err = z_erofs_do_map_blocks(inode, &map,
+ EROFS_GET_BLOCKS_FINDTAIL);
+ erofs_put_metabuf(&map.buf);
+ if (err < 0)
+ goto out_put_metabuf;
+ }
+done:
+ /* paired with smp_mb() at the beginning of the function */
+ smp_mb();
+ set_bit(EROFS_I_Z_INITED_BIT, &vi->flags);
+out_put_metabuf:
+ erofs_put_metabuf(&buf);
+out_unlock:
+ clear_and_wake_up_bit(EROFS_I_BL_Z_BIT, &vi->flags);
+ return err;
+}
+
int z_erofs_map_blocks_iter(struct inode *inode, struct erofs_map_blocks *map,
int flags)
{
--
2.24.4


2023-02-06 01:10:51

by Yue Hu

[permalink] [raw]
Subject: Re: [PATCH 1/6] erofs: get rid of erofs_inode_datablocks()

On Sat, 4 Feb 2023 17:30:35 +0800
Gao Xiang <[email protected]> wrote:

> erofs_inode_datablocks() has the only one caller, let's just get
> rid of it entirely. No logic changes.
>
> Signed-off-by: Gao Xiang <[email protected]>

Reviewed-by: Yue Hu <[email protected]>

2023-02-06 01:20:26

by Yue Hu

[permalink] [raw]
Subject: Re: [PATCH 5/6] erofs: get rid of z_erofs_do_map_blocks() forward declaration

On Sat, 4 Feb 2023 17:30:39 +0800
Gao Xiang <[email protected]> wrote:

> The code can be neater without forward declarations. Let's
> get rid of z_erofs_do_map_blocks() forward declaration.
>
> Signed-off-by: Gao Xiang <[email protected]>

Reviewed-by: Yue Hu <[email protected]>

2023-02-06 02:08:35

by Yue Hu

[permalink] [raw]
Subject: Re: [PATCH 4/6] erofs: move zdata.h into zdata.c

On Sat, 4 Feb 2023 17:30:38 +0800
Gao Xiang <[email protected]> wrote:

> Definitions in zdata.h are only used in zdata.c and for internal
> use only. No logic changes.
>
> Signed-off-by: Gao Xiang <[email protected]>

Reviewed-by: Yue Hu <[email protected]>


2023-02-06 02:20:57

by Yue Hu

[permalink] [raw]
Subject: Re: [PATCH 6/6] erofs: tidy up internal.h

On Sat, 4 Feb 2023 17:30:40 +0800
Gao Xiang <[email protected]> wrote:

> Reorder internal.h code so that removing unneeded macros and more.
> No logic changes.
>
> Signed-off-by: Gao Xiang <[email protected]>

Reviewed-by: Yue Hu <[email protected]>

2023-02-07 08:27:24

by Jingbo Xu

[permalink] [raw]
Subject: Re: [PATCH 1/6] erofs: get rid of erofs_inode_datablocks()



On 2/4/23 5:30 PM, Gao Xiang wrote:
> erofs_inode_datablocks() has the only one caller, let's just get
> rid of it entirely. No logic changes.
>
> Signed-off-by: Gao Xiang <[email protected]>

Reviewed-by: Jingbo Xu <[email protected]>


> ---
> fs/erofs/internal.h | 6 ------
> fs/erofs/namei.c | 18 +++++-------------
> 2 files changed, 5 insertions(+), 19 deletions(-)
>
> diff --git a/fs/erofs/internal.h b/fs/erofs/internal.h
> index 08ba817d6551..c18af21ba9c4 100644
> --- a/fs/erofs/internal.h
> +++ b/fs/erofs/internal.h
> @@ -344,12 +344,6 @@ static inline erofs_off_t erofs_iloc(struct inode *inode)
> (EROFS_I(inode)->nid << sbi->islotbits);
> }
>
> -static inline unsigned long erofs_inode_datablocks(struct inode *inode)
> -{
> - /* since i_size cannot be changed */
> - return DIV_ROUND_UP(inode->i_size, EROFS_BLKSIZ);
> -}
> -
> static inline unsigned int erofs_bitrange(unsigned int value, unsigned int bit,
> unsigned int bits)
> {
> diff --git a/fs/erofs/namei.c b/fs/erofs/namei.c
> index b64a108fac92..966eabc61c13 100644
> --- a/fs/erofs/namei.c
> +++ b/fs/erofs/namei.c
> @@ -5,7 +5,6 @@
> * Copyright (C) 2022, Alibaba Cloud
> */
> #include "xattr.h"
> -
> #include <trace/events/erofs.h>
>
> struct erofs_qstr {
> @@ -87,19 +86,13 @@ static struct erofs_dirent *find_target_dirent(struct erofs_qstr *name,
> return ERR_PTR(-ENOENT);
> }
>
> -static void *find_target_block_classic(struct erofs_buf *target,
> - struct inode *dir,
> - struct erofs_qstr *name,
> - int *_ndirents)
> +static void *erofs_find_target_block(struct erofs_buf *target,
> + struct inode *dir, struct erofs_qstr *name, int *_ndirents)
> {
> - unsigned int startprfx, endprfx;
> - int head, back;
> + int head = 0, back = DIV_ROUND_UP(dir->i_size, EROFS_BLKSIZ) - 1;
> + unsigned int startprfx = 0, endprfx = 0;
> void *candidate = ERR_PTR(-ENOENT);
>
> - startprfx = endprfx = 0;
> - head = 0;
> - back = erofs_inode_datablocks(dir) - 1;
> -
> while (head <= back) {
> const int mid = head + (back - head) / 2;
> struct erofs_buf buf = __EROFS_BUF_INITIALIZER;
> @@ -180,8 +173,7 @@ int erofs_namei(struct inode *dir, const struct qstr *name, erofs_nid_t *nid,
> qn.end = name->name + name->len;
>
> ndirents = 0;
> -
> - de = find_target_block_classic(&buf, dir, &qn, &ndirents);
> + de = erofs_find_target_block(&buf, dir, &qn, &ndirents);
> if (IS_ERR(de))
> return PTR_ERR(de);
>

--
Thanks,
Jingbo

2023-02-07 08:48:56

by Jingbo Xu

[permalink] [raw]
Subject: Re: [PATCH 6/6] erofs: tidy up internal.h



On 2/4/23 5:30 PM, Gao Xiang wrote:
> Reorder internal.h code so that removing unneeded macros and more.
> No logic changes.
>
> Signed-off-by: Gao Xiang <[email protected]>

Reviewed-by: Jingbo Xu <[email protected]>


> ---
> fs/erofs/internal.h | 84 +++++++++++++++------------------------------
> 1 file changed, 28 insertions(+), 56 deletions(-)
>
> diff --git a/fs/erofs/internal.h b/fs/erofs/internal.h
> index c18af21ba9c4..48a2f33de15a 100644
> --- a/fs/erofs/internal.h
> +++ b/fs/erofs/internal.h
> @@ -377,12 +377,6 @@ struct page *erofs_grab_cache_page_nowait(struct address_space *mapping,
> readahead_gfp_mask(mapping) & ~__GFP_RECLAIM);
> }
>
> -extern const struct super_operations erofs_sops;
> -extern struct file_system_type erofs_fs_type;
> -
> -extern const struct address_space_operations erofs_raw_access_aops;
> -extern const struct address_space_operations z_erofs_aops;
> -
> /* Has a disk mapping */
> #define EROFS_MAP_MAPPED 0x0001
> /* Located in metadata (could be copied from bd_inode) */
> @@ -407,7 +401,6 @@ struct erofs_map_blocks {
> unsigned int m_flags;
> };
>
> -/* Flags used by erofs_map_blocks_flatmode() */
> #define EROFS_GET_BLOCKS_RAW 0x0001
> /*
> * Used to get the exact decompressed length, e.g. fiemap (consider lookback
> @@ -425,24 +418,6 @@ enum {
> Z_EROFS_COMPRESSION_RUNTIME_MAX
> };
>
> -/* zmap.c */
> -extern const struct iomap_ops z_erofs_iomap_report_ops;
> -
> -#ifdef CONFIG_EROFS_FS_ZIP
> -int z_erofs_fill_inode(struct inode *inode);
> -int z_erofs_map_blocks_iter(struct inode *inode,
> - struct erofs_map_blocks *map,
> - int flags);
> -#else
> -static inline int z_erofs_fill_inode(struct inode *inode) { return -EOPNOTSUPP; }
> -static inline int z_erofs_map_blocks_iter(struct inode *inode,
> - struct erofs_map_blocks *map,
> - int flags)
> -{
> - return -EOPNOTSUPP;
> -}
> -#endif /* !CONFIG_EROFS_FS_ZIP */
> -
> struct erofs_map_dev {
> struct erofs_fscache *m_fscache;
> struct block_device *m_bdev;
> @@ -453,8 +428,27 @@ struct erofs_map_dev {
> unsigned int m_deviceid;
> };
>
> -/* data.c */
> +extern struct file_system_type erofs_fs_type;
> +extern const struct super_operations erofs_sops;
> +
> +extern const struct address_space_operations erofs_raw_access_aops;
> +extern const struct address_space_operations z_erofs_aops;
> +extern const struct address_space_operations erofs_fscache_access_aops;
> +
> +extern const struct inode_operations erofs_generic_iops;
> +extern const struct inode_operations erofs_symlink_iops;
> +extern const struct inode_operations erofs_fast_symlink_iops;
> +extern const struct inode_operations erofs_dir_iops;
> +
> extern const struct file_operations erofs_file_fops;
> +extern const struct file_operations erofs_dir_fops;
> +
> +extern const struct iomap_ops z_erofs_iomap_report_ops;
> +
> +/* flags for erofs_fscache_register_cookie() */
> +#define EROFS_REG_COOKIE_NEED_INODE 1
> +#define EROFS_REG_COOKIE_NEED_NOEXIST 2
> +
> void erofs_unmap_metabuf(struct erofs_buf *buf);
> void erofs_put_metabuf(struct erofs_buf *buf);
> void *erofs_bread(struct erofs_buf *buf, struct inode *inode,
> @@ -466,26 +460,13 @@ int erofs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
> u64 start, u64 len);
> int erofs_map_blocks(struct inode *inode,
> struct erofs_map_blocks *map, int flags);
> -
> -/* inode.c */
> -extern const struct inode_operations erofs_generic_iops;
> -extern const struct inode_operations erofs_symlink_iops;
> -extern const struct inode_operations erofs_fast_symlink_iops;
> -
> struct inode *erofs_iget(struct super_block *sb, erofs_nid_t nid);
> int erofs_getattr(struct user_namespace *mnt_userns, const struct path *path,
> struct kstat *stat, u32 request_mask,
> unsigned int query_flags);
> -
> -/* namei.c */
> -extern const struct inode_operations erofs_dir_iops;
> -
> int erofs_namei(struct inode *dir, const struct qstr *name,
> erofs_nid_t *nid, unsigned int *d_type);
>
> -/* dir.c */
> -extern const struct file_operations erofs_dir_fops;
> -
> static inline void *erofs_vm_map_ram(struct page **pages, unsigned int count)
> {
> int retried = 0;
> @@ -501,23 +482,19 @@ static inline void *erofs_vm_map_ram(struct page **pages, unsigned int count)
> return NULL;
> }
>
> -/* pcpubuf.c */
> void *erofs_get_pcpubuf(unsigned int requiredpages);
> void erofs_put_pcpubuf(void *ptr);
> int erofs_pcpubuf_growsize(unsigned int nrpages);
> void erofs_pcpubuf_init(void);
> void erofs_pcpubuf_exit(void);
>
> -/* sysfs.c */
> int erofs_register_sysfs(struct super_block *sb);
> void erofs_unregister_sysfs(struct super_block *sb);
> int __init erofs_init_sysfs(void);
> void erofs_exit_sysfs(void);
>
> -/* utils.c / zdata.c */
> struct page *erofs_allocpage(struct page **pagepool, gfp_t gfp);
> -static inline void erofs_pagepool_add(struct page **pagepool,
> - struct page *page)
> +static inline void erofs_pagepool_add(struct page **pagepool, struct page *page)
> {
> set_page_private(page, (unsigned long)*pagepool);
> *pagepool = page;
> @@ -543,6 +520,9 @@ int erofs_try_to_free_cached_page(struct page *page);
> int z_erofs_load_lz4_config(struct super_block *sb,
> struct erofs_super_block *dsb,
> struct z_erofs_lz4_cfgs *lz4, int len);
> +int z_erofs_fill_inode(struct inode *inode);
> +int z_erofs_map_blocks_iter(struct inode *inode, struct erofs_map_blocks *map,
> + int flags);
> #else
> static inline void erofs_shrinker_register(struct super_block *sb) {}
> static inline void erofs_shrinker_unregister(struct super_block *sb) {}
> @@ -560,6 +540,7 @@ static inline int z_erofs_load_lz4_config(struct super_block *sb,
> }
> return 0;
> }
> +static inline int z_erofs_fill_inode(struct inode *inode) { return -EOPNOTSUPP; }
> #endif /* !CONFIG_EROFS_FS_ZIP */
>
> #ifdef CONFIG_EROFS_FS_ZIP_LZMA
> @@ -580,23 +561,15 @@ static inline int z_erofs_load_lzma_config(struct super_block *sb,
> }
> return 0;
> }
> -#endif /* !CONFIG_EROFS_FS_ZIP */
> +#endif /* !CONFIG_EROFS_FS_ZIP_LZMA */
>
> -/* flags for erofs_fscache_register_cookie() */
> -#define EROFS_REG_COOKIE_NEED_INODE 1
> -#define EROFS_REG_COOKIE_NEED_NOEXIST 2
> -
> -/* fscache.c */
> #ifdef CONFIG_EROFS_FS_ONDEMAND
> int erofs_fscache_register_fs(struct super_block *sb);
> void erofs_fscache_unregister_fs(struct super_block *sb);
>
> struct erofs_fscache *erofs_fscache_register_cookie(struct super_block *sb,
> - char *name,
> - unsigned int flags);
> + char *name, unsigned int flags);
> void erofs_fscache_unregister_cookie(struct erofs_fscache *fscache);
> -
> -extern const struct address_space_operations erofs_fscache_access_aops;
> #else
> static inline int erofs_fscache_register_fs(struct super_block *sb)
> {
> @@ -606,8 +579,7 @@ static inline void erofs_fscache_unregister_fs(struct super_block *sb) {}
>
> static inline
> struct erofs_fscache *erofs_fscache_register_cookie(struct super_block *sb,
> - char *name,
> - unsigned int flags)
> + char *name, unsigned int flags)
> {
> return ERR_PTR(-EOPNOTSUPP);
> }

--
Thanks,
Jingbo

2023-02-14 13:48:08

by Chao Yu

[permalink] [raw]
Subject: Re: [PATCH 1/6] erofs: get rid of erofs_inode_datablocks()

On 2023/2/4 17:30, Gao Xiang wrote:
> erofs_inode_datablocks() has the only one caller, let's just get
> rid of it entirely. No logic changes.
>
> Signed-off-by: Gao Xiang <[email protected]>

Reviewed-by: Chao Yu <[email protected]>

Thanks,


2023-02-14 14:45:02

by Chao Yu

[permalink] [raw]
Subject: Re: [PATCH 4/6] erofs: move zdata.h into zdata.c

On 2023/2/4 17:30, Gao Xiang wrote:
> Definitions in zdata.h are only used in zdata.c and for internal
> use only. No logic changes.
>
> Signed-off-by: Gao Xiang <[email protected]>

Reviewed-by: Chao Yu <[email protected]>

Thanks,


2023-02-14 14:45:39

by Chao Yu

[permalink] [raw]
Subject: Re: [PATCH 5/6] erofs: get rid of z_erofs_do_map_blocks() forward declaration

On 2023/2/4 17:30, Gao Xiang wrote:
> The code can be neater without forward declarations. Let's
> get rid of z_erofs_do_map_blocks() forward declaration.
>
> Signed-off-by: Gao Xiang <[email protected]>

Reviewed-by: Chao Yu <[email protected]>

Thanks,


2023-02-14 14:47:06

by Chao Yu

[permalink] [raw]
Subject: Re: [PATCH 6/6] erofs: tidy up internal.h

On 2023/2/4 17:30, Gao Xiang wrote:
> Reorder internal.h code so that removing unneeded macros and more.
> No logic changes.
>
> Signed-off-by: Gao Xiang <[email protected]>

Reviewed-by: Chao Yu <[email protected]>

Thanks,