Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755480Ab3ETDer (ORCPT ); Sun, 19 May 2013 23:34:47 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:41635 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755404Ab3ETDdk (ORCPT ); Sun, 19 May 2013 23:33:40 -0400 X-AuditID: cbfee690-b7efc6d000006d92-15-5199998e8de0 From: Jaegeuk Kim Cc: Jaegeuk Kim , 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 Message-id: <1369020743-18520-6-git-send-email-jaegeuk.kim@samsung.com> X-Mailer: git-send-email 1.8.1.3.566.gaa39828 In-reply-to: <1369020743-18520-1-git-send-email-jaegeuk.kim@samsung.com> References: <1369020743-18520-1-git-send-email-jaegeuk.kim@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrNLMWRmVeSWpSXmKPExsVy+t8zA92+mTMDDdrvaFpc3/WXyeLSIneL PXtPslhc3jWHzYHFY/eCz0wefVtWMXp83iQXwBzFZZOSmpNZllqkb5fAlbGr+ydTwWb2isuP VjM1MHaydTFyckgImEhs3zuBCcIWk7hwbz1YXEhgGaPE8z1WMDUTj31l7mLkAoovYpTYNnUh K4TTxiSxseEIUAcHB5uAtsTm/QYgDSICzBILpp5nBKlhFpjAKPF/0XsWkISwgK/EytsvwDaw CKhKfPnUDbaZV8BdYt2LBSwQ23QlVv9/zg5icwp4SGy9e4oRZL4QUM3rcyUgMyUEfrNJPJuz FmqOgMS3yYdYQGokBGQlNh1ghhgjKXFwxQ2WCYzCCxgZVjGKphYkFxQnpReZ6BUn5haX5qXr JefnbmKEBOyEHYz3DlgfYkwGGjeRWUo0OR8Y8Hkl8YbGZkYWpiamxkbmlmakCSuJ86q3WAcK CaQnlqRmp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-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1159 Lines: 38 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 --- 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/