lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1457666963-14641-1-git-send-email-shawn.lin@rock-chips.com>
Date:	Fri, 11 Mar 2016 11:29:23 +0800
From:	Shawn Lin <shawn.lin@...k-chips.com>
To:	Jaegeuk Kim <jaegeuk@...nel.org>
Cc:	linux-kernel@...r.kernel.org,
	linux-f2fs-devel@...ts.sourceforge.net,
	Shawn Lin <shawn.lin@...k-chips.com>
Subject: [PATCH 8/8] f2fs: check inline flag ahead for get_dnode_of_data

Check inline data flag ahead, so we can save some
cpu cycle.

Signed-off-by: Shawn Lin <shawn.lin@...k-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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ