From patchwork Mon Jan 16 13:02:25 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: 44127 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1182700wrn; Mon, 16 Jan 2023 05:10:06 -0800 (PST) X-Google-Smtp-Source: AMrXdXsG9fjcvhD7DjPCgOqiVy/0z1zU1d3pS8mAv/kKpJSxItF6BR/viVJ8kx+xnf4yO92uikUV X-Received: by 2002:a17:906:3bcb:b0:86e:3531:555f with SMTP id v11-20020a1709063bcb00b0086e3531555fmr6349681ejf.32.1673874606520; Mon, 16 Jan 2023 05:10:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1673874606; cv=pass; d=google.com; s=arc-20160816; b=TbZWePKE4tIfGZa+RAZ9EplHo/3xedfuQunvQbtolZ3jcYfm+biMSqLti5D//Ectv8 i27fl8ur7S9kr1OA/wdQyk6wFDeSLAOFHe3Y80+fCtaM07notTcBreQRAsf4qgUsivJG /ESjmsZBthokKNBmrXBe+4sG9//jAdnhJfxP743dPtzWjqkVdgmAXkT0PABcJtW3w2AO KKBOUJmh+rBDdRZR8CHcAPscqP5K0cxb+go3YlV84zWy1jjIgZUlHPobv0UyKHdX4MZZ 5oa4s4VlPALbK6JIgJ18AatVIZBzjH6WMR5hWF5L1kvnZEZRM0S0TqWLwyaA/Z833h2N omwA== 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=LD/fWeUHjzYE+WRwzmlLxSCP9GEFOqaTeuks0H5w1hY=; b=vnJi1uPtNdHk3zLVfjt8AiBny+OjFzYHZG7bxOr/L59XugrY5B7GSt9KVVYXB2pcON G84N00Bn/i6Vt1yvJ0EfwVc7Hdd0vXdf0XfuVcJ43T0pd4/TdxYqmqbRlcBwPlEC6wKp jwl/kyiQFU2ZLeD2jVUY3CucwHJggg/SiFQ0UJKJfNYj9YoP7hvt7NQH8cJfDilUip8C hCf7J6ItFJ5I2rESkz3yGydP54EDqXEGrRWyOgR+Ptc6TMzh6GF5Py9AycCDs83URNYc eV1LzNQwy2hcsYFHGQVasoE4ztqk9vUTrnT9OhZSILdNvmvVFHLGoRNHMgRQQNhNPakE OhGg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=SM5UG69R; 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 dm3-20020a170907948300b007c157940720si28635062ejc.440.2023.01.16.05.09.43; Mon, 16 Jan 2023 05:10: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=SM5UG69R; 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 S231187AbjAPNEg (ORCPT + 99 others); Mon, 16 Jan 2023 08:04:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231410AbjAPNDS (ORCPT ); Mon, 16 Jan 2023 08:03:18 -0500 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2128.outbound.protection.outlook.com [40.107.117.128]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18DD71204F for ; Mon, 16 Jan 2023 05:02:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=m3q6xPiOHrqaE8vFIarW2NMhPF34LDQjYt0PP5E7frEXEuYIGGjaKQx9K0FIWWCjAjkXev2LoHsjDvykULxDv76vIc50F+a+B/H4jlDFaKqPt9Eo/2TGTFZ9w0C/JpcR0PuMZr+u6mYCnp2S7CrYbo7kRfrhq68999VmFuX/EoLXAWS3FHKjcQIXPvCTH68/6wtj5cEDbtsCtWhgpOYZ8vLFlDTjK38jQdpj5aDZfN46hI/8lNLi1ZM8N+C5bioJvtWceAeigeg1Dd/SpGirum+Xkj6ll0tFHIQAGunR+orcBZI9yWTba6AUKRpf9SeSg5k9sivCOWF8G9nvFY6UHA== 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=LD/fWeUHjzYE+WRwzmlLxSCP9GEFOqaTeuks0H5w1hY=; b=g0mOksktLBHKTQtG/ykf7H8PhbRdEwYjZROZjv62PsnVl7nRY1jzwbMwvkd4MLklZ+PJtJ+NkP5MRWcj1RTWqhHbKt0HwHTA7Bl8ai14qrDhLYHBCze9qB80fr1qJMC3SFye79tg0EFLegLEVwyJD0jehRLEGMZ0qj1FYszN/KtCzYyCex0qc/db9KkANzhT2OIx6Fj5/LlAoS7ytJnQesuQyYXba7p9IeSE/lNjJxyMYiNxUyHhksuLmpdZ9EqoaUBL8ZZvr2vh7CHUsm0H4Tr4ursmX7SvyLZibLH6uenTz1rMopj6KltsD91by6hbM1IiFmx75lcqHi+xOU3TtQ== 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=LD/fWeUHjzYE+WRwzmlLxSCP9GEFOqaTeuks0H5w1hY=; b=SM5UG69RCE4CgJoWWas4aWvOaAsq2D6NMzeszfLUHzrG/psK8O9GfrFSEjoPvVl6YEjFMLBX/8kffQ2KyO4Evrw4eWJ24OfmMvDcS2FGhqv17OWFaRClS0+PSFVjSEG79S1efaz+dHhcylNkgEA9ZVr8DE8ltDbu7qlgOEwJJma3I/AdZgV8orlsNqE0bQNOm3KJox7tnNZ2ayked0ilntFtMLAo91gwykMGu11myjotcpMZbDEX3SOMZQseJoqZpKVe/NfDuEkXsXN2oCoGyeaxS2SKDxaNIWViEN0uPvGmdP3thy/d6L3lco5W93F9TPZuCrr2qqaxfit+Y1R/fQ== 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 SI2PR06MB4251.apcprd06.prod.outlook.com (2603:1096:4:154::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.11; Mon, 16 Jan 2023 13:02:35 +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; Mon, 16 Jan 2023 13:02:35 +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 , kernel test robot , Dan Carpenter Subject: [PATCH v2 2/2] f2fs: use iostat_lat_type directly as a parameter in the iostat_update_and_unbind_ctx() Date: Mon, 16 Jan 2023 21:02:25 +0800 Message-Id: <20230116130225.34600-1-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 X-ClientProxiedBy: SG2P153CA0054.APCP153.PROD.OUTLOOK.COM (2603:1096:4:c6::23) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SI2PR06MB4251:EE_ X-MS-Office365-Filtering-Correlation-Id: 4ed2704a-8bcc-4fd4-f5ce-08daf7c1f02c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oRrFugrkq18RlDKdsOoLwk2VbiP3wuvW/iY+yH6C1rigEpo2754LdiKJMVCeTYWgbZP7DtjoGfVhOe2W225PinHlZHIObOmrXuvINQpSyKLDM3IAjYfQMelVkHU0MLP7DrN3GdFaF1Sk1TU9q53PMp/wSasQh7c3wg+O49NI8Gxr7RmDwLZXRwQkIhVJBRdwJAcDNm5/RYGJMe4BtZ4pb1LsS/05mXkQFA256VY05Yvto+1pnkk+NHRiiWn7HIZwgbMgInxfaNTdAT8dCQuvLMHWXqqZy/LVy/OEyBAbjmMVUqwsNLXuwh/qRvWOOeDx78AC6kRAaQu8bx+cS7rotTQEVNN/p43qiPPmk+GgFD2osj1I2HaHL9+YEwMP66qlBb4HRJgxTCaAKB2mrVhV/s8+97gmiHkUPicAsbfIYD0Fn1DaFuSy2rYNMBUx5zjsxSTmZQ+H7uProLhOC5W/iKUaoEv/M9u7qOjnOsm4wmEUZtx7TqmdrUF9+LAvq3QRtP3KfIoi564sjBsy1imggrKvrd5Y69pOmh/mw4j6Dtz60wGm2nP4wTdDwwzUGQ/i+521c8250JrAfaWtcBTPokNANRXWHMoGwGLcEw4VDCQbaKQkqJOBGLBZdvmMa03bsPFjRD4JT2USN2Yho4IoNRuZgwW5sKKQQGbl8+n1bWfX0rKkPFNieBimlbMVY7GP2Vuwi0DW5ggf9YS2t6NAwg== 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)(396003)(346002)(376002)(366004)(39860400002)(136003)(451199015)(36756003)(86362001)(6512007)(186003)(26005)(4326008)(8676002)(66556008)(41300700001)(66946007)(2616005)(66476007)(316002)(52116002)(6506007)(1076003)(478600001)(6666004)(54906003)(6486002)(2906002)(38100700002)(38350700002)(83380400001)(5660300002)(8936002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: a0wnBheJLXLU7jSjhnX9nbTHEEbLPiqEGUhcPj4YRHyYtDA1skEh3Ybb+qRzJQl08jRsL2bWXEakp63L7PlvHH31er3CO8aLN09cDwBTvPz0HWV5//4FF4egLACuCKRYfB6eBO9MHUdUdc80RYv6AM3caoWMbwpbRozOIE34JuB1ef0+I65sXWerhu0mC5rQXU+zu4zgaGpTkzV/EMAKUOmA19to6ZmpFclLTsLo4zrO/5lKyKTSfTfHpWviF4J+K9syAORIqHsinkjbTkD+i8l/bsC22D48uESOJBgjrBSy5BHIAi5VwuzQZzd9Um+mNtbCOrcadXLfoMAnyn14NIlAxCp9laHcFmcosPImVpZXw566vx45kQKk5in4uc/k6fJLgi1t5C4Cw/SN5vNcUcDH2X8ZGvKrnMZEkjnb1vIGIVnWHcw2mTwEXOjI9TULpXe70x1RJSsYt9CKsk7uVXqT8Tk/SdPWkwP03h4OmWHCPpn8o7MR/SnMBFt4dpGmZqmAS5J3kHheHxkUs6r9MJydL62ibho8faQ5tYWei7xwJK26l8kKCYppSyMTkVCgFNnXHRUG+oQTQazmu8ukmj2QIgjBDXmxCiiIILnZpWzxYuOOPPnWU3/HNMC/kEj2C5i/Qc9tEAAt641oPzAYQwfGxjWXk5svhZoUb2nuZlIpfknpcoCzz6eBzR/ig5VteHka8hPabEGVvLGSMxvM9P1x6NcQk6wWr9Sce4OlkQqx/T9B9y2Mo5Xlq5uP270rZBaLHpbYq4Xh0i/nlTJ/D2ONO6/lJdvWKFmVfkBH/5q4m5VPijNk4N19/P6EPQo4elORLErDEQ0ANgPZUIoZcwgS3X7rOtKBVEyX805enmlyUcguh2Iyx/THXs+fyQ0ww9rZ9A8FZ02vTRJUYzUv+3h1t42EwE3aHqye5k+ZhRJtkbE7/hqgw3rpRB9W6ujXJHIds95y3X2Ng2pUnTA6YTom7yR/30NN/H0fLjawvm+rklXUvI29BgG8XBKi4hjcxEF6kYz4sF62LDxAH0BFYLiQrtm3YXpx2ktoQb9PqibGk3wEdSPsE4Hvi+cEA+Wbc/rsaVq9/bJpW5npU+h5T0x6s8Yq1qOIopRsXsd4PNAk4Rl7OqnzPXDNiisqPrunitka2jc6dtQFRei5+h2v73YrtjrWh+qZRZ/WqzGlRjPW7uGpWVb7uWb1a1IPQcSQcHXzll2Qa/uE5zIrCITFkSLScjkY9hWT4Pnw75lZym7QOyWShC2TIzMPZPgAI2HJj9iNcEjv9MeHgoWZ9MYuidaF4zpUml4X/blCC+2gZlrmj8XfvhAQEiPTF4uSzRAcoIOhjMBWoYNiXJGtlFzapzyyh22qWPvOxsLdALj3yH7PqRUeyv0WKxTj43tMhiB8ueklU+x1fXpfd3cEnN/4PyfsPMXTrCDwhG6zY5xTY0lJ7zntxdPAscnfwBFNxJcWa0N665K2s68kbfHb1RzNXHkBetpF4E10y8vuje4a9ksrsNY5M0wvcJLjnBnLijMcWWPafVqeotqSQKO91xUAfhuBXI5BPqr9WVtrYvxLfw4/4pL8FkCFHDs4NpXX9z3/ X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4ed2704a-8bcc-4fd4-f5ce-08daf7c1f02c X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jan 2023 13:02:35.8604 (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: rguwMTYMihRZq4TJukKRZAmlYzWuUACtc+DMwRmS40bP1asIz2XZ9Ws0iDv1qt8x3WeTqt0T4ju+OGF6Jq5RBg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SI2PR06MB4251 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?1755184739257769502?= X-GMAIL-MSGID: =?utf-8?q?1755184739257769502?= Convert to use iostat_lat_type as parameter instead of raw number. BTW, move NUM_PREALLOC_IOSTAT_CTXS to the header file, and rename iotype to page_type to match the definition. Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Yangtao Li --- fs/f2fs/data.c | 4 ++-- fs/f2fs/iostat.c | 36 ++++++++++++------------------------ fs/f2fs/iostat.h | 19 ++++++++++--------- 3 files changed, 24 insertions(+), 35 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index c940da1c540f..6153647d93b0 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -292,7 +292,7 @@ static void f2fs_read_end_io(struct bio *bio) struct bio_post_read_ctx *ctx; bool intask = in_task(); - iostat_update_and_unbind_ctx(bio, 0); + iostat_update_and_unbind_ctx(bio, READ_IO); ctx = bio->bi_private; if (time_to_inject(sbi, FAULT_READ_IO)) @@ -330,7 +330,7 @@ static void f2fs_write_end_io(struct bio *bio) struct bio_vec *bvec; struct bvec_iter_all iter_all; - iostat_update_and_unbind_ctx(bio, 1); + iostat_update_and_unbind_ctx(bio, bio->bi_opf & REQ_SYNC ? WRITE_SYNC_IO : WRITE_ASYNC_IO); sbi = bio->bi_private; if (time_to_inject(sbi, FAULT_WRITE_IO)) diff --git a/fs/f2fs/iostat.c b/fs/f2fs/iostat.c index e9a3df7ce4d9..bc6a9c80a026 100644 --- a/fs/f2fs/iostat.c +++ b/fs/f2fs/iostat.c @@ -14,7 +14,6 @@ #include "iostat.h" #include -#define NUM_PREALLOC_IOSTAT_CTXS 128 static struct kmem_cache *bio_iostat_ctx_cache; static mempool_t *bio_iostat_ctx_pool; @@ -210,54 +209,43 @@ void f2fs_update_iostat(struct f2fs_sb_info *sbi, struct inode *inode, } static inline void __update_iostat_latency(struct bio_iostat_ctx *iostat_ctx, - int rw, bool is_sync) + enum iostat_lat_type lat_type) { unsigned long ts_diff; - unsigned int iotype = iostat_ctx->type; + unsigned int page_type = iostat_ctx->type; struct f2fs_sb_info *sbi = iostat_ctx->sbi; struct iostat_lat_info *io_lat = sbi->iostat_io_lat; - int idx; unsigned long flags; if (!sbi->iostat_enable) return; ts_diff = jiffies - iostat_ctx->submit_ts; - if (iotype == META_FLUSH) - iotype = META; - - if (rw == 0) { - idx = READ_IO; - } else { - if (is_sync) - idx = WRITE_SYNC_IO; - else - idx = WRITE_ASYNC_IO; - } + if (page_type == META_FLUSH) + page_type = META; - if (iotype >= NR_PAGE_TYPE) { + if (lat_type >= MAX_IO_TYPE || page_type >= NR_PAGE_TYPE) { f2fs_bug_on(sbi, 1); return; } spin_lock_irqsave(&sbi->iostat_lat_lock, flags); - io_lat->sum_lat[idx][iotype] += ts_diff; - io_lat->bio_cnt[idx][iotype]++; - if (ts_diff > io_lat->peak_lat[idx][iotype]) - io_lat->peak_lat[idx][iotype] = ts_diff; + io_lat->sum_lat[lat_type][page_type] += ts_diff; + io_lat->bio_cnt[lat_type][page_type]++; + if (ts_diff > io_lat->peak_lat[lat_type][page_type]) + io_lat->peak_lat[lat_type][page_type] = ts_diff; spin_unlock_irqrestore(&sbi->iostat_lat_lock, flags); } -void iostat_update_and_unbind_ctx(struct bio *bio, int rw) +void iostat_update_and_unbind_ctx(struct bio *bio, enum iostat_lat_type lat_type) { struct bio_iostat_ctx *iostat_ctx = bio->bi_private; - bool is_sync = bio->bi_opf & REQ_SYNC; - if (rw == 0) + if (lat_type == READ_IO) bio->bi_private = iostat_ctx->post_read_ctx; else bio->bi_private = iostat_ctx->sbi; - __update_iostat_latency(iostat_ctx, rw, is_sync); + __update_iostat_latency(iostat_ctx, lat_type); mempool_free(iostat_ctx, bio_iostat_ctx_pool); } diff --git a/fs/f2fs/iostat.h b/fs/f2fs/iostat.h index 2c048307b6e0..1f827a2fe6b2 100644 --- a/fs/f2fs/iostat.h +++ b/fs/f2fs/iostat.h @@ -8,20 +8,21 @@ struct bio_post_read_ctx; +enum iostat_lat_type { + READ_IO = 0, + WRITE_SYNC_IO, + WRITE_ASYNC_IO, + MAX_IO_TYPE, +}; + #ifdef CONFIG_F2FS_IOSTAT +#define NUM_PREALLOC_IOSTAT_CTXS 128 #define DEFAULT_IOSTAT_PERIOD_MS 3000 #define MIN_IOSTAT_PERIOD_MS 100 /* maximum period of iostat tracing is 1 day */ #define MAX_IOSTAT_PERIOD_MS 8640000 -enum { - READ_IO, - WRITE_SYNC_IO, - WRITE_ASYNC_IO, - MAX_IO_TYPE, -}; - struct iostat_lat_info { unsigned long sum_lat[MAX_IO_TYPE][NR_PAGE_TYPE]; /* sum of io latencies */ unsigned long peak_lat[MAX_IO_TYPE][NR_PAGE_TYPE]; /* peak io latency */ @@ -57,7 +58,7 @@ static inline struct bio_post_read_ctx *get_post_read_ctx(struct bio *bio) return iostat_ctx->post_read_ctx; } -extern void iostat_update_and_unbind_ctx(struct bio *bio, int rw); +extern void iostat_update_and_unbind_ctx(struct bio *bio, enum iostat_lat_type type); extern void iostat_alloc_and_bind_ctx(struct f2fs_sb_info *sbi, struct bio *bio, struct bio_post_read_ctx *ctx); extern int f2fs_init_iostat_processing(void); @@ -67,7 +68,7 @@ extern void f2fs_destroy_iostat(struct f2fs_sb_info *sbi); #else static inline void f2fs_update_iostat(struct f2fs_sb_info *sbi, struct inode *inode, enum iostat_type type, unsigned long long io_bytes) {} -static inline void iostat_update_and_unbind_ctx(struct bio *bio, int rw) {} +static inline void iostat_update_and_unbind_ctx(struct bio *bio, enum iostat_lat_type type) {} static inline void iostat_alloc_and_bind_ctx(struct f2fs_sb_info *sbi, struct bio *bio, struct bio_post_read_ctx *ctx) {} static inline void iostat_update_submit_ctx(struct bio *bio,