summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/node.c
diff options
context:
space:
mode:
authorChao Yu2016-01-26 08:39:35 +0100
committerJaegeuk Kim2016-02-23 01:07:23 +0100
commit81ca7350ce5ed438547ea769b0c33cb0abbd74ba (patch)
treebe860162ea7dd360f9ecf7e38ce7acabdb9eae1c /fs/f2fs/node.c
parentf2fs: simplify __allocate_data_blocks (diff)
downloadkernel-qcow2-linux-81ca7350ce5ed438547ea769b0c33cb0abbd74ba.tar.gz
kernel-qcow2-linux-81ca7350ce5ed438547ea769b0c33cb0abbd74ba.tar.xz
kernel-qcow2-linux-81ca7350ce5ed438547ea769b0c33cb0abbd74ba.zip
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/node.c')
-rw-r--r--fs/f2fs/node.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index a004bc0432b1..5e381b2772f2 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -407,10 +407,10 @@ cache:
* The maximum depth is four.
* Offset[0] will have raw inode offset.
*/
-static int get_node_path(struct f2fs_inode_info *fi, long block,
+static int get_node_path(struct inode *inode, long block,
int offset[4], unsigned int noffset[4])
{
- const long direct_index = ADDRS_PER_INODE(fi);
+ const long direct_index = ADDRS_PER_INODE(inode);
const long direct_blks = ADDRS_PER_BLOCK;
const long dptrs_per_blk = NIDS_PER_BLOCK;
const long indirect_blks = ADDRS_PER_BLOCK * NIDS_PER_BLOCK;
@@ -498,7 +498,7 @@ int get_dnode_of_data(struct dnode_of_data *dn, pgoff_t index, int mode)
int level, i;
int err = 0;
- level = get_node_path(F2FS_I(dn->inode), index, offset, noffset);
+ level = get_node_path(dn->inode, index, offset, noffset);
nids[0] = dn->inode->i_ino;
npage[0] = dn->inode_page;
@@ -792,7 +792,7 @@ int truncate_inode_blocks(struct inode *inode, pgoff_t from)
trace_f2fs_truncate_inode_blocks_enter(inode, from);
- level = get_node_path(F2FS_I(inode), from, offset, noffset);
+ level = get_node_path(inode, from, offset, noffset);
restart:
page = get_node_page(sbi, inode->i_ino);
if (IS_ERR(page)) {