summaryrefslogtreecommitdiff
path: root/fs/erofs/erofs_fs.h
diff options
context:
space:
mode:
authorGao Xiang <hsiangkao@linux.alibaba.com>2023-04-14 11:30:27 +0300
committerGao Xiang <hsiangkao@linux.alibaba.com>2023-04-16 20:15:55 +0300
commit745ed7d77834048879bf24088c94e5a6462b613f (patch)
treeb8332bbd8252efaa88935b3f7a55438a0f583512 /fs/erofs/erofs_fs.h
parent10656f9ca60ed85f4cfc06bcbe1f240ee310fa8c (diff)
downloadlinux-745ed7d77834048879bf24088c94e5a6462b613f.tar.xz
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 <hsiangkao@linux.alibaba.com> Reviewed-by: Chao Yu <chao@kernel.org> Link: https://lore.kernel.org/r/20230414083027.12307-2-hsiangkao@linux.alibaba.com
Diffstat (limited to 'fs/erofs/erofs_fs.h')
-rw-r--r--fs/erofs/erofs_fs.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/erofs/erofs_fs.h b/fs/erofs/erofs_fs.h
index 4ec422c2b74f..2c7b16e340fe 100644
--- a/fs/erofs/erofs_fs.h
+++ b/fs/erofs/erofs_fs.h
@@ -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