const unsigned int advise = le16_to_cpu(v1->i_advise);
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)) {
- errln("unknown data mapping mode %u of nid %llu",
- vi->data_mapping_mode, vi->nid);
+ if (unlikely(vi->datamode >= EROFS_INODE_LAYOUT_MAX)) {
+ errln("unsupported data mapping %u of nid %llu",
+ vi->datamode, vi->nid);
DBG_BUGON(1);
return -EIO;
}
inode->i_size = le64_to_cpu(v2->i_size);
/* 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);
} else if (__inode_version(advise) == EROFS_INODE_LAYOUT_V1) {
struct erofs_sb_info *sbi = EROFS_SB(inode->i_sb);
sbi->build_time_nsec;
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);
} else {
errln("unsupported on-disk inode version %u of nid %llu",
{
struct erofs_vnode *vi = EROFS_V(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);
u32 request_mask, unsigned int query_flags)
{
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_IMMUTABLE;
/* atomic flags (including bitlocks) */
unsigned long flags;
- unsigned char data_mapping_mode;
- /* inline size in bytes */
+ unsigned char datamode;
unsigned char inode_isize;
unsigned short xattr_isize;
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)
{
- return EROFS_V(inode)->data_mapping_mode ==
- EROFS_INODE_LAYOUT_COMPRESSION;
+ return EROFS_V(inode)->datamode == EROFS_INODE_LAYOUT_COMPRESSION;
}
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;