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


Groups > linux.kernel > #1355578 > unrolled thread

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

Started byShawn Lin <shawn.lin@rock-chips.com>
First post2016-03-11 04:40 +0100
Last post2016-03-11 04:40 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [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

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

FromShawn Lin <shawn.lin@rock-chips.com>
Date2016-03-11 04:40 +0100
Subject[PATCH 8/8] f2fs: check inline flag ahead for get_dnode_of_data
Message-ID<rbm5I-8y-3@gated-at.bofh.it>
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

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web