Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1355578

[PATCH 8/8] f2fs: check inline flag ahead for get_dnode_of_data

From Shawn Lin <shawn.lin@rock-chips.com>
Newsgroups linux.kernel
Subject [PATCH 8/8] f2fs: check inline flag ahead for get_dnode_of_data
Date 2016-03-11 04:40 +0100
Message-ID <rbm5I-8y-3@gated-at.bofh.it> (permalink)
References <rbm5I-8y-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH 8/8] f2fs: check inline flag ahead for get_dnode_of_data Shawn Lin <shawn.lin@rock-chips.com> - 2016-03-11 04:40 +0100

csiph-web