diff options
author | Gao Xiang <gaoxiang25@huawei.com> | 2019-09-04 04:08:54 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-09-05 20:10:07 +0200 |
commit | 8a76568225deae18cea1d1a21c2bade2f2ced2ba (patch) | |
tree | 1156c41d308d2a292b6c7ed5aa0fe916b10ec495 /fs/erofs/data.c | |
parent | erofs: use feature_incompat rather than requirements (diff) | |
download | linux-8a76568225deae18cea1d1a21c2bade2f2ced2ba.tar.xz linux-8a76568225deae18cea1d1a21c2bade2f2ced2ba.zip |
erofs: better naming for erofs inode related stuffs
updates inode naming
- kill is_inode_layout_compression [1]
- kill magic underscores [2] [3]
- better naming for datamode & data_mapping_mode [3]
- better naming erofs_inode_{compact, extended} [4]
[1] https://lore.kernel.org/r/20190829102426.GE20598@infradead.org/
[2] https://lore.kernel.org/r/20190829102426.GE20598@infradead.org/
[3] https://lore.kernel.org/r/20190902122627.GN15931@infradead.org/
[4] https://lore.kernel.org/r/20190902125438.GA17750@infradead.org/
Reported-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Link: https://lore.kernel.org/r/20190904020912.63925-8-gaoxiang25@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/erofs/data.c')
-rw-r--r-- | fs/erofs/data.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/erofs/data.c b/fs/erofs/data.c index 0983807737fd..4d9b07991d07 100644 --- a/fs/erofs/data.c +++ b/fs/erofs/data.c @@ -113,11 +113,12 @@ static int erofs_map_blocks_flatmode(struct inode *inode, erofs_blk_t nblocks, lastblk; u64 offset = map->m_la; struct erofs_vnode *vi = EROFS_V(inode); + bool tailendpacking = (vi->datalayout == EROFS_INODE_FLAT_INLINE); trace_erofs_map_blocks_flatmode_enter(inode, map, flags); nblocks = DIV_ROUND_UP(inode->i_size, PAGE_SIZE); - lastblk = nblocks - is_inode_flat_inline(inode); + lastblk = nblocks - tailendpacking; if (offset >= inode->i_size) { /* leave out-of-bound access unmapped */ @@ -132,7 +133,7 @@ static int erofs_map_blocks_flatmode(struct inode *inode, if (offset < blknr_to_addr(lastblk)) { map->m_pa = blknr_to_addr(vi->raw_blkaddr) + map->m_la; map->m_plen = blknr_to_addr(lastblk) - offset; - } else if (is_inode_flat_inline(inode)) { + } else if (tailendpacking) { /* 2 - inode inline B: inode, [xattrs], inline last blk... */ struct erofs_sb_info *sbi = EROFS_SB(inode->i_sb); @@ -169,7 +170,7 @@ err_out: int erofs_map_blocks(struct inode *inode, struct erofs_map_blocks *map, int flags) { - if (is_inode_layout_compression(inode)) { + if (erofs_inode_is_data_compressed(EROFS_V(inode)->datalayout)) { int err = z_erofs_map_blocks_iter(inode, map, flags); if (map->mpage) { @@ -403,7 +404,7 @@ static sector_t erofs_bmap(struct address_space *mapping, sector_t block) { struct inode *inode = mapping->host; - if (is_inode_flat_inline(inode)) { + if (EROFS_V(inode)->datalayout == EROFS_INODE_FLAT_INLINE) { erofs_blk_t blks = i_size_read(inode) >> LOG_BLOCK_SIZE; if (block >> LOG_SECTORS_PER_BLOCK >= blks) |