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


Groups > linux.kernel > #1355581 > unrolled thread

[PATCH 1/8] f2fs: check inline flag ahead for f2fs_write_inline_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 1/8] f2fs: check inline flag ahead for f2fs_write_inline_data Shawn Lin <shawn.lin@rock-chips.com> - 2016-03-11 04:40 +0100

#1355581 — [PATCH 1/8] f2fs: check inline flag ahead for f2fs_write_inline_data

FromShawn Lin <shawn.lin@rock-chips.com>
Date2016-03-11 04:40 +0100
Subject[PATCH 1/8] f2fs: check inline flag ahead for f2fs_write_inline_data
Message-ID<rbm5I-8y-17@gated-at.bofh.it>
No matter inline data flag is set or not, current code is
going to new a dnode. But actually we can avoid it by puting
the check of inline data flag in advance to save this cpu cycle.

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

---

 fs/f2fs/inline.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/fs/f2fs/inline.c b/fs/f2fs/inline.c
index 358214e..0926eab 100644
--- a/fs/f2fs/inline.c
+++ b/fs/f2fs/inline.c
@@ -195,16 +195,14 @@ int f2fs_write_inline_data(struct inode *inode, struct page *page)
 	struct dnode_of_data dn;
 	int err;
 
+	if (!f2fs_has_inline_data(inode))
+		return -EAGAIN;
+
 	set_new_dnode(&dn, inode, NULL, NULL, 0);
 	err = get_dnode_of_data(&dn, 0, LOOKUP_NODE);
 	if (err)
 		return err;
 
-	if (!f2fs_has_inline_data(inode)) {
-		f2fs_put_dnode(&dn);
-		return -EAGAIN;
-	}
-
 	f2fs_bug_on(F2FS_I_SB(inode), page->index);
 
 	f2fs_wait_on_page_writeback(dn.inode_page, NODE, true);
-- 
2.3.7

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web