summaryrefslogtreecommitdiff
path: root/fs/f2fs/data.c
diff options
context:
space:
mode:
authorChao Yu <chao2.yu@samsung.com>2016-01-26 10:39:35 +0300
committerJaegeuk Kim <jaegeuk@kernel.org>2016-02-23 03:07:23 +0300
commit81ca7350ce5ed438547ea769b0c33cb0abbd74ba (patch)
treebe860162ea7dd360f9ecf7e38ce7acabdb9eae1c /fs/f2fs/data.c
parent5b8db7fada07e67bb2075a39320f0abe7fe0ed77 (diff)
downloadlinux-81ca7350ce5ed438547ea769b0c33cb0abbd74ba.tar.xz
f2fs: remove unneeded pointer conversion
There are redundant pointer conversion in following call stack: - at position a, inode was been converted to f2fs_file_info. - at position b, f2fs_file_info was been converted to inode again. - truncate_blocks(inode,..) - fi = F2FS_I(inode) ---a - ADDRS_PER_PAGE(node_page, fi) - addrs_per_inode(fi) - inode = &fi->vfs_inode ---b - f2fs_has_inline_xattr(inode) - fi = F2FS_I(inode) - is_inode_flag_set(fi,..) In order to avoid unneeded conversion, alter ADDRS_PER_PAGE and addrs_per_inode to acept parameter with type of inode pointer. Signed-off-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/data.c')
-rw-r--r--fs/f2fs/data.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index f89ef4e37510..bb60e6afbb72 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -497,7 +497,6 @@ got_it:
static int __allocate_data_block(struct dnode_of_data *dn)
{
struct f2fs_sb_info *sbi = F2FS_I_SB(dn->inode);
- struct f2fs_inode_info *fi = F2FS_I(dn->inode);
struct f2fs_summary sum;
struct node_info ni;
int seg = CURSEG_WARM_DATA;
@@ -525,7 +524,7 @@ alloc:
set_data_blkaddr(dn);
/* update i_size */
- fofs = start_bidx_of_node(ofs_of_node(dn->node_page), fi) +
+ fofs = start_bidx_of_node(ofs_of_node(dn->node_page), dn->inode) +
dn->ofs_in_node;
if (i_size_read(dn->inode) < ((loff_t)(fofs + 1) << PAGE_CACHE_SHIFT))
i_size_write(dn->inode,
@@ -592,7 +591,7 @@ next_dnode:
goto unlock_out;
}
- end_offset = ADDRS_PER_PAGE(dn.node_page, F2FS_I(inode));
+ end_offset = ADDRS_PER_PAGE(dn.node_page, inode);
next_block:
blkaddr = datablock_addr(dn.node_page, dn.ofs_in_node);