diff options
author | Jingbo Xu <jefflexu@linux.alibaba.com> | 2023-07-19 15:33:18 +0800 |
---|---|---|
committer | Gao Xiang <hsiangkao@linux.alibaba.com> | 2023-07-22 14:09:05 +0800 |
commit | c9a01ba346330ca7dd009b6c7079b1e75c6fe596 (patch) | |
tree | c9d6c41a8632b8a6c70c4104d9c24fe5046f33f9 /include | |
parent | f44d53735d6c8a84c9cc580518262a66bf521b3b (diff) | |
download | erofs-utils-c9a01ba346330ca7dd009b6c7079b1e75c6fe596.tar.gz |
erofs-utils: simplify iloc()
Let's follow kernel commit b780d3fc6107 ("erofs: simplify iloc()") by
passing in inodes directly to clean up all callers. Also rename iloc()
as erofs_iloc().
Signed-off-by: Jingbo Xu <jefflexu@linux.alibaba.com>
Link: https://lore.kernel.org/r/20230719073319.27996-2-jefflexu@linux.alibaba.com
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/erofs/internal.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/include/erofs/internal.h b/include/erofs/internal.h index 46690f5..93e3a0b 100644 --- a/include/erofs/internal.h +++ b/include/erofs/internal.h @@ -103,11 +103,6 @@ struct erofs_sb_info { /* make sure that any user of the erofs headers has atleast 64bit off_t type */ extern int erofs_assert_largefile[sizeof(off_t)-8]; -static inline erofs_off_t iloc(erofs_nid_t nid) -{ - return erofs_pos(sbi.meta_blkaddr) + (nid << sbi.islotbits); -} - #define EROFS_FEATURE_FUNCS(name, compat, feature) \ static inline bool erofs_sb_has_##name(void) \ { \ @@ -219,6 +214,11 @@ struct erofs_inode { unsigned int fragment_size; }; +static inline erofs_off_t erofs_iloc(struct erofs_inode *inode) +{ + return erofs_pos(sbi.meta_blkaddr) + (inode->nid << sbi.islotbits); +} + static inline bool is_inode_layout_compression(struct erofs_inode *inode) { return erofs_inode_is_data_compressed(inode->datalayout); |