Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964793AbbLOFcX (ORCPT ); Tue, 15 Dec 2015 00:32:23 -0500 Received: from mailout4.samsung.com ([203.254.224.34]:51941 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933199AbbLOFcU (ORCPT ); Tue, 15 Dec 2015 00:32:20 -0500 X-AuditID: cbfee61b-f793c6d00000236c-04-566fa5e2b1b2 From: Chao Yu To: Jaegeuk Kim Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: [PATCH 3/8] f2fs: introduce __remove_dirty_inode Date: Tue, 15 Dec 2015 13:31:40 +0800 Message-id: <00f601d136f9$f6da6700$e48f3500$@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: AdE29gTnPVid5E5+QeGO0ThZK7f/qg== Content-language: zh-cn X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrNLMWRmVeSWpSXmKPExsVy+t9jAd1HS/PDDOY8VLV4sn4Ws8WlRe4W l3fNYXNg9ti0qpPNY/eCz0wenzfJBTBHcdmkpOZklqUW6dslcGVsXdbFXrCFu6Jz6n6mBsZz nF2MHBwSAiYSr86IdzFyApliEhfurWfrYuTiEBJYyiix7shKdgjnFaPEo0VPGUGq2ARUJJZ3 /GcCsUWA7EOLLrOD2MwCHhKNHd9ZQWxhAUuJxg3vmUFsFgFViVvzHoP18gLF5608xAJhC0r8 mHyPBaJXS2L9zuNMELa8xOY1b5khLlKQ2HH2NSPELj2J/xcvM0PUiEtsPHKLZQKjwCwko2Yh GTULyahZSFoWMLKsYpRILUguKE5KzzXKSy3XK07MLS7NS9dLzs/dxAgO4mfSOxgP73I/xCjA wajEw/uDNT9MiDWxrLgy9xCjBAezkgjvgl6gEG9KYmVValF+fFFpTmrxIUZpDhYlcd59lyLD hATSE0tSs1NTC1KLYLJMHJxSDYze9Sfnsu6UdJHzLWvkW2vx2UV+yeqI9pbV/9X/nYqTCz42 J2yvrcS1u+snb53s57v1aSHbeU3hYz+qC1ki7zUd9ptSwCZt/v/qZoc/Dis0Duzv1LOqa97f ++T8fmETFYPY3YqdSdOf1HCKzvMxUJm2//L/JbVWpqk/e7TeTnl9cL39BFOPO9+VWIozEg21 mIuKEwHClgPhXgIAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1652 Lines: 58 Introduce __remove_dirty_inode to clean up codes in remove_dirty_dir_inode. Signed-off-by: Chao Yu --- fs/f2fs/checkpoint.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c index 1aca402..a4392f0 100644 --- a/fs/f2fs/checkpoint.c +++ b/fs/f2fs/checkpoint.c @@ -736,6 +736,20 @@ static void __add_dirty_inode(struct inode *inode) return; } +static void __remove_dirty_inode(struct inode *inode) +{ + struct f2fs_sb_info *sbi = F2FS_I_SB(inode); + struct f2fs_inode_info *fi = F2FS_I(inode); + + if (get_dirty_pages(inode) || + !is_inode_flag_set(F2FS_I(inode), FI_DIRTY_DIR)) + return; + + list_del_init(&fi->dirty_list); + clear_inode_flag(fi, FI_DIRTY_DIR); + stat_dec_dirty_dir(sbi); +} + void update_dirty_page(struct inode *inode, struct page *page) { struct f2fs_sb_info *sbi = F2FS_I_SB(inode); @@ -777,15 +791,7 @@ void remove_dirty_dir_inode(struct inode *inode) return; spin_lock(&sbi->dir_inode_lock); - if (get_dirty_pages(inode) || - !is_inode_flag_set(F2FS_I(inode), FI_DIRTY_DIR)) { - spin_unlock(&sbi->dir_inode_lock); - return; - } - - list_del_init(&fi->dirty_list); - clear_inode_flag(fi, FI_DIRTY_DIR); - stat_dec_dirty_dir(sbi); + __remove_dirty_inode(inode); spin_unlock(&sbi->dir_inode_lock); /* Only from the recovery routine */ -- 2.6.3 -- 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/