f2fs: skip get_node_page if locked node page is passed
authorJaegeuk Kim <jaegeuk.kim@samsung.com>
Mon, 20 May 2013 00:42:28 +0000 (09:42 +0900)
committerJaegeuk Kim <jaegeuk.kim@samsung.com>
Tue, 28 May 2013 06:03:01 +0000 (15:03 +0900)
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>
fs/f2fs/node.c

index 96415345a428097660269ade77a61d95283f7a1d..f63f0a4046c6145fdeb2288f070194e8bf7dda48 100644 (file)
@@ -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);