From patchwork Fri Jan 20 13:40:26 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: 46347 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp204196wrn; Fri, 20 Jan 2023 05:42:37 -0800 (PST) X-Google-Smtp-Source: AMrXdXtBsHQD58ogNDgBLXXuLqmvPd6Rca329k2qr4tSVIgB4HNVPMZ/zkU0rlsicGHF1y5stVPo X-Received: by 2002:a17:907:c314:b0:86e:7896:80d2 with SMTP id tl20-20020a170907c31400b0086e789680d2mr16494776ejc.60.1674222157750; Fri, 20 Jan 2023 05:42:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674222157; cv=pass; d=google.com; s=arc-20160816; b=VyU6IsbyBOW2hUdjoRSMQCJDOLIxskNDRkCmVrYYzTdbaolzipyTj0S9LpNe7XMbot xO5tlXzrog3CpY6Y6aSPsE/HwCNEQuT8V0iM6BwqM27bBuI6yzyOKGk3DZakDWHDKRIK WjIcYN9pA/tnWQh0j6/5GPgVs09P6DgO28ghmfjS+1xyB4eChywjFM701MhQ8bB4GtaR ID8qRf9/g7nlfUFj4uDN7l9+4OEuCTaB6mLYBdzwTLj6Q1GS0EPc3xvEkhucSQh3HXRA qAj+lpmOrDpTCVcgyQFRIOhAodU7sak5Hg+xcAxIwDKbEVTP5JLl1XAZibKC9kgR7qfj iWAw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=vU1ycY7GCmUeqhh20nXHtH1ShX3OQjcr+pnw1xwkW1s=; b=UV+/9B2tiTNqTgTuNgMXWAT6NAKmJsc3/6y9YKVT6wivyADU2eypCLW7Lr74TLvFco dlSO0xGfVYZkTIc/kfFkBzeft1OUayOF+p06hnzzmwYeBx/W9zbpt+WPJZk+jHqLgKQ+ aQkHN9dwkJxPH5DN4urRHI0WvkFnJMARt5NevmrKSjBxD5yDuzqQoaEoTRecU7vcOOKZ veboXZGNA2JanoY8iNUSrpaBDolRkLLjY/f+So1IEmhD+zCPMsFRgbUVt9iGE5u/DM90 VmFfBesEI+DWo+TQ52vmKmh4FmLWUn0jHL6MaUhkVP81/ejsJ+pIdhiSvP1CUAa/40zb DPgQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=b27vdpUF; 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 gb30-20020a170907961e00b0086eb408a888si7443921ejc.131.2023.01.20.05.42.11; Fri, 20 Jan 2023 05:42:37 -0800 (PST) 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=b27vdpUF; 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 S229837AbjATNk6 (ORCPT + 99 others); Fri, 20 Jan 2023 08:40:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229641AbjATNk4 (ORCPT ); Fri, 20 Jan 2023 08:40:56 -0500 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2094.outbound.protection.outlook.com [40.107.117.94]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 880437DFBD for ; Fri, 20 Jan 2023 05:40:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZO2P5MaRaElfGvxtu6946t3E2PFisdEn5ym408QngP9qKXxQHdk1IWXqD2N7KWtnorsXqzmXuThWVIPsB9eeBu7OS0s/f+jPhxsX3VbZqMGymyt2Vmm3bl8meoybg9/KaqCsna2pNIFIt5h4wWZL6+pd2Szi2f9RUun9WQqJ7B683t6oIOPlmQYtJUbWD3qu9kLgW0eNJcIQpOYhXOZNqVgFHREUhLTYgqb6My8nrlUiuIT9+xGd9YoSZNkvz7sUYP4mTs4uO1xyU+b6DszXd+srifafSM4juokX1YvnorrSBfRZXR9LZiqzf8I4XayxdFzD2YQu6PkmCi8b3rq3vQ== 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=vU1ycY7GCmUeqhh20nXHtH1ShX3OQjcr+pnw1xwkW1s=; b=bcLpem5r29M58MEsfZ3cwTmk2vZ8VKN7o0GveGEZJa6jkaiMMV7KNp/E/GaaikLydAt+uLk/Qglk/iGiI4ZJiIJ0+TdyGqOtZuQumjnzXxjFXs6IzKoIHUCo8QVUBC5jtIQoEULEy1Nfqk6sEPZXKpyaKXzMa7i5kHzyf8TsvcqZckWReGpz+4UR90CPZCKPwsBE5Y2wUxyNWkX07X35P3p6JsKJczRH89xU+aMJXAI84KfLYlfWEhnG4WyAl98WnBBZdY+TH1qrQD2fD6HxT/7DyvgiktJJRPwJJRSRg6u5XlWRiTer79ika67bRhGJRuDqeqv8/0Wtmn0rlHHXYQ== 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=vU1ycY7GCmUeqhh20nXHtH1ShX3OQjcr+pnw1xwkW1s=; b=b27vdpUFuztfGG43Fb25p1LuZi+peu6h69Uz+nmsAGUPpjgI4eJtG3yifu4hf7HscR1o3u6CJz9IBWltry8UAMfMNwzQUgKhNKyjwKa+Ci54TANGF8sDGS1hi3s6BRnGjQemklzhRONF5AMvjJW9OYG65/xHyhXI0T8YjuW+tI/e4ieCEiq8c8A0KG5fCEAtrES2mW1gNdZtYNbJwxuWFARBQeEK1PImzX6pmq5R4qdR0vHuPIOFUCq3O7qeyAFcKfJVQV2p88Ek6Rh8vGABM6dJB1OBt0VB3PpDV9+pcIVIzZVkWHJ3oQbKgP+oIPzaqaLPRapyzJ3ktbb2yTyrgw== 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 TY0PR06MB5127.apcprd06.prod.outlook.com (2603:1096:400:1b2::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.5; Fri, 20 Jan 2023 13:40:50 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::3e52:d08c:ecf4:d572]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::3e52:d08c:ecf4:d572%5]) with mapi id 15.20.6002.012; Fri, 20 Jan 2023 13:40:49 +0000 From: Yangtao Li To: jaegeuk@kernel.org, chao@kernel.org Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Yangtao Li Subject: [PATCH 1/4] f2fs: fix to set ipu policy Date: Fri, 20 Jan 2023 21:40:26 +0800 Message-Id: <20230120134029.69200-1-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 X-ClientProxiedBy: SG2PR06CA0234.apcprd06.prod.outlook.com (2603:1096:4:ac::18) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|TY0PR06MB5127:EE_ X-MS-Office365-Filtering-Correlation-Id: cbfd678e-4f62-4000-a676-08dafaebf0ef X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NEPvmUuDh777qxZNYL34+3UhLk6j4CCWydtZhmrmQoDHt7xDY8mK2JNOs3KJnCs53G1waUq/1xX+4w/IevkVi7CSc1V469XVube58PBrG3EzRkCT+SL0oZAgYl4SMr8wPaBbNASQ5eeL926iQX8ILfbAK23FOxIVME0xeJmMRmU8VZ1yoXPA49aWVIvYAK/ReGJ3dHfufap/c7RXcMay1mKXBbiX6EqqxS4Zbm+0qSfRzAcHcJQHIrUsYpwAiqiR7qv/9a9G/hWk1hlwA8i+Jxzt7N8Eapg65yBbIzwiXlKg+7t11qFNeaA6n3EP5v9/yYtJyE9arrA+4zbVZAIzMySx9MKNF1Lz//V1T9rwh35Q7kr8DP80Bj2gw8BkXi2HrwI0aYHrxf6eQkkVo2vdlBnpTteu6x06qyKda4AJluBzp8Kz3yIq10xYqm1tPuGmktf8UDHu93S8rmRFMgzlcyG69FY0KixoiMxoi/xMOlh9NtPvkwHWKL+CRpebV+oxhNoSxKkL2ed5s6gshoCczf2sjNJiLh2C+y6SWuJL2Dn8P8GX7wl6EfHTVuQGYL2CIxGnv+oYHTMtepilDJLWNIFW4AastTt7Oflci3luKjUWqls0suWGxGf7aIcWGgP48Hxi96dLwnbpIQKJiqvf1mtfTlI55x974/722QJvr1kP3x9UY7z3Gt6d8Yt8CrgeoaqhHxI5PZHTLdX1o+8TWA== 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:(13230022)(4636009)(366004)(376002)(346002)(136003)(396003)(39860400002)(451199015)(316002)(38350700002)(6506007)(38100700002)(66556008)(66476007)(66946007)(6666004)(107886003)(2906002)(1076003)(2616005)(4326008)(26005)(52116002)(478600001)(8676002)(8936002)(186003)(6512007)(5660300002)(83380400001)(36756003)(41300700001)(86362001)(6486002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: JuuHN6IpVIvKaQ8SynbOuWqztiKXEDlA6UIHK0sJGCVwfeODxr4arARB4V6Z1nM4Vu9e1VVX9TTXIgdfSeyBrnp7wn2Lvl4nEV3ORkTDguOKgDLB44AjHTKXtRP3To3oHTKkJDertiBRf6cVn+LLPzQc5+RKFfsX9hKyk1hkpXJK3IqbnzQwBDHpr733Ses7/dwEiaAS43PVFLK/mHQlssQFNCMw4AvHjkzNi1Mt8dj4/6TZIWoX+YaKKlkV2l2JwZYLOn8LlFcvgQjhqWL+WWBBlSpdtIRHV4rN25ZfG6pYQ5pCvhQb7G5UdN4SSSpGBGRgHkQfALclz6I8avIffXdrcB0BYFWtHfN+EHOULdpR4MBaMx5l+cJ9HqY2ofZ2MYwZECW443tsxo3S0XLSoKduQdxUdrizi646zCuqUFpjArcUdwyKqtlcY98GZ0fphjyotKCFd0+ZX2Fv23ZVfhIfwNue0tVL+vxbcFHJ6CimrkQfHy5+VsEtvaNzVqxcYcRcVxcukVjGD1FYLRcAKaMWzTI+9vspyOAoQTGyZ9YfmmAKPl5OTfXf6lI6bt1JrkVn0eDXSpJjNJe5+O0AnlpXVH6QDwQXWpNcZkjJ1xrbogHASglL2ucpEwifPbswu5yUfVcFkTjU1zaQGWovJADeXIPVjX9r+nA8fnKIqvJyEirEMIpsk3xN/j8ZAAUmsumO+K7eXltmNQhiN3gnih9dpi8tcNjuv749h/YmxiTR1Six8KtUI/+/wN5fO9sji9jy5ll1niaXeDs3LrJtRHP0enCEnnzfLlT9nLNIIwkCnZvpSA9yk72zNVqSJ4PpU0zJDnzSNS9ODyqe0QyB6xsBvzTWXqZXBwyaDNEmKxXn1EYjl1Iu/7oOmkWfk69fFO4EMKT1En+A4qIAkRlEBs2dZ1F8Ux7o405cYqJAYCLs6kFvaReb3fFWwfASRP3Fv9asSjxtOctcSXsVHW5y5BCllifTxUcQarIPf8ylCwVkMp8849RZ7T5z9jvWjoZ8VXMRBqviE9e0s5j9CnBgHk5yEnrQRI7QSYLBMNXpKjEifLk5ofo6Ht9U0LAC2vj/OI7YLiV46LdbPqnNWpoFyupmkSDak4OAKI42t6uT4QQaTMl2KAWrosCINj2jk54kPjqxnpUgBfNk6V2Up6875245bu/yb3p7/b0uetX0o8h6haaXrgryGm8dM/ax7Spei39ndGAbT5Tijc4lCq6D+tLaJsXvbyn1sQJr8GxQHv+W3yeIdh9jlPJzr8ta3KVa+wRRbrI9hPSX7OuUAHatcg4orpIAiI5quvqWWUwa+AeHBoICSwHjeb02aPPnx3N2XqSPcCTuyZXecYMZgEtEWn2Df4U7BFjQ4tDfzzTIhGpFqkb9v5cv1OB4HfIniNhXGK3bgsgxtOSnQ9XucCBtrLCjrInapUK4w4lACZG92J6GvFdf6id+BQbYxdR9vtg5/sb6Pe6IY/96hWPaNFfpbcT0O/M8PiW/009soLrpG3OeJ5HrxjyMvLOgHUzTSmdSurmwnBfLQJ2z22HQHgI2hRCt5V2mh8DRx6ptWS/JS9ypv2L1E+lRFYTBO9u8Yunm X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: cbfd678e-4f62-4000-a676-08dafaebf0ef X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jan 2023 13:40:49.4729 (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: EmAQt5s2l/zxaNKLCip/goliOWp3dyOpbVMc58XMMT+NjO1dYBgWke/Mc/XPwip+2BFXUpUs/xLxtN9k7CTyBA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY0PR06MB5127 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 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?1755549173241240280?= X-GMAIL-MSGID: =?utf-8?q?1755549173241240280?= For LFS mode, it should update outplace and no need inplace update. When using LFS mode for small-volume devices, IPU will not be used, and the OPU writing method is actually used, but F2FS_IPU_FORCE can be read from the ipu_policy node, which is different from the actual situation. And after remount, ipu should be disabled when convert to lfs mode, let's fix it. commit bdc48fa11e46 ("checkpatch/coding-style: deprecate 80-column warning") increased the limit to 100 columns. BTW modify some unnecessary newlines. Fixes: 84b89e5d943d ("f2fs: add auto tuning for small devices") Signed-off-by: Yangtao Li --- fs/f2fs/segment.h | 2 ++ fs/f2fs/super.c | 20 +++++++++----------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h index ad6a9c19f46a..0b0eb8f03cba 100644 --- a/fs/f2fs/segment.h +++ b/fs/f2fs/segment.h @@ -670,6 +670,8 @@ static inline int utilization(struct f2fs_sb_info *sbi) #define SMALL_VOLUME_SEGMENTS (16 * 512) /* 16GB */ +#define F2FS_IPU_DISABLE 0 + enum { F2FS_IPU_FORCE, F2FS_IPU_SSR, diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index d8a65645ee48..ebc76683f05d 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -2272,6 +2272,9 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data) if (err) goto restore_opts; + if (F2FS_OPTION(sbi).fs_mode == FS_MODE_LFS) + SM_I(sbi)->ipu_policy = F2FS_IPU_DISABLE; + /* * Previous and new state of filesystem is RO, * so skip checking GC and FLUSH_MERGE conditions. @@ -4080,10 +4083,9 @@ static void f2fs_tuning_parameters(struct f2fs_sb_info *sbi) /* adjust parameters according to the volume size */ if (MAIN_SEGS(sbi) <= SMALL_VOLUME_SEGMENTS) { if (f2fs_block_unit_discard(sbi)) - SM_I(sbi)->dcc_info->discard_granularity = - MIN_DISCARD_GRANULARITY; - SM_I(sbi)->ipu_policy = BIT(F2FS_IPU_FORCE) | - BIT(F2FS_IPU_HONOR_OPU_WRITE); + SM_I(sbi)->dcc_info->discard_granularity = MIN_DISCARD_GRANULARITY; + if (F2FS_OPTION(sbi).fs_mode != FS_MODE_LFS) + SM_I(sbi)->ipu_policy = BIT(F2FS_IPU_FORCE) | BIT(F2FS_IPU_HONOR_OPU_WRITE); } sbi->readdir_ra = true; @@ -4310,9 +4312,7 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent) test_opt(sbi, MERGE_CHECKPOINT)) { err = f2fs_start_ckpt_thread(sbi); if (err) { - f2fs_err(sbi, - "Failed to start F2FS issue_checkpoint_thread (%d)", - err); + f2fs_err(sbi, "Failed to start F2FS issue_checkpoint_thread (%d)", err); goto stop_ckpt_thread; } } @@ -4320,14 +4320,12 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent) /* setup f2fs internal modules */ err = f2fs_build_segment_manager(sbi); if (err) { - f2fs_err(sbi, "Failed to initialize F2FS segment manager (%d)", - err); + f2fs_err(sbi, "Failed to initialize F2FS segment manager (%d)", err); goto free_sm; } err = f2fs_build_node_manager(sbi); if (err) { - f2fs_err(sbi, "Failed to initialize F2FS node manager (%d)", - err); + f2fs_err(sbi, "Failed to initialize F2FS node manager (%d)", err); goto free_nm; } From patchwork Fri Jan 20 13:40:27 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: 46346 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp204003wrn; Fri, 20 Jan 2023 05:42:07 -0800 (PST) X-Google-Smtp-Source: AMrXdXsdDRQHbUOVl7AmgETo+V/yNKFUIfWD8yFmx2g7L4oGTU9q24O4hWqrJ0zopF2FPf+H4vLt X-Received: by 2002:a17:907:1b0f:b0:86b:93ea:3366 with SMTP id mp15-20020a1709071b0f00b0086b93ea3366mr22795679ejc.3.1674222126807; Fri, 20 Jan 2023 05:42:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674222126; cv=pass; d=google.com; s=arc-20160816; b=dXGcpnBGCjF6o+4CggocepZb5IOYLuqaXIKnaJayLSHobcEUMcvFxq8gkevEBdL0mc ofqGugkUWn6/W6s4stoiEIZHj9KOglLGcD8RPzRc3aQUhguXj8mYRdrMWPINeMBUH9Bh 69FijLEsMAkN7ITnPu9Vs/Y5DwPRsmkEKqZIRqimG99kSnZ6TQeAaWz77Xc3mOD1t5GF 17Fc0VdqtorQ86cH6sPTtbMLnCXHKr2yWfzFKoQC3oAV6PJkqn8TWDz0wWNgshkjwnH7 nnlWj7up85yjQnYCnB9wVBS3Jd4IpX/1uoF7bJQ12k6WL+a2eDap6tIGfh8IyaYht9JY ibuQ== 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=smT8vJ0bT+nzUyUQ1bOT7yb2PHCpctRrRzjc0vu+iEQ=; b=neWWE5OY65mUpa791dDykTRnATiG+Knlagwb5bwTf1N3s61A28q2UkQ1BI1MEeg1YX Ft0i/wTu5JMNKNjiqMi547+NRzJZKVrTfqxsVTEQsqkqNr5iYt1qS9/0PAmFjON31NQd ZnBjB3jZZiFQ6XW5YOfBP4UH+/GlZbnZQ+G8G9NnrHZ6Rm8+RHhqnQ9lNcs4M2YXv5pP sQ10WefKlT3rO50jxn2yZLKw0Q9sjs8kQyq1Gx095CvK3aw17ddKCKJHy5uxTppdnuRL j7f/Gqk7s5fxk3Z7mRQbjRBmB5+BUmkzdO7Vy0TZZvGviukGMSEt2oFbIrodMcZLHv8O M/8Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=ejhVpBpW; 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 ho19-20020a1709070e9300b00872236c2730si15815321ejc.216.2023.01.20.05.41.42; Fri, 20 Jan 2023 05:42:06 -0800 (PST) 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=ejhVpBpW; 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 S229770AbjATNk5 (ORCPT + 99 others); Fri, 20 Jan 2023 08:40:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229539AbjATNkz (ORCPT ); Fri, 20 Jan 2023 08:40:55 -0500 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2094.outbound.protection.outlook.com [40.107.117.94]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63D8F7AF26 for ; Fri, 20 Jan 2023 05:40:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JW+Y0WiZRgva8ciRyQwo44pSbllhhDtNS8MNMd/kayB+KlLsuBZy3Y0aVbLPw2Rzc6cZyZKDfrKfJxNaIoQeSSxiLMQ0We6K86Iq44ofH4DkWmkE8VWbJeMBJ48b7Ue6o0e+m0FWfhHLdwkais8ln04d5XkLshTSPCUTAvkvAUvGgjOMRR+sJUM4jDe9vNIvFbYJ3N4BCNYFKP3HJHt+n59gVWCZVMFOQjyGTSD5rwGHRykooUjjY9E87Dypoarno3YERyZgiA4KlQRvOXCIR1j6GpCLMcMDkl2mXz1AhA9IWtLT9UVR4lRNKaBUWS8ztNhr3fdlM7eoBpD9XYct3A== 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=smT8vJ0bT+nzUyUQ1bOT7yb2PHCpctRrRzjc0vu+iEQ=; b=iJpKx0OIZ93V0ejwWC0UFWRU96l+vec83GYWcIFOf5VSovEoItRNIHOnUhnE/Vz1dmzZbkneCU/ETRxzn4aZTQiPceg0kHvYcs1dxlP6EmVTzuLTYhkIfIxYDNKzbtZZgTGJQasGxROjChT1CDnMwE8SapdyNJdrYLTsRUO5DqUMMumBaozwhJjAvdcgV1gdxG4KnZAe+WJZIFwJQuiA94W6EJIFTzWgAeFJnBqtdyyhqFQq95QML6oKHHRnxamkTTRz68PZFD9fuqBSWL454K/6vk3DzIB0QTknOo71hhAck/Fj1TgH+ro5pDsddQWG8a6OXfHCKBn2Wvjs13R9EQ== 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=smT8vJ0bT+nzUyUQ1bOT7yb2PHCpctRrRzjc0vu+iEQ=; b=ejhVpBpWvNtzRDNkdReCZR/A9BmakOpS1S51gEieaYNiJ+ms9pzNKJHDbPf4jD0x3H65QQZnJ3fwxsZuoAS7rCInDhoE6r0b0Z3gCv8/FFNKUb3qjUaAw+V7TS0a7bo+cxFCe+ESu7fKjg3X0X7AQgXtpdh8QmytZAgkrfcpMQaJ+RYUSgppPmuorm9VvZI7cqA619LZF5UNk5UOkpWrdIDHSSiU1N/9/pY3pn0JTm2ZLbZY06ZiY0YjWFQZhpN8ZdpuI3u2J8qNmgjcfs6pC5HgUWOMH8lK2xLxc9/aXBJKJ3tKAtDcguMrjgHtoCNTVzSZNz5a63Lm2vkzkDfoTw== 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 TY0PR06MB5127.apcprd06.prod.outlook.com (2603:1096:400:1b2::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.5; Fri, 20 Jan 2023 13:40:52 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::3e52:d08c:ecf4:d572]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::3e52:d08c:ecf4:d572%5]) with mapi id 15.20.6002.012; Fri, 20 Jan 2023 13:40:52 +0000 From: Yangtao Li To: jaegeuk@kernel.org, chao@kernel.org Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Yangtao Li Subject: [PATCH 2/4] f2fs: add sanity check for ipu_policy Date: Fri, 20 Jan 2023 21:40:27 +0800 Message-Id: <20230120134029.69200-2-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230120134029.69200-1-frank.li@vivo.com> References: <20230120134029.69200-1-frank.li@vivo.com> X-ClientProxiedBy: SG2PR06CA0234.apcprd06.prod.outlook.com (2603:1096:4:ac::18) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|TY0PR06MB5127:EE_ X-MS-Office365-Filtering-Correlation-Id: 331be740-6006-4157-8302-08dafaebf280 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 34U/fznAnjtyyvG1NMu1QjcawJqFnCJ96IHvP8PuvK0xMO2A2OoPUcMafsDthJOz4hfJYK0TSHhYj+yVgDTsyLnhz9ZbP/wrfRe+M26IpzciID9Kvk2nyFyIYg/QUcC/qbyT8m9rqPmg+idL4hcdq6pKK05LFXNT6IO5GdqWjoIDTGuW8wHtLhAnhwLMOqZ+m/Nb93jn9T8q56AGgfL4r8a+Wc2ETB9I5vbMl0u35rJgvKK7o6EXW/qAWmYfjWNhWOyE721ZRLb97dI3ChmRejic+lfQdze9FIJz62FAL6eQgr/K2bQPZPH2x5LlBoUFXIj7Jsd9RvFIWRnQyapHtZFMnZSUz9fhLdQdeFykUf10OU3yE+Z1o78df4o7Pas6XMvskGApb8eZm+T6eSIIe9uesXqhu3WqULwQrquOj4CTuHZOoGz/xDkxuh2EVsEfCVsH71nnYnPS1EGNKi+p43Gne6CeqZ/eKq1H5p1HJOe8tMJl8sQLQdtoY4uqJPh1w/P3lGr4cJ7XnH4r9ImN+li0m3sNzLh++mTuDgK/fHZz0pTDh8ViSFbJlstSjJbImETvKTBjPnv4FSgr2n1aAEaDMrWZfHK8dFb215OXoIpmOk0d9XkNZYmGE1Rc/hb6Dkl8OivV/cmDY5b66RZv7v/SKKvjWziFbWOdsZOttL0h9ly85GH9I9jXHJTVbkqM 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:(13230022)(4636009)(366004)(376002)(346002)(136003)(396003)(39860400002)(451199015)(316002)(38350700002)(6506007)(38100700002)(66556008)(66476007)(66946007)(6666004)(107886003)(2906002)(1076003)(2616005)(4326008)(26005)(52116002)(478600001)(8676002)(8936002)(186003)(6512007)(5660300002)(83380400001)(36756003)(41300700001)(86362001)(6486002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: RWGgjf44CD8q8i5vfgPV1OwvM65zlZbCu67NZlB8eK+JfP7MRPJp0o2j0gC0CiHoe9s5Vo4wxWzE5tC/JC6cPNE15F0uKd3vNYW05WMIA6kMdeXZ/+OsoPSfaFFFtLVeVKizPanLrWnJyhw1zMgwtV7PloriUP45uJhZobwzn7FTp9P1jebuS1a4hw88JXKUWznWHQ0ogVf6AWPb3Rk7Jv+m21qqw/H1QBW5D6maSnw9mjG+zZS/DSXhzom6BZHU/HkZonm0c+8nypUxMjT4oLnMxncnfN0rDvmxfCxpfc/gYe7WyH5XmLrXWRVzFOcGlfcfN5uSbjk89wb0GKrEpDN1mJAaux3Ef8MZ8H6/4gw3Pv7sb7H8U9hJFB9CZ88hXoyblLX266wMNSxNa4u+B6J95AVgEJlgYQHo0EAMa2xEi4VRd1mtc1CvgsoqLswOKVkWsNj4TiV4QVlt9X4u5dI+qUyuTio8Dfxm0UJaa+Q8SBQLDYa7VJGae9iLOks11EVGSnPjJRCVab67FNDq1WNfzmqM7jBm9c2ZeDui9wE9CkBD0pFpbIc+i4RuQmCeL77ghH3fL0Kgk0SMn2oIItx3Gn+sye3rk5UAW0loYv75/fbg+zYUlHsEv7JndWlTY0939UKO3GrDYlbxdS1KA0GXS19HP0Cts1aYYuaPOcEUA3p9058Uu2wRZYCpN9pRuJ1uHl1/SAoHaxks9slpZSM68tfvJcXQLyVg1dQJksXABcMgT+ioeWhrJMYw0lXmObB01LTCa8J3vXO9YMDgwKr0MNJoQa33kpTQ4t4vENovVuoY80atoOqKi/vGemk8c4TQYeXT9fAe3C/x5kiz70mB4Sknb5AdYm0w8TLeM1FJhjmdWdom1G5wbLrTA85ZlL/7vJ+fobZXUelHWjgql5k+rbo5cuNbumXNrcEujikcHWPr57QGwsRYmkXKNg8YPS+i/F0v8mexYD76KT6yBVbEI19cvEZ8928i/NW9TPfSWTCT+wirMaoY482a+LEXeXiY8AIHydSWfIqiOUA2K1fSmayAXzkKS5SG4Ty62SfChstv4C/iMnFoGvW1+18fEug8OGPFLWkXlN9/cwUPw5V1PDftI/eSmSmBd7PVbCjjupuT4uTKg4iYUUdyqY4U8LgRZdsGVXhVFeCKF4L54MyyzAUM6bv/63nQKOODzOMYYdBhNOf/7pFkFo/1BXcE9yw5NAC3GjUWpjuxyzHnMR7nnAinw8H2WW5lZI1hT8lEBvQAT4fTe53eCftq3OFBxVmzh6Nt1t6xzxvlQlgpYP1lV2I1xaa45xMGEE3armhzKRMO65Y6fksc6/98vdjMvNo4ZSWUL+9+obxGdsANcv3Y0y1oVOlvYuJoYt37M77GnPgp8iQfS9iQ+rxFExwoaOl5ceyf+j2PJbCOdwZVmXXS09ajcxap7A/AKbx7OqsyzxU0AJ84VO+hyydkiINLYvMyTQ4n6piKu0RiUvM89HBXHArrrrjHnTiROk68rtgeLWjdNCPEphw84OFnvF7Mb1BQ4+Ofw/Fl48JT2vNK1op+wSxTcKSx9RI7G31yI0mTZ85glB8XfBd2cwFr1J1h X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 331be740-6006-4157-8302-08dafaebf280 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jan 2023 13:40:52.0206 (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: HnugIPF/2l2ForYzuwyAbeFYkPA5WRhDBlCOnGVqKw/Fh4EuligokRvTZT7z093Jgv89fF/l/CEg7LhRWo0Tdw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY0PR06MB5127 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 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?1755549140692036161?= X-GMAIL-MSGID: =?utf-8?q?1755549140692036161?= Disallow the value set beyond the range, and disallow to change the value in lfs mode. BTW, convert open code to use BIT(). Signed-off-by: Yangtao Li --- fs/f2fs/segment.h | 1 + fs/f2fs/sysfs.c | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h index 0b0eb8f03cba..d73e988566a5 100644 --- a/fs/f2fs/segment.h +++ b/fs/f2fs/segment.h @@ -681,6 +681,7 @@ enum { F2FS_IPU_ASYNC, F2FS_IPU_NOCACHE, F2FS_IPU_HONOR_OPU_WRITE, + F2FS_IPU_MAX, }; #define F2FS_IPU_POLICY(name) \ diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c index bdc761f36310..576e6416ffb9 100644 --- a/fs/f2fs/sysfs.c +++ b/fs/f2fs/sysfs.c @@ -452,7 +452,7 @@ static ssize_t __sbi_store(struct f2fs_attr *a, if (ret < 0) return ret; #ifdef CONFIG_F2FS_FAULT_INJECTION - if (a->struct_type == FAULT_INFO_TYPE && t >= (1 << FAULT_MAX)) + if (a->struct_type == FAULT_INFO_TYPE && t >= BIT(FAULT_MAX)) return -EINVAL; if (a->struct_type == FAULT_INFO_RATE && t >= UINT_MAX) return -EINVAL; @@ -706,6 +706,15 @@ static ssize_t __sbi_store(struct f2fs_attr *a, return count; } + if (!strcmp(a->attr.name, "ipu_policy")) { + if (F2FS_OPTION(sbi).fs_mode == FS_MODE_LFS) + return -EINVAL; + if (t >= BIT(F2FS_IPU_MAX)) + return -EINVAL; + SM_I(sbi)->ipu_policy = (unsigned int)t; + return count; + } + *ui = (unsigned int)t; return count; From patchwork Fri Jan 20 13:40:28 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: 46348 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp205119wrn; Fri, 20 Jan 2023 05:44:34 -0800 (PST) X-Google-Smtp-Source: AMrXdXtcwDVMuJOn03zkg/epnaQjEmryQhwzWjUZr7rSxCrcy736M2BZV2r1J1DUUlQ91D+K6KBo X-Received: by 2002:a05:6402:2907:b0:49e:498c:5e34 with SMTP id ee7-20020a056402290700b0049e498c5e34mr10201854edb.31.1674222274400; Fri, 20 Jan 2023 05:44:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674222274; cv=pass; d=google.com; s=arc-20160816; b=ybPYC5ZG0cgiyqCfa1y14ajBMdUPqikVs3EDQtMUucHU7Asz/7lFUaVQftL7qvhWDf jiDZL6aKBZjnczcukjlgS9NKpzTEnv6/0MgMPjgg2tutMTZxpOHSwybSNjN4hc5YZDUv dkt1qMv4FKxnbOXhJCPfWcqW8tLYhi+YLmPpo2+sn5Big1Pz/SnzKSb7EA43vvIU88Rk l1vhCrfWxOxdcBS0268kwisV0PicLfEZQGeT9RIExBl6h+aMYWNwRq6bQLavfuqYBvP8 3Bu16EeZCahq4LsYfrI8+ISi0dfIC79So92FuCSG0HcTh5d+qMapxZc573uM6GxyrMAV Zx9Q== 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=U5emMNXcn5nO4RQsCH/yOtGcWvmEc1t6pdeO4lYcqJU=; b=MFCjJfjp1sUxRa6UZmtj4oIaqgGTUMudNkRP0yTeCrKBOqVaS2sgrF+tENxbYmEs4/ /n0CjTemlYKzhkKCA1i6NwvnZzdzlGzOHttWkBiU6FQH10r2ocOHbozZE6u9xeeZTlDL Ppdk15noUYKU98poxpFnZgZiHTPdZ0VppYEIho9pB0fD7EJ51Y9MQ60t1qijNR0bZtaF WxI5ooxLwivqfWSC3OzztVUPRiCOfG12MVHkpEE99M76fnOeHXZTH0qAFvV1KpJVUtRo LSbB8K630wp4VaxiQgGCMaYh8eG3ty2F5r9zZZmdylsYLLnmbpSD2GejKzZwf5aBi8zl hOPg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=bihMwYZz; 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 z11-20020a05640240cb00b0049d3f37b767si23808979edb.268.2023.01.20.05.44.10; Fri, 20 Jan 2023 05:44:34 -0800 (PST) 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=bihMwYZz; 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 S230032AbjATNlB (ORCPT + 99 others); Fri, 20 Jan 2023 08:41:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229928AbjATNk5 (ORCPT ); Fri, 20 Jan 2023 08:40:57 -0500 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2094.outbound.protection.outlook.com [40.107.117.94]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95E967AF26 for ; Fri, 20 Jan 2023 05:40:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mTxvMjxd5b+5u790FetDa3dUnWNuSrf5l9xYK3q+KM7EgYjJWgEWmrBoIJHm6jDJALKiScDpYNvV5rDuwZYPhctu8MJfHASa/hSxg0uc2WweA7+XMWiu5rzqbyZJK/fH89/dPkJBukPg4by9idMsSYXr/ZOiuVg/fLYNRDste9pQcgMwinVGHHJVO4NwCmXDZTUmb6cVOvtvLd00zi0tipJl5QJR5TN8UPt4bVfySQ0EWratghuVo+cEzta5WJHugFLcHQKBKlzhPE3PbJgTegTB7+Vhf9Mmz/kn1HPD9uGTt9WZ0MKfluNzoMVLAE5AtL5WWcz7mibF85exYEUcOQ== 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=U5emMNXcn5nO4RQsCH/yOtGcWvmEc1t6pdeO4lYcqJU=; b=j1kYe+X9ec9rDig3PUT11XGugEdHBYLDPCS0ZSgePaze7y7iBhr3Qn631QeuxCI8JSWlXwnONGo/k8ZjUHM5IySshXkkWQoRrpSkSXXwXGKf01GJGallfH6cErGD2IOuTvmkeQZJSjfw5YiImTpVL3MSoUvWSqR9OfC0JVOaWeNopVsnW4bj2StO+5LRv6w74if2r+L82lHgTHd5UJhN1ULC045g5gLM0aLYQsc0iJlMaz2sFYSVli7+2LPqD7OVPXSDRpklDW5Jn4CrGv2vacxkb5dB4Q3MxwTI2QNx3xsoE9JLSNLbhtPckZfWKahkcuCcJ8II5u9hMLgpBjynmw== 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=U5emMNXcn5nO4RQsCH/yOtGcWvmEc1t6pdeO4lYcqJU=; b=bihMwYZzrX51oJjGWlC3xoL958U387HIYZUxj23vElANOwmqEPuMJlAzjKIRPD2Ep1NHwgxaFep7ssxC+eE1v6a9+FU4lECkGJ+0K0u9GDF6UBGdXbX0of0SW5id4v6itF45LTDog51bF0oZGjLAYkKFwK4u64Re6d6v00Oz9R0M4ZNES+1sT+z4w7GZhBgTjANmy1yZ+5ogYpL+WXuL1la80CRY0V/8FGw+eg/DH6aeiqYEoguffqiEOo7DAv0XLTKb6bJm/TT9RXGSPtvWHisU9SN59SV2J92im9yB64HOZApfjMKfOA1dVI+hRljUMywKvLiSlDMngpcariQpPA== 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 TY0PR06MB5127.apcprd06.prod.outlook.com (2603:1096:400:1b2::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.5; Fri, 20 Jan 2023 13:40:54 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::3e52:d08c:ecf4:d572]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::3e52:d08c:ecf4:d572%5]) with mapi id 15.20.6002.012; Fri, 20 Jan 2023 13:40:54 +0000 From: Yangtao Li To: jaegeuk@kernel.org, chao@kernel.org Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Yangtao Li Subject: [PATCH 3/4] f2fs: introduce ipu_mode sysfs node Date: Fri, 20 Jan 2023 21:40:28 +0800 Message-Id: <20230120134029.69200-3-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230120134029.69200-1-frank.li@vivo.com> References: <20230120134029.69200-1-frank.li@vivo.com> X-ClientProxiedBy: SG2PR06CA0234.apcprd06.prod.outlook.com (2603:1096:4:ac::18) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|TY0PR06MB5127:EE_ X-MS-Office365-Filtering-Correlation-Id: a6cddac8-d20c-43df-47ca-08dafaebf3b6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8MXvqp9MScye/SjJZRoqqU7y+AWyeMm4p7BaFHPSH0E5dweOXOXzADDc6jtSIZijr2Qk4Iw3jP4DaN5vM64vWj1dggPB49xVclPmGB/sZ4CFCDkXdRXdHEn3j/jk2PZ/Var18u2Q4xV1qPwNa8iSBw9x0F9wnnjJxoeCNKtbge8yUrib7FKvPPnRairn4m3KipCTUiKK84xB2K8olk0as9Jxibm2w/5uSOV5XeB2Wmxs0Hls2Bt1WZjZBKIqvZ8PdVF+6S/6qjbHVmVeqy+kgfcd0sXo1yn6tAfmEz4eyH4K1pgotjlZhPnskzAaHxBl/uINCiFEcciPHkC2qCj4qt+rJCBCYvLC18eCOO65zghGMfRgbZoJyh6OxhPjbF+dZEcf4pUjZEIH2VN0JJonf77MtCooaDlRjhaVRss8vwuIUAhCFv9rldcHio641/uD3DKQ5QFieRlxdeVWLOprnKpLEi5m54LpxSgDj7+EVTP+vF57y85+LT36wsQlHCUQJiLjukr5ey3WQvf9dSDfEjtp82MiprlYfOiu7I4MV4ba/6eRTZkITfUNV+bxLcXhpOf47/rZ2E0xzDD4IU8UGYY2JlLgTzLKe6iJlN91IkJfkxeQ8mj0gXO1SJUqueTv0UNmXSPKwNr27+f3QaqOsygR6nHgs2MVNVEB88gymbXgFd+FjqBIC6twrbOf7cVhux3huNogiyD+L2ouhkIsIQ== 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:(13230022)(4636009)(366004)(376002)(346002)(136003)(396003)(39860400002)(451199015)(19627235002)(316002)(38350700002)(6506007)(38100700002)(66556008)(66476007)(66946007)(6666004)(107886003)(2906002)(1076003)(2616005)(4326008)(26005)(52116002)(478600001)(8676002)(8936002)(186003)(6512007)(5660300002)(83380400001)(36756003)(41300700001)(86362001)(6486002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: wPjxsoFdVHRgNrUK6yA0oS9z0Y9VTXQn4ObcUtAM1f6iXb0kyAChyQTfSnFcIqj8xcZLHmblvuLLfrjmDYgB74KplaA3iFbNtuChAnfbN3Ig8Wg9yoDsw9A2pAVrVp6uq7EuUiAfDig5zOIzmrZV7cddY42LxgyHTpzazRSpYUWWjqfvAvDg+fafHnft+886lHg9aoyd5nCtRIqC8+Lf7o9DlvR6zh1+5nBp6RrU/LhN6iT2+/G/0DpjQ4fBail9q7g+caxtjsTmVDs7H+v4Fh+8sJZc4JATS5OyNf7Yi9w+YLwu416g9NFsNbaVNWFXZjeEKxCeWhWSlqEmiBGWy5hHipiiQIFxQ+Ay5Bm/C45lePEZcYNVOQT/CgmrLU19i3hQAiPO/PNU2E0u5cicaDtGrd14VzokxrgkiLTsGy7AqNyXH2q2ffZV2eQTr+byvctF1jRmKflLB7TWbhs3WQPrRV7HMC6T43dZTkOZSRI+BiON8Cnjy6cv9JmSNcJ8IbfSVkf5f5KbsTaFwUt9+xJ4DL22chhRbwiLprWh33MEYdQGlX/895EJ16f/V17PxoETCtubjfBa7j2VpYfaijjIWtEQGUz29jtFgvLbCs5bsumrpAbzYZpf1oJdrpPsZup2Lb8YHxb5ToVdIx7EV8J7PM1sr7OMXo4mI7WgDu8yGDGplw4u7vK9cZ4SXn3uVUHk0NWv8qqZg6p+fLc6D+jFtYERlN7z0cRqhDiDklENmdoBoX1mzbQphtx9rDMfHj6RuHpTLMmy767iboBHLBtRtrH9CdgxXEMbJuDWUwiIfaHORBcQcibthCVUe9Yn9G1uBb8Lp3XylNQeTwEdsoQSf5hf4EOueUp77X2D9MGcRyn3hnemBgErf4tzvc8lY0rJblMWH4p9wcQ2qflobX4c4OoxcEhtudQKSWmfOZWCggba0UTCs/2KYtFqyNW05I6AF00RsFzN4eU+uYULRhZ555mt3fIopNqURkPi7RLaUhNnn+WwKxJdm74C1hO/y5ZNVLLnoBrJMHA8b5bqVkUyKNzNOD5K27yXX+HFKIH4geSi5tTvyJYieaDeMuW3Yp5UeJwXiVglaTnqpgWtvfoVY+zxZFfzYy1L0i242LdaTKQ0+vBHoSm3OAjTCK8hepafrUkYcLdd7M/utaJNGwaDwON+eG/T48OUgwKUPyTpQsW/IUZtyTevzlItm1OrP5F1G3OA0wixzCVVzAjJQ7Ii+SPkLMbnOt+zlv7vvZVgHCX7FgYxUUFBsR4VlpDRfe97ksQ1yjay+h2gxxMzRRKPczawtD+irkB9XMw3OU2e8DxMBMR16GlpVGw6hLjiEvqaHYKYUxkhZxxDNRnqd2djuppmZp8llcPtD+62m504L9QcexQllT38YRUbCTScutxJv8LMDVCPpcbsytVBKRkwHl5u+Uu+7yO6iwNtks/ApGIUkzsZPL2JWRssFDCymrjaTke63AcpqNVlk9zhTSg0cziR03yFdbNoDPEgnQQ8dzUB8E6tTb47c3utwEv/ROj18Sxbd6HjsA5ppQjWGtnowSgmJUghS+nNsi/O/jEvhJ7BECHxNFzPEO7AfX2F X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: a6cddac8-d20c-43df-47ca-08dafaebf3b6 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jan 2023 13:40:54.0508 (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: qn4qQ5dbZu7dhmcjDaXwgKhV7cuENZEZ/MZu6++5kWSnKjdqvuyS96dXo6/g0XACjc5t3ZMc2cYhzN21kLVlkg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY0PR06MB5127 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 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?1755549295731230369?= X-GMAIL-MSGID: =?utf-8?q?1755549295731230369?= Add a ipu_mode sysfs node to show the current ipu policy as a string. Since we use ipu_policy as a bitmap, and the bitmap API parameter is unsigned long type data, let's change ipu_policy to unsigned long type. Signed-off-by: Yangtao Li --- Documentation/ABI/testing/sysfs-fs-f2fs | 6 ++++++ fs/f2fs/f2fs.h | 4 ++-- fs/f2fs/segment.h | 1 + fs/f2fs/sysfs.c | 26 +++++++++++++++++++++++++ 4 files changed, 35 insertions(+), 2 deletions(-) diff --git a/Documentation/ABI/testing/sysfs-fs-f2fs b/Documentation/ABI/testing/sysfs-fs-f2fs index 0f17adc80488..64b15a28fe30 100644 --- a/Documentation/ABI/testing/sysfs-fs-f2fs +++ b/Documentation/ABI/testing/sysfs-fs-f2fs @@ -722,3 +722,9 @@ What: /sys/fs/f2fs//last_age_weight Date: January 2023 Contact: "Ping Xiong" Description: When DATA SEPARATION is on, it controls the weight of last data block age. + +What: /sys/fs/f2fs//ipu_mode +Date: January 2023 +Contact: "Yangtao Li" +Description: Show the current ipu policy as a string. + This is a read-only entry. diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 9edad9ccc2cd..b221a3bdb3fe 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -1071,7 +1071,7 @@ struct f2fs_sm_info { struct list_head sit_entry_set; /* sit entry set list */ - unsigned int ipu_policy; /* in-place-update policy */ + unsigned long ipu_policy; /* in-place-update policy */ unsigned int min_ipu_util; /* in-place-update threshold */ unsigned int min_fsync_blocks; /* threshold for fsync */ unsigned int min_seq_blocks; /* threshold for sequential blocks */ @@ -1323,7 +1323,7 @@ enum { MAX_TIME, }; -/* Note that you need to keep synchronization with this gc_mode_names array */ +/* Modification on enum should be synchronized with gc_mode_names array */ enum { GC_NORMAL, GC_IDLE_CB, diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h index d73e988566a5..50c63155ad56 100644 --- a/fs/f2fs/segment.h +++ b/fs/f2fs/segment.h @@ -672,6 +672,7 @@ static inline int utilization(struct f2fs_sb_info *sbi) #define F2FS_IPU_DISABLE 0 +/* Modification on enum should be synchronized with ipu_mode_names array */ enum { F2FS_IPU_FORCE, F2FS_IPU_SSR, diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c index 576e6416ffb9..aaf5d8650518 100644 --- a/fs/f2fs/sysfs.c +++ b/fs/f2fs/sysfs.c @@ -51,6 +51,17 @@ static const char *gc_mode_names[MAX_GC_MODE] = { "GC_URGENT_MID" }; +static const char *ipu_mode_names[F2FS_IPU_MAX] = { + "FORCE", + "SSR", + "UTIL", + "SSR_UTIL", + "FSYNC", + "ASYNC", + "NOCACHE", + "HONOR_OPU_WRITE", +}; + struct f2fs_attr { struct attribute attr; ssize_t (*show)(struct f2fs_attr *a, struct f2fs_sb_info *sbi, char *buf); @@ -149,6 +160,19 @@ static ssize_t gc_mode_show(struct f2fs_attr *a, return sysfs_emit(buf, "%s\n", gc_mode_names[sbi->gc_mode]); } +static ssize_t ipu_mode_show(struct f2fs_attr *a, + struct f2fs_sb_info *sbi, char *buf) +{ + int len = 0, i = 0; + + if (SM_I(sbi)->ipu_policy == F2FS_IPU_DISABLE) + return sysfs_emit(buf, "DISABLE\n"); + + for_each_set_bit(i, &SM_I(sbi)->ipu_policy, F2FS_IPU_MAX) + len += scnprintf(buf + len, PAGE_SIZE - len, "%s\n", ipu_mode_names[i]); + return len; +} + static ssize_t features_show(struct f2fs_attr *a, struct f2fs_sb_info *sbi, char *buf) { @@ -907,6 +931,7 @@ F2FS_GENERAL_RO_ATTR(mounted_time_sec); F2FS_GENERAL_RO_ATTR(main_blkaddr); F2FS_GENERAL_RO_ATTR(pending_discard); F2FS_GENERAL_RO_ATTR(gc_mode); +F2FS_GENERAL_RO_ATTR(ipu_mode); #ifdef CONFIG_F2FS_STAT_FS F2FS_STAT_ATTR(STAT_INFO, f2fs_stat_info, cp_foreground_calls, cp_count); F2FS_STAT_ATTR(STAT_INFO, f2fs_stat_info, cp_background_calls, bg_cp_count); @@ -997,6 +1022,7 @@ static struct attribute *f2fs_attrs[] = { ATTR_LIST(max_ordered_discard), ATTR_LIST(pending_discard), ATTR_LIST(gc_mode), + ATTR_LIST(ipu_mode), ATTR_LIST(ipu_policy), ATTR_LIST(min_ipu_util), ATTR_LIST(min_fsync_blocks), From patchwork Fri Jan 20 13:40:29 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: 46349 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp205140wrn; Fri, 20 Jan 2023 05:44:38 -0800 (PST) X-Google-Smtp-Source: AMrXdXsg8gZPZhtUQJmiKJC1ccuhG9aoQ8zwICRDovWikbj4YWmMR2oZhDRVQtSnhtmjb8UTF3Nl X-Received: by 2002:a05:6402:2054:b0:496:b479:e437 with SMTP id bc20-20020a056402205400b00496b479e437mr14438636edb.27.1674222277988; Fri, 20 Jan 2023 05:44:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674222277; cv=pass; d=google.com; s=arc-20160816; b=NNATt+Z8c92q2DFhE9lR8TnXkNG77JNyz2jBsafVrWzPWHyy05wo/vnf/61BQRktLb rJ5rvJkDzzYpYIbO1WRiOrhiB6RWzZtkf0kWYhSQrJkwdbFs95NGkMQfYBTJZKVANSsY e303wrcjadXB0+tOcg0ZSJKObtaY4iXWVLH3g5sI1GkRpWOMzDwKGLH+CWDu9iLvBD2V PD5wEU8g4mhpmmi5b5YRRcU/5K2rEQ0SLpbRvz/vuOhfUalAM432bDEr/iLEoKoU6rDT hJb1qE1Mw7vCCRtgdZE3sgO9PVsoJ5Xpf2yKd4gs4pLHejSv2OQNn25f2h6h9KmYUAa6 QN8Q== 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=mLOdM8LVsxaz86Ehuw6AfCW5Tg8yFGJpSkcggspwKKM=; b=SmzDEblbZWQ5ORoMmw0QKWGvVg6Zvuk22XOHAa7SuuhfeNqdBM4ZTfpySag9TO5hwl 0hrwXeqc+mggCUF/B2m57hQ2XTkLAwhd2BkVtGYhqv4/NgPeZwzQ5KX34oWhxgkbvqqf Hnw6oFcg1n0LHrSZOsN37V17S2qNJMoNgc72kcrzVjtqW61MgBaxZcDBkwkHGo4szxGb 3rjLFaWgfjYNsQ8F+6D56ipgPoPHSsf1iALVPtXHTPI0OtPLt2+EyUEvVVl1l2XpgHYY MKATnJ3mJNnKtAKqtXSV7P/tAEtkzcMICQhBqabQ+4sFVF9/MwZvhKafkIv3EjkR6aoc GZxw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b="kS4Jz2b/"; 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 et12-20020a056402378c00b0049e24a14a25si12562096edb.250.2023.01.20.05.44.13; Fri, 20 Jan 2023 05:44:37 -0800 (PST) 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="kS4Jz2b/"; 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 S230037AbjATNlE (ORCPT + 99 others); Fri, 20 Jan 2023 08:41:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229988AbjATNk7 (ORCPT ); Fri, 20 Jan 2023 08:40:59 -0500 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2094.outbound.protection.outlook.com [40.107.117.94]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6AE2B1EFC for ; Fri, 20 Jan 2023 05:40:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mWygaqxgitnd8dn2c+qGk6UjnUe/RnweViC29rKSi1/7KP2z05Min7QOxMiU3J5lF/I4rrdPgrLdLC3TtFDDLfFtwsIYAvAmXamYjDvdv5ywX13NEn7cNN2SJsAs/XCPZCJY/jxKPDrRHMCOu/3PRJb7lyZzmNXmQKnH9yWA9oP2xv/w7XRjeHJovEqKVyALZ+jMGERnJwjRdj+HIZaUiBAIm2aVGLjIyTkq3Ycx2f4DcPCMq8uf6eMWYwgbqIuD7kB80zf952cF3P1iYGqGLlnmeG8IsRGBocsyKBsgRW+QKy65ua/1lZICyI6W7Yap1/DML3M2QWOJiOVX8wH/aw== 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=mLOdM8LVsxaz86Ehuw6AfCW5Tg8yFGJpSkcggspwKKM=; b=kMKr+CsACZYrbp8Hds/N1UgO6q92vPBe9rLHHDSMfpZbO3upH6DQJnM6UPiSzNa/wKMQbS+INgXDhngZq2cXhJejuMWgO/78DH9mK0VcQRT9pK2ZZxKskrH8FCtpxOC3U8lkmkaaW+T2GxfAk0tHOuzuUYlN7aqfVCnQxpKYpCLVE6u4OQQFyJ7awKmdXW2jr9efhoc4mgefyhCLqfNy0pIk+Z5rXt2I1nMnvSbLCpQbIYw1RYTigeHHAsz37jLcXgGCK+IBW/hYEnGKdhwS9SBj9QDAV9OD/r5Jsnbj0SygkJvUV3abszi6aP4mh4rBG/m6NSWTuiMNpzVKlcK6wA== 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=mLOdM8LVsxaz86Ehuw6AfCW5Tg8yFGJpSkcggspwKKM=; b=kS4Jz2b/8wJAuU/eNVLPGmz/3RGi9hVWb1xyYDMitKXVLbKGfjQi0H9fy/YBGrByPTjmuHI+k7wTUU33fIkWSN5/5xPZvlZSIo4aw3Gi1jJAgdkFb9JTeNxaj51zsHW2HmU/lSE3R2YSW3UGs+ZB4Fu/GM6A3D/2sF+jfg5NqdYWtMTgFAFvuOHrDclLXbALYgmz8966FqRAGQ2jG01mHtOpNwggcwenG63y/j20R0IOuI4aY215fzYNWrU4UQLWokOQ+TcEKaE9raqgZP8OxfzOpHV/2YMtjYR02sG5FKXigxdFOFqrdtYnoRnEpdT3MsxJXd9ZzSga6DjqBZHC9Q== 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 TY0PR06MB5127.apcprd06.prod.outlook.com (2603:1096:400:1b2::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.5; Fri, 20 Jan 2023 13:40:56 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::3e52:d08c:ecf4:d572]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::3e52:d08c:ecf4:d572%5]) with mapi id 15.20.6002.012; Fri, 20 Jan 2023 13:40:55 +0000 From: Yangtao Li To: jaegeuk@kernel.org, chao@kernel.org Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Yangtao Li Subject: [PATCH 4/4] f2fs: move ipu_policy definitions to separated file Date: Fri, 20 Jan 2023 21:40:29 +0800 Message-Id: <20230120134029.69200-4-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230120134029.69200-1-frank.li@vivo.com> References: <20230120134029.69200-1-frank.li@vivo.com> X-ClientProxiedBy: SG2PR06CA0234.apcprd06.prod.outlook.com (2603:1096:4:ac::18) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|TY0PR06MB5127:EE_ X-MS-Office365-Filtering-Correlation-Id: d5d70597-7217-44d4-9901-08dafaebf4c8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZUlJPiQfTYT0/hMnJM5SlxgETyLURTu0prdUkakWb/9gaVOYw0b5OIsbch6UF6TlwvhzbNpCo/3ajfPSYFbGYYjZaZg9dFvRGg9wOw+fPl5oxk1kIofmSGKLVsr2wymnQHloAnu6d/gZwlzXRHTnB9SxRbEPc7LpU04rpoawbWj1bZ2UGLuN0WJzUPHCiH8wv2IP1zOhg+0A1cRmaGePugbFvdBzDtqNqxhFbT7rR1lzQyslRkQ8yjRi6btuQG5LHXbDQcJePJpQqzksuNl9h39D0SXO+2QAqJxWYWG4xrK2baJcR9ECztA38XPUfpciwP5Qkyn/WlcRRoB1qEp7/s3OmfjRAWNpPs22yzgl6+Viucu8FLRHBRARq0TuktJ2I+kkTMGNGUN/Xx2luHbZCmKzsXiU76dNKw0a7Ebk0YSQTaeFMrcyWnOD+XU3Ks1bmmC+9AxHyFfrVuxIJuD/+PmbQQ4TxLy46XzJm+dg2KB0/buqXIb56pi0msv+ESUhoJf3pVM1e4BAMLG7kVV8X9O91TqVQ3fSCntjqJOJT6ZhcONRz7VcC3irugfHaNyznm5jUYLewqkQoq3DnKHU51MRH9VPTESEUInEWvPPwD5QBiqsp5I3Q5L7MA+b/rx1lZKUCyDjUaoJml74IKhx1P9H2GJ/klc5QelyLWtravmnL763cHsyRjsWk5BALk6/YdpUVWVY6g7zEX23KCEm2w== 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:(13230022)(4636009)(366004)(376002)(346002)(136003)(396003)(39860400002)(451199015)(19627235002)(316002)(38350700002)(6506007)(38100700002)(66556008)(66476007)(66946007)(6666004)(107886003)(2906002)(1076003)(2616005)(4326008)(26005)(52116002)(478600001)(8676002)(8936002)(186003)(6512007)(5660300002)(83380400001)(36756003)(41300700001)(86362001)(6486002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: svZaHbfGHIEgDb0RXUIDDxW9kdW7bKoYatlAxP4NTrzy4Nnq9QKpWGTCXWPJq098ji+LH9PJZS25+gfykaOU9WIJbLaOT0Y59ucMp5DiKKyudxLyBV8QRffNqhwl976riDwk0aRCRKhqobL/2Gtf32zjcfVEXIdAjzyzQSwiap2QjWKTWRJJHsfDc5ivGHVt4XwLeSKSR6HYq4hScu2v6tD8HBl7Vey74I/pkw6i5TCI8BLV1N5jMc6KEmMIDn9AuPulGKIoRFGfB2fNHgGWqgtC296VxbChpxG3LQpKkW/j0QNYde5NiZMPz+4OtCQaoOF/MXZByEezYZeVOxzK9LeIPUeamtKzyKS2LAmJNP7k3YvrEO0XX1s0YWMRC1vxXDGMKFOZ8xgTKQZNfDdgC+TAcUFS703K6xPE8OtiD852ct2fPkm2LLjddJ8piGj4t2VYG/1ivBz27psyw/VG8rp8/Ru8HA7gl4lX0qJfA3VUECguXCFxabsNjM3s8lk6+iVOUVMrSd8Oo6bhJDEHbzbwkx5gZYP+b9XAbjRho1UKg9YZvW2vdnywGqVeXTJlGZj5lWwAyoOxeho+kSbF9orK/8+B59K2zS6IegNizTuU6Vf/sBLuFt0CraPlEkDKNVMIJCKh217f6AvADVvHS4uSQqkFntqdWFj15PBDKyzrKc8MEXoIH4Xl667UjqsNw1oHBbAx444aNKjy2CQ5T5IR980p6EfJGXI/0RkhylMNL1KSBPqAJX0h6Fjbk8A8AEhHBTPloOugCmJqfhvjluH+emLzoSOCAhx9/9kbImsdFpa4pouoKb2fOuZ/WotqNCNU6Pz2jnUg/RwforTohVeozP7rP8Vinuf/L2d7gMmznNpz6IwyFhsWT1iKy/uzVfANugJK3sYtMuAu9Nynwb/dVpIvNN0xFpTQsPzHdilCmh1AgQ8QROhBrHoFq7cBe33jPwA2n32Q5XgWAeod3n4YMwCR9xXdwysxXmF3Pg8Co79t+xZLWKv3HYJ8b0Rvrlp70PwCOHBfpu5O5GCyJBWJIG4aMD1cZcivaVbT3bJdga0uVzvBBfuL9qI/+tk8EQoHRlYz5F+ab6E+GrRAxzoV6DykcgkHxifPWKxS1Lhly+rxLjeQCkNq9ID2QOCa+gCbDqSGrCOkeLcu6PWbIvoJ13RM+m0dnVg7zI2dcDw5SLmUaCF/bQh42ijk8AC4iZ8NRyCCMTwjpLK9HGonyMpRPqNh3hMdVba3915mzrPkQ12DrdHMY8DSv+JfUu81g2ABe1aNGfaYfMc9qx5EgEwN9PdrO9rAr54n65TbZ0H96JMcKR1QHzruT0MPQeRvnRIo/7QpB2PjnXR58eJ46xHQUzzLbDcbG93A0JX1nuYLmk70XYd2ZIJ6XGTWj5IScwdrNMhiacPlBz6g7A3CuvjHVZHOGyHkZ2pBrkzwPv+sTK61PneDjJj/gWHsJi6YOpfStnwynLiCZB1zIAjmSwhViczARk1yUiN6d1MiMhW+jF8mPdnVVFpr0mxdWqk2ZWERUk8bKng2Up0coUesDCNlrGC6HrRXH0UXfO+cmQtv/JeMva6NjegAc6wDf3kM X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: d5d70597-7217-44d4-9901-08dafaebf4c8 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jan 2023 13:40:55.8485 (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: PneOskVXex82iWQAgRf65AkqA2+J76zUPd/HGGDA2ZZyvfHrztIWu+sfGZtd1zDZNGoZJn+bd+3/HRLGPF9bcw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY0PR06MB5127 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 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?1755549299449390005?= X-GMAIL-MSGID: =?utf-8?q?1755549299449390005?= User can control f2fs ipu policy through /sys/fs/f2fs//ipu_policy, export related definitions and introduce new macro to make it more convenient for users to use. Signed-off-by: Yangtao Li --- Documentation/ABI/testing/sysfs-fs-f2fs | 25 ++++++------ fs/f2fs/segment.c | 2 +- fs/f2fs/segment.h | 37 ++--------------- fs/f2fs/super.c | 2 +- fs/f2fs/sysfs.c | 2 +- include/uapi/linux/f2fs.h | 54 +++++++++++++++++++++++++ 6 files changed, 73 insertions(+), 49 deletions(-) diff --git a/Documentation/ABI/testing/sysfs-fs-f2fs b/Documentation/ABI/testing/sysfs-fs-f2fs index 64b15a28fe30..d05ad2bc56d1 100644 --- a/Documentation/ABI/testing/sysfs-fs-f2fs +++ b/Documentation/ABI/testing/sysfs-fs-f2fs @@ -49,18 +49,19 @@ Contact: "Jaegeuk Kim" Description: Controls the in-place-update policy. updates in f2fs. User can set: - ==== ================= - 0x01 F2FS_IPU_FORCE - 0x02 F2FS_IPU_SSR - 0x04 F2FS_IPU_UTIL - 0x08 F2FS_IPU_SSR_UTIL - 0x10 F2FS_IPU_FSYNC - 0x20 F2FS_IPU_ASYNC - 0x40 F2FS_IPU_NOCACHE - 0x80 F2FS_IPU_HONOR_OPU_WRITE - ==== ================= - - Refer segment.h for details. + ==== ============================ + 0x00 SET_F2FS_IPU_DISABLE + 0x01 SET_F2FS_IPU_FORCE + 0x02 SET_F2FS_IPU_SSR + 0x04 SET_F2FS_IPU_UTIL + 0x08 SET_F2FS_IPU_SSR_UTIL + 0x10 SET_F2FS_IPU_FSYNC + 0x20 SET_F2FS_IPU_ASYNC + 0x40 SET_F2FS_IPU_NOCACHE + 0x80 SET_F2FS_IPU_HONOR_OPU_WRITE + ==== ============================ + + Refer include/uapi/linux/f2fs.h for details. What: /sys/fs/f2fs//min_ipu_util Date: November 2013 diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index a007f5084e84..c56f5a80d3a6 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -5138,7 +5138,7 @@ int f2fs_build_segment_manager(struct f2fs_sb_info *sbi) sm_info->rec_prefree_segments = DEF_MAX_RECLAIM_PREFREE_SEGMENTS; if (!f2fs_lfs_mode(sbi)) - sm_info->ipu_policy = BIT(F2FS_IPU_FSYNC); + sm_info->ipu_policy = SET_F2FS_IPU_FSYNC; sm_info->min_ipu_util = DEF_MIN_IPU_UTIL; sm_info->min_fsync_blocks = DEF_MIN_FSYNC_BLOCKS; sm_info->min_seq_blocks = sbi->blocks_per_seg; diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h index 50c63155ad56..c064ddffe91b 100644 --- a/fs/f2fs/segment.h +++ b/fs/f2fs/segment.h @@ -7,6 +7,7 @@ */ #include #include +#include /* constant macro */ #define NULL_SEGNO ((unsigned int)(~0)) @@ -646,51 +647,19 @@ static inline int utilization(struct f2fs_sb_info *sbi) sbi->user_block_count); } -/* - * Sometimes f2fs may be better to drop out-of-place update policy. - * And, users can control the policy through sysfs entries. - * There are five policies with triggering conditions as follows. - * F2FS_IPU_FORCE - all the time, - * F2FS_IPU_SSR - if SSR mode is activated, - * F2FS_IPU_UTIL - if FS utilization is over threashold, - * F2FS_IPU_SSR_UTIL - if SSR mode is activated and FS utilization is over - * threashold, - * F2FS_IPU_FSYNC - activated in fsync path only for high performance flash - * storages. IPU will be triggered only if the # of dirty - * pages over min_fsync_blocks. (=default option) - * F2FS_IPU_ASYNC - do IPU given by asynchronous write requests. - * F2FS_IPU_NOCACHE - disable IPU bio cache. - * F2FS_IPU_HONOR_OPU_WRITE - use OPU write prior to IPU write if inode has - * FI_OPU_WRITE flag. - * F2FS_IPU_DISABLE - disable IPU. (=default option in LFS mode) - */ #define DEF_MIN_IPU_UTIL 70 #define DEF_MIN_FSYNC_BLOCKS 8 #define DEF_MIN_HOT_BLOCKS 16 #define SMALL_VOLUME_SEGMENTS (16 * 512) /* 16GB */ -#define F2FS_IPU_DISABLE 0 - -/* Modification on enum should be synchronized with ipu_mode_names array */ -enum { - F2FS_IPU_FORCE, - F2FS_IPU_SSR, - F2FS_IPU_UTIL, - F2FS_IPU_SSR_UTIL, - F2FS_IPU_FSYNC, - F2FS_IPU_ASYNC, - F2FS_IPU_NOCACHE, - F2FS_IPU_HONOR_OPU_WRITE, - F2FS_IPU_MAX, -}; - #define F2FS_IPU_POLICY(name) \ static inline int IS_##name(struct f2fs_sb_info *sbi) \ { \ - return SM_I(sbi)->ipu_policy & BIT(name); \ + return TEST_##name(SM_I(sbi)->ipu_policy); \ } +F2FS_IPU_POLICY(F2FS_IPU_DISABLE); F2FS_IPU_POLICY(F2FS_IPU_FORCE); F2FS_IPU_POLICY(F2FS_IPU_SSR); F2FS_IPU_POLICY(F2FS_IPU_UTIL); diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index ebc76683f05d..b19085fa335a 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -4085,7 +4085,7 @@ static void f2fs_tuning_parameters(struct f2fs_sb_info *sbi) if (f2fs_block_unit_discard(sbi)) SM_I(sbi)->dcc_info->discard_granularity = MIN_DISCARD_GRANULARITY; if (F2FS_OPTION(sbi).fs_mode != FS_MODE_LFS) - SM_I(sbi)->ipu_policy = BIT(F2FS_IPU_FORCE) | BIT(F2FS_IPU_HONOR_OPU_WRITE); + SM_I(sbi)->ipu_policy = SET_F2FS_IPU_FORCE | SET_F2FS_IPU_HONOR_OPU_WRITE; } sbi->readdir_ra = true; diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c index aaf5d8650518..375ace5f330d 100644 --- a/fs/f2fs/sysfs.c +++ b/fs/f2fs/sysfs.c @@ -165,7 +165,7 @@ static ssize_t ipu_mode_show(struct f2fs_attr *a, { int len = 0, i = 0; - if (SM_I(sbi)->ipu_policy == F2FS_IPU_DISABLE) + if (IS_F2FS_IPU_DISABLE(sbi)) return sysfs_emit(buf, "DISABLE\n"); for_each_set_bit(i, &SM_I(sbi)->ipu_policy, F2FS_IPU_MAX) diff --git a/include/uapi/linux/f2fs.h b/include/uapi/linux/f2fs.h index 955d440be104..1b672fb6af91 100644 --- a/include/uapi/linux/f2fs.h +++ b/include/uapi/linux/f2fs.h @@ -5,6 +5,60 @@ #include #include +/* + * For /sys/fs/f2fs//ipu_policy entry + * + * Sometimes f2fs may be better to drop out-of-place update policy. + * And, users can control the policy through sysfs entries. + * There are five policies with triggering conditions as follows. + * F2FS_IPU_FORCE - all the time, + * F2FS_IPU_SSR - if SSR mode is activated, + * F2FS_IPU_UTIL - if FS utilization is over threashold, + * F2FS_IPU_SSR_UTIL - if SSR mode is activated and FS utilization is over + * threashold, + * F2FS_IPU_FSYNC - activated in fsync path only for high performance flash + * storages. IPU will be triggered only if the # of dirty + * pages over min_fsync_blocks. (=default option) + * F2FS_IPU_ASYNC - do IPU given by asynchronous write requests. + * F2FS_IPU_NOCACHE - disable IPU bio cache. + * F2FS_IPU_HONOR_OPU_WRITE - use OPU write prior to IPU write if inode has + * FI_OPU_WRITE flag. + * F2FS_IPU_DISABLE - disable IPU. (=default option in LFS mode) + */ +#define F2FS_IPU_DISABLE 0 +/* Modification on enum should be synchronized with ipu_mode_names array */ +enum { + F2FS_IPU_FORCE, + F2FS_IPU_SSR, + F2FS_IPU_UTIL, + F2FS_IPU_SSR_UTIL, + F2FS_IPU_FSYNC, + F2FS_IPU_ASYNC, + F2FS_IPU_NOCACHE, + F2FS_IPU_HONOR_OPU_WRITE, + F2FS_IPU_MAX, +}; + +#define SET_F2FS_IPU_DISABLE F2FS_IPU_DISABLE +#define SET_F2FS_IPU_FORCE BIT(F2FS_IPU_FORCE) +#define SET_F2FS_IPU_SSR BIT(F2FS_IPU_SSR) +#define SET_F2FS_IPU_UTIL BIT(F2FS_IPU_UTIL) +#define SET_F2FS_IPU_SSR_UTIL BIT(F2FS_IPU_SSR_UTIL) +#define SET_F2FS_IPU_FSYNC BIT(F2FS_IPU_FSYNC) +#define SET_F2FS_IPU_ASYNC BIT(F2FS_IPU_ASYNC) +#define SET_F2FS_IPU_NOCACHE BIT(F2FS_IPU_NOCACHE) +#define SET_F2FS_IPU_HONOR_OPU_WRITE BIT(F2FS_IPU_HONOR_OPU_WRITE) + +#define TEST_F2FS_IPU_DISABLE(val) ((val) == F2FS_IPU_DISABLE) +#define TEST_F2FS_IPU_FORCE(val) ((val) & BIT(F2FS_IPU_FORCE)) +#define TEST_F2FS_IPU_SSR(val) ((val) & BIT(F2FS_IPU_SSR)) +#define TEST_F2FS_IPU_UTIL(val) ((val) & BIT(F2FS_IPU_UTIL)) +#define TEST_F2FS_IPU_SSR_UTIL(val) ((val) & BIT(F2FS_IPU_SSR_UTIL)) +#define TEST_F2FS_IPU_FSYNC(val) ((val) & BIT(F2FS_IPU_FSYNC)) +#define TEST_F2FS_IPU_ASYNC(val) ((val) & BIT(F2FS_IPU_ASYNC)) +#define TEST_F2FS_IPU_NOCACHE(val) ((val) & BIT(F2FS_IPU_NOCACHE)) +#define TEST_F2FS_IPU_HONOR_OPU_WRITE(val) ((val) & BIT(F2FS_IPU_HONOR_OPU_WRITE)) + /* * f2fs-specific ioctl commands */