Skip to content

Commit

Permalink
f2fs: skip get_node_page if locked node page is passed
Browse files Browse the repository at this point in the history
If get_dnode_of_data gets a locked node page, let's skip redundant
get_node_page calls.
This is for the futher enhancement.

Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
  • Loading branch information
Jaegeuk Kim committed May 28, 2013
1 parent 0a364af commit 1646cfa
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions fs/f2fs/node.c
Original file line number Diff line number Diff line change
Expand Up @@ -408,10 +408,13 @@ int get_dnode_of_data(struct dnode_of_data *dn, pgoff_t index, int mode)
level = get_node_path(index, offset, noffset);

nids[0] = dn->inode->i_ino;
npage[0] = get_node_page(sbi, nids[0]);
if (IS_ERR(npage[0]))
return PTR_ERR(npage[0]);
npage[0] = dn->inode_page;

if (!npage[0]) {
npage[0] = get_node_page(sbi, nids[0]);
if (IS_ERR(npage[0]))
return PTR_ERR(npage[0]);
}
parent = npage[0];
if (level != 0)
nids[1] = get_nid(parent, offset[0], true);
Expand Down

0 comments on commit 1646cfa

Please sign in to comment.