From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753641AbbIYJzy (ORCPT ); Fri, 25 Sep 2015 05:55:54 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:46059 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751470AbbIYJzw (ORCPT ); Fri, 25 Sep 2015 05:55:52 -0400 X-AuditID: cbfee61b-f79d56d0000048c5-39-56051a18e13b From: Chao Yu To: Jaegeuk Kim Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: [PATCH] f2fs: remove unneeded f2fs_{,un}lock_op in do_recover_data() Date: Fri, 25 Sep 2015 17:54:56 +0800 Message-id: <01c101d0f778$5455cdf0$fd0169d0$@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: AdD3d80eHfa8fDfjRwiV9GCV3NY6xg== Content-language: zh-cn X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrNLMWRmVeSWpSXmKPExsVy+t9jQV0JKdYwg44D7BZP1s9itri0yN3i 8q45bA7MHptWdbJ57F7wmcnj8ya5AOYoLpuU1JzMstQifbsEroypRx8yFkzkrHi0tI+9gXEf excjJ4eEgInErqOLGCFsMYkL99azdTFycQgJzGKUOPR1NiuE84pRYuuZpawgVWwCKhLLO/4z gdgiQPahRZfBJjELeEg0dnwHquHgEBbwlTg1zRMkzCKgKtG/5DcLiM0rYCmxfd1vJghbUOLH 5HssEK1aEut3HmeCsOUlNq95ywxxkILEjrOvGSFW6Uks2/sUqkZcYuORWywTGIGuRBg1C8mo WUhGzULSsoCRZRWjRGpBckFxUnquUV5quV5xYm5xaV66XnJ+7iZGcBA/k97BeHiX+yFGAQ5G JR5ehVaWMCHWxLLiytxDjBIczEoivFV/gEK8KYmVValF+fFFpTmpxYcYpTlYlMR5bxxiCBMS SE8sSc1OTS1ILYLJMnFwSjUwNmarzEl4q7vz9IWp+xeb5/j7sfzxSJvyJ8P1OtcV3/Odb/nN rrNd2e68xqp3hxJHwaRsjwXXNWZ5P19nmqXk7rbzpufZRJkYB2/TaVHBJV99GOf9e5WTtu35 2/U1PyRb5rx46eGrNeEC684djWvjmn8cVJrsyr+lmTO3+87bObUzN6dYbfjDpcRSnJFoqMVc VJwIAJguV3peAgAA Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Protecting recovery flow by using cp_rwsem is not needed, since we have prevent triggering any checkpoint by locking cp_mutex previously. Signed-off-by: Chao Yu --- fs/f2fs/recovery.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/fs/f2fs/recovery.c b/fs/f2fs/recovery.c index acc21f2..c5daec5 100644 --- a/fs/f2fs/recovery.c +++ b/fs/f2fs/recovery.c @@ -383,15 +383,11 @@ static int do_recover_data(struct f2fs_sb_info *sbi, struct inode *inode, start = start_bidx_of_node(ofs_of_node(page), fi); end = start + ADDRS_PER_PAGE(page, fi); - f2fs_lock_op(sbi); - set_new_dnode(&dn, inode, NULL, NULL, 0); err = get_dnode_of_data(&dn, start, ALLOC_NODE); - if (err) { - f2fs_unlock_op(sbi); + if (err) goto out; - } f2fs_wait_on_page_writeback(dn.node_page, NODE); @@ -456,7 +452,6 @@ static int do_recover_data(struct f2fs_sb_info *sbi, struct inode *inode, set_page_dirty(dn.node_page); err: f2fs_put_dnode(&dn); - f2fs_unlock_op(sbi); out: f2fs_msg(sbi->sb, KERN_NOTICE, "recover_data: ino = %lx, recovered = %d blocks, err = %d", -- 2.5.2