mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
f2fs: introduce help macro ADDRS_PER_PAGE()
Introduce help macro ADDRS_PER_PAGE() to get the number of address pointers in direct node or inode. Signed-off-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
This commit is contained in:
parent
2aea39eca6
commit
6403eb1f64
4 changed files with 7 additions and 12 deletions
|
|
@ -652,8 +652,7 @@ static int get_data_block(struct inode *inode, sector_t iblock,
|
|||
goto put_out;
|
||||
}
|
||||
|
||||
end_offset = IS_INODE(dn.node_page) ?
|
||||
ADDRS_PER_INODE(F2FS_I(inode)) : ADDRS_PER_BLOCK;
|
||||
end_offset = ADDRS_PER_PAGE(dn.node_page, F2FS_I(inode));
|
||||
bh_result->b_size = (((size_t)1) << blkbits);
|
||||
dn.ofs_in_node++;
|
||||
pgofs++;
|
||||
|
|
@ -675,8 +674,7 @@ get_next:
|
|||
if (dn.data_blkaddr == NEW_ADDR)
|
||||
goto put_out;
|
||||
|
||||
end_offset = IS_INODE(dn.node_page) ?
|
||||
ADDRS_PER_INODE(F2FS_I(inode)) : ADDRS_PER_BLOCK;
|
||||
end_offset = ADDRS_PER_PAGE(dn.node_page, F2FS_I(inode));
|
||||
}
|
||||
|
||||
if (maxblocks > (bh_result->b_size >> blkbits)) {
|
||||
|
|
|
|||
|
|
@ -288,10 +288,7 @@ int truncate_blocks(struct inode *inode, u64 from)
|
|||
return err;
|
||||
}
|
||||
|
||||
if (IS_INODE(dn.node_page))
|
||||
count = ADDRS_PER_INODE(F2FS_I(inode));
|
||||
else
|
||||
count = ADDRS_PER_BLOCK;
|
||||
count = ADDRS_PER_PAGE(dn.node_page, F2FS_I(inode));
|
||||
|
||||
count -= dn.ofs_in_node;
|
||||
f2fs_bug_on(count < 0);
|
||||
|
|
|
|||
|
|
@ -301,10 +301,7 @@ static int do_recover_data(struct f2fs_sb_info *sbi, struct inode *inode,
|
|||
goto out;
|
||||
|
||||
start = start_bidx_of_node(ofs_of_node(page), fi);
|
||||
if (IS_INODE(page))
|
||||
end = start + ADDRS_PER_INODE(fi);
|
||||
else
|
||||
end = start + ADDRS_PER_BLOCK;
|
||||
end = start + ADDRS_PER_PAGE(page, fi);
|
||||
|
||||
f2fs_lock_op(sbi);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue