From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C915DC71157 for ; Wed, 18 Jun 2025 06:43:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Subject:MIME-Version:References:In-Reply-To:Message-ID:Date:To:From:Sender: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=mbHuN0TXdM4ZQ1YsvaJlgdE585Y/zMJ0emVmEk9Qfs0=; b=jDASPfd46mPcGdnXI9HkhVyjz9 JzxwzBW8SLjyZJoML/O/tz/teEth4iNupQnyFx9PkXc5TjLeVHWPuNluJdGyKgu53vU7dmJdQRLfm p2V+UL62kIVsEJ1ObvjtBUcAu/XUwdvwpIDSeLn3L5eNWyCoLNK9LrFGBG555uBj+tRs=; Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1uRmWQ-0002K2-Cr; Wed, 18 Jun 2025 06:43:46 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1uRmWO-0002Jn-NH for linux-f2fs-devel@lists.sourceforge.net; Wed, 18 Jun 2025 06:43:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Type:Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:CC:To:From:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=HRB9fm4/TWkCzsTwmnERp07lVUluKpYeS6Fs43QrGps=; b=XDH8EK51gIaD5OeVNwQ2lmK+Ea dKi1o7MxbXRPVZ9OMteRO6+vHLvhAfabZphWx7Hr/XZrjqn9Eq4Auy0XFE8oyqNhr9zm/QaTd3eHL Zzg30HER5VWakRFCd98C4iiPdJR2AY5k3LIFp6rjPh74PQVmTjnnv51nk7KZRLDkOtCE=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Type:Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:CC:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=HRB9fm4/TWkCzsTwmnERp07lVUluKpYeS6Fs43QrGps=; b=bgXmY8kLSLoC0e+8hShzqxyS8v FIixAr9n+IJTPkhSXuky7r3e1nzaCh85V5TKuS+QB5e8YqMeVgwD/PSMM9y1SyyH2qRg3awXl90GB Qfy5Y0ErbSqDkCTMWqksK+XPPe2xUtZbqRSfLqzvOkvTe6HkJc+ygXUi2NmNAX6C1HKo=; Received: from mta21.hihonor.com ([81.70.160.142]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1uRmWC-0006nf-Pa for linux-f2fs-devel@lists.sourceforge.net; Wed, 18 Jun 2025 06:43:33 +0000 Received: from w001.hihonor.com (unknown [10.68.25.235]) by mta21.hihonor.com (SkyGuard) with ESMTPS id 4bMYzS4NcpzYlqL6; Wed, 18 Jun 2025 14:41:08 +0800 (CST) Received: from a011.hihonor.com (10.68.31.243) by w001.hihonor.com (10.68.25.235) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Wed, 18 Jun 2025 14:43:21 +0800 Received: from localhost.localdomain (10.144.23.14) by a011.hihonor.com (10.68.31.243) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Wed, 18 Jun 2025 14:43:20 +0800 From: wangzijie To: , Date: Wed, 18 Jun 2025 14:43:03 +0800 Message-ID: <20250618064303.2477852-2-wangzijie1@honor.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20250618064303.2477852-1-wangzijie1@honor.com> References: <20250618064303.2477852-1-wangzijie1@honor.com> MIME-Version: 1.0 X-Originating-IP: [10.144.23.14] X-ClientProxiedBy: w002.hihonor.com (10.68.28.120) To a011.hihonor.com (10.68.31.243) X-Headers-End: 1uRmWC-0006nf-Pa Subject: [f2fs-dev] [PATCH v3 2/2] f2fs: cleanup F2FS_I_SB in f2fs_setattr() X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: feng.han@honor.com, linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, wangzijie Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net After introduce sbi in f2fs_setattr(), cleanup F2FS_I_SB. No logic change. Signed-off-by: wangzijie --- fs/f2fs/file.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 9e0f1c98f..4809f0fd6 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -1029,7 +1029,7 @@ int f2fs_setattr(struct mnt_idmap *idmap, struct dentry *dentry, struct f2fs_sb_info *sbi = F2FS_I_SB(inode); int err; - if (unlikely(f2fs_cp_error(F2FS_I_SB(inode)))) + if (unlikely(f2fs_cp_error(sbi))) return -EIO; if (unlikely(IS_IMMUTABLE(inode))) @@ -1080,12 +1080,11 @@ int f2fs_setattr(struct mnt_idmap *idmap, struct dentry *dentry, } if (i_uid_needs_update(idmap, attr, inode) || i_gid_needs_update(idmap, attr, inode)) { - f2fs_lock_op(F2FS_I_SB(inode)); + f2fs_lock_op(sbi); err = dquot_transfer(idmap, inode, attr); if (err) { - set_sbi_flag(F2FS_I_SB(inode), - SBI_QUOTA_NEED_REPAIR); - f2fs_unlock_op(F2FS_I_SB(inode)); + set_sbi_flag(sbi, SBI_QUOTA_NEED_REPAIR); + f2fs_unlock_op(sbi); return err; } /* @@ -1095,7 +1094,7 @@ int f2fs_setattr(struct mnt_idmap *idmap, struct dentry *dentry, i_uid_update(idmap, attr, inode); i_gid_update(idmap, attr, inode); f2fs_mark_inode_dirty_sync(inode, true); - f2fs_unlock_op(F2FS_I_SB(inode)); + f2fs_unlock_op(sbi); } if (attr->ia_valid & ATTR_SIZE) { @@ -1156,7 +1155,7 @@ int f2fs_setattr(struct mnt_idmap *idmap, struct dentry *dentry, f2fs_mark_inode_dirty_sync(inode, true); /* inode change will produce dirty node pages flushed by checkpoint */ - f2fs_balance_fs(F2FS_I_SB(inode), true); + f2fs_balance_fs(sbi, true); return err; } -- 2.25.1 _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel