Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp10381641pxu; Wed, 30 Dec 2020 00:42:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJwdy3pAjfaQ8/bJ9bYoJax924t+lgG8N/ef6im70gUDu96wwR/qAgDol5Kv1a2L/miMLoJF X-Received: by 2002:aa7:c891:: with SMTP id p17mr22032235eds.309.1609317729877; Wed, 30 Dec 2020 00:42:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609317729; cv=none; d=google.com; s=arc-20160816; b=igf38f++gI0SStDEBOgEW6SvNDQdPXWFGO1FRncTbrvsRRL8eFFoJMTIbZXr0rY2tt 4/P1+SILkm8NGWIuEjqHbPIrk144Kr7IjV8deUmHSDyOHZr+j5T9pkOH1tb4yghW8qvO t7+cXR+hlXULfFVSP6y9+XUiToNWarEl14mSuCZN2BuZ+XCiLe50K8S7A8sfQz19PYO9 CLpvwUPimWwYlZU6PPItDBUyEY+Gf9A4+rqvaDlrvl4X5z5kqC+dJRrZ83dingSzfT8O /wMNrqqWnO6RaMqTejHZzGZeGmHmp6JYuou2onJS2nNYTRw0DRA4VuCuVf3Rngjnyyj8 KdnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=sT0AUtelC5S6Ak0bo3clITUU7m7ioVXUm/3532bosP0=; b=gZUEMTCalJ9oqm8AvoKH1I1v/YOzGcwxqJEY7s+2qzGQMRp/EV4i6zbY2ImoMJAYZQ ab+syAiCR7bmUGIz562O6xnRNuUtnlebOYm8+HoL4b3VveS3Zn+wJG+VLXD+32tZv6yk 3PTvbvuntsMdviKD2fePXzDOW44Dp2WO3Qdh3idwcdFxKv7RBjT15Jt1pBUBFKgyX/hr 1JLccKWQ8wTB/R73TRGpnAX7bfQlO9z6JxKD1imNcXFRsOyxs9tZzCVK0U9l+2dh7G9d 7CzBhi9AA8WvQEjqh31IFhShGHXUE6Nwl62l6LX+He51eKPZvb1qzri15AZv4+dy4Mp/ 0EOw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v5si17093305eji.385.2020.12.30.00.41.45; Wed, 30 Dec 2020 00:42:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726185AbgL3Ija (ORCPT + 99 others); Wed, 30 Dec 2020 03:39:30 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:10099 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726144AbgL3Ija (ORCPT ); Wed, 30 Dec 2020 03:39:30 -0500 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4D5Pmm3pZkzMBkC; Wed, 30 Dec 2020 16:37:44 +0800 (CST) Received: from szvp000203569.huawei.com (10.120.216.130) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.498.0; Wed, 30 Dec 2020 16:38:36 +0800 From: Chao Yu To: CC: , , , Chao Yu Subject: [PATCH] f2fs: trival cleanup in move_data_block() Date: Wed, 30 Dec 2020 16:38:35 +0800 Message-ID: <20201230083835.115049-1-yuchao0@huawei.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.120.216.130] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Trival cleanups: - relocate set_summary() before its use - relocate "allocate block address" to correct place - remove unneeded f2fs_wait_on_page_writeback() Signed-off-by: Chao Yu --- fs/f2fs/gc.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index 43919a3ae6a6..4561c44dfa8f 100644 --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c @@ -1169,8 +1169,6 @@ static int move_data_block(struct inode *inode, block_t bidx, if (err) goto put_out; - set_summary(&sum, dn.nid, dn.ofs_in_node, ni.version); - /* read page */ fio.page = page; fio.new_blkaddr = fio.old_blkaddr = dn.data_blkaddr; @@ -1207,6 +1205,9 @@ static int move_data_block(struct inode *inode, block_t bidx, } } + set_summary(&sum, dn.nid, dn.ofs_in_node, ni.version); + + /* allocate block address */ f2fs_allocate_data_block(fio.sbi, NULL, fio.old_blkaddr, &newaddr, &sum, type, NULL); @@ -1234,9 +1235,6 @@ static int move_data_block(struct inode *inode, block_t bidx, set_page_writeback(fio.encrypted_page); ClearPageError(page); - /* allocate block address */ - f2fs_wait_on_page_writeback(dn.node_page, NODE, true, true); - fio.op = REQ_OP_WRITE; fio.op_flags = REQ_SYNC; fio.new_blkaddr = newaddr; -- 2.29.2