From patchwork Tue Jun 13 07:51:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?5p2O5oms6Z+s?= X-Patchwork-Id: 107166 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp372009vqr; Tue, 13 Jun 2023 00:57:31 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ47QJe5vswbn7y70hSsZI1r6NJLhbpryxepQGVVtKW45WG6lN7qBFamQ8c5taHNPTwy8CYs X-Received: by 2002:a05:6a00:15d6:b0:659:3031:5037 with SMTP id o22-20020a056a0015d600b0065930315037mr14814194pfu.3.1686643051652; Tue, 13 Jun 2023 00:57:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1686643051; cv=pass; d=google.com; s=arc-20160816; b=BXM4aGhRWPNIwUaNN5sKLDUHZFBtg3gtq+CpAa4y9ekTpDTMjx3MTRk5y9OsNQ00J5 lkK59A1y10s/meZy8Xx5WC/nSkAtwFkWPInPug55HtFzqDDY7NFD29CCStE93qO1ChFX utAt9+dIQGsqH7mH3xepGNMTOIX40AjdETCveKNCR+AGbUw7Uk+cpmZKXPzS39aPO1bI DjiwgiAYK21Y43qBsm8E8ttF9y5zwuYS1DyEHdXJnkfktae4G/4acF1nNqlTRTWimIBh XGNfR1mge4MNN5UQLx5sEF4NyujQe2khQ2vjPhPRjMxg/ZhVkI4Mq7KIAsp9g6qXwqbv 0BCQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=H+3RJUylxZ2BDv8qqONAc27GOdD9mtFjjjMhHozz6kY=; b=U/3HcJfJUUq4bpyFeYTDqKUW110fZR3EXCN/Yw5BAJBCzKHorZFl5BMK/inijUdXZI C2HLJS8iJqIzvle2cjlwMTwdpF+e1O9DRaoScgXgJhvoeFbwVfOxxRgnXwZ4Z6bCPbup +DKkx7cxltULiRYNtZM80997aLjkR/mP1s2O4AYfFnsyx/z5dQUDYo0GSL2oTGG7KTGc 9jNOVbjeJTazdS8FcGQDA508kCHElcQIWvi07MG9Ml+tTAwLO6svrmOO4EASL2WNN1Ef V7rIVQ2zdUnkemwDnuDYkeMf2DlDCofSyQmh9MrNS6k/iHMJnV7Wh3e/nZ/wEAKQHeVt 9cLQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=gtNwDCoG; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s19-20020a63af53000000b0052c688e6608si8274586pgo.505.2023.06.13.00.57.18; Tue, 13 Jun 2023 00:57:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=gtNwDCoG; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240535AbjFMHwY (ORCPT + 99 others); Tue, 13 Jun 2023 03:52:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238289AbjFMHwQ (ORCPT ); Tue, 13 Jun 2023 03:52:16 -0400 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2104.outbound.protection.outlook.com [40.107.117.104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A300113E for ; Tue, 13 Jun 2023 00:52:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XK7DAS3Nv5zVL4OO9rWRk15T7CvzbHZ0d523/UEbgN5LVikmrJe8XWbohpt+wXPRgBtMYYa0/upgv6aaMF55fLyAeT0k07AjL6IPpgauVUp91Nzs9GHZ/wqRDgDILAYJyj7uqXSwl1uzZzJmGrOKk7oG2umUowZDRVFjYokC/v+d9IGG6nEdmVhd7aK75FqfPCxxjjcS2FawQ59/AG5vki8YiIEitA/wyuSHoBBsZo1HKtESbMKdCzptBfuBXySqvQOghfpI+/LvCqw287YDH3iv6JxKdhDtd1BCfbBiaaUSJbEYYYnbE6UQyV201NVE05ztaCRcUCwU2BzJrFPHsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=H+3RJUylxZ2BDv8qqONAc27GOdD9mtFjjjMhHozz6kY=; b=aFXnNGy3jqo588j6AxXjQLNpIWO2t175IpKlf1m3Dhw9kg4w6Fgxbd3NXUi8X+Vy2trndRtKUDapZ4kCQaWEfx5LI/3O9n4fWlggdNWJ4zlfg/KGMtUMUwqYhF1AoSOVNjCvaeiq3TweuUSSpvacQ4jvbk2SBUgdUUxpqKzOeRQrdLYdF96P2x06sfrN06bD6YWM0ugg3nwN3Ueu5033AwHSkS0NSlP0YKmNyQ+EWT+3NOHWtJzKB/a1yjba2o2nCYgDZHA8y1NtZn3W9w10Od65KTPS06Dqb7/FfP1Drf2ipJZsZzv8WPwknzmhMmQC2Uu3JqoVaKgeIOXwHqQEmA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=H+3RJUylxZ2BDv8qqONAc27GOdD9mtFjjjMhHozz6kY=; b=gtNwDCoGTj1Pq60w7frQAztr9femWGtf3Vx4pGuoSqAq7y5xRSzRM60m0xLysVjD6mot79RW8A3tqZNZgJ9jWIOFK0hUmVGrdA6ANGvm5jsrWO7lgBudMKGy+XI8g74jU0MFB3CpB50+JB5agz2oWKlgBCklIs6mphIgv4E7ZWynQMGQwZshetQTNCU6RED9hg/TeTqJjX1+qLHUxYLAxr4V4R0ypWLpR6sm/wyniWiZFWEaHs31q/49yPebe7s0fIVS3FH+p5+MxOkKsAhRz4yEhq4AfIqNUDrcvEVh6DoOjUkqENPnDq8JdXdb5RwhNJZPHw3attxYvFZdJ2QnXQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) by SEZPR06MB6572.apcprd06.prod.outlook.com (2603:1096:101:184::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.31; Tue, 13 Jun 2023 07:52:12 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::76d6:4828:7e80:2965]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::76d6:4828:7e80:2965%3]) with mapi id 15.20.6455.039; Tue, 13 Jun 2023 07:52:12 +0000 From: Yangtao Li To: Jaegeuk Kim , Chao Yu Cc: Yangtao Li , linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] f2fs: convert to use sbi directly Date: Tue, 13 Jun 2023 15:51:57 +0800 Message-Id: <20230613075157.41065-2-frank.li@vivo.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230613075157.41065-1-frank.li@vivo.com> References: <20230613075157.41065-1-frank.li@vivo.com> X-ClientProxiedBy: SI1PR02CA0032.apcprd02.prod.outlook.com (2603:1096:4:1f6::12) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SEZPR06MB6572:EE_ X-MS-Office365-Filtering-Correlation-Id: 84ea1f3e-9040-4824-2906-08db6be318d3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3xdOIu/EUGY/IOflE+8i7kqofk6CiIv2OdayXMY9oRHExNDazhPprM4dBLH51vXLPG1C0UBJNIQeTRxKJsJT+TgcObYUGbTk5Yf8vGt0qU6Q2HI5zYK/WWCyUyBQ7LlcsZIM66VZ96f7zCtcCHylqpuw+lM1oVs9J5jvl+GbJ/iqByqj2JomvxIgIcHKzwIddYMtRZM/BIYaPDHMg7jsVN/c2+RSMANRIIpwAgqwoBnc7b6jPQD5Jh6aL9GiOJ4fr8wkLte4jhwUqED15s4PRNpLo5gbCwpBE5CRni0xfpcW7XHLjws4wo1DclWtXyK7d67JdvuCX0rJvKnmEyVNLtUVeRwKMXnqtqd0kNv53OJkMQsRkDERFwxvIomLWBTU5SW5QJPvjEbpvMM6QzHaN60vlXC+fSgSAixfBNAOutsqxxgXOVpbeSV0ovM9SJ5ILOmk0vwLVbyB5/MubI2k5Nkw8SgOvy8kLTnaZ2vcyr9XD9lGkikmhKolqtxdA4nxEKx6c+NUgcqtWwDi5zTs6ZB79A/vgeLRJNWu6e4wNeX2zlz+e6avhll6FiariucUxOQFtmoAd8Si+JtelkHDVCMAYiGAs4sV0gRl1OF1gxGpNB1pq+gsNlHp+U0C3c3E X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR06MB5269.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(396003)(346002)(136003)(366004)(376002)(451199021)(186003)(52116002)(2906002)(6666004)(83380400001)(478600001)(1076003)(36756003)(6486002)(2616005)(38100700002)(86362001)(26005)(6506007)(38350700002)(6512007)(66476007)(66946007)(66556008)(5660300002)(110136005)(8936002)(4326008)(8676002)(41300700001)(316002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ARjeGxjwyEApYyIx5cIGpgHw/hxZrAYrkmqWqNdRJSGtb5aVoaqWUq9EwEIiLyAoH55jBuOL1X2QUoeKqaAcpkUZdpgKu9lo78S9W+dRePzEXU7Fp4TCttkXfKpfuCUjy0Mnoky80OPeyVKPKKFJuLjniIe3qKXoAyntKYGBKY2RXEbORWT3OwVW4hVfWkxG9z/EIG4pjnNaM2xoD+oH0Cfxyb5otDd9R8rqUcN6ETJX1QiZWhRbpTni6k0gQYiAZvHHLzhu5xTyTWa2oPsGdSINQProYIlpC9XIErCsG+S1I2PMJMfznXpK383FrAzuAfIJC7WhiV/36d2ZZatwItxOKiDZV5yCwnMJUg6L8x9rDadrbdyVZxOrbhSwcq4Yy3j55v9rJ52yVuKNB1sPnjXnAvEvNMjUMRtgMmTiBe3eCiL03Cm0P5umvsxjsSvQj2iRnMuxUgFNsX/YvWvR/3RuXTd0EwtGmAkH3eBMxo0einA1PiKIJu5M8T+zGvC/8WJGRhuV0rcdQpJbEeVuf4KzA+VhHpVe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Exchange-CrossTenant-Network-Message-Id: 84ea1f3e-9040-4824-2906-08db6be318d3 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jun 2023 07:52:12.3435 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 00cfRnIVlkJEqlmxArBE3p0LSycnt8O6NpYpkzFsUyIKEPk+kvb1Nt+wEVjEbpElzpf1D0MKO+JydzhbRt8j5w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR06MB6572 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768573424747480889?= X-GMAIL-MSGID: =?utf-8?q?1768573424747480889?= F2FS_I_SB(inode) is redundant. Signed-off-by: Yangtao Li Reviewed-by: Chao Yu --- fs/f2fs/file.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 41e7c2b80f31..f45d05c13ae5 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -3476,7 +3476,7 @@ static int f2fs_release_compress_blocks(struct file *filp, unsigned long arg) int ret; int writecount; - if (!f2fs_sb_has_compression(F2FS_I_SB(inode))) + if (!f2fs_sb_has_compression(sbi)) return -EOPNOTSUPP; if (!f2fs_compressed_file(inode)) @@ -3489,7 +3489,7 @@ static int f2fs_release_compress_blocks(struct file *filp, unsigned long arg) if (ret) return ret; - f2fs_balance_fs(F2FS_I_SB(inode), true); + f2fs_balance_fs(sbi, true); inode_lock(inode); @@ -3646,7 +3646,7 @@ static int f2fs_reserve_compress_blocks(struct file *filp, unsigned long arg) unsigned int reserved_blocks = 0; int ret; - if (!f2fs_sb_has_compression(F2FS_I_SB(inode))) + if (!f2fs_sb_has_compression(sbi)) return -EOPNOTSUPP; if (!f2fs_compressed_file(inode)) @@ -3662,7 +3662,7 @@ static int f2fs_reserve_compress_blocks(struct file *filp, unsigned long arg) if (atomic_read(&F2FS_I(inode)->i_compr_blocks)) goto out; - f2fs_balance_fs(F2FS_I_SB(inode), true); + f2fs_balance_fs(sbi, true); inode_lock(inode); @@ -4056,7 +4056,7 @@ static int f2fs_ioc_decompress_file(struct file *filp) if (!f2fs_compressed_file(inode)) return -EINVAL; - f2fs_balance_fs(F2FS_I_SB(inode), true); + f2fs_balance_fs(sbi, true); file_start_write(filp); inode_lock(inode); @@ -4131,7 +4131,7 @@ static int f2fs_ioc_compress_file(struct file *filp) if (!f2fs_compressed_file(inode)) return -EINVAL; - f2fs_balance_fs(F2FS_I_SB(inode), true); + f2fs_balance_fs(sbi, true); file_start_write(filp); inode_lock(inode);