From patchwork Tue Jun 27 17:43:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 113526 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp8377562vqr; Tue, 27 Jun 2023 11:03:15 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5HrdqdPXT5E4qi0LxqXFkAMPbDN5Kac2sFECt+466ahVtbjY/yw2Kr1bGZ/i/i3ZqR/Lk1 X-Received: by 2002:a05:6a21:32a2:b0:125:687a:1c5d with SMTP id yt34-20020a056a2132a200b00125687a1c5dmr17920364pzb.60.1687888994725; Tue, 27 Jun 2023 11:03:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1687888994; cv=pass; d=google.com; s=arc-20160816; b=E6sgUxM2RU0Q3O4FVqfQQdcl+1ji2XI8qD/Tj4qTL69OnXYtUuJRUN5p2F2Q8Yh0Yy +9VSx2E08bYoLI0KVb6n4Op7dKWBbH9ckNj9tJzZBlRmtG0BaPJs8GX8eF3u6ZeUJNR7 w8g7eWbQlCnZSlKa2eGpSq/lphXjVSp9Zp+uxFOgDAcOfdVpdg1KS1J58kuOvTCWecfc CnJ/k0GR/V8Edmy10Cisv2/Y3FPf9OuvpdZY+giX04yRgQd3YQUnNDW2ITkXWxTGpBWG IZ9NWx8IIZKpUNiTHme7Al89pjwOa1tfgkqb4Wn7Y2j60eruhp0C5ICZAPIKSngCB2lU KhWg== 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:dkim-signature; bh=v3v33DyM6oPRucep+24y1w8r3ESXjCAyCiAqWo1iQQo=; fh=bf6/2T5R3S9sYIEW749K8pwakgeBaicjiWMp0TNetn0=; b=DkWPcu/chw09GvbMDG2KPjUJN0Tk6YzXcb/+jHM2XpkW5/APLQsYPhIGT29z/rQL+h a2H0e76DOLNGzujCW2ia9Ga0S8wjQ+6Lvu6nTASVPR7Z2pl/Tl2aZg67gN8u/Ha80Bxm XSGyjLa1cB4NdkgHl5snjj/sx5/NbwY1iQcHygfYBPMWdUDfpGXruMFtx2nEyiDuH2e+ W1Wr+egzJveXQOEIbgaJuoAES2Tkqjc0KM91J9G1PYQZvHJaWPunLNP+UVmDa4BaWFVa xdie0E9F6e+MVfUURU91XQ0MBt6mjCXQixk0bbQ2B8b6qLzZJvCAFTyYCfz/lowaEEYV zing== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=L82NlmCZ; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=aApW0Gnh; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.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=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z19-20020a63e113000000b00553ced07d15si7991069pgh.368.2023.06.27.11.02.38; Tue, 27 Jun 2023 11:03:13 -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=@oracle.com header.s=corp-2023-03-30 header.b=L82NlmCZ; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=aApW0Gnh; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.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=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230486AbjF0Roc (ORCPT + 99 others); Tue, 27 Jun 2023 13:44:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230473AbjF0Roa (ORCPT ); Tue, 27 Jun 2023 13:44:30 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E41A297B; Tue, 27 Jun 2023 10:44:29 -0700 (PDT) Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 35RBtbAM007684; Tue, 27 Jun 2023 17:44:12 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=v3v33DyM6oPRucep+24y1w8r3ESXjCAyCiAqWo1iQQo=; b=L82NlmCZDmuLh/fDp3MielH09xbuOnBg+a1SkC92dS/30QYnFuYfGuWvJ0/sf3sFQwBU 2gl09gmvGUmrhnirGPHOgQIsEQc2jOmKYcCwxnVIL0Nu6xNPOBnrS4k2bw7h620oSIGS SK4OrGqSLFrRDE3cEx8h80mLifW/EFfgjsPGvJKRaZW0k51A/q3ZEv60ndJYAESAi5DD ZC11lMmpxl0oSlD9lgWG+S3tQQ6g8NIgE6xzIorJ6XFg+vSoeGSI+5L4EY6WyTrMXLHZ SCkpMAcjDNi03EpLnOrHwPGP7FapMl8fzyvvdPeIcEsv3z7TXUdITzmOTSwxytyPz5ox eQ== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3rdq935k92-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Jun 2023 17:44:12 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 35RGUQQG019956; Tue, 27 Jun 2023 17:44:12 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2168.outbound.protection.outlook.com [104.47.58.168]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3rdpxam0r1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Jun 2023 17:44:11 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=azNtQ6nQpQXcfAHQxgzCL2bp80baSAGkoH8uXXoP42gk81aiYphkoUGCfjq5nU6TzrxfrpdItL91iwyVcVd3EG+TH6bdWDMUkriwvwPrz5oM94NXHeUeYFXe0PCPcqu/nv4CQDZCTHjf4sXqfZirSaAKsXlJlPdJQuViKkWz1ivkjtkVjuV+Dc9frzT5Ez0EE3t9X3BRZkxTROUMFDwLeldFegL2JUd6oY7tQapuic6foEEuITqBvbezsmbIwPFWJyu/mnjB8JwZZInHuuOiQCKWXTMpYPnVZ3BeCqWkmcBi40MrcRv6wWHUI41JQa20pKB6Rjzx4ro51Sza6DTJSA== 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=v3v33DyM6oPRucep+24y1w8r3ESXjCAyCiAqWo1iQQo=; b=b6SWvYkM8UDtdopXAxaUrfD0LqTtEBnwTrShfN8xNIjrs/ffJ/I1XNOs4DhkuBRlGkKIcadT4F0RwjDjOFhvxYyU7qOL0jYDTlOLXJ2kZMY1abGQhxUGpdQKO1iRwlETFBYCH/gL+u46btMQLQ95p1E1ZtU0v9X1WVMdZ+64fSQcH4fpmAOi43qQ1XEbqX+PRlw8SzkKKjWjvktILCEeAchGzQ0Ca1pEZm2NWArehcBrPQxhm3AQgtFALiI7mAiqVmxpBMukKwrgYI6iv0boAHV14ieMkPAQIOca2pCSf1wkq9w8fw8gxRS50tRVScJ3W9iZpq0q8F5v/HvaAz/Iow== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=v3v33DyM6oPRucep+24y1w8r3ESXjCAyCiAqWo1iQQo=; b=aApW0Gnh8zGTQTUu2wYQ3tW+qnmQ8xq0bYPrN91/Wmh/s+aeKzk/G8aonlo455yJ2pl1xArjGh7X4LRz/3lz+a5eEChD0fdIR7i3Le2eXgZcQYFLOSUCLZgb/zf1ySRAXvizUn8VBGZQHPtIunzv7KFqYqMxQJBN1Q0J4LeVDJs= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by IA1PR10MB6193.namprd10.prod.outlook.com (2603:10b6:208:3a7::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.23; Tue, 27 Jun 2023 17:44:10 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::d9c0:689a:147b:ced5]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::d9c0:689a:147b:ced5%5]) with mapi id 15.20.6544.012; Tue, 27 Jun 2023 17:44:10 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org Cc: akpm@linux-foundation.org, tytso@mit.edu, willy@infradead.org, adilger.kernel@dilger.ca, hughd@google.com, hch@infradead.org, Sidhartha Kumar Subject: [PATCH] mm: increase usage of folio_next_index() helper Date: Tue, 27 Jun 2023 10:43:49 -0700 Message-ID: <20230627174349.491803-1-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.41.0 X-ClientProxiedBy: BY5PR17CA0066.namprd17.prod.outlook.com (2603:10b6:a03:167::43) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|IA1PR10MB6193:EE_ X-MS-Office365-Filtering-Correlation-Id: 483b3c32-c047-4b68-afad-08db77361cd8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RZgV3Ool1PYtPn5BvxCxxMd8A/MQXI0TSYDeuUY8CQmV8AUvMXamL4ajOmAiYe35S1EmE7baCgYST0AB38II+htUGkpPUqlR5R5nwN66AFQ8NZX4rIEtYmyX8N06EtfktYY6pmIXq0CSGlyPbkMzHtD/uoCCYLBxqPUXSUivBretIh7Nw7guC7wTLdHQYd1l1+Q7if3Ps/Fmi+Pq4Jm3+3207hopsxfhHfiQx6Zs5USIAnRc2k1t+98aLRm9yZgm/AXHoNpTn/ONtyyfYnmthfFdGycUllihoKcNCyOUuRmR2vwPTkjRg5dnmqKV831D86dB7HnHVurKmHtlcqsmFvXrOOfRHhwp3hU+XM7TIWjHai9nq0l0Nbepsual4hu9gzI1dtGZ6FJ0sJIYOhak/ztgl/f3aP8T1runuPCoTI/UIqdhL2gOxLVgA4x/YsJ4aDwS84XsnV8P0RjbEgy+5vNBWpJmHIq5KY/frVLhdQuXa4kN9vs5Ycj99IbbvWQVUNTbEYE+peYjjxVDtkHsXM+xz6wpkTo5hkWObFeQpMpmQh+OtH8wBZGvJHmEcDLP X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH0PR10MB5113.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(346002)(136003)(39860400002)(366004)(376002)(451199021)(66556008)(66476007)(107886003)(6506007)(36756003)(1076003)(6666004)(478600001)(2616005)(83380400001)(26005)(186003)(2906002)(6486002)(5660300002)(44832011)(7416002)(66946007)(38100700002)(8676002)(86362001)(316002)(4326008)(41300700001)(8936002)(6512007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 4IU2lUVL9FO7BelvsmUWpwOAW2AlftfHhtKNVmnHvyRMimwXcef9y78M48iJrP26KYSVtY3zMKZQr3b2O5T7CRSME8CUSmY3j19Hve2voOLmFMmR1/WeuYNbkKR4FwihBJvcJob1IUYw/K/7MI7cXsST2SCACwJAP814FoKG5sXC/n11LDBEO/BaHOc30HjzdAe0mxgKu+fuOENRTnnyLLKkWlFiuiGeK29X9YyaiDrSCrR7JiS81p3La0SOSLGceAO1fHFhQYJlqwotC5RwMrT9ahSUcjVe23dsxerqZEOY8sgxSGdKVaGU/Tne3LQFjxyS9/mQDYTUMaJrCJvg8r3pouNfHxaD89TYdH48C9w4yJuHVhzLCpC8LLP6KhCK84fbw+IzWHUauWChCb60L7M9B+YWDBJoioEH6F7iAYehlbvu2VZ1txp3U41ETfR3xaDAGF9m5QsJT5pUEy3zAXo53jU8Hc87InYkUylvh3U8t8Ek07Y1Y5fas048D0n1f7JXFHsc6MH+BmWzDgvkViWp+kfyNp5s1+WD2AfU4mJMVTrt3z19uusjZ2yr5249/ZjB7OWRhbHvgdmA+03ivZsfERabBDbj6vS/iAU/GdatHg5ecfG6YsN6Nj7RT1zU3dPGZuvKclusnpZb8kWDGIc1e5EL+aJXkGRUsmm1eOQmd6LXc9LD/O4v+b/q3VvfPUrnEbcfCtsH6+hAeGsn44fv765bg0CcPY759Go/LAUnKRbsX4B1XEWKmHwCwRNamcWR/wP+mcAcll1fSFsnPH4TzgrGykbBaDcz/3HNbHberaYe87bZhg0Xf1c1MXUQ9EOW8v0bmP4xJHKlSXX8HtYoQv69iUR5bP584ni2XyDYl9gtKQMkl1sPKONncxueAZs9Qx9T+/KvHZoyGnUvrneIyHmdcf+On4t9mxnJxPkiEtLRe5HaoKq3UxiMtuz3uBW5OZ/2m+liiJYa6Id2cku0hLq9cKKW/kLXp2GtQOnGzSTQ/xpf4EkEK4fT3KmiceDCkFBKWKHh/PWEvrKP9lFwEsCZkLEbimphLg528GvWcOslEjqx3apsIgyK/emIcp1CYy6f7cr2Gceil8dzh1abippuqiQTg3/Yv/GX6r3fKagTGDgGmJ5reWxbZKDowYz1MeM3uqGn6dGNY2CkUviD8lhyeBgHhx0tmClDWVgAvzCSr4A+oHby+Bguuj8bIv0cmtaiFd2NofEXNhLcs3bH5BVCU0MtCZ5E+y4+RsPY2SON+VFB6fZfgwkVX2nXhJOUe3mNeUKAx6aQGxhd/GQtdqigla4SDkkZAhYPKFivuPKEJPXDEF2ZKfRHPRMHFoFkZ0KMcLi1nCG+tfEAhYPhQDtGBwBo/ytxM4vCHVxxRid9iOmlw8PIsgLLOXfB6hhGxsdC/ff2A9IAXho4O/bYDgbPT2VLAzMuA+DJ47M+usErXZ8tqIzYWFJHoTCsVzjU9JIlO7rKHzDdkokMmTecQ3ijVLOvEk2NEzdb42/LtzX0fP4OvVUBr2fx3Jqu9Fl21Px8E92I2b60FBSskW1gx8Ejqqh91telsQHoVEycSy5Q5mMI666gD6JDINtjTHo6WnHlTgwV+vbJnHa7wQ== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: rTkKCpeOf2PE6pMhNP64ZGZ1m6Sto6b1XTvz7WSGT3ATPupC/tnstvgjjoOr3o9Ldyr3UfZeRl8TyV+tCLdI1v8u4ZsqwwSaoMs0R56jrpRjgSp4/0N0oz61ZLQYsOT6XdBtU7s0nJHUhxXeYhBLpLuTIARlfzzhHzaMb4qS21CJztg/fe9FdxsSulNcr8UJgfEZH6UOMcxie+z3mK/EW/QAkAIFBy0kPq5U0ar5IZ44EuiClERdASLS+QzyFpL2WO141bNUjlTLCQeq9wmaHpeG4YQRE6d9UpcJ+vnZDMui6wfr+hlGj33G0Qi+53T/N30nTO0Ow2XxPuDxQvm6kkdtMVgW1KkvuNQBc+hrkSzY72A5b4Im50zXKpq+K6Lc2+MArRsUv5vl6yBKInecCrfYAYv93+1jEBFsZJjS1cIRCtt+bIkqDS6lUDw1KL+JjSmu6OU/sI6udgPpidIOVuQf53WMJ9Pa8tsXBUezyJeTA9OfCVfv7QSoucCWEH1kjx4+c2cmB2ty5419QitMGzhnTPShOKOx1OoaKPIWlHqnnjGzvYuchsVHdD/hnKGxoQd4waK5KvZdQ5cm933vTNqK7BfnXe+j+l1nFcgZkREQ+MLre4jzIwGxVhiksqtErxRngVZQh1E/04NBzxRSUb5aJj7ZPxiPnlw3thBr5ZsEF8QWCoYzKMXjMQcEQezsqLvSzsy3UbhMDrD6dTKfL17YlXQ+af22mypzISA800jbhVTVRH02PyC7T0oklmJ1j5eiHxc9mwiBYLOMsOn/8NUJ63E/xbyRfqSk4bmDP9MhJrucCVIqURbANXq7G49s9Bw0UHWN44ErpxbcraQI2Wx98zaKmeZwj0yYPN9KqGyE9NSniuTQWrkJqDQ6TjClu48+Pjv0e3WeLGXfyyvsabsgXXNflUVD09Kwqal9rgXS6u5u1Gl4Eit9t84ToFaOhk30daT5mWFQmOfuxCIV2w== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 483b3c32-c047-4b68-afad-08db77361cd8 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jun 2023 17:44:10.0585 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ts2H7xlUlyGJ2fuDrXKyunMGJlXm5yKqdw/lsYghv7yGXYu74QBam8iTEMWjTtuLx/UxtBsVUSq79KYR04bB8Sf1Q9hxILLcETlefyGGcSo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR10MB6193 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-06-27_12,2023-06-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 adultscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306270161 X-Proofpoint-ORIG-GUID: ylDKhHUzeumFo9-LDMnmKD6LdBfk7PVR X-Proofpoint-GUID: ylDKhHUzeumFo9-LDMnmKD6LdBfk7PVR X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE 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?1769879889788604273?= X-GMAIL-MSGID: =?utf-8?q?1769879889788604273?= Simplify code pattern of 'folio->index + folio_nr_pages(folio)' by using the existing helper folio_next_index(). Signed-off-by: Sidhartha Kumar Suggested-by: Christoph Hellwig Reviewed-by: Christoph Hellwig --- fs/ext4/inode.c | 4 ++-- mm/filemap.c | 8 ++++---- mm/memory.c | 2 +- mm/shmem.c | 2 +- mm/truncate.c | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 31b839a0ce8b8..ded4cbb017a51 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -1583,7 +1583,7 @@ static void mpage_release_unused_pages(struct mpage_da_data *mpd, if (folio->index < mpd->first_page) continue; - if (folio->index + folio_nr_pages(folio) - 1 > end) + if (folio_next_index(folio) - 1 > end) continue; BUG_ON(!folio_test_locked(folio)); BUG_ON(folio_test_writeback(folio)); @@ -2481,7 +2481,7 @@ static int mpage_prepare_extent_to_map(struct mpage_da_data *mpd) if (mpd->map.m_len == 0) mpd->first_page = folio->index; - mpd->next_page = folio->index + folio_nr_pages(folio); + mpd->next_page = folio_next_index(folio); /* * Writeout when we cannot modify metadata is simple. * Just submit the page. For data=journal mode we diff --git a/mm/filemap.c b/mm/filemap.c index 758bbdf300e73..fdac934ce81a6 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -2075,7 +2075,7 @@ unsigned find_lock_entries(struct address_space *mapping, pgoff_t *start, if (!xa_is_value(folio)) { if (folio->index < *start) goto put; - if (folio->index + folio_nr_pages(folio) - 1 > end) + if (folio_next_index(folio) - 1 > end) goto put; if (!folio_trylock(folio)) goto put; @@ -2174,7 +2174,7 @@ bool folio_more_pages(struct folio *folio, pgoff_t index, pgoff_t max) return false; if (index >= max) return false; - return index < folio->index + folio_nr_pages(folio) - 1; + return index < folio_next_index(folio) - 1; } /** @@ -2242,7 +2242,7 @@ unsigned filemap_get_folios_contig(struct address_space *mapping, if (folio_test_hugetlb(folio)) *start = folio->index + 1; else - *start = folio->index + folio_nr_pages(folio); + *start = folio_next_index(folio); } out: rcu_read_unlock(); @@ -2359,7 +2359,7 @@ static void filemap_get_read_batch(struct address_space *mapping, break; if (folio_test_readahead(folio)) break; - xas_advance(&xas, folio->index + folio_nr_pages(folio) - 1); + xas_advance(&xas, folio_next_index(folio) - 1); continue; put_folio: folio_put(folio); diff --git a/mm/memory.c b/mm/memory.c index 21fab27272092..0cabfe9d501d9 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -3497,7 +3497,7 @@ void unmap_mapping_folio(struct folio *folio) VM_BUG_ON(!folio_test_locked(folio)); first_index = folio->index; - last_index = folio->index + folio_nr_pages(folio) - 1; + last_index = folio_next_index(folio) - 1; details.even_cows = false; details.single_folio = folio; diff --git a/mm/shmem.c b/mm/shmem.c index 85a0f8751a147..d4ca8bc7ab94f 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -970,7 +970,7 @@ static void shmem_undo_range(struct inode *inode, loff_t lstart, loff_t lend, same_folio = lend < folio_pos(folio) + folio_size(folio); folio_mark_dirty(folio); if (!truncate_inode_partial_folio(folio, lstart, lend)) { - start = folio->index + folio_nr_pages(folio); + start = folio_next_index(folio); if (same_folio) end = folio->index; } diff --git a/mm/truncate.c b/mm/truncate.c index 95d1291d269b5..2f28cc0e12ef1 100644 --- a/mm/truncate.c +++ b/mm/truncate.c @@ -378,7 +378,7 @@ void truncate_inode_pages_range(struct address_space *mapping, if (!IS_ERR(folio)) { same_folio = lend < folio_pos(folio) + folio_size(folio); if (!truncate_inode_partial_folio(folio, lstart, lend)) { - start = folio->index + folio_nr_pages(folio); + start = folio_next_index(folio); if (same_folio) end = folio->index; }