lkml.org 
[lkml]   [2016]   [Mar]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 8/8] f2fs: check inline flag ahead for get_dnode_of_data
Date
Check inline data flag ahead, so we can save some
cpu cycle.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
---

fs/f2fs/node.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index 771166d..69467bd 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -534,6 +534,11 @@ int get_dnode_of_data(struct dnode_of_data *dn, pgoff_t index, int mode)
int err = 0;

level = get_node_path(dn->inode, index, offset, noffset);
+ /* if inline_data is set, should not report any block indices */
+ if (f2fs_has_inline_data(dn->inode) && index) {
+ err = -ENOENT;
+ goto release_out;
+ }

nids[0] = dn->inode->i_ino;
npage[0] = dn->inode_page;
@@ -544,13 +549,6 @@ int get_dnode_of_data(struct dnode_of_data *dn, pgoff_t index, int mode)
return PTR_ERR(npage[0]);
}

- /* if inline_data is set, should not report any block indices */
- if (f2fs_has_inline_data(dn->inode) && index) {
- err = -ENOENT;
- f2fs_put_page(npage[0], 1);
- goto release_out;
- }
-
parent = npage[0];
if (level != 0)
nids[1] = get_nid(parent, offset[0], true);
--
2.3.7

\
 
 \ /
  Last update: 2016-03-11 05:21    [W:0.069 / U:1.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site