From: Jingbo Xu jefflexu@linux.alibaba.com
anolis inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/IB5UKT
Reference: https://gitee.com/anolis/cloud-kernel/commit/4590e9194687
--------------------------------
ANBZ: #4627
commit 8b58f9f02162124c2149779af401c8115c70b649 upstream.
For erofs_map_blocks() and erofs_map_blocks_flatmode(), the flags argument is always EROFS_GET_BLOCKS_RAW. Thus remove the unused flags parameter for these two functions.
Besides EROFS_GET_BLOCKS_RAW is originally introduced for reading compressed (raw) data for compressed files. However it's never used actually and let's remove it now.
Signed-off-by: Jingbo Xu jefflexu@linux.alibaba.com Reviewed-by: Yue Hu huyue2@coolpad.com Reviewed-by: Gao Xiang hsiangkao@linux.alibaba.com Reviewed-by: Chao Yu chao@kernel.org Link: https://lore.kernel.org/r/20230209024825.17335-2-jefflexu@linux.alibaba.com Signed-off-by: Gao Xiang hsiangkao@linux.alibaba.com Acked-by: Joseph Qi joseph.qi@linux.alibaba.com Link: https://gitee.com/anolis/cloud-kernel/pulls/1561
Conflicts: fs/erofs/data.c fs/erofs/internal.h
Signed-off-by: Baokun Li libaokun1@huawei.com --- fs/erofs/data.c | 16 +++++++--------- fs/erofs/fscache.c | 4 ++-- fs/erofs/internal.h | 6 +----- include/trace/events/erofs.h | 3 +-- 4 files changed, 11 insertions(+), 18 deletions(-)
diff --git a/fs/erofs/data.c b/fs/erofs/data.c index 89f76d7a3452..44fea7bf7bb8 100644 --- a/fs/erofs/data.c +++ b/fs/erofs/data.c @@ -96,8 +96,7 @@ void *erofs_read_metabuf(struct erofs_buf *buf, struct super_block *sb, }
static int erofs_map_blocks_flatmode(struct inode *inode, - struct erofs_map_blocks *map, - int flags) + struct erofs_map_blocks *map) { erofs_blk_t nblocks, lastblk; u64 offset = map->m_la; @@ -139,8 +138,7 @@ static int erofs_map_blocks_flatmode(struct inode *inode, return 0; }
-int erofs_map_blocks(struct inode *inode, - struct erofs_map_blocks *map, int flags) +int erofs_map_blocks(struct inode *inode, struct erofs_map_blocks *map) { struct super_block *sb = inode->i_sb; struct erofs_inode *vi = EROFS_I(inode); @@ -152,7 +150,7 @@ int erofs_map_blocks(struct inode *inode, void *kaddr; int err = 0;
- trace_erofs_map_blocks_enter(inode, map, flags); + trace_erofs_map_blocks_enter(inode, map, 0); map->m_deviceid = 0; if (map->m_la >= inode->i_size) { /* leave out-of-bound access unmapped */ @@ -162,7 +160,7 @@ int erofs_map_blocks(struct inode *inode, }
if (vi->datalayout != EROFS_INODE_CHUNK_BASED) { - err = erofs_map_blocks_flatmode(inode, map, flags); + err = erofs_map_blocks_flatmode(inode, map); goto out; }
@@ -214,7 +212,7 @@ int erofs_map_blocks(struct inode *inode, out: if (!err) map->m_llen = map->m_plen; - trace_erofs_map_blocks_exit(inode, map, flags, 0); + trace_erofs_map_blocks_exit(inode, map, 0, err); return err; }
@@ -297,7 +295,7 @@ static inline struct bio *erofs_read_raw_page(struct bio *bio, erofs_blk_t blknr; unsigned int blkoff;
- err = erofs_map_blocks(inode, &map, EROFS_GET_BLOCKS_RAW); + err = erofs_map_blocks(inode, &map); if (err) goto err_out;
@@ -467,7 +465,7 @@ static sector_t erofs_bmap(struct address_space *mapping, sector_t block) return 0; }
- if (!erofs_map_blocks(inode, &map, EROFS_GET_BLOCKS_RAW)) + if (!erofs_map_blocks(inode, &map)) return erofs_blknr(map.m_pa);
return 0; diff --git a/fs/erofs/fscache.c b/fs/erofs/fscache.c index 5c7208418d44..36bb49ecf6a2 100644 --- a/fs/erofs/fscache.c +++ b/fs/erofs/fscache.c @@ -142,7 +142,7 @@ static int erofs_fscache_readpage(struct file *file, struct page *page) int ret;
map.m_la = pos; - ret = erofs_map_blocks(inode, &map, EROFS_GET_BLOCKS_RAW); + ret = erofs_map_blocks(inode, &map); if (ret) goto out_unlock;
@@ -212,7 +212,7 @@ static void erofs_fscache_readahead(struct readahead_control *rac) pos = start + done;
map.m_la = pos; - ret = erofs_map_blocks(inode, &map, EROFS_GET_BLOCKS_RAW); + ret = erofs_map_blocks(inode, &map); if (ret) return;
diff --git a/fs/erofs/internal.h b/fs/erofs/internal.h index 59de35fec51e..f7b01a4be183 100644 --- a/fs/erofs/internal.h +++ b/fs/erofs/internal.h @@ -388,9 +388,6 @@ struct erofs_map_blocks { unsigned int m_flags; };
-/* Flags used by erofs_map_blocks_flatmode() */ -#define EROFS_GET_BLOCKS_RAW 0x0001 - /* zmap.c */ #ifdef CONFIG_EROFS_FS_ZIP int z_erofs_fill_inode(struct inode *inode); @@ -421,8 +418,7 @@ void erofs_put_metabuf(struct erofs_buf *buf); void *erofs_read_metabuf(struct erofs_buf *buf, struct super_block *sb, erofs_blk_t blkaddr, enum erofs_kmap_type type); int erofs_map_dev(struct super_block *sb, struct erofs_map_dev *dev); -int erofs_map_blocks(struct inode *inode, - struct erofs_map_blocks *map, int flags); +int erofs_map_blocks(struct inode *inode, struct erofs_map_blocks *map);
/* inode.c */ static inline unsigned long erofs_inode_hash(erofs_nid_t nid) diff --git a/include/trace/events/erofs.h b/include/trace/events/erofs.h index 717ddd17acb1..f02427cb664c 100644 --- a/include/trace/events/erofs.h +++ b/include/trace/events/erofs.h @@ -18,8 +18,7 @@ struct erofs_map_blocks; { 0, "FILE" }, \ { 1, "DIR" })
-#define show_map_flags(flags) __print_flags(flags, "|", \ - { EROFS_GET_BLOCKS_RAW, "RAW" }) +#define show_map_flags(flags) __print_flags(flags, "|", {} )
#define show_mflags(flags) __print_flags(flags, "", \ { EROFS_MAP_MAPPED, "M" }, \