Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756857AbbBEKDc (ORCPT ); Thu, 5 Feb 2015 05:03:32 -0500 Received: from mailout1.samsung.com ([203.254.224.24]:44929 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753258AbbBEKDa (ORCPT ); Thu, 5 Feb 2015 05:03:30 -0500 X-AuditID: cbfee61a-f79c06d000004e71-59-54d33ff1b6f2 From: Chao Yu To: Jaegeuk Kim , Changman Lee Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] f2fs: switch to check FI_NO_EXTENT in f2fs_{lookup,update}_extent_cache Date: Thu, 05 Feb 2015 18:02:44 +0800 Message-id: <000901d0412a$fcc1de20$f6459a60$@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-index: AdBBFWsUy/UWeBgCRrWruHkhDRkQVA== Content-language: zh-cn X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrILMWRmVeSWpSXmKPExsVy+t9jQd2P9pdDDM7OFLe4tq+RyeLJ+lnM FpcWuVtc3jWHzYHFY9OqTjaP3Qs+M3n0bVnF6PF5k1wASxSXTUpqTmZZapG+XQJXxo7uh4wF K4Qqnuw0a2CczN/FyMEhIWAicXqRfBcjJ5ApJnHh3nq2LkYuDiGB6YwS32fshXJ+MErs2naT GaSKTUBFYnnHfyYQW0TAS2LS/hMsIDazgIdEY8d3VhBbWCBOYlfrTUYQm0VAVWLq3fVgcV4B S4m2xuVsELagxI/J96B6tSTW7zzOBGHLS2xe85YZ4iIFiR1nXzNC7NKTOL2rkxGiRlxi45Fb LBMYBWYhGTULyahZSEbNQtKygJFlFaNoakFyQXFSeq6hXnFibnFpXrpecn7uJkZwQD+T2sG4 ssHiEKMAB6MSD6/lvkshQqyJZcWVuYcYJTiYlUR4NTkuhwjxpiRWVqUW5ccXleakFh9ilOZg URLnVbJvCxESSE8sSc1OTS1ILYLJMnFwSjUwWv3vZtB95LSocE+ZsaTOq3OnnrF7hvKvtrB8 lvH0HnuMyTEDd1PNcplzX505H2jIBR6vW9jXdSdj54eNyQfTWP95cMq/3mr1f5Pg1p1tObqq x1s33mncaW2T/IL5wcUC2wkvju5pKLgvusqWifNJe0S7gfDhN0F92z32/TT45nTcKLXguk+7 EktxRqKhFnNRcSIAob1+1WQCAAA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2511 Lines: 83 This patch switch to check FI_NO_EXTENT in f2fs_{lookup,update}_extent_cache instead of f2fs_{lookup,update}_extent_tree or {lookup,update}_extent_info. No functionality modification in this patch. Signed-off-by: Chao Yu --- fs/f2fs/data.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 112db9c..45b97a5 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -273,9 +273,6 @@ static bool lookup_extent_info(struct inode *inode, pgoff_t pgofs, pgoff_t start_fofs, end_fofs; block_t start_blkaddr; - if (is_inode_flag_set(fi, FI_NO_EXTENT)) - return false; - read_lock(&fi->ext_lock); if (fi->ext.len == 0) { read_unlock(&fi->ext_lock); @@ -306,9 +303,6 @@ static bool update_extent_info(struct inode *inode, pgoff_t fofs, block_t start_blkaddr, end_blkaddr; int need_update = true; - if (is_inode_flag_set(fi, FI_NO_EXTENT)) - return false; - write_lock(&fi->ext_lock); start_fofs = fi->ext.fofs; @@ -542,9 +536,6 @@ static bool f2fs_lookup_extent_tree(struct inode *inode, pgoff_t pgofs, struct extent_tree *et; struct extent_node *en; - if (is_inode_flag_set(F2FS_I(inode), FI_NO_EXTENT)) - return false; - trace_f2fs_lookup_extent_tree_start(inode, pgofs); down_read(&sbi->extent_tree_lock); @@ -586,9 +577,6 @@ static void f2fs_update_extent_tree(struct inode *inode, pgoff_t fofs, struct extent_info ei, dei; unsigned int endofs; - if (is_inode_flag_set(F2FS_I(inode), FI_NO_EXTENT)) - return; - trace_f2fs_update_extent_tree(inode, fofs, blkaddr); down_write(&sbi->extent_tree_lock); @@ -780,6 +768,9 @@ out: static bool f2fs_lookup_extent_cache(struct inode *inode, pgoff_t pgofs, struct extent_info *ei) { + if (is_inode_flag_set(F2FS_I(inode), FI_NO_EXTENT)) + return false; + if (test_opt(F2FS_I_SB(inode), EXTENT_CACHE)) return f2fs_lookup_extent_tree(inode, pgofs, ei); @@ -796,6 +787,9 @@ void f2fs_update_extent_cache(struct dnode_of_data *dn) /* Update the page address in the parent node */ __set_data_blkaddr(dn); + if (is_inode_flag_set(fi, FI_NO_EXTENT)) + return; + fofs = start_bidx_of_node(ofs_of_node(dn->node_page), fi) + dn->ofs_in_node; -- 2.2.1 -- 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/