mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jaegeuk Kim <jaegeuk.kim@samsung.com>
To: unlisted-recipients:; (no To-header on input)
Cc: Jaegeuk Kim <jaegeuk.kim@samsung.com>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net
Subject: [PATCH 06/15] f2fs: skip get_node_page if locked node page is passed
Date: Mon, 20 May 2013 12:32:20 +0900	[thread overview]
Message-ID: <1369020743-18520-6-git-send-email-jaegeuk.kim@samsung.com> (raw)
In-Reply-To: <1369020743-18520-1-git-send-email-jaegeuk.kim@samsung.com>

If get_dnode_of_data gets a locked node page, let's skip redundant
get_node_page calls.
This is for the futher enhancement.

Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
---
 fs/f2fs/node.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index 9641534..f63f0a4 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -408,10 +408,13 @@ int get_dnode_of_data(struct dnode_of_data *dn, pgoff_t index, int mode)
 	level = get_node_path(index, offset, noffset);
 
 	nids[0] = dn->inode->i_ino;
-	npage[0] = get_node_page(sbi, nids[0]);
-	if (IS_ERR(npage[0]))
-		return PTR_ERR(npage[0]);
+	npage[0] = dn->inode_page;
 
+	if (!npage[0]) {
+		npage[0] = get_node_page(sbi, nids[0]);
+		if (IS_ERR(npage[0]))
+			return PTR_ERR(npage[0]);
+	}
 	parent = npage[0];
 	if (level != 0)
 		nids[1] = get_nid(parent, offset[0], true);
-- 
1.8.1.3.566.gaa39828


  parent reply	other threads:[~2013-05-20  3:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-20  3:32 [PATCH 01/15] f2fs: remove redundant assignment Jaegeuk Kim
2013-05-20  3:32 ` [PATCH 02/15] f2fs: remove unnecessary flag set Jaegeuk Kim
2013-05-20  7:31   ` Jaegeuk Kim
2013-05-20  3:32 ` [PATCH 03/15] f2fs: fix por_doing variable coverage Jaegeuk Kim
2013-05-20  3:32 ` [PATCH 04/15] f2fs: fix BUG_ON during f2fs_evict_inode(dir) Jaegeuk Kim
2013-05-20  3:32 ` [PATCH 05/15] f2fs: remove unnecessary por_doing check Jaegeuk Kim
2013-05-20  3:32 ` Jaegeuk Kim [this message]
2013-05-20  3:32 ` [PATCH 07/15] f2fs: change get_new_data_page to pass a locked node page Jaegeuk Kim
2013-05-20  3:32 ` [PATCH 08/15] f2fs: update inode page after creation Jaegeuk Kim
2013-05-20  3:32 ` [PATCH 09/15] f2fs: add debug msgs in the recovery routine Jaegeuk Kim

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=1369020743-18520-6-git-send-email-jaegeuk.kim@samsung.com \
    --to=jaegeuk.kim@samsung.com \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --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

all inboxes | Powered by JetHome®