erofs: sunset erofs_dbg()
PATCH 1/2 erofs: sunset erofs_dbg()
Such debug messages are rarely used now. Let's get rid of these, and revert locally if they are needed for debugging.
Signed-off-by Gao Xiang <[email protected]>
--- fs/erofs/inode.c | 3 --- fs/erofs/internal.h | 2 -- fs/erofs/namei.c | 9 +++------ fs/erofs/zdata.c | 5 ----- fs/erofs/zmap.c | 3 --- 5 files changed, 3 insertions(+), 19 deletions(-)
fs/erofs/inode.c +0 -3
@@ -26,9 +26,6 @@ static void *erofs_read_inode(struct erofs_buf *buf, blkaddr =erofs_blknr (sb, inode_loc); *ofs =erofs_blkoff (sb, inode_loc); -erofs_dbg ("%s, reading inode nid %llu at %u of blkaddr %u" , - __func__, vi->nid, *ofs, blkaddr); - kaddr =erofs_read_metabuf (buf, sb, blkaddr,EROFS_KMAP );if (IS_ERR (kaddr)) { erofs_err(sb, "failed to get inode (nid: %llu) page, err %ld",
fs/erofs/internal.h +0 -2
@@ -31,10 +31,8 @@ __printf(3, 4) void _erofs_info(struct super_block *sb,#define erofs_info (sb, fmt, ...) \ _erofs_info(sb, __func__, fmt "\n", ##__VA_ARGS__)#ifdef CONFIG_EROFS_FS_DEBUG -#define erofs_dbg (x, ...) pr_debug(x "\n", ##__VA_ARGS__)#define DBG_BUGON BUG_ON#else -#define erofs_dbg (x, ...) ((void)0)#define DBG_BUGON (x) ((void)(x))#endif /* !CONFIG_EROFS_FS_DEBUG */
fs/erofs/namei.c +3 -6
@@ -205,16 +205,13 @@ static struct dentry *erofs_lookup(struct inode *dir, struct dentry *dentry, err =erofs_namei (dir, &dentry->d_name, &nid, &d_type); -if (err == -ENOENT ) { +if (err == -ENOENT )/* negative dentry */ inode =NULL ; - }else if (err) { +else if (err) inode =ERR_PTR (err); - }else { -erofs_dbg ("%s, %pd (nid %llu) found, d_type %u" , __func__, - dentry, nid, d_type); +else inode =erofs_iget (dir->i_sb, nid); - }return d_splice_alias (inode, dentry); }
fs/erofs/zdata.c +0 -5
@@ -979,8 +979,6 @@ static int z_erofs_do_read_page(struct z_erofs_decompress_frontend *fe,if (offset + cur < map->m_la || offset + cur >= map->m_la + map->m_llen) { -erofs_dbg ("out-of-range map @ pos %llu" , offset + cur); -if (z_erofs_collector_end (fe)) fe->backmost = false; map->m_la = offset + cur;
@@ -1105,9 +1103,6 @@ static int z_erofs_do_read_page(struct z_erofs_decompress_frontend *fe,if (err)z_erofs_page_mark_eio (page);z_erofs_onlinepage_endio (page); - -erofs_dbg ("%s, finish page: %pK spiltted: %u map->m_llen %llu" , - __func__, page, spiltted, map->m_llen);return err; }
fs/erofs/zmap.c +0 -3
@@ -585,9 +585,6 @@ static int z_erofs_do_map_blocks(struct inode *inode, unmap_out:erofs_unmap_metabuf (&m.map->buf); -erofs_dbg ("%s, m_la %llu m_pa %llu m_llen %llu m_plen %llu m_flags 0%o" , - __func__, map->m_la, map->m_pa, - map->m_llen, map->m_plen, map->m_flags);return err; }
Signature · 1 line
2.24.4
PATCH 2/2 erofs: cleanup i_format-related stuffs
Switch EROFS_I_{VERSION,DATALAYOUT}_BITS into
EROFS_I_{VERSION,DATALAYOUT}_MASK.
Also avoid erofs_bitrange() since its functionality is simple enough.
Signed-off-by Gao Xiang <[email protected]>
--- fs/erofs/erofs_fs.h | 8 ++++---- fs/erofs/internal.h | 18 ++++-------------- 2 files changed, 8 insertions(+), 18 deletions(-)
fs/erofs/erofs_fs.h +4 -4
@@ -109,14 +109,14 @@ static inline bool erofs_inode_is_data_compressed(unsigned int datamode) }/* bit definitions of inode i_format */ -#define EROFS_I_VERSION_BITS 1 -#define EROFS_I_DATALAYOUT_BITS 3 +#define EROFS_I_VERSION_MASK 0x01 +#define EROFS_I_DATALAYOUT_MASK 0x07#define EROFS_I_VERSION_BIT 0#define EROFS_I_DATALAYOUT_BIT 1 +#define EROFS_I_ALL_BIT 4 -#define EROFS_I_ALL \ - ((1 << (EROFS_I_DATALAYOUT_BIT + EROFS_I_DATALAYOUT_BITS)) - 1) +#define EROFS_I_ALL ((1 << EROFS_I_ALL_BIT) - 1)/* indicate chunk blkbits, thus 'chunksize = blocksize << chunk blkbits' */ #define EROFS_CHUNK_FORMAT_BLKBITS_MASK 0x001F
fs/erofs/internal.h +4 -14
@@ -343,24 +343,14 @@ static inline erofs_off_t erofs_iloc(struct inode *inode) (EROFS_I (inode)->nid << sbi->islotbits); } -static inline unsigned int erofs_bitrange (unsigned int value,unsigned int bit, -unsigned int bits) +static inline unsigned int erofs_inode_version (unsigned int ifmt) { - -return (value >> bit) & ((1 << bits) -1 ); -} - - -static inline unsigned int erofs_inode_version (unsigned int value) -{ -return erofs_bitrange (value,EROFS_I_VERSION_BIT , -EROFS_I_VERSION_BITS ); +return (ifmt >>EROFS_I_VERSION_BIT ) &EROFS_I_VERSION_MASK ; } -static inline unsigned int erofs_inode_datalayout (unsigned int value) +static inline unsigned int erofs_inode_datalayout (unsigned int ifmt) { -return erofs_bitrange (value,EROFS_I_DATALAYOUT_BIT , -EROFS_I_DATALAYOUT_BITS ); +return (ifmt >>EROFS_I_DATALAYOUT_BIT ) &EROFS_I_DATALAYOUT_MASK ; }/*
Signature · 1 line
2.24.4
Re: [PATCH 2/2] erofs: cleanup i_format-related stuffs
Quoted 6 lines · Gao Xiang
Switch EROFS_I_{VERSION,DATALAYOUT}_BITS into
EROFS_I_{VERSION,DATALAYOUT}_MASK.Also avoid
erofs_bitrange()since its functionality is simple enough.Signed-off-by Gao Xiang <[email protected]>
Reviewed-by Chao Yu <[email protected]>
Thanks,
Quoted 4 lines · Gao Xiang
Such debug messages are rarely used now. Let's get rid of these, and revert locally if they are needed for debugging.
Signed-off-by Gao Xiang <[email protected]>
Reviewed-by Chao Yu <[email protected]>
Thanks,