From: Shawn Lin <shawn.lin@rock-chips.com>
To: Jaegeuk Kim <jaegeuk@kernel.org>
Cc: Shawn Lin <shawn.lin@rock-chips.com>,
linux-kernel@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net
Subject: [PATCH 1/8] f2fs: check inline flag ahead for f2fs_write_inline_data
Date: Fri, 11 Mar 2016 11:28:18 +0800 [thread overview]
Message-ID: <1457666898-14352-1-git-send-email-shawn.lin@rock-chips.com> (raw)
In-Reply-To: <1457666880-14311-1-git-send-email-shawn.lin@rock-chips.com>
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
------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140
next prev parent reply other threads:[~2016-03-11 3:36 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-11 3:28 [PATCH 0/8] some cleanup of inline flag checking Shawn Lin
2016-03-11 3:28 ` Shawn Lin [this message]
2016-03-11 3:28 ` [PATCH 2/8] f2fs: remove checing inline data flag for f2fs_write_data_page Shawn Lin
2016-03-11 3:28 ` [PATCH 3/8] f2fs: check inline flag ahead for f2fs_read_inline_data Shawn Lin
2016-03-11 3:28 ` [PATCH 4/8] f2fs: remove redundant checking of inline data flag Shawn Lin
2016-03-11 3:28 ` [PATCH 5/8] f2fs: f2fs: check inline flag ahead for f2fs_inline_data_fiemap Shawn Lin
2016-03-11 3:29 ` [PATCH 6/8] f2fs: remove checing inline data flag for f2fs_fiemap Shawn Lin
2016-03-11 3:29 ` [PATCH 7/8] f2fs: remove unnecessary inline checking for f2fs_convert_inline_inode Shawn Lin
2016-03-11 3:29 ` [PATCH 8/8] f2fs: check inline flag ahead for get_dnode_of_data Shawn Lin
2016-03-11 5:29 ` [f2fs-dev] [PATCH 0/8] some cleanup of inline flag checking Chao Yu
2016-03-11 6:34 ` Shawn Lin
2016-03-11 7:25 ` Chao Yu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1457666898-14352-1-git-send-email-shawn.lin@rock-chips.com \
--to=shawn.lin@rock-chips.com \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).