staging: erofs: rename data_mapping_mode to datamode

data_mapping_mode is too long as a member name of erofs_vnode,
datamode is straight-forward enough.

Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Gao Xiang 2019-06-11 10:42:20 +08:00 committed by Greg Kroah-Hartman
parent 98a716ce1d
commit 76bc27a26a
2 changed files with 12 additions and 15 deletions

View File

@ -22,11 +22,11 @@ static int read_inode(struct inode *inode, void *data)
const unsigned int advise = le16_to_cpu(v1->i_advise); const unsigned int advise = le16_to_cpu(v1->i_advise);
erofs_blk_t nblks = 0; erofs_blk_t nblks = 0;
vi->data_mapping_mode = __inode_data_mapping(advise); vi->datamode = __inode_data_mapping(advise);
if (unlikely(vi->data_mapping_mode >= EROFS_INODE_LAYOUT_MAX)) { if (unlikely(vi->datamode >= EROFS_INODE_LAYOUT_MAX)) {
errln("unknown data mapping mode %u of nid %llu", errln("unsupported data mapping %u of nid %llu",
vi->data_mapping_mode, vi->nid); vi->datamode, vi->nid);
DBG_BUGON(1); DBG_BUGON(1);
return -EIO; return -EIO;
} }
@ -63,7 +63,7 @@ static int read_inode(struct inode *inode, void *data)
inode->i_size = le64_to_cpu(v2->i_size); inode->i_size = le64_to_cpu(v2->i_size);
/* total blocks for compressed files */ /* total blocks for compressed files */
if (vi->data_mapping_mode == EROFS_INODE_LAYOUT_COMPRESSION) if (is_inode_layout_compression(inode))
nblks = le32_to_cpu(v2->i_u.compressed_blocks); nblks = le32_to_cpu(v2->i_u.compressed_blocks);
} else if (__inode_version(advise) == EROFS_INODE_LAYOUT_V1) { } else if (__inode_version(advise) == EROFS_INODE_LAYOUT_V1) {
struct erofs_sb_info *sbi = EROFS_SB(inode->i_sb); struct erofs_sb_info *sbi = EROFS_SB(inode->i_sb);
@ -95,7 +95,7 @@ static int read_inode(struct inode *inode, void *data)
sbi->build_time_nsec; sbi->build_time_nsec;
inode->i_size = le32_to_cpu(v1->i_size); inode->i_size = le32_to_cpu(v1->i_size);
if (vi->data_mapping_mode == EROFS_INODE_LAYOUT_COMPRESSION) if (is_inode_layout_compression(inode))
nblks = le32_to_cpu(v1->i_u.compressed_blocks); nblks = le32_to_cpu(v1->i_u.compressed_blocks);
} else { } else {
errln("unsupported on-disk inode version %u of nid %llu", errln("unsupported on-disk inode version %u of nid %llu",
@ -127,7 +127,7 @@ static int fill_inline_data(struct inode *inode, void *data,
{ {
struct erofs_vnode *vi = EROFS_V(inode); struct erofs_vnode *vi = EROFS_V(inode);
struct erofs_sb_info *sbi = EROFS_I_SB(inode); struct erofs_sb_info *sbi = EROFS_I_SB(inode);
int mode = vi->data_mapping_mode; const int mode = vi->datamode;
DBG_BUGON(mode >= EROFS_INODE_LAYOUT_MAX); DBG_BUGON(mode >= EROFS_INODE_LAYOUT_MAX);
@ -299,9 +299,8 @@ int erofs_getattr(const struct path *path, struct kstat *stat,
u32 request_mask, unsigned int query_flags) u32 request_mask, unsigned int query_flags)
{ {
struct inode *const inode = d_inode(path->dentry); struct inode *const inode = d_inode(path->dentry);
struct erofs_vnode *const vi = EROFS_V(inode);
if (vi->data_mapping_mode == EROFS_INODE_LAYOUT_COMPRESSION) if (is_inode_layout_compression(inode))
stat->attributes |= STATX_ATTR_COMPRESSED; stat->attributes |= STATX_ATTR_COMPRESSED;
stat->attributes |= STATX_ATTR_IMMUTABLE; stat->attributes |= STATX_ATTR_IMMUTABLE;

View File

@ -349,8 +349,7 @@ struct erofs_vnode {
/* atomic flags (including bitlocks) */ /* atomic flags (including bitlocks) */
unsigned long flags; unsigned long flags;
unsigned char data_mapping_mode; unsigned char datamode;
/* inline size in bytes */
unsigned char inode_isize; unsigned char inode_isize;
unsigned short xattr_isize; unsigned short xattr_isize;
@ -385,18 +384,17 @@ static inline unsigned long inode_datablocks(struct inode *inode)
static inline bool is_inode_layout_plain(struct inode *inode) static inline bool is_inode_layout_plain(struct inode *inode)
{ {
return EROFS_V(inode)->data_mapping_mode == EROFS_INODE_LAYOUT_PLAIN; return EROFS_V(inode)->datamode == EROFS_INODE_LAYOUT_PLAIN;
} }
static inline bool is_inode_layout_compression(struct inode *inode) static inline bool is_inode_layout_compression(struct inode *inode)
{ {
return EROFS_V(inode)->data_mapping_mode == return EROFS_V(inode)->datamode == EROFS_INODE_LAYOUT_COMPRESSION;
EROFS_INODE_LAYOUT_COMPRESSION;
} }
static inline bool is_inode_layout_inline(struct inode *inode) static inline bool is_inode_layout_inline(struct inode *inode)
{ {
return EROFS_V(inode)->data_mapping_mode == EROFS_INODE_LAYOUT_INLINE; return EROFS_V(inode)->datamode == EROFS_INODE_LAYOUT_INLINE;
} }
extern const struct super_operations erofs_sops; extern const struct super_operations erofs_sops;