From patchwork Fri Jan 21 05:18:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandan Babu R X-Patchwork-Id: 12719256 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4FA91C433FE for ; Fri, 21 Jan 2022 05:19:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230507AbiAUFTj (ORCPT ); Fri, 21 Jan 2022 00:19:39 -0500 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:33686 "EHLO mx0a-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231447AbiAUFTf (ORCPT ); Fri, 21 Jan 2022 00:19:35 -0500 Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 20L045iE018296; Fri, 21 Jan 2022 05:19:31 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2021-07-09; bh=LNbi5Yh6ZLH9WdE7OeKLnm0Pecr0XTe7WfHMkgVn79I=; b=VMQMHcj9mcO1l/JpLo6mmEo5kYeRdLOwXH5vMzO3NBI6JYp5N0E+k/nmV6kMPPO751L2 zsMitllKcuFYLCkJQTTupmpkXphTPqFUcJJKvpHA09ElulHbRH/1Uacp16el3kkhA/uA Y4PPzRl2eTM7bxYZg7pG1sSNgD/RZUG+K3dG4JkeXVZXwupPXzkJ+h2paFjqss+TGhZa qZvor8A4ScaUZtaT7OBSgqwjM5EpqiCVpo/w+h9MagbZvEgV5PcPkEoBrtSNpxl2s6KP bAq93r3ZP4k3IJ+mPLvKGcw3tLDW4wDm8H8yKBITYjlATdv3N92DZJAbDbD5zkdbT9QX nQ== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by mx0b-00069f02.pphosted.com with ESMTP id 3dqhycgcq8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jan 2022 05:19:31 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 20L5GoAu082183; Fri, 21 Jan 2022 05:19:30 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2174.outbound.protection.outlook.com [104.47.57.174]) by userp3030.oracle.com with ESMTP id 3dqj0vbjy9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jan 2022 05:19:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gB4y4M5sWaYE7rPiPR1dY3CBzHnQpDZwopn4VvvwXagVQJc0hvGUAWDTD0LUFdhhTWg7m2b0LrxzgKgrbLnG1fKkh0XWuM9hkRliMIr9M/7JZ85s5vcIqJPPguE2Vdq8DMsGz9w5RcksXLgzflzpaVYCIc5cz6uUsOmj3Uh75sMhmlvM7o04KyGsUWapl3DCkcChlzJU95sSBJ9wL5eSAoU4TSBi2SKlDDVzTW9+N9z/NQhGVsso7mlZkEVEA7k74WzV/UNFheE4PTZQ5Z9I1rE0AQ0RENALV72A09sAT+OczmMmFAoV5O/9ZZ9AZRIAyHBaFpC4wt+fnJZoAUYzUw== 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=LNbi5Yh6ZLH9WdE7OeKLnm0Pecr0XTe7WfHMkgVn79I=; b=kab31EFrxVEfM0/H7t7SOTDVExJ1M+czpBKjjFEPDoz9PRVhKREN81LdbFgVzTyOvKJ/U9u7/oIxRN38jD0ltDvZDec8lPuWy9xuV+RxwRvDpng5JB7AO2Mc0niy8h2qBH3TZOyEsebw7KH4Yk6dLHhu6mKcksOKZoW6PCRRvMqHTpfUtEVq4wjiBZP2gXlJk6roYbe6OKttUpi1TkdXVfUC3VBiEEfFEwvzvHxkJXAG5Z28O2xOrH+yS/I2xKN+Qom8OElykDUFXifyNb0yTs8d076zL2OUnUL3o1LeJpDNK4FaonTx4keYKldLT5pw38sqF7O9K2Zdf3bCk+eFUA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=LNbi5Yh6ZLH9WdE7OeKLnm0Pecr0XTe7WfHMkgVn79I=; b=GCjxWT7t3RG05Iq4Cy4i1SfWrvAoFk2t934zOJVULfUMEqin/BNv0Xuh+kt/FchVjOJlxE+0xTG0ZLDrXpLcdBvJcjf+1/0aaJFxArGddetLyiQarCTrYGPp9sCxNKTwjHoPOYkeoG5VYt6yvOic4/dxZ7EOMo3MDILBz8x8jPE= Received: from SJ0PR10MB4589.namprd10.prod.outlook.com (2603:10b6:a03:2d0::16) by BN6PR10MB1236.namprd10.prod.outlook.com (2603:10b6:405:11::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.8; Fri, 21 Jan 2022 05:19:28 +0000 Received: from SJ0PR10MB4589.namprd10.prod.outlook.com ([fe80::3ce8:7ee8:46a0:9d4b]) by SJ0PR10MB4589.namprd10.prod.outlook.com ([fe80::3ce8:7ee8:46a0:9d4b%3]) with mapi id 15.20.4909.011; Fri, 21 Jan 2022 05:19:28 +0000 From: Chandan Babu R To: linux-xfs@vger.kernel.org Cc: Chandan Babu R , djwong@kernel.org, david@fromorbit.com Subject: [PATCH V5 01/16] xfs: Move extent count limits to xfs_format.h Date: Fri, 21 Jan 2022 10:48:42 +0530 Message-Id: <20220121051857.221105-2-chandan.babu@oracle.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220121051857.221105-1-chandan.babu@oracle.com> References: <20220121051857.221105-1-chandan.babu@oracle.com> X-ClientProxiedBy: SI2P153CA0027.APCP153.PROD.OUTLOOK.COM (2603:1096:4:190::22) To SJ0PR10MB4589.namprd10.prod.outlook.com (2603:10b6:a03:2d0::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 09853f82-82ea-48d7-9c36-08d9dc9d98b2 X-MS-TrafficTypeDiagnostic: BN6PR10MB1236:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3276; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: I7YIbVMUUsrGzKfxdVU/QwhYmVUh0FX+CSMk3ILqgMMCwqg8C69flU8qefOO+Ot5MHP9pGF+KoIXvqthktq6U26JMQcIwV+8ywx7KQyqLQFsYeMqxWPgOTMVYwdIZL/HFTqCWOta/2HfMC2K3nJGQx7lwuFTVDL3O9NYd6onm7htVixnIaMwQpD+4mkcaAYJhOaYj72D1OigOxgbCin1jmYks/PXWldSWPmarmYxBcW1oWMjV20fWMq3TF0xwLOfrLIqzeGNSQQMfy+MmSjigSpZ4RjrMH4WtPiq+ogpWPHH380hbFWUGNssSu/ORzkGZSwxc6PBuSbubV5dyQfAMfxkaO3dmKl6V8a0VVkoHW2D6RXZTIZHKaFVXD0+d6JOrq/poqQQdMinaXjGTJdsKvAgoc0NLgNEew7TTG5GQzMG7mqhf3KR1Je9UsaWOfhFatOR0JCs2BLlsWHX2hCWtGETV2u+OTC3V1mX59VrQU3hHewAqDd1aqaJ4bgUoGkG1uC9Rg6lkiEAB8p5iyEKdOBz6R9ym7TL90NUd4nrkD/agt3ImaULEJry9YQxfcOOL69Dfsg1VvKOYibfAVOFcQBvJpI3ZskYoHQXk2nEuSDCF2ZZ5KP10/dqdM7mKsm6fFBzZ1OvPn2DMbsmddtsLSp5msSz50BZ3ezfKWFosBGGfvZEPFKVNKt+PLZPJwGb09jbnY5FzC2WEDFRcgvc0A== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR10MB4589.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(6916009)(2616005)(6506007)(186003)(508600001)(36756003)(26005)(83380400001)(6486002)(52116002)(38350700002)(6666004)(38100700002)(86362001)(2906002)(66946007)(66556008)(66476007)(8936002)(316002)(6512007)(1076003)(4326008)(5660300002)(8676002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: kr0hQdMGduqqCWl+DJwnOk2OtvhUPYGv+ilDPvV/b1r6IJtYfF9IEbuFDTWvf/3BhwiA23mK4aZJCnBa6uWuQhXNqyw8zUceeS3jzoQCn59sygmdpGT8xXOY3Cl66p8vlPcLR56HMTBbrFaFuMcmYek/vSrYg/MtZxTscChPL2d3dMVu1sGbI6K0jNFiW+OSZKNb9BZp0ovLvnPmp2ZjEJElewtEBSXlVK2fIJxxjYSWUyzOYb5T+40sukFitPhbv7KNhH5oYi5jDV6AvPOWN+b9kesRnXakk4C+RWjL9T6DIDq4uEJA5aM6MUz0HiopEUXSLuPsBOdhEEKh9JiNyybtaCMZpMtK6616E15HIVIiNrDhteA+DeJ2EB1VMDRFvACjcLCMniHxs4jcklpSDj3qvReuFoeEjAlIKAeVE6aKJf7WQ/fPdHET2jdp/LJ3Uzor8zQmIudd5SOR1cUgXQvoeXpWMy4gIAOyKCbkecS87Sg/uSjIfKFrpg9ODkcGxEf37M7piOq5k758HyEXRobZAa5oQM+9sWPZ0AfVLJl7WRioDIH3q5T4Vpk/ZM+c10W8JX9WSbe36B9XT2wUrvSecV1cdtGmz5V5YykPh1SMNULK3tMH6tdFtZRFIVt7ELeZUbPum4dbbe53B/2EfmSLvm9JSztUTiWlFAxAXNDWJ059qwcRSq3RfOvSyKyyvBA9jMx+XCOaaPmnneN06O5eJlquA2ODJU7JoVmLr2jw6boe9LkfSvIUWxN0qEjepKHLkZaancdKqXy+4viGiLRWPFuzey718e0GSMiE88T+T8TqUpSqYIgsRH/DZVy1NvEyqMva6p/1uecJTOJJuq//8EOW7L+1BJPP4uv801vkjooRwIXoeHrynetEQ+H9BHFk/5N+ubzD7UNvE1bxc0avf9jvzbk/4NRHOY2wNODcpL4el+HS0DvgMadzpYVFABPD02fzkp6C6ocznrbcjmEXsUzpCVsi0RlZiMBm/XW6Q9FwJm/aI2tqhpfmhYfJndz82OlW8duHM0obc009KyUeB/s4xe04T0tsqm1Nk+I3riZauBoo+pPgA3kfN3mnp5DHUqXm0d/aSyepm4dC8Ixl4HxGOFZqo69T3hieuVwxeDmXVgMMGf6sIKp6LjVvnTwWVPN0W+LxWYCL97iXBXd4AGYFLYiU5oXbx90MdsHCfosteaMpvk5kVY6qGq24mAZ3jNg13uDDLgSdeUBBTkhBgA0GVz/SoJXVHVLFbZd1pTo510q4Vo4fXIi3FmihTLF2jDw9LUjitdrrUAFqLjX27QUtF2ef1HHIvvjjRm8TjXgThveNeGn1lxvIslFqaYtnikaamel61ysYwMwxqrdWhlY92eJhFG+RscnZIr3y4DW6eGM96wjfLylhOhPudKfk8md/yxer2R1P7nUifmoaSg6HbTd3NbemmrGLZZiy+iIFit/rwKceunZSnvmPJWDglm/AZhd2RGNvP2PLokgivy7pfXuh2I7zJSWsAIuPxIOEkyCobLFaUlEkRiMTFj2O9Af3luR6BU3tnPMqc3o7qGhAVnbbVAzjJ5PiGkHCQh8eZ9Z2kKLBc54rlVblDOMQdNUV7kwhrki9/Jf6jrEi6UuvoGck45CpzoAxkfo= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 09853f82-82ea-48d7-9c36-08d9dc9d98b2 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB4589.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2022 05:19:28.2098 (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: F9kHmxv6Jzx0rOzGaN6YhmTqwU+Eah7ITvfQVkvbZFxgoRnszoiCa5clZz+LRa/5kULrLFKKCKF+Mk7DsjWD8Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR10MB1236 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10233 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 mlxscore=0 suspectscore=0 spamscore=0 mlxlogscore=999 bulkscore=0 malwarescore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2201210037 X-Proofpoint-ORIG-GUID: 9aIMCA1Toqc1i_fB6bpMwwVd-I3dr12M X-Proofpoint-GUID: 9aIMCA1Toqc1i_fB6bpMwwVd-I3dr12M Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org Maximum values associated with extent counters i.e. Maximum extent length, Maximum data extents and Maximum xattr extents are dictated by the on-disk format. Hence move these definitions over to xfs_format.h. Reviewed-by: Darrick J. Wong Signed-off-by: Chandan Babu R --- fs/xfs/libxfs/xfs_format.h | 7 +++++++ fs/xfs/libxfs/xfs_types.h | 7 ------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/fs/xfs/libxfs/xfs_format.h b/fs/xfs/libxfs/xfs_format.h index d665c04e69dd..d75e5b16da7e 100644 --- a/fs/xfs/libxfs/xfs_format.h +++ b/fs/xfs/libxfs/xfs_format.h @@ -869,6 +869,13 @@ enum xfs_dinode_fmt { { XFS_DINODE_FMT_BTREE, "btree" }, \ { XFS_DINODE_FMT_UUID, "uuid" } +/* + * Max values for extlen, extnum, aextnum. + */ +#define MAXEXTLEN ((xfs_extlen_t)0x001fffff) /* 21 bits */ +#define MAXEXTNUM ((xfs_extnum_t)0x7fffffff) /* signed int */ +#define MAXAEXTNUM ((xfs_aextnum_t)0x7fff) /* signed short */ + /* * Inode minimum and maximum sizes. */ diff --git a/fs/xfs/libxfs/xfs_types.h b/fs/xfs/libxfs/xfs_types.h index b6da06b40989..794a54cbd0de 100644 --- a/fs/xfs/libxfs/xfs_types.h +++ b/fs/xfs/libxfs/xfs_types.h @@ -56,13 +56,6 @@ typedef void * xfs_failaddr_t; #define NULLFSINO ((xfs_ino_t)-1) #define NULLAGINO ((xfs_agino_t)-1) -/* - * Max values for extlen, extnum, aextnum. - */ -#define MAXEXTLEN ((xfs_extlen_t)0x001fffff) /* 21 bits */ -#define MAXEXTNUM ((xfs_extnum_t)0x7fffffff) /* signed int */ -#define MAXAEXTNUM ((xfs_aextnum_t)0x7fff) /* signed short */ - /* * Minimum and maximum blocksize and sectorsize. * The blocksize upper limit is pretty much arbitrary. From patchwork Fri Jan 21 05:18:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandan Babu R X-Patchwork-Id: 12719257 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 61FD3C43219 for ; Fri, 21 Jan 2022 05:19:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231145AbiAUFTk (ORCPT ); Fri, 21 Jan 2022 00:19:40 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:34882 "EHLO mx0b-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232204AbiAUFTh (ORCPT ); Fri, 21 Jan 2022 00:19:37 -0500 Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 20L04vTR017314; Fri, 21 Jan 2022 05:19:33 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2021-07-09; bh=QMo1SCQBxZ86ZoXdkJlmuLxVGcV/RdAme/gxwC8qTOo=; b=pc7JaErXVHcJiXnBiWq2XXLvzkPx82/teZssCamZfXaT9IqXjsaiqNgRZwXwD9IAWyZN /FDF5eCFSJv+2IyN13EXdT/SpBUqy/oXD/o3eH8Zg0OiDWD8kVWUMUq+5uaKz7Tro2+b gdcS0PGGwT1jLdFY13lIkithenG7Rqly1wg20gfI4+EdRHGz0Vy8pYqnAgdnXgvFwQ/g mRsAdloWcRW+nj5uxQGxizXZxP6g1RKHny8R8+V8DOMrd8n6vE/bKWro1iDHuHY0U4tZ Av9Lh2XeqZ1apUB+f6dInrhrw1B8Fe80hHJ5Isc4t+dpgxVxOMxVIBbyMapYR9vFt4k1 tA== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by mx0b-00069f02.pphosted.com with ESMTP id 3dqhydrc6p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jan 2022 05:19:33 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 20L5GUE1190235; Fri, 21 Jan 2022 05:19:32 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2169.outbound.protection.outlook.com [104.47.57.169]) by aserp3020.oracle.com with ESMTP id 3dqj0sh01y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jan 2022 05:19:32 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=haqyKKjt2xgQL43Pj3zMzI/JC6mIoeH5yEna/CFGOYwxbp6Wz55MP+yNPoJCI+steKj7j3ofNwIr7F3HGLsN2rwbnUa554IPlZmVSKxpdh0nA8H0gXJ6Ez1GyaAqgPpee6c3jGONh92muCLxu5Q8s1IsxKqsE731/B8LePEFo50ZiNRBImQOQzz43bLAfIrCbSWlQTdrplMw75iHqllAMknLCiUOq05jEmDlU3fRnghFCAyUsAC7y/mqtxSpR1gyi3pc+V5Rr6GPLtK6r1/M577YJcbCmfuDiCUykQqVVEaSw3gFG1whhhRz+i37H/Q2ike8uoaD5aY1ufOTiKWW7w== 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=QMo1SCQBxZ86ZoXdkJlmuLxVGcV/RdAme/gxwC8qTOo=; b=ei1Np2dMpZlHfoiAj7idyf/aoXzD7EWsM28gVtwlA4GGWq4nBs9CiZ/9pcBM6aO3q+VOsBnleFWG2xeK9uevDvDvNiZ/FGh1xYMpWkWwvjMoEAjTAe/T1FbRV9q3JrBTFIMvg7r2YlPlXR+wHyYN1bpmoR0xEBW5ZRO40yAB5UTQza4dirMVK6RWv3JYhTFPMg8f5ocj5qMRjNXgcPXI7gFeJMS9P13Lm/cklHmaK7pUCEHL5gF/S7DEGp2QXW048D0kETnSPKWYDcsqFFNhIgL8WifW7RAkHCK2lqOUuREr0G//J2QsThoeNP6FZ8ZwGRSNeYdAoJ5uMt+oA7w1yg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=QMo1SCQBxZ86ZoXdkJlmuLxVGcV/RdAme/gxwC8qTOo=; b=L4H9OYdDSe/xT4TwyI/nuExFkMv2lBiJO5Lq+MCBF8pz4mQx4h5N8wxmLjpylnPKLkivIYiuyKdby0JTNpi0JfoU6BL9+OJLJeFQt4ZE6PQNKwlPZKvwyI5EPURAe1jnTclcbjr9F33XJgc0uD1iuMOzRmNMvvnP7sScTtZbA0Y= Received: from SJ0PR10MB4589.namprd10.prod.outlook.com (2603:10b6:a03:2d0::16) by BN6PR10MB1236.namprd10.prod.outlook.com (2603:10b6:405:11::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.8; Fri, 21 Jan 2022 05:19:30 +0000 Received: from SJ0PR10MB4589.namprd10.prod.outlook.com ([fe80::3ce8:7ee8:46a0:9d4b]) by SJ0PR10MB4589.namprd10.prod.outlook.com ([fe80::3ce8:7ee8:46a0:9d4b%3]) with mapi id 15.20.4909.011; Fri, 21 Jan 2022 05:19:30 +0000 From: Chandan Babu R To: linux-xfs@vger.kernel.org Cc: Chandan Babu R , djwong@kernel.org, david@fromorbit.com Subject: [PATCH V5 02/16] xfs: Introduce xfs_iext_max_nextents() helper Date: Fri, 21 Jan 2022 10:48:43 +0530 Message-Id: <20220121051857.221105-3-chandan.babu@oracle.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220121051857.221105-1-chandan.babu@oracle.com> References: <20220121051857.221105-1-chandan.babu@oracle.com> X-ClientProxiedBy: SI2P153CA0027.APCP153.PROD.OUTLOOK.COM (2603:1096:4:190::22) To SJ0PR10MB4589.namprd10.prod.outlook.com (2603:10b6:a03:2d0::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 296b17a8-660a-4751-a493-08d9dc9d9a2d X-MS-TrafficTypeDiagnostic: BN6PR10MB1236:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:546; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2nBLhRduwmlPKQDykdMu19qkHADyLFf36IcfGNZCHgRkN7FYP6Sa/VbGMF9KNuN3i1szxnggYdZl4J9oIFiavFZ5uJLmWiQU012yFpLWeT7P7jOYc/9IJNoF4ujGYRkkjf5jVrFPYu0hl68MYdamhnMMZJpw6AEqWOJYkiIFx8yzwUV0+3fBorG2y01UCGjgT/J8ATkZvpoi9oVYioP9wfxbUZX/4BlG6Lvej8KxIL8lkG+PedXCE2VcoRDA+kRuBc2AnJGPYEB+RIb6BNZWAfkzOrLkRIt8XtNiqgMT18lHK9DBbQg39CO2Hw3Hy2OPCqNHLIaNzfzNmHADsrcAt+2K8QhF/bwgbUx6Q1yh6s+q+M0bPFuFYJUlnPV3zvluAgcsiEnR+HYWDAU3Gcm02XymEJs/GAZOWrYUGk6FXxLADTqkzCjCUaz2Qo4fW400quxq1GSCDFNr5RL7/OodM2fyyBk0B7TVBdUddLuFndOpxQyf4be0t3YrML3Dhk7p2czAgwaeS+j6+uKZODGXdDriV4YpCzlUNPMCHt4tczRI5mPLiUswz+GSBGNEtvPDyiGmVaYXK5YaYZU237VCqMtK45atfGQT43GyPU7KUI7H2+kTXlEeaI9JPj2K5qb0SHElL7x7meyE1STgy123828HsB6Za8naX9KIS04n4sfMXOID6Yb1lpxtu+jDR+1PF0lPsAUUravvRcZlVu17xg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR10MB4589.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(6916009)(2616005)(6506007)(186003)(508600001)(36756003)(26005)(83380400001)(6486002)(52116002)(38350700002)(6666004)(38100700002)(86362001)(2906002)(66946007)(66556008)(66476007)(8936002)(316002)(6512007)(1076003)(4326008)(5660300002)(8676002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: vZ5fi6ROFhWdBEOUi8Y6BO9NcT5TiupJlNs/lJGBtF7LDqzsnnJTObyiyuCp3GJJpOlqB5EwpKdAX42QPKAEUhCl6A+1UlO7wraWYq5dOEKrR+Hvj4k637oTVLWupXsCwVhcuPpeK9RQDfo6RzgEeGh1KPUBcOXSERNAJYyjJUfYa2TeFWoZYqpJEzschuvEoNHzfOSLJmvw0pfPEkEVMSZb8WyGSyDwClipdeefTLxL9Rwz4GEEmQdq+dR917R9YgaSqN8trIJx7gCrnM8hd6hv4EWbGIyYXrh9H+uCBPrCnjvxHhRJbAElSVD9l0iLUSruc/cnjaZT3YhMM7YQ0grdXlwR0ZKjNzFIo7nPxcOLIo3njZt/ZZ3aH+secSKSJ+Ceyki1zZmJh71yuEyYjMuR4RzEv6akmAShkanl0Y9e/VePGNCsvrYY6y1oH8ojc9xUwxZBtuR252IIkU58i+ufESqJym5aZtA5aEGJFfEI1vXd8KAncNsZJtj7foWZ4yTAYPMd+eYJCePdx9iOIVftUZdnIlVQ2XqyWnL4TdEjXPgUx4xtYnsr4SunAS3ZDhZ97XW7YEiWikNDZmlpqM3EQy1JnCYYtrrJSYQxn/4dMr+k94xQSkMuRUvkfA//LIhcu7N81irv9kPzYMj19ZxnCJq9vdxFa+HYrOEK4PMybns1fKzbw87c712XNCeaWKsG+c2SXITg27HouKkWQPNvliINz6WyCXSZSZgsk8X1ft/+HILsOFG2S4np8u2hWU7n09dv16AXDGo0DxBb8qrw9NCZjviDDjCKgc4FtlCAaw8bXwnz7oc7EPW9RgE8BchxprrfSkOU0y+U0WMHenNJTG2OmYM9vXIoD+4+8OtqeJ6mcbccKoaiy9X8v91A6sYDCTchu+OWSYumC9sT9eb0IdTmwyWeWDc706muHxALdhaHehYanUsZmJVuXyd6BQ9QcOsENt77ILKyQzKs9+jbwEQRsuL5eRmFf+IjwhCopv2QLkfRRp1I0nfWWtJsC3eySrGxGsHxa+4adEy5nH4fFEMZ7LzWXYanlja/1XZ2x0VQJHUzYFwbUGGJDUsdPWTn2ijqEvlzb2CqG3EwJ+sWnfMdtP4cd21q8MbN5jOebKqNZl3mCAwsSJ/IJ1aY9CFfczON6hDHYktISgTR8xu3URGUeESoddjr+N2FALanLLue6MDR2VY83tp9YtNtAGYKUX/0Ec6coN0320OtSvvGhUOzOQQsjIAQhKwzxuwKBnwzLi+lHoSDMJ+qkuiSUl+pURuCNnEGjOlciCrnry31D0ndRxFBmTLltX/MhtajjzNxLQntaaMgC9Kvgp/9GyS7AfKlxRv90Rg8MU2oN/eH79JKcHsKboZMuhEUNVRZ79k904p1zZZObJlkmmkYTMCt+n3/IYwVgeKPg6URn3qjNoSzVVxZx64Rm7O/Tm15m68Hwr5igAq1X4y9kVgaCWs0q9Gz2O+H/2321kJDA51oUHiYllHw9r3jKSloQiJ6XC1o/rfmDeH7DQ8Dgu8Sq7b3axkMxzY8OnFdD3FuePabMEQFnUQAeBGwiBMlN4VH5n8uG9kZIhLBbWT5NeANiDOSgA4T+tMFqJr00PMdR2fHhjPeaBg9L1iJ8fl4G5s= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 296b17a8-660a-4751-a493-08d9dc9d9a2d X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB4589.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2022 05:19:30.6950 (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: EDifFVhDhCiF6j1JMuxDPwVuUOrQXPIEYu+OGyko67vzQFSK4jllnwP3Lt9sY0Di/BNO0gO6PLXht6XPTJiB6w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR10MB1236 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10233 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 spamscore=0 malwarescore=0 phishscore=0 suspectscore=0 bulkscore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2201210037 X-Proofpoint-GUID: KJwDqnxrZvPmU6i77n43shiG4zOfXvMi X-Proofpoint-ORIG-GUID: KJwDqnxrZvPmU6i77n43shiG4zOfXvMi Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org xfs_iext_max_nextents() returns the maximum number of extents possible for one of data, cow or attribute fork. This helper will be extended further in a future commit when maximum extent counts associated with data/attribute forks are increased. Reviewed-by: Darrick J. Wong Signed-off-by: Chandan Babu R --- fs/xfs/libxfs/xfs_bmap.c | 9 ++++----- fs/xfs/libxfs/xfs_inode_buf.c | 8 +++----- fs/xfs/libxfs/xfs_inode_fork.c | 2 +- fs/xfs/libxfs/xfs_inode_fork.h | 8 ++++++++ 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c index 4dccd4d90622..75e8e8a97568 100644 --- a/fs/xfs/libxfs/xfs_bmap.c +++ b/fs/xfs/libxfs/xfs_bmap.c @@ -74,13 +74,12 @@ xfs_bmap_compute_maxlevels( * ATTR2 we have to assume the worst case scenario of a minimum size * available. */ - if (whichfork == XFS_DATA_FORK) { - maxleafents = MAXEXTNUM; + maxleafents = xfs_iext_max_nextents(whichfork); + if (whichfork == XFS_DATA_FORK) sz = XFS_BMDR_SPACE_CALC(MINDBTPTRS); - } else { - maxleafents = MAXAEXTNUM; + else sz = XFS_BMDR_SPACE_CALC(MINABTPTRS); - } + maxrootrecs = xfs_bmdr_maxrecs(sz, 0); minleafrecs = mp->m_bmap_dmnr[0]; minnoderecs = mp->m_bmap_dmnr[1]; diff --git a/fs/xfs/libxfs/xfs_inode_buf.c b/fs/xfs/libxfs/xfs_inode_buf.c index cae9708c8587..e6f9bdc4558f 100644 --- a/fs/xfs/libxfs/xfs_inode_buf.c +++ b/fs/xfs/libxfs/xfs_inode_buf.c @@ -337,6 +337,7 @@ xfs_dinode_verify_fork( int whichfork) { uint32_t di_nextents = XFS_DFORK_NEXTENTS(dip, whichfork); + xfs_extnum_t max_extents; switch (XFS_DFORK_FORMAT(dip, whichfork)) { case XFS_DINODE_FMT_LOCAL: @@ -358,12 +359,9 @@ xfs_dinode_verify_fork( return __this_address; break; case XFS_DINODE_FMT_BTREE: - if (whichfork == XFS_ATTR_FORK) { - if (di_nextents > MAXAEXTNUM) - return __this_address; - } else if (di_nextents > MAXEXTNUM) { + max_extents = xfs_iext_max_nextents(whichfork); + if (di_nextents > max_extents) return __this_address; - } break; default: return __this_address; diff --git a/fs/xfs/libxfs/xfs_inode_fork.c b/fs/xfs/libxfs/xfs_inode_fork.c index 9149f4f796fc..e136c29a0ec1 100644 --- a/fs/xfs/libxfs/xfs_inode_fork.c +++ b/fs/xfs/libxfs/xfs_inode_fork.c @@ -744,7 +744,7 @@ xfs_iext_count_may_overflow( if (whichfork == XFS_COW_FORK) return 0; - max_exts = (whichfork == XFS_ATTR_FORK) ? MAXAEXTNUM : MAXEXTNUM; + max_exts = xfs_iext_max_nextents(whichfork); if (XFS_TEST_ERROR(false, ip->i_mount, XFS_ERRTAG_REDUCE_MAX_IEXTENTS)) max_exts = 10; diff --git a/fs/xfs/libxfs/xfs_inode_fork.h b/fs/xfs/libxfs/xfs_inode_fork.h index 3d64a3acb0ed..2605f7ff8fc1 100644 --- a/fs/xfs/libxfs/xfs_inode_fork.h +++ b/fs/xfs/libxfs/xfs_inode_fork.h @@ -133,6 +133,14 @@ static inline int8_t xfs_ifork_format(struct xfs_ifork *ifp) return ifp->if_format; } +static inline xfs_extnum_t xfs_iext_max_nextents(int whichfork) +{ + if (whichfork == XFS_DATA_FORK || whichfork == XFS_COW_FORK) + return MAXEXTNUM; + + return MAXAEXTNUM; +} + struct xfs_ifork *xfs_ifork_alloc(enum xfs_dinode_fmt format, xfs_extnum_t nextents); struct xfs_ifork *xfs_iext_state_to_fork(struct xfs_inode *ip, int state); From patchwork Fri Jan 21 05:18:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandan Babu R X-Patchwork-Id: 12719258 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9462CC4321E for ; Fri, 21 Jan 2022 05:19:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229598AbiAUFTm (ORCPT ); Fri, 21 Jan 2022 00:19:42 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:38878 "EHLO mx0b-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229608AbiAUFTk (ORCPT ); Fri, 21 Jan 2022 00:19:40 -0500 Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 20L04MqM016482; Fri, 21 Jan 2022 05:19:36 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2021-07-09; bh=Jn9g1OToqf5eYnzOn4oPzopnlEgzyMI9HzPFjzEx+x4=; b=Cchj6vf/wHar5VkhZnKb9LiiaHplCeFwYcCtZh+MAIJU6x/hx5aauhYnRYarcYl71m4c /k70eCYy23imRkmieI6BTd55vX9O/ID8hwJ6Y5SDPbElRY8fBs7JiiR/gZFS6Npna8WI Si9t9CtT3qYWWv+FuUTO1XPcCORkq/o/Umu38+MYa0Gg1uAf8vJJ6RxoGHl3p8mUxLyn L/+Q8x016kF4xt/jNeBBahqc9WfRxOz5fbq0Yppry7x/vmCQlV3BZc5cruJdD7D0c8kx NRnWiRPh+VkjvMk8y7/VqTaLf0BVDsSgYUE40AyIrWm9vathECrENDtNio/vThaj4JUD IA== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by mx0b-00069f02.pphosted.com with ESMTP id 3dqhydrc6q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jan 2022 05:19:35 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 20L5GVYk190279; Fri, 21 Jan 2022 05:19:34 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2172.outbound.protection.outlook.com [104.47.57.172]) by aserp3020.oracle.com with ESMTP id 3dqj0sh02g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jan 2022 05:19:34 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jk1d2ovCZAubcWCrlQ6/6zGXU9DeUZcCFsDjBJzZGjwryyibRhlfZWie6uwqPvezbqrF8n3E9H9WhJK0DrrMCqbZVFEKNIcUPEOstH7sCHmKZmWK++4x16M/n55trXC4IrNNZTBEPK67uxXK3pfPRq5B79/ZyxnpZZ5eoEUaylEkLhFEPD39lt5BEcf2ZiLQMAYeSiNT2tvXfNuzJy8qgyic7sfe6RxzXvH1cubm3O8Z+aH8WgBKToQ3fMjRN168Qn/8zCzvlKO6L9S9EBiSYVuFBxHp/qK7UqvCRewic5Bz7nbG3zH9rgXjTxp5cF02UMEg7kFeEYqt+ONS+EdCHg== 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=Jn9g1OToqf5eYnzOn4oPzopnlEgzyMI9HzPFjzEx+x4=; b=BU1Oabe+ASAJh0mstuFu3w4PGpPbEMR/iElJYr2U8/vydBYuTc3Qq1v4pwHXVU1DGQtG/Bz6Z4V7kisDgFodaWYDSuAQkzrbuFxYiZQL5Qzx1bwPlPABpBahguW7G0bpX6deNMG7DbAlHpD899s3csZGAqn9Rz1zUGOi++LknBqEn3V5fT+Y2S/jonwOTJ/xPr3lmKlIjsVVG35dDjqm05PUFBgAIRoKWpPlDvuovarhLRoZ8guEbUu/puC0MT1NkqAYHvYtv9bErpbR5OqS/PcjCsdSsqqpaQUA/HlKaF0v02TZdKT4pSYL1vFXFyoUJ32pGQ1A8CmUjPh1I0qXNQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=Jn9g1OToqf5eYnzOn4oPzopnlEgzyMI9HzPFjzEx+x4=; b=vGYypcwpC/FP6/rHf35mnx+hV+BZ4WgLIvSPwwYbR0LoOzyOJ4XpUfDGf7mOVCIv6Eb80zDClApzV/dlLv2fhZzRkfRyKWY/t3pM2Ak3KxPaLeX4dvAkfzWk/BiNwNJ+JKyqf+3y29l6/cputVJXmj4KxxlLb0FcXiyA0CUavVU= Received: from SJ0PR10MB4589.namprd10.prod.outlook.com (2603:10b6:a03:2d0::16) by BN6PR10MB1236.namprd10.prod.outlook.com (2603:10b6:405:11::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.8; Fri, 21 Jan 2022 05:19:32 +0000 Received: from SJ0PR10MB4589.namprd10.prod.outlook.com ([fe80::3ce8:7ee8:46a0:9d4b]) by SJ0PR10MB4589.namprd10.prod.outlook.com ([fe80::3ce8:7ee8:46a0:9d4b%3]) with mapi id 15.20.4909.011; Fri, 21 Jan 2022 05:19:32 +0000 From: Chandan Babu R To: linux-xfs@vger.kernel.org Cc: Chandan Babu R , djwong@kernel.org, david@fromorbit.com Subject: [PATCH V5 03/16] xfs: Use xfs_extnum_t instead of basic data types Date: Fri, 21 Jan 2022 10:48:44 +0530 Message-Id: <20220121051857.221105-4-chandan.babu@oracle.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220121051857.221105-1-chandan.babu@oracle.com> References: <20220121051857.221105-1-chandan.babu@oracle.com> X-ClientProxiedBy: SI2P153CA0027.APCP153.PROD.OUTLOOK.COM (2603:1096:4:190::22) To SJ0PR10MB4589.namprd10.prod.outlook.com (2603:10b6:a03:2d0::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 21d8d8aa-ff54-4090-177b-08d9dc9d9b66 X-MS-TrafficTypeDiagnostic: BN6PR10MB1236:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:376; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Ph93uBbRA0KpVW6hVtpdpiJAyD0xtq5FzPI7gPnfetH7H6CBsvL57mSb5Z1IeLFsXNZCsF84qCwx3POOP6+YoaZk8+X1wkjgBgNUkLlrrjgKRUouikugsfXI8TzArEPtXvcd2eINZO02gU9bSBt3Xx84LsIGXDSuEuzMLcy4sHMzOypOBV41PiMbWALTNWCYMVz7pCkD8YmvEmDIPr/hYkkxwIBbARz8tAkcG7+GGdoBhCRLphC5JSE77bHgKsK/V8y3zDWp0EBsVOMCuvHXlXkjJYE37rXkmwMpzdf3DLpPl7xqs5Uq+JEumbJLrz4lZcYiXn9DCJKRd6PmhToANdvt6xpc4XLXv9nxDo8fMCsvvf+qCUxzzPtTtElfA6rCMCefeGZuNtMiBLUlODuEgkeEz59tenOauzUBg75noDK0B/ps3vH333o4BGkKLb7H2PbTHD2vosMYobBgcDGk7U142QPst0TmFxJFnNuJ4XLquH+DRsO9RN3giJx87fJjMaqrZ3ShHyr3QT3nqHqQXp0ygGlZV5Rc1kGVCVCHh4LK+ILH31OlaOXm9NU0hz5zwmWvEjT05TxAVzmvfOu9NA3vDL5wbMf6BW7Ecd7WsJnbDz23cArATCVVNNbh6gN8h/R6Axnf4ShL90fYfkIFxMt4y/7fyxfT3pt0Ddnja81w51CqJog483ER3KboQXESxKqPk2ZkKp+4FubYg+DuLg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR10MB4589.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(6916009)(2616005)(6506007)(186003)(508600001)(36756003)(26005)(83380400001)(6486002)(52116002)(38350700002)(6666004)(38100700002)(86362001)(2906002)(66946007)(66556008)(66476007)(8936002)(316002)(6512007)(1076003)(4326008)(5660300002)(8676002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: CpFWA1FK1ruVNE8SakSkeON0bCOanbMn/X/ELjX4jFzsetrDNgRdpAryJUybGvRfXwb0t0ENd/ouU2RH5k8d1dxoOeZhaPWNZ1rtSHj7xMM7SGIzMcNSmZ7hmo0pE552LyeatTFnTZH49BainLuyOtw6saGIGW594S5+0p90Zdf3RJcGRgNBIEwdonfNUn6izBbrLGThRQo/S7WxH9oAyjKlL+MMJPShYpEq6JZa102FaPBtMrvW5FQMNbyl6Lyv4bRxVlqdCb/a5qiAH1I9yfsEItj/JQwAwONRhHCOWdxKb6Z5TCS+/5jxKsLAgJ42CUaIkqpg3v6wmXcZpFr4QWlgfZw63m07ja8Rfz9W+CwbFy9/UAtqH5YHiUEyIUt4o6kWbmCUcYp4AAcmdSDbNxSEPR+wfXm0ChJx/kL55PAbHLb70S3HFmd7+bj95hjw53jxs4v+4sn+1jyRW56CvLgtMVN8/7hR8hDpUlE0OC4kVW1/IZK5nW/ngv1qpobkz5rQ66J39fouh5ugO3JFvhqm7S0e0GTbc9n1jCK2m1SF2CTLH38q/TvMoMg0nrv+aWw6ifyzLdKvkfoyZBFojKTpJslgo0pMYDNlcXdV/Jl05kNVH8lDa0whbapXSupGkDot1u+cvrJeV8hn/ZjafEXQeQCTm8GWXPt5O0opOEm3lKtn46dz/fizzLgAQtNDkOyHlhwM4vHPcMUeQa4iTQ37OLxcfmbCjhCCBIKklJRTo3IqdwlO4nGd0uW4nGAkUsemg+Rwqedcr/yw4+DGJix1QvG0CwZtxnxuwAgfLYqVtvgI8+OgosDX0jOS9kmWWjMfL9/k3F/hAFWLDt2kdeRKd0LOknCdhfVl8eSW1lfJ0njsjk1uVkvK43XVf+Vpz/UOK1RWeM0XuPH4IxH8eoDTDLGgzNP+QCRNAQmyda5EiSK7UJTfAz6VKH4p/lTDMvO4G2kFkZXZ1/Dt3TFlOMnClWT6P686WpwIbMU3f6LsMuaQuCAxJqAMHwn8pumjVR37RrsELJvMBoxHphIb2HJAL9Swd+cBzrDJiY7Apcm027URNeJKRmipw4xhcFrQxt0z7rhHAbMHvx60/HS+oEU16U3ku+SHm7hQ2yDrtU22ihKb1kpSLYwac/EIkxcJ2cv6QsOha6Aa8BUOtD9JgqYuCZLF0z1xKvA3EunLEIs/NeJXpeUoPU6VidfbY+rHWcSk1c1LDLE/3y8h3eyvKozoUFmsoDV8cwAZwCPbcveThluGR+1MvJLIG1wEUVfVMiLoGh+LVqztwfwopTLLzXB5xYIgByzL+PpoWze9nA/o+0Yn56qD2pXidG/9noAzUColFz2unv0aZ1CfDJSe11eBasnpl9M28nvEmsh+7SLLKwTtfxxfdzqQ4DftnYkfETLfQETNcMGNCnR0SJ63cKWxvBuCcF7VWkDL3+2JBnux399iWPgC2MvNTror1zT5AVwL7Exh0en8mOwYOHeVz/ZRzpBQtb1Mx/rH7XFv54bDTrgePmYFVp+G0nLazF/mIWmeb8FkTVG1HxSrwXLOemgUsNbTFPZg4E1Me4sNCLLs4AEdIJVX5ETNRzocwAgLnPR7nOCns5wi2VJlREewOGQbWPTLCOkzmYpF1ju4M+0= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 21d8d8aa-ff54-4090-177b-08d9dc9d9b66 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB4589.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2022 05:19:32.7426 (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: 2lgOK3P8Ag/9lqUlq0jyDWd7I2cL0Lxob8+wbrwiAdf+9uXsAJzYDNDJuwMdSalv6bJwUxpP0O54RlGgaNbSoQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR10MB1236 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10233 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 spamscore=0 malwarescore=0 phishscore=0 suspectscore=0 bulkscore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2201210037 X-Proofpoint-GUID: 9lfFJUyMz2zk56BcDmWckjo4uIvpdCEj X-Proofpoint-ORIG-GUID: 9lfFJUyMz2zk56BcDmWckjo4uIvpdCEj Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org xfs_extnum_t is the type to use to declare variables which have values obtained from xfs_dinode->di_[a]nextents. This commit replaces basic types (e.g. uint32_t) with xfs_extnum_t for such variables. Reviewed-by: Darrick J. Wong Signed-off-by: Chandan Babu R --- fs/xfs/libxfs/xfs_bmap.c | 2 +- fs/xfs/libxfs/xfs_inode_buf.c | 2 +- fs/xfs/libxfs/xfs_inode_fork.c | 2 +- fs/xfs/scrub/inode.c | 2 +- fs/xfs/xfs_trace.h | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c index 75e8e8a97568..6a0da0a2b3fd 100644 --- a/fs/xfs/libxfs/xfs_bmap.c +++ b/fs/xfs/libxfs/xfs_bmap.c @@ -54,7 +54,7 @@ xfs_bmap_compute_maxlevels( { int level; /* btree level */ uint maxblocks; /* max blocks at this level */ - uint maxleafents; /* max leaf entries possible */ + xfs_extnum_t maxleafents; /* max leaf entries possible */ int maxrootrecs; /* max records in root block */ int minleafrecs; /* min records in leaf block */ int minnoderecs; /* min records in node block */ diff --git a/fs/xfs/libxfs/xfs_inode_buf.c b/fs/xfs/libxfs/xfs_inode_buf.c index e6f9bdc4558f..5c95a5428fc7 100644 --- a/fs/xfs/libxfs/xfs_inode_buf.c +++ b/fs/xfs/libxfs/xfs_inode_buf.c @@ -336,7 +336,7 @@ xfs_dinode_verify_fork( struct xfs_mount *mp, int whichfork) { - uint32_t di_nextents = XFS_DFORK_NEXTENTS(dip, whichfork); + xfs_extnum_t di_nextents = XFS_DFORK_NEXTENTS(dip, whichfork); xfs_extnum_t max_extents; switch (XFS_DFORK_FORMAT(dip, whichfork)) { diff --git a/fs/xfs/libxfs/xfs_inode_fork.c b/fs/xfs/libxfs/xfs_inode_fork.c index e136c29a0ec1..a17c4d87520a 100644 --- a/fs/xfs/libxfs/xfs_inode_fork.c +++ b/fs/xfs/libxfs/xfs_inode_fork.c @@ -105,7 +105,7 @@ xfs_iformat_extents( struct xfs_mount *mp = ip->i_mount; struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, whichfork); int state = xfs_bmap_fork_to_state(whichfork); - int nex = XFS_DFORK_NEXTENTS(dip, whichfork); + xfs_extnum_t nex = XFS_DFORK_NEXTENTS(dip, whichfork); int size = nex * sizeof(xfs_bmbt_rec_t); struct xfs_iext_cursor icur; struct xfs_bmbt_rec *dp; diff --git a/fs/xfs/scrub/inode.c b/fs/xfs/scrub/inode.c index eac15af7b08c..87925761e174 100644 --- a/fs/xfs/scrub/inode.c +++ b/fs/xfs/scrub/inode.c @@ -232,7 +232,7 @@ xchk_dinode( size_t fork_recs; unsigned long long isize; uint64_t flags2; - uint32_t nextents; + xfs_extnum_t nextents; prid_t prid; uint16_t flags; uint16_t mode; diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h index 4a8076ef8cb4..3153db29de40 100644 --- a/fs/xfs/xfs_trace.h +++ b/fs/xfs/xfs_trace.h @@ -2169,7 +2169,7 @@ DECLARE_EVENT_CLASS(xfs_swap_extent_class, __field(int, which) __field(xfs_ino_t, ino) __field(int, format) - __field(int, nex) + __field(xfs_extnum_t, nex) __field(int, broot_size) __field(int, fork_off) ), From patchwork Fri Jan 21 05:18:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandan Babu R X-Patchwork-Id: 12719259 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D3AE2C433EF for ; Fri, 21 Jan 2022 05:19:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229608AbiAUFTm (ORCPT ); Fri, 21 Jan 2022 00:19:42 -0500 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:40744 "EHLO mx0a-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231174AbiAUFTl (ORCPT ); Fri, 21 Jan 2022 00:19:41 -0500 Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 20L043Ok017784; Fri, 21 Jan 2022 05:19:38 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2021-07-09; bh=d3lMqiif1aKxdn3iKKw48ManH7yGbbzd4vjwDIFeWlo=; b=wn/tD7mSYrxMmy1EU5ENfB5SjmSnBXqM+Wo4odWZ7srLzWt5dJ8C7ipWRVoXeHfddzfI ngc0DPXBeqSSZHw2ADKGbvWyi3doKOlsvs67ANsa1ojt0f5KnQSgjAupUiHK1dSRgK5S sCjkXfg+R3/sjDcUSL/ZNunVycN9+DWuuQvB9BdFpNdgQf9gBDxaJf+8XzMyT5zipe/0 f10OBcyEah0Bk1gmNRAHRW7oz4AiXSy7VyP/a/4FX8GNg3iLI0ATgIbiYrcatzfhyUnJ RivObYQ4KaoEeiqmf/uCgglbSFkTBrYtwUzouuVzepyZM2TbGR/rHFC2eVSkqycIKFgO 1Q== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by mx0b-00069f02.pphosted.com with ESMTP id 3dqhyc0d29-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jan 2022 05:19:38 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 20L5Gg4e081935; Fri, 21 Jan 2022 05:19:37 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2177.outbound.protection.outlook.com [104.47.57.177]) by userp3030.oracle.com with ESMTP id 3dqj0vbk08-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jan 2022 05:19:37 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ixWR6neTWyEWOlCGmAR1EUzuD7tOnaHkAuCn9kzIqHvkgzG1UhcWYzbDIDkDnX9ks/HbzG4YkhOrc2EnDkdychd5ytkx8yqIWsVjU6HDzEFxuDquDRy25qh8s87o8CuMvbSk1A+S3v+RZkAc4J3y4XhFcGm025YmTklOwlJpZz/kelwfTmfWqnGGFQxa69e3uTixjWbf2BfrhklX07TNz33/V52e3NM9tVMzmoREb8jyWuJsvB3uEt3DUbdYny8LIIAFlBy55rWm9cmjgDaHrbXIBt1me7t3is2+aE2oWsl+kt14/wnXhWUoCnPM0fsrNHKli2fmFzRKeeW3QBxYRg== 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=d3lMqiif1aKxdn3iKKw48ManH7yGbbzd4vjwDIFeWlo=; b=HDu8VfBhmQYtCvHBniqIjebzUqVpcRoZa/RR+NJIAV1a2HVFb7zCP2Jlrz1MVQuM9OaGr1wGdXE7tu+Cwlpppv7KBhILfvdAHTEY9BayXnkcmZb8HV9DLGKQEMmwX5AAYqOQu/CtI6PrQGp9DBkqo/ShT1qVrTYFfygDLG2XcOi3CLSik6P0QfED5SiMECpHSqL2Pbt2avQl8LV4GZg5M7i/Ib1NtoJRq6LUHeT778/OAi2VNtn/6/E2sqaHqYmNNP4eULJxYVI4uxi9PQd7hm9uw0H/W6nJqnnALfSPC1otm7XeJoVqnFA/hZ+l31Sn0qcrX1xY3AavdNTd71jwxQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=d3lMqiif1aKxdn3iKKw48ManH7yGbbzd4vjwDIFeWlo=; b=Xakas4C24bWYPrOEfHDVgS9UHTZ8PQEzyXsjbRKBZnYHuxu/uvwOrL7BQFsbzg00wFacQ0qTWp7Y66Pveifayt4NQYqCxexXHP/D8hgquriLWerIgFCuGhZqcWiNwsLYBm2RZrUTmEm4sX2Kjy8YCdt3wFg8ozYTqva/GyfdeEY= Received: from SJ0PR10MB4589.namprd10.prod.outlook.com (2603:10b6:a03:2d0::16) by BN6PR10MB1236.namprd10.prod.outlook.com (2603:10b6:405:11::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.8; Fri, 21 Jan 2022 05:19:35 +0000 Received: from SJ0PR10MB4589.namprd10.prod.outlook.com ([fe80::3ce8:7ee8:46a0:9d4b]) by SJ0PR10MB4589.namprd10.prod.outlook.com ([fe80::3ce8:7ee8:46a0:9d4b%3]) with mapi id 15.20.4909.011; Fri, 21 Jan 2022 05:19:34 +0000 From: Chandan Babu R To: linux-xfs@vger.kernel.org Cc: Chandan Babu R , djwong@kernel.org, david@fromorbit.com Subject: [PATCH V5 04/16] xfs: Introduce xfs_dfork_nextents() helper Date: Fri, 21 Jan 2022 10:48:45 +0530 Message-Id: <20220121051857.221105-5-chandan.babu@oracle.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220121051857.221105-1-chandan.babu@oracle.com> References: <20220121051857.221105-1-chandan.babu@oracle.com> X-ClientProxiedBy: SI2P153CA0027.APCP153.PROD.OUTLOOK.COM (2603:1096:4:190::22) To SJ0PR10MB4589.namprd10.prod.outlook.com (2603:10b6:a03:2d0::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9da37860-3504-4811-41ca-08d9dc9d9caf X-MS-TrafficTypeDiagnostic: BN6PR10MB1236:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:265; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xJnjpNmljwYuhCmokGoqYSrmXVZFvAv+EIvBQIxzQlYnJgiYrJAy2PAHw7pTQvAIUeOn8OjHToBcp7g9HqtQv75FEHvd1S6nmETlgYj/GRHD4OM3NZ68wP3b/jcrE3TQLoDcHKq59yHePqXbQ4/ceXwa/pyPoC1EvYM3728EGaohMT9kFDWDrCSHH+YzEsJKyRX8cy11b3ANSAio39/l1lFz5Wkr1PqVs8g8RdURTrmxXDG5RGx/8MVMohJy+EstoLfK8kOX3zZDUv/fwsHRA/g9qBwccI3Ep6qm04AtAyIRu+aB+20nY/xKyE14LP/4daqXZ7OnV+mLGXgDQRV/l8ISen46zNnVDW+0SjLzA/GTESGjCqduw5RpVPYSD15xHkh2QZM10ApwOeLcAUie4Y4FOuBE3rZ1j0bTw87ACtX2j2mVMRnaKsRNOZ6t5Se3yi2GE9Xajxll3yVPFsptuEL3Mj1vPX8oJriWsvlKYP/IAzrETrg0aiy3F4Bz3eODbErf/eXp5s1cv9teywuisrM8I4DeNx3AWEuqu2/HV3QDoMElbXonr/BmcYgqRXGvWrS3D7g31njlOmbjG1YsTE8l3zvKMTBhExFpBH2ivQchP5s435Guclm4Ap5BST/fzS7pW+IX8fA3Ev3aHPziuQzMXGgrx1q5X99as5tf2TEYXB68H/xQKuuO+4WXkdEjUKVP8Tb27xWVOTwd5NTM2w== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR10MB4589.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(6916009)(2616005)(6506007)(186003)(508600001)(36756003)(26005)(83380400001)(6486002)(52116002)(38350700002)(6666004)(38100700002)(86362001)(2906002)(66946007)(66556008)(66476007)(8936002)(316002)(6512007)(1076003)(4326008)(5660300002)(8676002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: gVlO9IlFPYSPrUGgv3ODWSNSRmjSzWZ0l7BRdL2Oi4WvHVQIfQjJx4dc7KkIhCY0WmEG+8wtlFmHNPvdD9Luz5sMQNVYk8gRhh3vb/4NbCTfUMEKIwtNweYh0/J5ePc8twz+bJO1VgAmWQHRTNoU0vVy8ygWN/3iEiHIdftmtnXaPC8g6E8A1CFaeV+2Ym6vbzn9y1rPPNxWljlyyCImNJIgX9JIC2wX/llNCvqfUuGw6BWXeFVxO4jGkf54GcT84blTziVpIcp7BkuRP6LQi/Xhw5EooYvJJw6mGMRue9HDgFzTJffIwkSdBWd26QHQn4o6Xf/ZUKxvIjBNu149CmVa9JsgM3VEeXbgxFhPZfDrO6xIf2yvi1tr6NQ2iO1dRvqtpgO1YlQVtnNuqsRz642oZe1OrqDZUhMhG2IkiyhsXon56tVlKDYNjRPbALheR7UQ3JyFqeXsOyqzMF8AETFG1pU6OFszrjH95VjjehG8sgbbR8NqWhIdV5SNh6RFlZbZ/NF5KP4JD7kbp/+ltQA9i4WcXisvsI7aF3gnnWIgkszVh3Wmoic6Fhu7vTd5cWNSfOkh8fFiS+yfWfJf8oKwiTvjorqiQsyEt/m4TkpQmJjB6ZjsnxATC5JnyuEfd9GN8hc6MeOYOdVsZ1ZZBEY+18yMoQnGmzYQFZqL83JMEdor/nyScyVOfnlQ791F0egsrPMJ1fF72AQMX5mcOIv8qBDJVNSgZ5dRiQlZ1WbqN8M7JUUssMYXTk8ujYHSHD/BBf71CDdfnCs6IyY29nCsYOIz6uR/CRKpGaqePhADqmtz4mNnW1XLYMQaQDSymeS0n4ywHp8m9IcVKG8liECd5dN4kjkq6qPvzjZAcFI4nsZGUyhfABGNq8OYBrQF+m/vgvqw5Z4g9/j0Lc6uAcCVk3p337ckXraVlnZ0eDMHiWp3Gna8gSt4NKtprAeQHHvIVnB4XS1r6JeNZfEvA1EW8q8i8nMhtdh5UnsdRVVYUFJtsIZqLidIByUORfy2iQ9eWKf469vNCnL+JW4t6XlStENFcJtYNkgG+VlZ1qLFp7R7WpC5cL2WYwWaPKXFv0YSO689ZjNhdBTFRy2eSi+1qq7Fz3Z4eM5NuYk7XCu5L30WcTfj75fep2TLMMAQzKs0Z61lcETU5wroJPP/gQ5A9j/wKtiaG93c+6XVRFGRFgLHJ/2sQioZB3tHt/lGnPebHZFNEYJwiVEU0Jgw8c6epA/A7W6VIn74GXak5SzbkyoTUBBYXVzLPN6l7fX8jX6mgw9zJ+waA6oF4+wj2VW9x0uSpju7qEYLJZ9sSZTJ48M3wnv0DUfDIqbHzcp4pc798ujDWfTv8EGAlSEb7kRcxwDkg89hfdkmaskbehYBlB2XToalehIcJxGSgrikTcoSVtbcdoPnuKocz5tnvFVTO0KPKOa9ybBeW/Q+ZBLE1SCMoPS3n3wHqKM25Cjh3fCnILBLeBeaiD/3oORnqInXPHV1IcY54uKJgN9yrxFSy3niekAsKbonB3j3K9tWlkBnCcFD66sNOYQOsyLIugAG036jKEnFpuV+bvtLSH9M4ROLUuQ3GrisPOSOTTCYiE8nx63XTXYQ2oq+QpOL+FB/Fj5Kk2rvFUBN22qXL5g= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9da37860-3504-4811-41ca-08d9dc9d9caf X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB4589.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2022 05:19:34.9623 (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: SBeFwnk9b/+C3BPt3zZ8pawJ6No7eLgVgWZ0lwz5tMLbXzIaiDqJwsKQnGjMVb77utATKvXWop/9uwdDrEUgcA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR10MB1236 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10233 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 mlxscore=0 suspectscore=0 spamscore=0 mlxlogscore=999 bulkscore=0 malwarescore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2201210037 X-Proofpoint-ORIG-GUID: 1qv9RY2qGitj7-fhIHum0soKHjBBgr_E X-Proofpoint-GUID: 1qv9RY2qGitj7-fhIHum0soKHjBBgr_E Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org This commit replaces the macro XFS_DFORK_NEXTENTS() with the helper function xfs_dfork_nextents(). As of this commit, xfs_dfork_nextents() returns the same value as XFS_DFORK_NEXTENTS(). A future commit which extends inode's extent counter fields will add more logic to this helper. This commit also replaces direct accesses to xfs_dinode->di_[a]nextents with calls to xfs_dfork_nextents(). No functional changes have been made. Reviewed-by: Darrick J. Wong Signed-off-by: Chandan Babu R --- fs/xfs/libxfs/xfs_format.h | 4 ---- fs/xfs/libxfs/xfs_inode_buf.c | 16 +++++++++++----- fs/xfs/libxfs/xfs_inode_fork.c | 10 ++++++---- fs/xfs/libxfs/xfs_inode_fork.h | 32 ++++++++++++++++++++++++++++++++ fs/xfs/scrub/inode.c | 18 ++++++++++-------- 5 files changed, 59 insertions(+), 21 deletions(-) diff --git a/fs/xfs/libxfs/xfs_format.h b/fs/xfs/libxfs/xfs_format.h index d75e5b16da7e..e5654b578ec0 100644 --- a/fs/xfs/libxfs/xfs_format.h +++ b/fs/xfs/libxfs/xfs_format.h @@ -925,10 +925,6 @@ enum xfs_dinode_fmt { ((w) == XFS_DATA_FORK ? \ (dip)->di_format : \ (dip)->di_aformat) -#define XFS_DFORK_NEXTENTS(dip,w) \ - ((w) == XFS_DATA_FORK ? \ - be32_to_cpu((dip)->di_nextents) : \ - be16_to_cpu((dip)->di_anextents)) /* * For block and character special files the 32bit dev_t is stored at the diff --git a/fs/xfs/libxfs/xfs_inode_buf.c b/fs/xfs/libxfs/xfs_inode_buf.c index 5c95a5428fc7..860d32816909 100644 --- a/fs/xfs/libxfs/xfs_inode_buf.c +++ b/fs/xfs/libxfs/xfs_inode_buf.c @@ -336,9 +336,11 @@ xfs_dinode_verify_fork( struct xfs_mount *mp, int whichfork) { - xfs_extnum_t di_nextents = XFS_DFORK_NEXTENTS(dip, whichfork); + xfs_extnum_t di_nextents; xfs_extnum_t max_extents; + di_nextents = xfs_dfork_nextents(dip, whichfork); + switch (XFS_DFORK_FORMAT(dip, whichfork)) { case XFS_DINODE_FMT_LOCAL: /* @@ -405,6 +407,8 @@ xfs_dinode_verify( uint16_t flags; uint64_t flags2; uint64_t di_size; + xfs_extnum_t nextents; + xfs_filblks_t nblocks; if (dip->di_magic != cpu_to_be16(XFS_DINODE_MAGIC)) return __this_address; @@ -435,10 +439,12 @@ xfs_dinode_verify( if ((S_ISLNK(mode) || S_ISDIR(mode)) && di_size == 0) return __this_address; + nextents = xfs_dfork_data_extents(dip); + nextents += xfs_dfork_attr_extents(dip); + nblocks = be64_to_cpu(dip->di_nblocks); + /* Fork checks carried over from xfs_iformat_fork */ - if (mode && - be32_to_cpu(dip->di_nextents) + be16_to_cpu(dip->di_anextents) > - be64_to_cpu(dip->di_nblocks)) + if (mode && nextents > nblocks) return __this_address; if (mode && XFS_DFORK_BOFF(dip) > mp->m_sb.sb_inodesize) @@ -495,7 +501,7 @@ xfs_dinode_verify( default: return __this_address; } - if (dip->di_anextents) + if (xfs_dfork_attr_extents(dip)) return __this_address; } diff --git a/fs/xfs/libxfs/xfs_inode_fork.c b/fs/xfs/libxfs/xfs_inode_fork.c index a17c4d87520a..829739e249b6 100644 --- a/fs/xfs/libxfs/xfs_inode_fork.c +++ b/fs/xfs/libxfs/xfs_inode_fork.c @@ -105,7 +105,7 @@ xfs_iformat_extents( struct xfs_mount *mp = ip->i_mount; struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, whichfork); int state = xfs_bmap_fork_to_state(whichfork); - xfs_extnum_t nex = XFS_DFORK_NEXTENTS(dip, whichfork); + xfs_extnum_t nex = xfs_dfork_nextents(dip, whichfork); int size = nex * sizeof(xfs_bmbt_rec_t); struct xfs_iext_cursor icur; struct xfs_bmbt_rec *dp; @@ -230,7 +230,7 @@ xfs_iformat_data_fork( * depend on it. */ ip->i_df.if_format = dip->di_format; - ip->i_df.if_nextents = be32_to_cpu(dip->di_nextents); + ip->i_df.if_nextents = xfs_dfork_data_extents(dip); switch (inode->i_mode & S_IFMT) { case S_IFIFO: @@ -295,14 +295,16 @@ xfs_iformat_attr_fork( struct xfs_inode *ip, struct xfs_dinode *dip) { + xfs_extnum_t naextents; int error = 0; + naextents = xfs_dfork_attr_extents(dip); + /* * Initialize the extent count early, as the per-format routines may * depend on it. */ - ip->i_afp = xfs_ifork_alloc(dip->di_aformat, - be16_to_cpu(dip->di_anextents)); + ip->i_afp = xfs_ifork_alloc(dip->di_aformat, naextents); switch (ip->i_afp->if_format) { case XFS_DINODE_FMT_LOCAL: diff --git a/fs/xfs/libxfs/xfs_inode_fork.h b/fs/xfs/libxfs/xfs_inode_fork.h index 2605f7ff8fc1..7ed2ecb51bca 100644 --- a/fs/xfs/libxfs/xfs_inode_fork.h +++ b/fs/xfs/libxfs/xfs_inode_fork.h @@ -141,6 +141,38 @@ static inline xfs_extnum_t xfs_iext_max_nextents(int whichfork) return MAXAEXTNUM; } +static inline xfs_extnum_t +xfs_dfork_data_extents( + struct xfs_dinode *dip) +{ + return be32_to_cpu(dip->di_nextents); +} + +static inline xfs_extnum_t +xfs_dfork_attr_extents( + struct xfs_dinode *dip) +{ + return be16_to_cpu(dip->di_anextents); +} + +static inline xfs_extnum_t +xfs_dfork_nextents( + struct xfs_dinode *dip, + int whichfork) +{ + switch (whichfork) { + case XFS_DATA_FORK: + return xfs_dfork_data_extents(dip); + case XFS_ATTR_FORK: + return xfs_dfork_attr_extents(dip); + default: + ASSERT(0); + break; + } + + return 0; +} + struct xfs_ifork *xfs_ifork_alloc(enum xfs_dinode_fmt format, xfs_extnum_t nextents); struct xfs_ifork *xfs_iext_state_to_fork(struct xfs_inode *ip, int state); diff --git a/fs/xfs/scrub/inode.c b/fs/xfs/scrub/inode.c index 87925761e174..edad5307e430 100644 --- a/fs/xfs/scrub/inode.c +++ b/fs/xfs/scrub/inode.c @@ -233,6 +233,7 @@ xchk_dinode( unsigned long long isize; uint64_t flags2; xfs_extnum_t nextents; + xfs_extnum_t naextents; prid_t prid; uint16_t flags; uint16_t mode; @@ -391,7 +392,7 @@ xchk_dinode( xchk_inode_extsize(sc, dip, ino, mode, flags); /* di_nextents */ - nextents = be32_to_cpu(dip->di_nextents); + nextents = xfs_dfork_data_extents(dip); fork_recs = XFS_DFORK_DSIZE(dip, mp) / sizeof(struct xfs_bmbt_rec); switch (dip->di_format) { case XFS_DINODE_FMT_EXTENTS: @@ -408,10 +409,12 @@ xchk_dinode( break; } + naextents = xfs_dfork_attr_extents(dip); + /* di_forkoff */ if (XFS_DFORK_APTR(dip) >= (char *)dip + mp->m_sb.sb_inodesize) xchk_ino_set_corrupt(sc, ino); - if (dip->di_anextents != 0 && dip->di_forkoff == 0) + if (naextents != 0 && dip->di_forkoff == 0) xchk_ino_set_corrupt(sc, ino); if (dip->di_forkoff == 0 && dip->di_aformat != XFS_DINODE_FMT_EXTENTS) xchk_ino_set_corrupt(sc, ino); @@ -423,19 +426,18 @@ xchk_dinode( xchk_ino_set_corrupt(sc, ino); /* di_anextents */ - nextents = be16_to_cpu(dip->di_anextents); fork_recs = XFS_DFORK_ASIZE(dip, mp) / sizeof(struct xfs_bmbt_rec); switch (dip->di_aformat) { case XFS_DINODE_FMT_EXTENTS: - if (nextents > fork_recs) + if (naextents > fork_recs) xchk_ino_set_corrupt(sc, ino); break; case XFS_DINODE_FMT_BTREE: - if (nextents <= fork_recs) + if (naextents <= fork_recs) xchk_ino_set_corrupt(sc, ino); break; default: - if (nextents != 0) + if (naextents != 0) xchk_ino_set_corrupt(sc, ino); } @@ -513,14 +515,14 @@ xchk_inode_xref_bmap( &nextents, &count); if (!xchk_should_check_xref(sc, &error, NULL)) return; - if (nextents < be32_to_cpu(dip->di_nextents)) + if (nextents < xfs_dfork_data_extents(dip)) xchk_ino_xref_set_corrupt(sc, sc->ip->i_ino); error = xfs_bmap_count_blocks(sc->tp, sc->ip, XFS_ATTR_FORK, &nextents, &acount); if (!xchk_should_check_xref(sc, &error, NULL)) return; - if (nextents != be16_to_cpu(dip->di_anextents)) + if (nextents != xfs_dfork_attr_extents(dip)) xchk_ino_xref_set_corrupt(sc, sc->ip->i_ino); /* Check nblocks against the inode. */ From patchwork Fri Jan 21 05:18:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandan Babu R X-Patchwork-Id: 12719260 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8F50BC433FE for ; Fri, 21 Jan 2022 05:19:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231174AbiAUFTn (ORCPT ); Fri, 21 Jan 2022 00:19:43 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:41182 "EHLO mx0b-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231447AbiAUFTm (ORCPT ); Fri, 21 Jan 2022 00:19:42 -0500 Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 20L04F66016439; Fri, 21 Jan 2022 05:19:40 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2021-07-09; bh=2e4letPu/8X48bk2LnFYZ85vi0veWBapY+gWpBAvNIU=; b=UVKFUdBZJLNmc3V9tUPaFxoEBZ4WgUlIB+IhQNEd7FQq/VO4/XkpZJGh/P9kLo+VcCcH WOFLvur3t438mkBHpSDbA688AswI+at5fgn+4wqkqPK/rqIKimL67pl//B+zTjvMa5l0 OT9HrG1aBbMfAMPCkroeaGd+yl5f50IB5BHATjx1YyyzKyKu+B015DykmIt03X5HAKDN 3CR4Wh/WZcL1WU7/P0kxOkRbhku5HhjWlGt/byL3B2UWQSu6P/Emphe1LaiM4IfyauC1 NJ87Y3g68n1VCgfRx3zgltXuheAY7pPWT3j2caOwoNOxhmP+xbfwq35Ax94vL1/O+82z zA== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by mx0b-00069f02.pphosted.com with ESMTP id 3dqhydrc6r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jan 2022 05:19:40 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 20L5H10N018873; Fri, 21 Jan 2022 05:19:39 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2176.outbound.protection.outlook.com [104.47.57.176]) by aserp3030.oracle.com with ESMTP id 3dqj05h2tn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jan 2022 05:19:39 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BwF6WVSvudg3tH+iLsYApV5Vhbgvr8bye6vqB7KAJuP5q2gIkzLQQUS2kWtxtn4UQKq4wFvBq78YnM7m2lyPFUXC/N3oqTzmpq0+YKS1BBpp94duQvdIeigoJ1jNWNOM4K+28nBjPZRBK1jSUL0zwLDnmPPj//Frf5ELCXwVrZUgF7xdtywtuiMNUg4MdyMzwaQh8Z6g/wBYAJ+p9E5Nk1Rohqk6iZj6j23dLt8Slxlat4WQpqgHuX7BtDzIqwYdH5gBsvnILoI91DyBU/vwI+JuFuQ5ROS+0dfIQkpPnjLb1ouHIZTbMorsGQL8V18xotRTDOenwAWmhPXtQSws5A== 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=2e4letPu/8X48bk2LnFYZ85vi0veWBapY+gWpBAvNIU=; b=mBZWjyInkEGPPLb443l3MgNV+/OvdDfXJBKwxqjAclWCdCc7dcQavgOhVEZiJ7Pgw/x6ITXrpWTIELsnIVeeZDZ5U5IaXk1VvirpCl5kRG5o5MR5Dhw9iWcLH44AxXy5o5/4nZv7j3t5X1Sm5J+Yh/qSo5N4LFhyIASL/2McKMeNFbGPID9MH8Wd5QoDQeNMsYM9A2j4XHZQS97PCfyxn0g/CbCu8BKb+ciTP88DV3S7zVcq/p6MfWB959bp+Rc8Sa4kGUfqD05wzHE6Ah23CR7h4bj7IxrNmBIFUbCQaRZr8Y5IeI4MrSS7shaL6Zr96HAh52Od26EU7inQSeG/Bg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=2e4letPu/8X48bk2LnFYZ85vi0veWBapY+gWpBAvNIU=; b=x6YZhMJU+b0zboOJymWI5lwcHF5GhplYBOrRBFE9HsB7v4pZ2kmTcn38afrXOqh/4gE6ajDvEnMt2fBnS0ns9jlzKN736Tt3NJR9AWwufMHHshmR5W8Wf29fNPZJq6YhNKYARU3Jfuv5kwgAkzaKFrTdXa6edSZ7dfttW2ozsug= Received: from SJ0PR10MB4589.namprd10.prod.outlook.com (2603:10b6:a03:2d0::16) by BN6PR10MB1236.namprd10.prod.outlook.com (2603:10b6:405:11::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.8; Fri, 21 Jan 2022 05:19:37 +0000 Received: from SJ0PR10MB4589.namprd10.prod.outlook.com ([fe80::3ce8:7ee8:46a0:9d4b]) by SJ0PR10MB4589.namprd10.prod.outlook.com ([fe80::3ce8:7ee8:46a0:9d4b%3]) with mapi id 15.20.4909.011; Fri, 21 Jan 2022 05:19:37 +0000 From: Chandan Babu R To: linux-xfs@vger.kernel.org Cc: Chandan Babu R , djwong@kernel.org, david@fromorbit.com Subject: [PATCH V5 05/16] xfs: Use basic types to define xfs_log_dinode's di_nextents and di_anextents Date: Fri, 21 Jan 2022 10:48:46 +0530 Message-Id: <20220121051857.221105-6-chandan.babu@oracle.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220121051857.221105-1-chandan.babu@oracle.com> References: <20220121051857.221105-1-chandan.babu@oracle.com> X-ClientProxiedBy: SI2P153CA0027.APCP153.PROD.OUTLOOK.COM (2603:1096:4:190::22) To SJ0PR10MB4589.namprd10.prod.outlook.com (2603:10b6:a03:2d0::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6f505fff-0e34-4ff1-d87a-08d9dc9d9e21 X-MS-TrafficTypeDiagnostic: BN6PR10MB1236:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:428; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Z7fsyvkpqOKH4uLzscm+mkgZ3aw2tpPtUmepTC94zSwi5RMoZNP1E0+lqAcPxXijKTIZz3LLV+qDAsYMVv5tMwaAYsZI291bpL1jMPpr8q4cyq22kovKknE3wniHGrgpiX+5m/pQ2DSqc79whP4PW9Xh73rmDZewbwJ8/FopOvzn4QRyvczESG6PmDKO3V2mt1Q704JcuyRklWglA35qWq5T/xShZiv+XT/Eh2uxJ+hXtXSmS5dr68iO47pEq8KtrSBD+uR80wFTNPI85FQQa/5yIV26TaaUbzGCOdWxCTPLAjlKAcWEGMXLracFVZBxSpC1KH76c2HokIJcEXKUGtYbGKNjHseDkgeca/2SSYLzbsXSId6diRUxKU8OMAWdmuqAIvU2qwDzYZmIN09uuyZm/mCdJoutxOttlD/5XcgjoQrVwPu2+csnwIaoVYi9HBrN4xtobOsAQo7cgqZLje/RE7p5AF2KGA5N640Degus0hRv1OaGjhjJOowRkiHf4WXCXpXbYWHQx2fs8kGM9vomL1tWpHIRLZR46ptpXPXUYfzljsSE+55a0gUrfPpZ5R+wG9Mi2EwFFesOGJdlZCgt8LWG87tr0qkmCcoO+jd0nw+ID584Pi/3OejxVPU4FeeaKzl5mmqq6em1UnZVgIoCTEzz07EOoO0uuhXNbVuXNAkxT4Jj1jJnhihbh+wHg+WXfOaOAKK6qkGqyl41aA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR10MB4589.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(6916009)(2616005)(6506007)(186003)(508600001)(36756003)(26005)(83380400001)(6486002)(52116002)(38350700002)(6666004)(38100700002)(86362001)(2906002)(66946007)(66556008)(66476007)(8936002)(316002)(6512007)(1076003)(4326008)(5660300002)(8676002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: GNPm8QyVwkZncf4ZAgGmNN5gawWwud7KD+DlI923f+639F8VYoaICjTC7HfVJQvPr3YGyJeyzmnIvVBy0B+DC5lC9XzLlEXn7Xa4ipAOWnnIhi5K+1Fiv6wf5oK15HV5RJC1MOBf9n47ubQXP6XlS1e/rmbhTbi1EbvNDWMOQOSF8LkYIiYvgBYJMtXZjxcZX4ETC+4ViU9XrlSo0s0ZWzCFTRcyYE9Ump4S0rQHk7b+2neHg5DePo0w0zMBEIaKnF2m2CCvns25EnL8q1WQXlj8a37FGFVn0xfYE8jbEZ/M5hRlHDgAFnzb/bLF4U2kANo6olVlc4y2eSUlJueds1dL1j9yzss30T7VQTNA6/R1ZIg/ro7avdygFFyUvXlIefF8Wt79/yqhML64FMqWWss3rbTOAGId3s1zuGOLv4mIE6CJTLrEFLie0DttPgag5JIKOpYz1Ey5spBS89YbfhHd6tw4gBCDXzzpH7twKvCj82nSSEVQxMbVtwWPipYe3zqCSOsaWZcnC3dCdHhyul0vfhnyt59JHkc1Mz+8YA6Vgz4r6bWRwMLlaEfSY8Yrg1K6MwbCwwQPNoZCVqJhtsoNv/94bFem4zCHNe7vpsTFRqMN1TYV48v3zLHwaHBLRfSg0c72kb8OMdrz4TV+3pTgbAYiTHF1lBff3hU/Ivo/CkKB4V1q0sUpPB2kAza4wox1EmUdTyS1qtcc+4ynG3T6eZHp3GTdQ46YfjL5OjKIjdIj2W7eGYnv1wCqFMSL7Q+qjtp3B4arFt87vuweJYcRiZge1tRdg7cqMJe7LhKDHLpjXkvt7XQO374rspzHf2qeadfSkHOJwexYptEG67Ho9wbrNa+mlPh7CGD7GsR5wpGaVADDkLEy6pcfbkXVewaYzfzatmLds60r4ages1qo6B9Cll3kWj74NIj1ua3IccHlqcVRWud7cxp5wD2U00uZ9T+SFqkDJgB80U6Z2hzUYMkrMYSdwZ1GYlpRQU8Oof8rIptjYqMhvI92BlLcLvH3l88BVK4mq/1degt9ur9jXTDQQvLteRnLkIqsHhgAMK4bc/0+bpK+rs6M7Tj2AmXyKLtY5A6Y6qJmCjVQD9gdggqPuUDCRvHyjHUfMPfYEw6vqXasqE08Wkjj4hJXCoO5C32qfSKVvGpw7ev6mGbkG2GyCmyqR2YZESrCrAaBsPoLautx7lJqj9pLtFzDn/z/ue22Qe4ee7hLoGFSxmNBaEVldDzHw+aSj6tNvGPjjGLFfNXwF9HVVUFT5IjhCPXfwFGEmvXequc8ho7yMatAgvx1fFc5HJJkfVBuswFYGwGZQnap7UlhKt2orkJHZ2GxQRQBAXwJuFQeL+D4Fx+hQMWTJwlkCHnrc8NpPiI47TDWUEPSq7VQXFcrn9ve1MmB1T0V8IKuFwDiNR/rP5qoEwtk8g8ibuBHaSA64KNp8kw1/RJIXapWSCpK+5eIZwzAdIVIWJZxOx/FwWnnRYABh2a0o7aXCTl24y74TIXm8Qdz15SAywL7hfipde5CXBNafqvrpCI1BHYWEXC5HDap9aXVuXijC5dx4fPunFgwEPr9+3TAaXmpYHmJw6Y9xduAzd0j5NNF6GnEV1FWGP9vE6pFk5zQQYJnxjL5+iU= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6f505fff-0e34-4ff1-d87a-08d9dc9d9e21 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB4589.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2022 05:19:37.2973 (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: 2ZGVImhiectnI3xSYCiaOme2IxezRPmTJZyk0Ec9ssTi1t7HgF/mTDRgTI0C2TZGSyNE9EH32vsUCqNGX3w4Jw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR10MB1236 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10233 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 spamscore=0 mlxlogscore=999 malwarescore=0 adultscore=0 suspectscore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2201210037 X-Proofpoint-GUID: sJCa67fewFqFcodHdx8RFByLnJau-PTo X-Proofpoint-ORIG-GUID: sJCa67fewFqFcodHdx8RFByLnJau-PTo Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org A future commit will increase the width of xfs_extnum_t in order to facilitate larger per-inode extent counters. Hence this patch now uses basic types to define xfs_log_dinode->[di_nextents|dianextents]. Reviewed-by: Darrick J. Wong Signed-off-by: Chandan Babu R --- fs/xfs/libxfs/xfs_log_format.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/xfs/libxfs/xfs_log_format.h b/fs/xfs/libxfs/xfs_log_format.h index b322db523d65..fd66e70248f7 100644 --- a/fs/xfs/libxfs/xfs_log_format.h +++ b/fs/xfs/libxfs/xfs_log_format.h @@ -396,8 +396,8 @@ struct xfs_log_dinode { xfs_fsize_t di_size; /* number of bytes in file */ xfs_rfsblock_t di_nblocks; /* # of direct & btree blocks used */ xfs_extlen_t di_extsize; /* basic/minimum extent size for file */ - xfs_extnum_t di_nextents; /* number of extents in data fork */ - xfs_aextnum_t di_anextents; /* number of extents in attribute fork*/ + uint32_t di_nextents; /* number of extents in data fork */ + uint16_t di_anextents; /* number of extents in attribute fork*/ uint8_t di_forkoff; /* attr fork offs, <<3 for 64b align */ int8_t di_aformat; /* format of attr fork's data */ uint32_t di_dmevmask; /* DMIG event mask */ From patchwork Fri Jan 21 05:18:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandan Babu R X-Patchwork-Id: 12719262 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 812A2C433EF for ; Fri, 21 Jan 2022 05:19:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231447AbiAUFTt (ORCPT ); Fri, 21 Jan 2022 00:19:49 -0500 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:48428 "EHLO mx0a-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231278AbiAUFTs (ORCPT ); Fri, 21 Jan 2022 00:19:48 -0500 Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 20L045iF018296; Fri, 21 Jan 2022 05:19:43 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2021-07-09; bh=JqzMCjcj82CXu12QhuyO8lS2WoxfPRYP4aceV8RiL+k=; b=rUIvovog8q2oEJfl1lRmUahj0FOV791jEpn0iMw0SkYoeXfWVU3/bsXHtBleRiMbiS98 UEGHX/pV02SKKCQU0t4d6n8xvevS5qP9YX0tkf7/1cLACcgN1MDUcMdB6JCQYLhTI3W6 hAqLigGhVvbPrqomGoOQ+NgGDEtxhr7nZBqqFNR9AuM6O5fFm8FyINtk3vW8RXMuTmwh 1AEM71nQCfmwra9JpOQc+TAwHORZdVkfj1FvYm7PFPfTat8n4R4pn3lmEA0K6wSRFAr/ /MsOJX9oTnM86aZ5xaGzGmeve5OB6hOdreOKHeNVcEFvEkUgUUpNcz9WBLjspmxpY1GU kg== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by mx0b-00069f02.pphosted.com with ESMTP id 3dqhycgcqd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jan 2022 05:19:43 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 20L5GgjJ081948; Fri, 21 Jan 2022 05:19:42 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2170.outbound.protection.outlook.com [104.47.57.170]) by userp3030.oracle.com with ESMTP id 3dqj0vbk1d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jan 2022 05:19:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HgG4YOqr2MBkjoQ/PH66Wjt5V9NBRBSR9DH6CMMNFXTrWmdT1Y2Qlz7wp/N0PKT5XX3jiI5IaQHg9VFLiRvalZk8nOhO22UVSmWP3QeNTeTD6ETocLflGY+pqZstBDx0GL7AfDwnhlqFZn1xs1/G425SPx9nDZWsFXOKckqKJP7doh3BJoZ9z0RsRdYd0SqqOq+8+/2Y9wwv9VCm0xsWUnM8dWxkAJxc0StUOzvl0oMBdmZqlX2/vwpuJ2IP5o8tWtN7YkcUbGRu+llc21N/r2/FBm66FRHZ9ccBLHUc679wiGzUDbJPZsRziSVw5SqXI6UyQfLn0gz1Dn1dLbtK6Q== 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=JqzMCjcj82CXu12QhuyO8lS2WoxfPRYP4aceV8RiL+k=; b=MqrC7PIMD4Ng2Pd9p12gNMfp1ZKO2PE14k1gdMIQL1jfTxeMJgYhPF8PB6hWKAbn1bZBib2xVgI81hl3TZ8UXXYMzy0x+B2HzE2ggKUOLIJ6uTyQQvSVuERMwRUdW6J53iyiqBihqq3bXCL75+fd1WMaTNjRA2AhMa2sSz7cB/JRADsK5sX4ino6iYaGUNwkvhEPGY/OqTaS5EwYawdPVy4dnnnVWR9DlFZG2zmx5yCxfXfb4Mxflp80iwsOWHP12qG4lYNefE4oTloKK9pCrn90xuh1O1vUSyg7XkQpYdwUkoUG4k1QqkzdDu9aRKHAXSnYtig2SnSTSTQ1mWNr0A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=JqzMCjcj82CXu12QhuyO8lS2WoxfPRYP4aceV8RiL+k=; b=ex2Xe9ZSQv2gyQ4sBpEem+ThFYbWfBCPrtN0/C3vWBPVKgIfWggGw0fYmpJVcm7jWmo5Ve3MRAORRoPQuGNs8iYkCn783PemIqU6AW1HVBE6SxA+w+ajx6G0hBp088h9F2aoCMc6tOZDecDtJv+Q1ai6o5nF807j9WOWMRAABd4= Received: from SJ0PR10MB4589.namprd10.prod.outlook.com (2603:10b6:a03:2d0::16) by BN6PR10MB1236.namprd10.prod.outlook.com (2603:10b6:405:11::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.8; Fri, 21 Jan 2022 05:19:39 +0000 Received: from SJ0PR10MB4589.namprd10.prod.outlook.com ([fe80::3ce8:7ee8:46a0:9d4b]) by SJ0PR10MB4589.namprd10.prod.outlook.com ([fe80::3ce8:7ee8:46a0:9d4b%3]) with mapi id 15.20.4909.011; Fri, 21 Jan 2022 05:19:39 +0000 From: Chandan Babu R To: linux-xfs@vger.kernel.org Cc: Chandan Babu R , djwong@kernel.org, david@fromorbit.com, kernel test robot Subject: [PATCH V5 06/16] xfs: Promote xfs_extnum_t and xfs_aextnum_t to 64 and 32-bits respectively Date: Fri, 21 Jan 2022 10:48:47 +0530 Message-Id: <20220121051857.221105-7-chandan.babu@oracle.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220121051857.221105-1-chandan.babu@oracle.com> References: <20220121051857.221105-1-chandan.babu@oracle.com> X-ClientProxiedBy: SI2P153CA0027.APCP153.PROD.OUTLOOK.COM (2603:1096:4:190::22) To SJ0PR10MB4589.namprd10.prod.outlook.com (2603:10b6:a03:2d0::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b7587087-343e-4e99-dca3-08d9dc9d9f7d X-MS-TrafficTypeDiagnostic: BN6PR10MB1236:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OvHgrGz6ic+NnlDILrsJIjPgPVOgGvdpazRHeWBLKcvk9rrMSTZYopeteG5+hPMP5TpNU7+kJAMiTOLxY99gsPndRCmwG0j4NY0pDmXU49VfKxqZ3wu5ngrOsD84Mf0AjTZ1k+1SuFJdUiSsHIsP4pfroG6LjjzgWxhOW704sxbysDYBc1apnk9Ev3J5OWxqjgdgChl0q8CO8OeDbrJrf2Ydk6OeyJ3bDvGuVdUelSs/JljctiWzNoOFDV/067H0yqsCQrAt/vtVggVlXR2I2z5fpYh4Q8E4TaAgN9tIcTOrj3UKPWyOHUdxZ07QwmG0CvhLppFgFxm7t7hbOg1wnAKOQVQ8yH0SBc9imgPJsRw+RoXQcU4PnTicIVGF5IO/WC6h+VjRw+t6iD0g8ejgbH7MLNgOnWvMv1dySiKhUyYBBEikiG6ONqBY5zFTNC5KIGAYZXsxAP5Lwq23QgWQLSmFXu15LuT8pvMOY/jqBD8TN7oTz8j4nWxO1ziwhFVbQkawsgVENYTrPwjOtKeJKh77AA77SlT5G96yGkad2IpxCdXfRoMVdpmFTYiF3zWx1tApFjSmC9HEBfVFq/oTxCEnvIYe5asYDVGV99pQLZCOGbzS8zB90YCG2LNWiqU+Maj76eNdojelvF9hDCCl9fXwjQIvBqIzHQgbdwpaiTSd6sE8mz8mqP3KHTKDFRyf7u7D9vbpG1f7IUEv8kL2JQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR10MB4589.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(6916009)(2616005)(6506007)(186003)(508600001)(36756003)(26005)(83380400001)(6486002)(52116002)(38350700002)(6666004)(38100700002)(86362001)(2906002)(66946007)(66556008)(66476007)(8936002)(316002)(6512007)(1076003)(54906003)(4326008)(5660300002)(8676002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: VRsXm/ICbUg1paXaGpKs3aGtGiH4mZw0xaMjjhGkdGJJiIIEwd/zku8IUmCJ6Xk8DRMxXQVQtDbihm3rrOhRznn/9xnWx38fnU13wnBXJwfHqNf5qZKhIXRlz50UCMGPV7u5GJkAWq/JErSKKP1uAKXxMmIYr9ZKueHoN2jRq7rwZqWvwT96a6kXUDXlyVA2dcbdz+JTP8eXLrDXvTV9Mlw13PDpUTBbYzDjdZivRdUrIclzGFT5ezfT+1b13Kl1578KUceig9GLOJgu2Nyj5fwNSHe7CNwZQI4jb2B/utY3SIkwtYdbCrhkBg4iukMqb5lPwDlJLA9wnwr3JYRbCTLL5dn10++UMSMFf0RUeAExB98W8lDUTw4NuJyC7XKi8fwK2eXRNIbOS5itEatWsLJZzE/vunN1wPeOprOtb2R9ud58EutpNwf0DTPBYqsJNHd5pdbHQ0VcWGAao0lxNneQH7pdd4sShx9xyv3ZgDm9p1BgjjXfKI1jt03cr9Nn8WexwPVro0odOH8hTUUuYRPsRCSMA3Qb3sD/YlzcVQllWP4tPuX22O59yIEdHY8mr+lczHh6qzo/ZiMlLGLuEb1zh9Mf4TaaXRrh6zOlWcWwnnjvBJi6Oy5xM60OVoZdzsYbtdEQvbBLxVTsvy8Kn5d7DiIQoAe2PyxBlax3SeUScQQ0rFiMaHf3WgorRU9JG4PWDuFlo9S5hZvifoQA8yDS7HmSlGKhZLtf++JUOUJ03aWUlxhOpLvN+8Gci4jkZJsmIMPpO/g9E2RmajTHT2EueK8MqatIiSXBGCfA8kfV6LdIZRvnOMUdryyXJyuyfoYiXiFeSTa3tf9POAbavVtyrpv+ZJcZ2Ilgje57F62ONtJ2WkK46xtsxJ4dJjOrI+IjAt+TAZiIhsrB1GnTxvd7aOpFV3iTY7QCbHvZ9MCxLn29SOWcjteqZaVeyLElLESBKhNpQFap73QGHao/TVfuW0z5YUd3xoVdG+6aREMsX8UrNG4e/kaIonY1fJTi43fe/D/ZJ0d4KVTfwP1wmeEjyDYxUWFP5Zl3puVdkVMgO8qJP0TcaJSV5a23T0qH+s+NRiByaSUHKXba5H9mkUQ/Zus/KrkUmiNJa3zsJL3dFe1/MoAgzW0FEFzOHZMSxd+PrbpZucLf8Hsu34qtlKsramEF51xrQbf2ADymQ6mbClM5GOkdIYuzawZeOP9IIxfS64mIKMAvxvc2zrlYrzfFCwkgschsyAk4e0ipI4X9mccU+aXpblr8wfRmKsg4UCQhIfwHnRSF9JIIgJtipnu70QcowJ+cYUAeJksbD7sbg2AMytBypSDvsBcPFNAtovjQFi0AXE6I+YliBxjvVInSIu7b4fb5YINY729bWSfMNk3/vJKN01ovxokrop7FMWAeU9BTE7AEdIIY5IGmhapw/PWkSoEFzOigTtV1TVU77SxCavoaropvC715zc5i6ivfxmJupwvfyqfXEhSzH0icoEZ2rYICI6znmU9zKx2OLrrztdLDVS3C4qAnwTRSi1xUDbdO+pbCaizgGeep1f7Dsqu7rCO0eMGp80DivELPDlobtuf8fToqKCmkDmcXsj6QzOKpZbd8+ASIphwb/gsZiA2W+oG2J+K65oXeyq4= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: b7587087-343e-4e99-dca3-08d9dc9d9f7d X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB4589.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2022 05:19:39.7199 (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: duY32lO/IG8Prz0TiWhNuAvnmEmZcDJ+cPVfT+A8E+PTRMQrj7DZ//l/DDfx48L8AyCmjYROZxniR0xdRNbTvw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR10MB1236 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10233 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 mlxscore=0 suspectscore=0 spamscore=0 mlxlogscore=999 bulkscore=0 malwarescore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2201210037 X-Proofpoint-ORIG-GUID: jW-0mEBweXuT2EX1AEld0iaN9i-yTZU8 X-Proofpoint-GUID: jW-0mEBweXuT2EX1AEld0iaN9i-yTZU8 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org A future commit will introduce a 64-bit on-disk data extent counter and a 32-bit on-disk attr extent counter. This commit promotes xfs_extnum_t and xfs_aextnum_t to 64 and 32-bits in order to correctly handle in-core versions of these quantities. Reported-by: kernel test robot Signed-off-by: Chandan Babu R Reviewed-by: Darrick J. Wong --- fs/xfs/libxfs/xfs_bmap.c | 6 +++--- fs/xfs/libxfs/xfs_inode_fork.c | 2 +- fs/xfs/libxfs/xfs_inode_fork.h | 2 +- fs/xfs/libxfs/xfs_types.h | 4 ++-- fs/xfs/xfs_inode.c | 4 ++-- fs/xfs/xfs_trace.h | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c index 6a0da0a2b3fd..6cc7817ff425 100644 --- a/fs/xfs/libxfs/xfs_bmap.c +++ b/fs/xfs/libxfs/xfs_bmap.c @@ -52,9 +52,9 @@ xfs_bmap_compute_maxlevels( xfs_mount_t *mp, /* file system mount structure */ int whichfork) /* data or attr fork */ { + xfs_extnum_t maxleafents; /* max leaf entries possible */ int level; /* btree level */ uint maxblocks; /* max blocks at this level */ - xfs_extnum_t maxleafents; /* max leaf entries possible */ int maxrootrecs; /* max records in root block */ int minleafrecs; /* min records in leaf block */ int minnoderecs; /* min records in node block */ @@ -83,7 +83,7 @@ xfs_bmap_compute_maxlevels( maxrootrecs = xfs_bmdr_maxrecs(sz, 0); minleafrecs = mp->m_bmap_dmnr[0]; minnoderecs = mp->m_bmap_dmnr[1]; - maxblocks = (maxleafents + minleafrecs - 1) / minleafrecs; + maxblocks = howmany_64(maxleafents, minleafrecs); for (level = 1; maxblocks > 1; level++) { if (maxblocks <= maxrootrecs) maxblocks = 1; @@ -467,7 +467,7 @@ xfs_bmap_check_leaf_extents( if (bp_release) xfs_trans_brelse(NULL, bp); error_norelse: - xfs_warn(mp, "%s: BAD after btree leaves for %d extents", + xfs_warn(mp, "%s: BAD after btree leaves for %llu extents", __func__, i); xfs_err(mp, "%s: CORRUPTED BTREE OR SOMETHING", __func__); xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE); diff --git a/fs/xfs/libxfs/xfs_inode_fork.c b/fs/xfs/libxfs/xfs_inode_fork.c index 829739e249b6..ce690abe5dce 100644 --- a/fs/xfs/libxfs/xfs_inode_fork.c +++ b/fs/xfs/libxfs/xfs_inode_fork.c @@ -117,7 +117,7 @@ xfs_iformat_extents( * we just bail out rather than crash in kmem_alloc() or memcpy() below. */ if (unlikely(size < 0 || size > XFS_DFORK_SIZE(dip, mp, whichfork))) { - xfs_warn(ip->i_mount, "corrupt inode %Lu ((a)extents = %d).", + xfs_warn(ip->i_mount, "corrupt inode %llu ((a)extents = %llu).", (unsigned long long) ip->i_ino, nex); xfs_inode_verifier_error(ip, -EFSCORRUPTED, "xfs_iformat_extents(1)", dip, sizeof(*dip), diff --git a/fs/xfs/libxfs/xfs_inode_fork.h b/fs/xfs/libxfs/xfs_inode_fork.h index 7ed2ecb51bca..4a8b77d425df 100644 --- a/fs/xfs/libxfs/xfs_inode_fork.h +++ b/fs/xfs/libxfs/xfs_inode_fork.h @@ -21,9 +21,9 @@ struct xfs_ifork { void *if_root; /* extent tree root */ char *if_data; /* inline file data */ } if_u1; + xfs_extnum_t if_nextents; /* # of extents in this fork */ short if_broot_bytes; /* bytes allocated for root */ int8_t if_format; /* format of this fork */ - xfs_extnum_t if_nextents; /* # of extents in this fork */ }; /* diff --git a/fs/xfs/libxfs/xfs_types.h b/fs/xfs/libxfs/xfs_types.h index 794a54cbd0de..373f64a492a4 100644 --- a/fs/xfs/libxfs/xfs_types.h +++ b/fs/xfs/libxfs/xfs_types.h @@ -12,8 +12,8 @@ typedef uint32_t xfs_agblock_t; /* blockno in alloc. group */ typedef uint32_t xfs_agino_t; /* inode # within allocation grp */ typedef uint32_t xfs_extlen_t; /* extent length in blocks */ typedef uint32_t xfs_agnumber_t; /* allocation group number */ -typedef int32_t xfs_extnum_t; /* # of extents in a file */ -typedef int16_t xfs_aextnum_t; /* # extents in an attribute fork */ +typedef uint64_t xfs_extnum_t; /* # of extents in a file */ +typedef uint32_t xfs_aextnum_t; /* # extents in an attribute fork */ typedef int64_t xfs_fsize_t; /* bytes in a file */ typedef uint64_t xfs_ufsize_t; /* unsigned bytes in a file */ diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index 6771f357ad2c..6813c2337da7 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c @@ -3495,8 +3495,8 @@ xfs_iflush( if (XFS_TEST_ERROR(ip->i_df.if_nextents + xfs_ifork_nextents(ip->i_afp) > ip->i_nblocks, mp, XFS_ERRTAG_IFLUSH_5)) { xfs_alert_tag(mp, XFS_PTAG_IFLUSH, - "%s: detected corrupt incore inode %Lu, " - "total extents = %d, nblocks = %Ld, ptr "PTR_FMT, + "%s: detected corrupt incore inode %llu, " + "total extents = %llu nblocks = %lld, ptr "PTR_FMT, __func__, ip->i_ino, ip->i_df.if_nextents + xfs_ifork_nextents(ip->i_afp), ip->i_nblocks, ip); diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h index 3153db29de40..6b4a7f197308 100644 --- a/fs/xfs/xfs_trace.h +++ b/fs/xfs/xfs_trace.h @@ -2182,7 +2182,7 @@ DECLARE_EVENT_CLASS(xfs_swap_extent_class, __entry->broot_size = ip->i_df.if_broot_bytes; __entry->fork_off = XFS_IFORK_BOFF(ip); ), - TP_printk("dev %d:%d ino 0x%llx (%s), %s format, num_extents %d, " + TP_printk("dev %d:%d ino 0x%llx (%s), %s format, num_extents %llu, " "broot size %d, forkoff 0x%x", MAJOR(__entry->dev), MINOR(__entry->dev), __entry->ino, From patchwork Fri Jan 21 05:18:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandan Babu R X-Patchwork-Id: 12719261 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 55679C433EF for ; Fri, 21 Jan 2022 05:19:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232153AbiAUFTr (ORCPT ); Fri, 21 Jan 2022 00:19:47 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:46552 "EHLO mx0b-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231278AbiAUFTr (ORCPT ); Fri, 21 Jan 2022 00:19:47 -0500 Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 20L03ra2001018; Fri, 21 Jan 2022 05:19:44 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2021-07-09; bh=6kQ768hsebW/CP/T66O0BO07Aa4mOY83l0g/6vPvftg=; b=qhIIeDKvPbp8B9I1H+KIoHvECTRCU/qO0WQc3YXzzL8/3oG7xNwZA4cpMss3YnpvmQ0g PKRmeGKv9c8QMIjBRX6iDw8wK43cnaMGM+hw3UaR7HHMhHKABCK81QXKnjYubO9QVUaX MqmzyYrfYdBNMznmg2bPckSfb21blJ2TCOmr4dkJdaNYFAO0qRYyDJ/bu74a5JvR6a/8 fUvXpnsxcehx8VjkmwjGHjJQAvfjzvysAcJBTWkcYzK4SMlUTtsS9RYMs/6cfunQG4st 6dCx8KRBQfAqVS9HY8nhVXVaVEk+R+jJ7IEGUEsrSU3ILmgBLtClUldxYtHHvN0c66hm jA== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by mx0b-00069f02.pphosted.com with ESMTP id 3dqhy9rcn3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jan 2022 05:19:44 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 20L5GUWO190261; Fri, 21 Jan 2022 05:19:43 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2170.outbound.protection.outlook.com [104.47.57.170]) by aserp3020.oracle.com with ESMTP id 3dqj0sh03x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jan 2022 05:19:43 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MG+GLmZnsZANShRPvQncsZNgbrle4HTgpe9faN/DqKORdgBT9Wv8TmpBhEudgnE6DDeaJ1+tYElkkGqPdhBe6NNn9hNX25/LI9Ecg69cbe3qqvFtpNtMUmGXHhqEiychfje/QThsjGquup+vIqO1V16+zpLdNwAdy3gx78wcYwkCLQ7NjJUaeWem3ZshSnvuNlNJAcIFkibkdJUbAii2E+GOVA5Ee1c4s7oHhM2tU9WiQLRX2JqUJenyXO5pyOty+56CdxJrdRE3qMFmZq1rkaXTu3M9CUZoTx1Sbm+k8vtcVBo/Uemf8tpkD3GxQardHdD4JUggAxym3fPFsAnxKQ== 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=6kQ768hsebW/CP/T66O0BO07Aa4mOY83l0g/6vPvftg=; b=Flq7gBrY8sMDLvE94jddMsxUHM/2IKcWsWOtnD3lwNKgCUD9+bgc2o3LHtveDm9Xtp1bFxFT/spT13BQIMkXIYipdt9Y1/VsJ3hBoeXD0sA4U/Mxj1fgiI1xJRdT8LjSjxLU9nWM7bKZIGPxj4HZxP/+/9k5Q1DqumpTPgPhM9a8QaOcF81gB6Iwi5bXv7yFBvsYz2nN1aKXAkU5Y2A9akIO/L7ohOaH5F2/2AG/6e4No65drSN7DEuHW7EP+hryJe88hqyXn98O2lDYS6VTh6jawSAAlDdL5pBYEwpvVeDFO2ZG8KatjfapuyBDXu6gUdclS0nO/49JHeMEaKM0Xw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=6kQ768hsebW/CP/T66O0BO07Aa4mOY83l0g/6vPvftg=; b=AowCfoWIlypqQp/6fTL9NDnR2FINGTqBsGBIh64JMJbfxtFVBypcp4P0jxoI3z+68eP6sepautzLUo5WCNbWlCyozHsE8O65XEYAuDI5S/+04zFPi2M2a2mVPGXu8kg49t2z58SPhdpekR05FXytVxjAcwdP1rc2ezHCSYGkrpc= Received: from SJ0PR10MB4589.namprd10.prod.outlook.com (2603:10b6:a03:2d0::16) by BN6PR10MB1236.namprd10.prod.outlook.com (2603:10b6:405:11::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.8; Fri, 21 Jan 2022 05:19:42 +0000 Received: from SJ0PR10MB4589.namprd10.prod.outlook.com ([fe80::3ce8:7ee8:46a0:9d4b]) by SJ0PR10MB4589.namprd10.prod.outlook.com ([fe80::3ce8:7ee8:46a0:9d4b%3]) with mapi id 15.20.4909.011; Fri, 21 Jan 2022 05:19:41 +0000 From: Chandan Babu R To: linux-xfs@vger.kernel.org Cc: Chandan Babu R , djwong@kernel.org, david@fromorbit.com Subject: [PATCH V5 07/16] xfs: Introduce XFS_SB_FEAT_INCOMPAT_NREXT64 and associated per-fs feature bit Date: Fri, 21 Jan 2022 10:48:48 +0530 Message-Id: <20220121051857.221105-8-chandan.babu@oracle.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220121051857.221105-1-chandan.babu@oracle.com> References: <20220121051857.221105-1-chandan.babu@oracle.com> X-ClientProxiedBy: SI2P153CA0027.APCP153.PROD.OUTLOOK.COM (2603:1096:4:190::22) To SJ0PR10MB4589.namprd10.prod.outlook.com (2603:10b6:a03:2d0::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 624e5ed6-f3c7-4d30-b218-08d9dc9da0dc X-MS-TrafficTypeDiagnostic: BN6PR10MB1236:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:186; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: e2y8gaAeNYSDX3Fr73bH8f4s7tmdoRmwuIgw9fP/bTvLtUlgPpsg3gfolS+KRy9ov2hjT+mSlLf2j8A34NbPCLTnISDvsLAY4CGwXRDVkiM1tyLCLsHLLXsL0f/RK+HeTxOAnC/4sFjpASstbYEqtOmeW2LmW9yqDqaXFjoLB0tKRQhsAfLZ9gy0Q6oev/BjHLoh9beQ4ZsqldkQUzAL22NAQVDBHHTw2Y0PehbRSw2S9oWjfxR8zAG8w9n+rm6bNTgWcltHtwxdGyb8J8zk7cXXhbxx4snznLsXY/f4trgMwq4+uMoxAfNR/5i74yNlf5CWYJq4LhlUFQifykp9IHJcfd/BYt1gEp0K9+twk21lnnGC/Y93ZehLUUWvNYaCfio7cnTjbvIYQ38CKRGNM9ZTGYGmZ+isT2zNQKj4YItWyj8Nm6nyFLklDCVEaBFQHtr9zXDDxuh+LHM0ypGr164smznJyq9HYnYG5Bp34Us3JDnVPJoZ63wDYSo9jFrDa8AwMDAieBnevKLUQJ0Gaww7oBwGOJ7A4ghfyf78z8Kazyox2lKhn/Gq8TGGMzizo9f3TP4PegPooavXD9ifxk3ypkKr+4VcEmuj0UflyXYdxp29rOzVkoGcMCq71B/x5F6nBPYPHblfhGs2o/ILM9yCDRzHMN1E35bxrX+Aw7FesJg+GlK3tRkEtniwWb3K X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR10MB4589.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(6916009)(2616005)(6506007)(186003)(508600001)(36756003)(26005)(83380400001)(6486002)(52116002)(38350700002)(38100700002)(86362001)(2906002)(66946007)(66556008)(66476007)(8936002)(316002)(6512007)(1076003)(4326008)(5660300002)(8676002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: iLJ0c+ACDMz48Wq5njgtGgRTwloku30QHppEBlDO+PVrJdvYOWwx5pv2Ek/NhmRSebxX3uDo13kJx1FUiw4GnQzZZ9YQUxLQcJj+sUwhxrtvAKL5CRzl6nxJveFJYBGP4yLP2SNdOj4gihhKDhjg5lae5LLFYtK2haJnNfOjZHzKeaGV9+FaYluhaFC0sqA7lXsMgQo3eQxO9uW+ZMaLLzAwaqwvcLyzA4qUIvkPCFMcj8Z2AIMc/X9Y0RhiNe0Gpug3137tTjxASzk+WoA17Or/fPmvSP1zsyiQhyyYOV5we5rT61XJijwPuP3cHShnzlZ003MlbsgOUmiS6xiZjfu/hTkbHrEvr2Wo7e89PzajYa2I7onApV8ErLsU/HfO/ffHlgXyeseRWLWEjGLo9gZWsjXSWd8cBmCcsz+FynrHvuraLB73LpjuQt4gh+VqndIwbNYDCjLe+hp9obU/mggL8HDi0YeRFY0fT960lT2woi7JNP1ScPvm2pNRM3cLDYyXaJJ8mDB9Yx16jBueNPArtv1jIO2Wy39HyEAwS7LB9GT16eTMDrLmoJ9InjqQK6WrK75wS+ZpsUU8oiixY8CoU9NAQu5fdf1V0o8vo0Iys4ZAyjpzVt2qk5VxHpfEbJhbKl2A/CkBqSqQROkSPltgNxI4b3MRNapzEyKjOaKeoPmtlUD0Up992GdmkkkW/tsaeDfRsgviBnv46kUX+TLpZwi2CG5W9xAg0zbcTY3C3nUq+1HtsqCN3bM23AbSjBfF4+7Qv91yCelf40EYT6wBFvceK/mbbYnV8afLVzBqiNmpZ5+tcPZD+hsO5VPZbDkWK6pU0/X3ZxEzftO4y+g8ZE2qF3GzxBrm7ArzQ1vTs8FxEp/5dFo7bUSsI/TpsoCB1dJvBbnZ8XWqxH2RXj9irofaIYdY/YOUAksb5IbVb2fhAIO1ZXfYrtlI/NTuxEZjl8DgFg0DEvMPIjdYUHat8nGSilAKEy+JQQLLA15844W7+LfuxE2XHhMeai3j8rSZT5RuE9A32Z6efUyPE0fxrQEhwtiuLxNpl3UWBLrkkg3VxqakfiyiOl+gLUyf+5osajUxZZ9kkLMlIv7COStgXsqBoQ5bCB0zfJKqFvLNlHmFQMeuKbOOK3NEG/v0miQVw+T0xKnx6QjZGogGEPdom/ZsI8ArWRX/1bZCGOb9TBioGcTrW2PSV4WQ74C7FLkW99UtNEUzovaSIKgvwsSK+4ZKMRj3t3XE85eBbUHtP5uQADSdTgGDPMUoWNS3LkEBskBoj2maGHC8f9iBvrnNJOnzsaHp/bgK7zpNQhqJiej6UeShuGWvGZeRlBY+8tXLTmZu8pINdjY/MtZb2E182H4NdjOpGWFW4ivZP550plnhXOmFdjuNNx9xM+jZyflvUSv6aipZLJY14c1+PEJaKqHqQD/lOEE963C6r1oM0RpO9neJFSRDFa04WABIMrZUD8A4vbMzrJ4koZKAIlQyoO9vGteEVjwXQKMAxTCj/BXqWknk1Gq8zXuW6UT2Q2UUx6B+SYhWlnYzt0TSCzcWGkYvWP/nX60kK0B9UUfG5uQ9lUCDLAh/DZTOo2bDrOxTF8D03FNylVbCzLL0DkoEwr+LLYnB4dw8OpV08lk= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 624e5ed6-f3c7-4d30-b218-08d9dc9da0dc X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB4589.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2022 05:19:41.9398 (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: OvZEBdIY6PyiUnSdlcbUoXDOvzl8XHz7QlIL7ZmmK4gfFlCYa5xp6f3gVxnEc4bnz1rrClOEQ50rcpX88mhhfg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR10MB1236 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10233 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 spamscore=0 malwarescore=0 phishscore=0 suspectscore=0 bulkscore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2201210037 X-Proofpoint-GUID: MepnMzKEZnzcXI9jrgGqS-BD9ueZjqK2 X-Proofpoint-ORIG-GUID: MepnMzKEZnzcXI9jrgGqS-BD9ueZjqK2 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org XFS_SB_FEAT_INCOMPAT_NREXT64 incompat feature bit will be set on filesystems which support large per-inode extent counters. This commit defines the new incompat feature bit and the corresponding per-fs feature bit (along with inline functions to work on it). Reviewed-by: Darrick J. Wong Signed-off-by: Chandan Babu R --- fs/xfs/libxfs/xfs_format.h | 1 + fs/xfs/libxfs/xfs_sb.c | 3 +++ fs/xfs/xfs_mount.h | 2 ++ 3 files changed, 6 insertions(+) diff --git a/fs/xfs/libxfs/xfs_format.h b/fs/xfs/libxfs/xfs_format.h index e5654b578ec0..7972cbc22608 100644 --- a/fs/xfs/libxfs/xfs_format.h +++ b/fs/xfs/libxfs/xfs_format.h @@ -372,6 +372,7 @@ xfs_sb_has_ro_compat_feature( #define XFS_SB_FEAT_INCOMPAT_META_UUID (1 << 2) /* metadata UUID */ #define XFS_SB_FEAT_INCOMPAT_BIGTIME (1 << 3) /* large timestamps */ #define XFS_SB_FEAT_INCOMPAT_NEEDSREPAIR (1 << 4) /* needs xfs_repair */ +#define XFS_SB_FEAT_INCOMPAT_NREXT64 (1 << 5) /* 64-bit data fork extent counter */ #define XFS_SB_FEAT_INCOMPAT_ALL \ (XFS_SB_FEAT_INCOMPAT_FTYPE| \ XFS_SB_FEAT_INCOMPAT_SPINODES| \ diff --git a/fs/xfs/libxfs/xfs_sb.c b/fs/xfs/libxfs/xfs_sb.c index f4e84aa1d50a..bd632389ae92 100644 --- a/fs/xfs/libxfs/xfs_sb.c +++ b/fs/xfs/libxfs/xfs_sb.c @@ -124,6 +124,9 @@ xfs_sb_version_to_features( features |= XFS_FEAT_BIGTIME; if (sbp->sb_features_incompat & XFS_SB_FEAT_INCOMPAT_NEEDSREPAIR) features |= XFS_FEAT_NEEDSREPAIR; + if (sbp->sb_features_incompat & XFS_SB_FEAT_INCOMPAT_NREXT64) + features |= XFS_FEAT_NREXT64; + return features; } diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h index 00720a02e761..10941481f7e6 100644 --- a/fs/xfs/xfs_mount.h +++ b/fs/xfs/xfs_mount.h @@ -276,6 +276,7 @@ typedef struct xfs_mount { #define XFS_FEAT_INOBTCNT (1ULL << 23) /* inobt block counts */ #define XFS_FEAT_BIGTIME (1ULL << 24) /* large timestamps */ #define XFS_FEAT_NEEDSREPAIR (1ULL << 25) /* needs xfs_repair */ +#define XFS_FEAT_NREXT64 (1ULL << 26) /* 64-bit inode extent counters */ /* Mount features */ #define XFS_FEAT_NOATTR2 (1ULL << 48) /* disable attr2 creation */ @@ -338,6 +339,7 @@ __XFS_HAS_FEAT(realtime, REALTIME) __XFS_HAS_FEAT(inobtcounts, INOBTCNT) __XFS_HAS_FEAT(bigtime, BIGTIME) __XFS_HAS_FEAT(needsrepair, NEEDSREPAIR) +__XFS_HAS_FEAT(nrext64, NREXT64) /* * Mount features From patchwork Fri Jan 21 05:18:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandan Babu R X-Patchwork-Id: 12719263 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3C89DC433FE for ; Fri, 21 Jan 2022 05:19:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231278AbiAUFTu (ORCPT ); Fri, 21 Jan 2022 00:19:50 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:49186 "EHLO mx0b-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232326AbiAUFTt (ORCPT ); Fri, 21 Jan 2022 00:19:49 -0500 Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 20L04vTS017314; Fri, 21 Jan 2022 05:19:47 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2021-07-09; bh=oTciLkGT+OS1ABSDJnEnRo/X+nnnwRKaO3IX2C1icU8=; b=Glnt7sgkNXCnQduz6PjpXcQZ3k11lsJE7ei7Aat2FFD1Lvh1dUyFyQHGrqRBJeOL1cc9 jDBzpx02soc8W+YynCwK32PxqpALym4ucXf6mu/okyglqALc7ur70ZGMmnZqSMu8XT4p tN5UmFMNLKfFh4cmEvA8zbfP+wwhIxsif11dRz+U//M+B8OD6oQUE6mmfo75Uxi9N3OP XPSahynKzeciXA9CZ51hda9UQplt/gsdyeIgBqkVXigYPr8m/odurNs1h1PJltiYdQ34 MfvPcYKy8av0xtkE+ef4ozC9Ozdg5kp0aCiJpf/4tKTdVbvPK/iVSAvBcGAXeIsO9LAh 0g== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by mx0b-00069f02.pphosted.com with ESMTP id 3dqhydrc6t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jan 2022 05:19:47 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 20L5H1Mm018897; Fri, 21 Jan 2022 05:19:46 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2177.outbound.protection.outlook.com [104.47.57.177]) by aserp3030.oracle.com with ESMTP id 3dqj05h2vy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jan 2022 05:19:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AC2SD9mVJyBDcA1JT8EPfkETeCasCTLuswu72AITy/hMaqrUys71dGbij5Sv9iD3kH4BGOsJ4s11DJdqJI40+MGFvicko4oSCJVbOfENWlci94PQNntGp6k9iQ4CMQdXI25OkEmPoKPI5uqhXBL6FbaeOQSQX0v65PR5WTT1RxKMgGMaTVfD1yrx7hzfo0qrIUu4gZQsTllIuUbW4+wkRF1yfPtok9BR5InARzetswlJdP4mPojZSjDDYSKxd9YEHyLad9UFhFL0P/xlVI/2ZtEBK1/Y97bOtBfnVL6mhAK/o4d/XWSqf84egabW0FVSK6Q+DCUZu4RfH3Ib7ESC8Q== 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=oTciLkGT+OS1ABSDJnEnRo/X+nnnwRKaO3IX2C1icU8=; b=DxwFQ4wZkhj6S4e3OTkj/+tJyTF5K0JEw5uvJMBuhjLbAsPC0TQg2NJLyU7vjr620JzY6jm4GlIiSlcrQX04LMHnIXtEXRQzmlPRQDSp9/Y7t91ZeGCpmceBb0QEJqhwyp2AVpOW9zxYD3eZ1IJV7d0uoBmySnKUoSNCb0AemU07n1FedcWJl/kXHlfVJauGsj4RwDJyWGbMvLdpb56f3atR/RE0JlzcxOAWTX7fmPvoW/zGfCGh5KUrXxG4u4hbaJ9/a8APDtR9A0Q6SQkcxrye1sLGpDYXPJYDjivqAhzSsE0B52hx6PckwCQKEGDZWbIYVWak5QQcBIjUb0Hy9A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=oTciLkGT+OS1ABSDJnEnRo/X+nnnwRKaO3IX2C1icU8=; b=Kpn1qJoPKZxcuRKwfMAKz4RGJLWG9ZuijddLdRc4MFmp1RMYLJSSm5ybWeRJRZQ5mp6l4I4Cg3LF4EzDbs7Pg+/HHlSLWM82HPcbOl1cLesIS/9PCcdo/FgavejjhOGa9ssB6x49S3UlV+I5wPNUH4B6N2wQv77rKX2sMi9ZUI8= Received: from SJ0PR10MB4589.namprd10.prod.outlook.com (2603:10b6:a03:2d0::16) by BN6PR10MB1236.namprd10.prod.outlook.com (2603:10b6:405:11::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.8; Fri, 21 Jan 2022 05:19:44 +0000 Received: from SJ0PR10MB4589.namprd10.prod.outlook.com ([fe80::3ce8:7ee8:46a0:9d4b]) by SJ0PR10MB4589.namprd10.prod.outlook.com ([fe80::3ce8:7ee8:46a0:9d4b%3]) with mapi id 15.20.4909.011; Fri, 21 Jan 2022 05:19:44 +0000 From: Chandan Babu R To: linux-xfs@vger.kernel.org Cc: Chandan Babu R , djwong@kernel.org, david@fromorbit.com Subject: [PATCH V5 08/16] xfs: Introduce XFS_FSOP_GEOM_FLAGS_NREXT64 Date: Fri, 21 Jan 2022 10:48:49 +0530 Message-Id: <20220121051857.221105-9-chandan.babu@oracle.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220121051857.221105-1-chandan.babu@oracle.com> References: <20220121051857.221105-1-chandan.babu@oracle.com> X-ClientProxiedBy: SI2P153CA0027.APCP153.PROD.OUTLOOK.COM (2603:1096:4:190::22) To SJ0PR10MB4589.namprd10.prod.outlook.com (2603:10b6:a03:2d0::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 329ae906-c352-41d3-eb7a-08d9dc9da246 X-MS-TrafficTypeDiagnostic: BN6PR10MB1236:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3513; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: f5TnQJvNAQkJr0Mf06olVKDjRM029c9ejfHcwe0fM48MMH5xq2V1yK8VpPmZLag+2EJglMTtiE2/EjCKYfCN5s5TUdUArQ8dAVM2JlfqMBk7fFYiNc64V/m3nYDTDiZ1twtW9dwuLdwrlSUoSVlMMq6+NwQZHl0vPP7RwqFuTUcuzR42nudy97p7HT9pKJC864GbC4qsdAHMsq5ERTQK7Fie4WMoeWAU1cv4ZUiCbtdHoYw+Av6dtj5J0pvliI5oECQbdaCeH6kyoRIrah3jrXKXr8GmmTLrVdZHv8wcvzBF24K9643b0tlUGCHquGVWWiX3LnSeWgyJuiHoAs/BHKRbkNRzwpDH9Gath3mYuRguhh8Di9MAt6Ljswm4iooYCsVIPypNH+7miuhk0bM5JQt5zXwBuBB6tTUOzwz5D+tAM4gtX1V3r4fTpbqSnfBxiItHVA0Ft1C7tRuMlq4CBvOgnWWE0kPorLo1fhXkE3wgtNl5YafiwW3nAkzGMgVmQNGVvmppww1ZjoXxT6/YqnKJIIeZeKbzEXzPe10NP/zDxdiJ27Xd/zLch79S5JNyJFEpcM/hcju2fJFOYUmX/S5M5AKnOowL4m+A/cM3K224y32n5iRXEZiyNeRAkk/DLNTkMav//dwA0UmGtcWex0KWN0pI7VgYGUlE8JaTndfDfPkyz/sT9QgCcSS0yh0BDVBG3liAMJhLtgxwHti9Qw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR10MB4589.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(6916009)(2616005)(6506007)(186003)(508600001)(36756003)(26005)(83380400001)(6486002)(52116002)(38350700002)(38100700002)(86362001)(2906002)(66946007)(66556008)(66476007)(8936002)(316002)(6512007)(1076003)(4326008)(5660300002)(8676002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: CdZHJf3TzXyenG1MtSzd4y1SDWd2pevhNEsYbqT8br3tMzNXZJM+jLMASZtI6GCv4gsRkc3PFEwESc2YSFUXVPGkJN6xBRoU4r1xMaRGO6pAfJZUCCUODHrAlTUrvd38FFTiSOcx7NYnL2yGHM90mcguB3IBx27FyK2vUEYu8GQ4T4+s2kRvHWcJo9JXv3tG9ILvhfbdl6PXp8hplwPJiSMW3pxnvBZFKaOQ6t6qUmo2UKSN/SVMjlIrsbhKpNFJ9w86v8T4Z6hCty//T+rH6Rf+p+urz7MdkjN5aUXZJ6wljVKpJEQ4sHJsWZFTU2qUbOfVv6AX5/YYDGiv0QIf0jmgSx2mVo0oH5+p3I22bzmlKm5u/BR9MsC/cQb0Uj+F9YmSWorM7uCanwg8X6oHFzDc1KVH2u5tBEdGmJYDHdEXINhxPHvZ49dpgXqM36m2dQH4daVS+ohEqoS66m3xVV/ahfippmjxFrTPdZQgatf/ZH6fp6m5+9UFSXQDyvnuqqBX0REUaYUUp6YLhjE4uH15DQsAxCJdJr8drWlhGP7beKB0klGy/kiUfZmBx3mCAzPWmd1rLx/2rJXeYZc+38AZjjAg8EWldVoxq0Eu5wTqdjxUhyFD/W0dCtHVT8dwy+qx1ziDEFUoUVk/0v5/ur/ET7wCeUFQ8k8VcpFinVNipgnD0M63t1IoDwIkElVV4m4JGLlU6dvjQLQ202BzKDDaQxvaCiiaQMzCp5v2f+tfe6c9dPWdmlRn19Ayh0En3qCyHPN32ucs7zc7womegUBax/OLUO5/yC8SqzE1ulSWn7Um+AH77X7KSZmkdWm1kuYTkoy5HbB8OY01QrrZU/In3lQXvK4gmM12Uv99O8ItrR7TqZUzuaMq6aYSlqegpNQPbmQX7sLZ2h+Fy1Yuba/aUfJ5mBJip2WAjBI1DxtUPaBWStJftFGA2fzYfV80Qhh87UvXhR/X3WhvFdGXnhe3f38Jza4tM7dtBkRs6+hpR6wqlsNoDNOLLELmdLzUplBNCO0pXV0PNBW7+/YQjzjEqERW7/ZnKMUUWBhVTG5wYqmY9FDC64LkYgfLNZMHEeyx9OIwpUc2U7ezPx7t7aJuZyE8GYafqRDDgACJ9y5nSg/8q0WCPNLa+WNdwJiwPyZONIOcmOMm4qCCr5p1uGV6J9GWf5CoGApJBTId71m26DvyVxtK22Fmjjnh/DITM9j8YkE2YtED3oOxG7a3O2y/Du0rhRj3j2/Da2A4VtDEVNHeheJlaqioxr9nSsHXxcKBkeDhizMOcBmfKkRk/Ncw907cjaW7J5gMuEa3xQJqCp6R6y7dKVEKDvOm1ZeR1hJZc79qK7IFlV60IOiWCvFck9nkve+m4YyUBmYcvDjV83I6rKJwnP6OlLm4NsCgcn32i3YPTajJlwNYrn522Vg1UkKXWFeavMlRASl+B4+Vwy9UbBQlZBxfirBm0xmP+yr/lBlbw7szDFzX6YFjwRPhnHScMWbpngGAauET45x9VdjGQjYMhkuRRSpOE30p5q3nwEjiSd7K+Y0V1Hp6bScNdXOps85f9tN/nqgMY1mRPBVbEjfUx7QLTRIC+4n/3acjxVAN/3ZrY6/zIQUtuksDiTTwRxytuI8Atxg1i2A= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 329ae906-c352-41d3-eb7a-08d9dc9da246 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB4589.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2022 05:19:44.3293 (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: nBYLp5RSafoEEnwYdbAj2ALYJWB/APVE8f68OIAtr+gUO1ecmJr5DvnMeQrjLkfr809CERPLVr3qb6fG02a3YQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR10MB1236 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10233 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 spamscore=0 mlxlogscore=999 malwarescore=0 adultscore=0 suspectscore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2201210037 X-Proofpoint-GUID: Nb8WOg8FITdZphidtzcAs71l3gC1G2D8 X-Proofpoint-ORIG-GUID: Nb8WOg8FITdZphidtzcAs71l3gC1G2D8 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org XFS_FSOP_GEOM_FLAGS_NREXT64 indicates that the current filesystem instance supports 64-bit per-inode extent counters. Reviewed-by: Darrick J. Wong Signed-off-by: Chandan Babu R --- fs/xfs/libxfs/xfs_fs.h | 1 + fs/xfs/libxfs/xfs_sb.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/fs/xfs/libxfs/xfs_fs.h b/fs/xfs/libxfs/xfs_fs.h index c43877c8a279..42bc39501d81 100644 --- a/fs/xfs/libxfs/xfs_fs.h +++ b/fs/xfs/libxfs/xfs_fs.h @@ -251,6 +251,7 @@ typedef struct xfs_fsop_resblks { #define XFS_FSOP_GEOM_FLAGS_REFLINK (1 << 20) /* files can share blocks */ #define XFS_FSOP_GEOM_FLAGS_BIGTIME (1 << 21) /* 64-bit nsec timestamps */ #define XFS_FSOP_GEOM_FLAGS_INOBTCNT (1 << 22) /* inobt btree counter */ +#define XFS_FSOP_GEOM_FLAGS_NREXT64 (1 << 23) /* 64-bit extent counter */ /* * Minimum and maximum sizes need for growth checks. diff --git a/fs/xfs/libxfs/xfs_sb.c b/fs/xfs/libxfs/xfs_sb.c index bd632389ae92..0c1add39177f 100644 --- a/fs/xfs/libxfs/xfs_sb.c +++ b/fs/xfs/libxfs/xfs_sb.c @@ -1138,6 +1138,8 @@ xfs_fs_geometry( } else { geo->logsectsize = BBSIZE; } + if (xfs_has_nrext64(mp)) + geo->flags |= XFS_FSOP_GEOM_FLAGS_NREXT64; geo->rtsectsize = sbp->sb_blocksize; geo->dirblocksize = xfs_dir2_dirblock_bytes(sbp); From patchwork Fri Jan 21 05:18:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandan Babu R X-Patchwork-Id: 12719264 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 19DA7C433EF for ; Fri, 21 Jan 2022 05:19:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232686AbiAUFTw (ORCPT ); Fri, 21 Jan 2022 00:19:52 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:51992 "EHLO mx0b-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232204AbiAUFTv (ORCPT ); Fri, 21 Jan 2022 00:19:51 -0500 Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 20L04392001131; Fri, 21 Jan 2022 05:19:49 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2021-07-09; bh=uvWJHcVGimsLI9IeMt0VEYN8dRYAcWqySMCWCQ7Icsc=; b=ynEW8WGv2WFwhmiK+xHBClGuYQLAvan4kgpwAD32PeIup4B+kS15jR42PUbPX0bwpYTW Ez00VuyJETSsJMSqrJ8SLs6U+qqsK1Fs2yHTxn+jzVGaamSy/Sxb0aBRCpuK375vffY3 diEQKh+PtrSJOdhz98JeTJI/s6mnsLn1pO529LQqIDHfadArdgDv/BE9d/6vL4z/GoMf u6QjhXfqRklkMft+/Gri50gGz7d9jUk9qLC52pWOf3KrjaGGyvJ4GpV1fJKIZocF+j2u RpZbWBTXfCaBdL8N2o9xYC9We5b/Y7UkOnpTsVAklggd/LHmiYmwxHNydOOv5IMy6pvo 4Q== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by mx0b-00069f02.pphosted.com with ESMTP id 3dqhy9rcn5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jan 2022 05:19:49 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 20L5GU9K190224; Fri, 21 Jan 2022 05:19:48 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2169.outbound.protection.outlook.com [104.47.59.169]) by aserp3020.oracle.com with ESMTP id 3dqj0sh05v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jan 2022 05:19:48 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AOeJmjZdjO/kJlIcJwMENylXDoTumjbPF9RS17jGOD1N2BrQSw1z2nZ5IVUAZObJDwzFh4Pw07mvBRJhgJfB/gYWh6E0hKaDT6sZIh6UAhWAQYFsDPgPkid4E/y4PKW9JqQdyAfFBAZpw40DZtylwFqLo12/lmNWsb5HcZyCfTDqNdHjeV6Rc+XomOSgG96nosy5KYzgrXvcV6yg1ExLzYvlUZb6oBOja9auDAG+z5sD0fhGjiqhWhKvH8rcbvN3c5KusrSynM6wTPrYKVLa0ZH2WeUbgbGPkIDrO48e3E3i8KuO9vT3qQHNssk2dw434rIklkRWmqzGTN95pYgROA== 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=uvWJHcVGimsLI9IeMt0VEYN8dRYAcWqySMCWCQ7Icsc=; b=DbAn5A8EPA4I8H/XAcP1sBciK++bXKg4DKUMpZtuYntjmAMiE9+262EOLNGY5wkphF7bzJ0vg1IXhMQKSl/f9cHR+Zo/57U7iOywAl/qUPI71hRDzvF2/KcssTbp+VDh9oJJsyHXu4xRgKfiQeGzubIc8YrywZr28BhtO4OAt3ywT4SbRNc6ywwhq6AJ0v3NUk1bgjCUD0tncv1xdiiwMd4R3xezmtebXSJwcLCIljxD2Jd5bWvZBP3h1lD5Bc9IFLnmEIuONJqAoVzPEp+qNECTYKuWeYlnGP0ZKzFfIFawhUQ1vEHrOOam4on0nHetefLOH/Y7R5tdgqx8hNs1RQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=uvWJHcVGimsLI9IeMt0VEYN8dRYAcWqySMCWCQ7Icsc=; b=kLLZP46j9rW7MmE5V9Ba9+5j8fsCIaQMlLo8CypVu8wlG6gAJlGRNyuRUMd0dqCZb1eHVrZRYHdKFtE7VBtMF+Xm+MjiGFjnzeagyKFLjsl9xhJKA+H4G5s0yL7NKv7iLxZCIWBoNipbI8j8eCep3RieEFRfGWUgZLobtOef3zk= Received: from SJ0PR10MB4589.namprd10.prod.outlook.com (2603:10b6:a03:2d0::16) by CY4PR10MB1287.namprd10.prod.outlook.com (2603:10b6:903:2b::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.12; Fri, 21 Jan 2022 05:19:46 +0000 Received: from SJ0PR10MB4589.namprd10.prod.outlook.com ([fe80::3ce8:7ee8:46a0:9d4b]) by SJ0PR10MB4589.namprd10.prod.outlook.com ([fe80::3ce8:7ee8:46a0:9d4b%3]) with mapi id 15.20.4909.011; Fri, 21 Jan 2022 05:19:46 +0000 From: Chandan Babu R To: linux-xfs@vger.kernel.org Cc: Chandan Babu R , djwong@kernel.org, david@fromorbit.com Subject: [PATCH V5 09/16] xfs: Introduce XFS_DIFLAG2_NREXT64 and associated helpers Date: Fri, 21 Jan 2022 10:48:50 +0530 Message-Id: <20220121051857.221105-10-chandan.babu@oracle.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220121051857.221105-1-chandan.babu@oracle.com> References: <20220121051857.221105-1-chandan.babu@oracle.com> X-ClientProxiedBy: SI2P153CA0027.APCP153.PROD.OUTLOOK.COM (2603:1096:4:190::22) To SJ0PR10MB4589.namprd10.prod.outlook.com (2603:10b6:a03:2d0::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 954238d7-a399-48c9-dd66-08d9dc9da38d X-MS-TrafficTypeDiagnostic: CY4PR10MB1287:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:411; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hirc6QiTPWhCI2C5IZ1/DPL+fudj78srbR4ZtpFRwe+rMhJeFkD6QsbfLd6IAUsOjvT5TIMIcpBAyRyjMGE0alrAjIsfRIZC9I3zp+XYnJex/t2NdeULBtlZP1QAqnB+05GQxYfSdpO1BiS8vUgXrn+V1QbXNf5t2fh1ctKwKZoWaY0oWs2vETUeJH0VpP6Qpt4FtlbTuk+C7tMq2dGxQMJhyj0m1+VsZ8HTcMkYMJumaEoqU0yf5YXASrBS9nt4nKP8lFpguwDqOKtRmyDejw3UlM2lT81op0icbh0F9DfV45bGCaROtQfz1p+Q26cb8sBZlbvnGdtuO4y/98fUVpnRh8eCjwR45yVSf3oJ0xhvdmdd7nkZDnec+W1smcX7+eaqCY3mAJv2ko3rMsYWsLfqHyk0o/pNVSyiqSzHwwxK1ywbl7QFlcUhnqNnpHpBVoyZiViBu/btsio0gRfmpPCpxMSyXpLpXqAhoVWGR59ZVFQqWN7nY1TMwjI6EjB/Qs/JMTtsyv8R+kPWqMNw9yKCr0H08Q+9RYiggoDowGU/FI062OyRLc870p8h0IuEzzIDrsgBZy/2gh5D1cS9UvdB3DsB0CozgPe0ksDCYB/NZR7o8uJWwRea995uaakK3hsEqh+dVUnVFlWneuj1CqYtYkpaXakCBuzLwvKNCGWBdxHtYy3TLpZpulBNCQ100Zpy8fCjdI7GoFy5gaKyxg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR10MB4589.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(508600001)(186003)(52116002)(66556008)(26005)(6916009)(2906002)(8676002)(5660300002)(66946007)(2616005)(6512007)(1076003)(4326008)(38100700002)(83380400001)(66476007)(86362001)(38350700002)(8936002)(6506007)(316002)(6486002)(6666004)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: CHIoxnRNtuSZy3Wy/7Rs2wWBpa1GZPP0NGMnolsDGO2q7Ft6iLWqt39MML/s5ns4aYaXkJd4jpo0ENG4UN5LAKC6LCu4H951Gjj11HlUrEprC7f0fzVe6thjPxv11Bho5s9suCa2ZRh6mGAydHhVRLcaALOaQ+K3MkclHs/UltkEdoZjpBru7qdCTo19s0wFqEIuCNmP9LkbqfKOQKlwfCBcirij9uPcJSOa6Bf11+nBf4Si0WEMXozWcNCiY2nex2Db9u93oF8/SneMdelHZGZNDpCmytIONF7VObDEQ2FvvPqElPPrOLO8SWQjN1Wd3h9TayEFpl8n82zPf19CO8fluTP/wCqJsyjDRZcQooPP+69ke0jg9Up/FYAremotHhIekvgKBeQxZcEIrqN7Ur/Ly4M8geHOfLAPLph6lwZh5xck8RA/NbL+QwyqH3ax7JOuyFQFTw9Hu0n93c11V6ToUTdn8M8UgQnGSevbsmMMdib5JdouE8+WJgVruLIy3gJqy9S/SeG9K2S2hSD8Hgygxqh1HlJ0sHwFxIq6qVWXj08jbZ3DsYraTuvW2Yrv8XnA2O+6+Bnm1h17y6dAOSZJRFNh+dUgyG8pcwok4WjE3Gt4K2Bv+I2bBGWPcpC3k/sAed+szoZAhmb83VrVvnGI9TdD+6dVi9rTjelY7VJPuCFCTT6YcBYUI2POw+wIoYDMZsnOcrIRh1e9PMAWdKnxJtha5NmgEcmHJUc0HKszJlfaDWH7RPgiXgEdmKYPTV5QMu2zN88C8eqDSy5ORrnEY5ot8jkEU0e/9L934qgxfXRYoTzN/Wm/iwcFb4QN0GZ1I9vgu4L/GUmsXl4ia7HGEdjeF6WTUGA+9ViNOlTzEOgnSQeZi/fSOxTd9ERf36pdEverUK5nrs54+2DEVM6hGhHcdcZH+/qK6k8OdAjLdOlc7huYoycmJkeRydBbvfeXoeSQ6HHJMbabt0nf+QtqQp7ZxaSWH3CzVJZZ2Z4Ww4vI7IU9ArGovODozcg0fNAOiivhNWzagT59yxLJGna8ssdQxQn8e3gxXNrI6WQMB7N2S3WmY0/E+HPekSgXNzanYZBV4cLOdruO3SKDF6WqVdNEH0DpKJKgka23/r3qfDTGtkzf2SiDKN8pmK/LVxblfN9nzOK8P7sMrQM+muc35NCiDj5fvXFXZiWWzIftespa3RDxFqFqarrT1YwyRVZJ/IUv1sY+P4D7n71IQea3Adsgj2a68Ozp37l1dizXhTM5yNKY/vMcunvZKQJh+gj/0GDoWm0QdQqwFm42eBc1+X6tWZGNdTvg+Qou7HKpCB4SCfp3sOYub88Obiy9PFgsr6/wdBhrtLUZWbzmpsvqdCSXbo4PZ1imBWQMFhYLiuwM0wiXaO0WWfV7VYhQiCwItH8GNOdJMxpesESrwm1NIbCUd7o3a3kUmYL3Rpux23byB7nHdc38XYIavYY3UG5qZPv3QDhqBbG1oVASvNIUrGAyEqOXYNLytHZEbOoRomTCDlj/LK+RS4D9zPVBSX0Reb58ld3tmEWvzb6TW8WP7s0NlDI+tfyVsah1aR7Nx/LZzGM5fyB0AAqCSIlqu6ZBb+mcyr7+zvup19gCuX9yQDcAvkBKPe17Zx1igkQ= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 954238d7-a399-48c9-dd66-08d9dc9da38d X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB4589.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2022 05:19:46.4407 (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: 10OjXWghmasIA2hy2wUFbbOnm1qQZjB8zZuGP0tUMPFP0KJRlDodR6T5Uj3QXyzkgh0i2TNcVyJE7QwOguG1kg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR10MB1287 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10233 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 spamscore=0 malwarescore=0 phishscore=0 suspectscore=0 bulkscore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2201210037 X-Proofpoint-GUID: d5PA2H-jBL_7tnIosDkVNcjlP1f2MMzt X-Proofpoint-ORIG-GUID: d5PA2H-jBL_7tnIosDkVNcjlP1f2MMzt Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org This commit adds the new per-inode flag XFS_DIFLAG2_NREXT64 to indicate that an inode supports 64-bit extent counters. This flag is also enabled by default on newly created inodes when the corresponding filesystem has large extent counter feature bit (i.e. XFS_FEAT_NREXT64) set. Reviewed-by: Darrick J. Wong Signed-off-by: Chandan Babu R --- fs/xfs/libxfs/xfs_format.h | 10 +++++++++- fs/xfs/libxfs/xfs_ialloc.c | 2 ++ fs/xfs/xfs_inode.h | 5 +++++ fs/xfs/xfs_inode_item_recover.c | 6 ++++++ 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/fs/xfs/libxfs/xfs_format.h b/fs/xfs/libxfs/xfs_format.h index 7972cbc22608..9934c320bf01 100644 --- a/fs/xfs/libxfs/xfs_format.h +++ b/fs/xfs/libxfs/xfs_format.h @@ -992,15 +992,17 @@ static inline void xfs_dinode_put_rdev(struct xfs_dinode *dip, xfs_dev_t rdev) #define XFS_DIFLAG2_REFLINK_BIT 1 /* file's blocks may be shared */ #define XFS_DIFLAG2_COWEXTSIZE_BIT 2 /* copy on write extent size hint */ #define XFS_DIFLAG2_BIGTIME_BIT 3 /* big timestamps */ +#define XFS_DIFLAG2_NREXT64_BIT 4 /* 64-bit extent counter enabled */ #define XFS_DIFLAG2_DAX (1 << XFS_DIFLAG2_DAX_BIT) #define XFS_DIFLAG2_REFLINK (1 << XFS_DIFLAG2_REFLINK_BIT) #define XFS_DIFLAG2_COWEXTSIZE (1 << XFS_DIFLAG2_COWEXTSIZE_BIT) #define XFS_DIFLAG2_BIGTIME (1 << XFS_DIFLAG2_BIGTIME_BIT) +#define XFS_DIFLAG2_NREXT64 (1 << XFS_DIFLAG2_NREXT64_BIT) #define XFS_DIFLAG2_ANY \ (XFS_DIFLAG2_DAX | XFS_DIFLAG2_REFLINK | XFS_DIFLAG2_COWEXTSIZE | \ - XFS_DIFLAG2_BIGTIME) + XFS_DIFLAG2_BIGTIME | XFS_DIFLAG2_NREXT64) static inline bool xfs_dinode_has_bigtime(const struct xfs_dinode *dip) { @@ -1008,6 +1010,12 @@ static inline bool xfs_dinode_has_bigtime(const struct xfs_dinode *dip) (dip->di_flags2 & cpu_to_be64(XFS_DIFLAG2_BIGTIME)); } +static inline bool xfs_dinode_has_nrext64(const struct xfs_dinode *dip) +{ + return dip->di_version >= 3 && + (dip->di_flags2 & cpu_to_be64(XFS_DIFLAG2_NREXT64)); +} + /* * Inode number format: * low inopblog bits - offset in block diff --git a/fs/xfs/libxfs/xfs_ialloc.c b/fs/xfs/libxfs/xfs_ialloc.c index b418fe0c0679..1d2ba51483ec 100644 --- a/fs/xfs/libxfs/xfs_ialloc.c +++ b/fs/xfs/libxfs/xfs_ialloc.c @@ -2772,6 +2772,8 @@ xfs_ialloc_setup_geometry( igeo->new_diflags2 = 0; if (xfs_has_bigtime(mp)) igeo->new_diflags2 |= XFS_DIFLAG2_BIGTIME; + if (xfs_has_nrext64(mp)) + igeo->new_diflags2 |= XFS_DIFLAG2_NREXT64; /* Compute inode btree geometry. */ igeo->agino_log = sbp->sb_inopblog + sbp->sb_agblklog; diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h index c447bf04205a..97946156359d 100644 --- a/fs/xfs/xfs_inode.h +++ b/fs/xfs/xfs_inode.h @@ -218,6 +218,11 @@ static inline bool xfs_inode_has_bigtime(struct xfs_inode *ip) return ip->i_diflags2 & XFS_DIFLAG2_BIGTIME; } +static inline bool xfs_inode_has_nrext64(struct xfs_inode *ip) +{ + return ip->i_diflags2 & XFS_DIFLAG2_NREXT64; +} + /* * Return the buftarg used for data allocations on a given inode. */ diff --git a/fs/xfs/xfs_inode_item_recover.c b/fs/xfs/xfs_inode_item_recover.c index 239dd2e3384e..767a551816a0 100644 --- a/fs/xfs/xfs_inode_item_recover.c +++ b/fs/xfs/xfs_inode_item_recover.c @@ -142,6 +142,12 @@ xfs_log_dinode_to_disk_ts( return ts; } +static inline bool xfs_log_dinode_has_nrext64(const struct xfs_log_dinode *ld) +{ + return ld->di_version >= 3 && + (ld->di_flags2 & XFS_DIFLAG2_NREXT64); +} + STATIC void xfs_log_dinode_to_disk( struct xfs_log_dinode *from, From patchwork Fri Jan 21 05:18:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandan Babu R X-Patchwork-Id: 12719265 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EF431C433F5 for ; Fri, 21 Jan 2022 05:19:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232326AbiAUFTz (ORCPT ); Fri, 21 Jan 2022 00:19:55 -0500 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:55886 "EHLO mx0a-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232204AbiAUFTy (ORCPT ); Fri, 21 Jan 2022 00:19:54 -0500 Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 20L04hqE009119; Fri, 21 Jan 2022 05:19:52 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2021-07-09; bh=gnM0NN+pJUWgUxxfuPBuHrqjtwiaaUEbdP6uJPSOWk0=; b=YOXpiiImEELMSQtcyWE/mkS0YSeAgMsig3tG8qIzJ/fl6xRNqOEfNTN0E/JSh/7NkPSo ygujBP8t9IvvzubgbAdUEXKc2qW0z3tUITBPdXtYl9l2cgdGAOjsfwuSewxFVmFHPPvb GykQLGa25zF9+ufIoKEhDzml6A/u+vDqWnvn38nsZ3WpfXQc2oSF3sz9rIvKbOqntKFF ZWh6DdrIOLjxhDExqwxMJOcwCyD4MeLpuR9wqQSug+HZ0rZz+elgTFjJIVnUZLed5dko 4U21rLP61kaZ2+qzD3rOa7OybbU8dvaGmnn7ahQk8Sowx7uI8hIB00ZDj3VsARTPbbQX cA== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3dqhykrcnv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jan 2022 05:19:52 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 20L5G9PE156901; Fri, 21 Jan 2022 05:19:50 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2177.outbound.protection.outlook.com [104.47.59.177]) by userp3020.oracle.com with ESMTP id 3dqj0maucb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jan 2022 05:19:50 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZnP88b37/ezezW1M+D/xJnReP92n2tFyI8ZAsCtTqK6lXEr3/GWoRZPXz0UG0CHKapmM86ooZy6j4PnNA0FHxeSLcSrh2FyGRBh8GRWx3hxkcz5vf1gzzOxKQnGMtvkcDOyd+LtnDHSCMa6S6kcFd4rGFiKT2GXVf5uyptgNdSYP4rDlQPdyTlGO69gndBirSMvr4aZgMgZ5fRCTbsIuO28gkffRZIhfUC7pVy0n5RCo/kl9z9REtDUF2M/R+Z2UaRiNPkFVTsTk0pUUwuiU+F6h/5le1XQS6FBQP3wKymg5L2HcMBFvFs6ChragbhgeFj+S6QUPEEQ0+kiQs9VyCA== 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=gnM0NN+pJUWgUxxfuPBuHrqjtwiaaUEbdP6uJPSOWk0=; b=TdXIhuyDWOSC877RtfhZbO56yGibyjzGDXrUeeMuOdfFC/qtxRcXwXgbFtC7EyI9byfvraeFbJi44JV7KRj1KxVNm75h1r7smJOw0yOwpLlKlGkwGdKdlqAKgJ1naquCmEjw1MZciYMurGz37NtdihatT2u+XyOFaRrdJZp1IPFOcxvFiJsLxJadTHxo09nDg6R6xh6s4CS6HUYEsr5n4y1uQvOugzhN3n5eGVOuMAw/sFA2Hq5xGnvgoVorfSPFm8ytx0pibwYYOxdpIMa+enuHnWk0iWdoJ3uphxKpgUezqei9xQQ+3oho9v+kaQgJAWnoVSjHn2x9tbwIWYhwdw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=gnM0NN+pJUWgUxxfuPBuHrqjtwiaaUEbdP6uJPSOWk0=; b=JwYzWQQGgw7s0hx4eJZtx+uAsJFA4NipfO4bh98lQO98nKJJXReoKD8pveeWUU7BpzDVOEsR5VMYIvsZ6x8n2ON4SuulJtwYIZTDJRrONmCh/iN+uOk877EKIFNtj89YP+SNxC3+890OBT+kQK+Uo9av92VYd1IZ1lAn7XDvLGQ= Received: from SJ0PR10MB4589.namprd10.prod.outlook.com (2603:10b6:a03:2d0::16) by CY4PR10MB1287.namprd10.prod.outlook.com (2603:10b6:903:2b::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.12; Fri, 21 Jan 2022 05:19:48 +0000 Received: from SJ0PR10MB4589.namprd10.prod.outlook.com ([fe80::3ce8:7ee8:46a0:9d4b]) by SJ0PR10MB4589.namprd10.prod.outlook.com ([fe80::3ce8:7ee8:46a0:9d4b%3]) with mapi id 15.20.4909.011; Fri, 21 Jan 2022 05:19:48 +0000 From: Chandan Babu R To: linux-xfs@vger.kernel.org Cc: Chandan Babu R , djwong@kernel.org, david@fromorbit.com, kernel test robot Subject: [PATCH V5 10/16] xfs: Use xfs_rfsblock_t to count maximum blocks that can be used by BMBT Date: Fri, 21 Jan 2022 10:48:51 +0530 Message-Id: <20220121051857.221105-11-chandan.babu@oracle.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220121051857.221105-1-chandan.babu@oracle.com> References: <20220121051857.221105-1-chandan.babu@oracle.com> X-ClientProxiedBy: SI2P153CA0027.APCP153.PROD.OUTLOOK.COM (2603:1096:4:190::22) To SJ0PR10MB4589.namprd10.prod.outlook.com (2603:10b6:a03:2d0::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c4909ad0-08b9-493c-ad1f-08d9dc9da50d X-MS-TrafficTypeDiagnostic: CY4PR10MB1287:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1923; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uiFd0JMX4ALZrPKrseTsFbesNE2+evtZkZDESKTDaivv/YRQdeZkOg+AdtrXi9f59BiBG/ViYdkuVSU6cJw+Ua5pHtmKU9PO2DdLsxfvFNWSw5kswx/ufzyAiJB6moVkT4IxJ2jRu9x0x9JYwWg5d67FSR8vxqG+LEt2sfVf/ZATXCqTxV0OerUL5VZI3crUGJrE5GgKfaHfStbNqO9bPm9hSMcxDxMIcxZHFdle4DENECnv2lVSiZk1Ihl5Kh3P7++glpT2TECVU+v/Fd3A5BBWrETyFYoWTaFV/uEWC9sb2c192XsmJyTfL5J8xIlMROSiNm31YitqDj0iCPu20JvX7htbtiO4I8EGUHwCfUCiJXPcQw9jbBftxoeR6GTxYU6Vq0s6ZUZfW3VQz3UIboNgB6iabdwta/Nr3W1/BnTit6EC1u1d93QpGPFw2Rx5saNamD2nlT6tmZ7JirIfed8QoLCNXCUKoKKN72gjtHZrj3IBXwYREglVloDW65Q6K2Q37X/PfQZjnBymJJUQ10h54z0+dGAmQd+m0GKGck6r7xag2ajm9syRfHCRr1MieK2EQjeg4okZQ1myv/e5j9y+DPNc6ifZ0eWhm/4/zNBXDsglhUw2APVdqa1IS+/lD/qAPK21eq9J+IiaxzK48i6He7NMAlYqAoIOfzcNMnJHVwuIqLVPOuPm0ws3q5jadwdLj/uNPKEiL7jxracsnA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR10MB4589.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(508600001)(186003)(52116002)(66556008)(26005)(6916009)(2906002)(8676002)(5660300002)(66946007)(2616005)(54906003)(6512007)(1076003)(4326008)(38100700002)(83380400001)(66476007)(86362001)(38350700002)(8936002)(6506007)(316002)(6486002)(6666004)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: sxGUGYEovhox6PjOmyFtOibLNybWfhSyxIO11o7pI3EIrd0ncs7Jp2MNFtvh1cb98kGORwccxwCvcq1mEhqIUXP848yu8+6toC6EYG8xmdVlnL6XlXjlsh43crZAj+SPV5GYA3QCQl2x1z7pXP/kOJcluYDwQe+u3BSafD5ExjK+4iLYeIiU9Zr8VaMwEBHG3XoTtEPPsSqQZ4hCH7TpNHlvt7jMlAGIcHgpYXNQwRdgITO7pOXb8s+N1gRX6SZT+QKzKtNdkfyCHlM+jyhDuMxGWY6WXUgVdkcgoitkoy2Cq0ROlGeey5uDrGq/ygHW6jXlZGw/nCA62cE7bNk1FDHIxfx2ftoB6jzlGyj19m1EbvpXv0PFd712KGtneVyYx8F9vWUT+1i3ZhHG1nqvWmoDCsCGhnxS4CQerIyioirQ/RUhzPSjU+3cxPZ861T96rXqYUkrsMos0aLMLqEZQbGhNS462RdyqK0xPHlCG/U7GVFHoRracCCie0W2sFl8vN6XndA+HFSZeJfg3e5ag7jhsA7Ad22n4gEKVvZmD3BFY+Tz65dBR3D7EOIMVDtfDgMpE1tQEaqPCtoiUS+JtVS3LO27TMT31iXtFxN+YIVpyTXZ3gz9YnAzbgkK589gBMNUFncqEZ+EZKwwBQsPbA2SYJ5mrf31S4el5XVAxbGUvA7qEYbv8hkpW7j5O0Ngkg8g2VJQ9TB0mzB7U54m8PXbRhCta0RgbvrL1O7KqXvUPBecBk5I7hHoO/+9tvrKcg7gEOT1naBHLu6FESICxU3hpLnTcB0n8fipQmkqrTWSR75wkW0M/2D6iOicl3p/qk4/pqavK6uP8vl4zllKqndzKPX4iTnO1J9hosWbJHjcWAY5706rhdw0yNK+MOzgBxklrJgqlXhs6S5Vfejh5U/LjzyhO6nKLiYL+sv3lUAOZXeDzWbECl/+0ZnQwiEXD2hXiYH+K3CtfwZ58EWvuO4fU1UNxxNJRuxJichUHUNVnQrH8oQzwcD2I2W/g+7FUCI3bJn+EI8zRx8GW448ePw8nIfPS/HTyIHlVBEEPDF4oTXG3GesNmzFCEhCwTVsQ/+/jZVTxrC2eT5tzmz5fz81V+D/Ba0NYezy1f1/qv1MxNIjhGl+JYe84lKqwkN1AcjvEpGa16OhMUSbj6AsfnMO/ykwIexp9X0StsDPUlBRimFjZZhPCJrtJukFsby2bnAFsbrRiLWXCdOKdRjSDapmlpNCP8CZf1OBFOWkLs5oG0NExdMB5oDJMW53ngD/0VufiMP9vf9cPJSm6jZTI0xubxP+WDZc4rVtBMefc+aa0ckSQno7qjh3LAQlt9J0HRA8W8+3CdWkfCEzLWsKdDgtJy6r8MQE+jy949Bn9Q5wyJjI6nBdZ22FCRubhqdH265zSWWNKa5EnTdN5PK0F5rTInfrUM+qgou3d58bKqE6KOZdcFuwqpdGzMvF1/4Z3MzwyUnfF9qVDcZwkU2nUck3vcaUrx1FqpMFF8uh7IRz7VQbtrnE+UkkvN2eZm9JpxV7OlnQ5Wlm8AGjX3gn7EAbd6MPQobEWH1pxARE1k694WDcoocliK8Yhvq3yuw19wjmK0qf05MsxKulQi/NgvGIOveVaPH1MSPiuiVf5V4= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: c4909ad0-08b9-493c-ad1f-08d9dc9da50d X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB4589.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2022 05:19:48.8779 (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: hvnlTWH7bpKG6Q1SfnxTSvTkRRaSrPRadCbDM772XR91AJOBdILpn3DMh5gqjJgFGB5FcqqlijTJGRK+SCKNnQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR10MB1287 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10233 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 bulkscore=0 spamscore=0 suspectscore=0 mlxlogscore=995 phishscore=0 malwarescore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2201210037 X-Proofpoint-ORIG-GUID: KWG4wwKevbYyABIOCNgBTKExkT96udQf X-Proofpoint-GUID: KWG4wwKevbYyABIOCNgBTKExkT96udQf Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org Reported-by: kernel test robot Signed-off-by: Chandan Babu R Reviewed-by: Darrick J. Wong --- fs/xfs/libxfs/xfs_bmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c index 6cc7817ff425..1948af000c97 100644 --- a/fs/xfs/libxfs/xfs_bmap.c +++ b/fs/xfs/libxfs/xfs_bmap.c @@ -53,8 +53,8 @@ xfs_bmap_compute_maxlevels( int whichfork) /* data or attr fork */ { xfs_extnum_t maxleafents; /* max leaf entries possible */ + xfs_rfsblock_t maxblocks; /* max blocks at this level */ int level; /* btree level */ - uint maxblocks; /* max blocks at this level */ int maxrootrecs; /* max records in root block */ int minleafrecs; /* min records in leaf block */ int minnoderecs; /* min records in node block */ @@ -88,7 +88,7 @@ xfs_bmap_compute_maxlevels( if (maxblocks <= maxrootrecs) maxblocks = 1; else - maxblocks = (maxblocks + minnoderecs - 1) / minnoderecs; + maxblocks = howmany_64(maxblocks, minnoderecs); } mp->m_bm_maxlevels[whichfork] = level; ASSERT(mp->m_bm_maxlevels[whichfork] <= xfs_bmbt_maxlevels_ondisk()); From patchwork Fri Jan 21 05:18:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandan Babu R X-Patchwork-Id: 12719266 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6C45EC433EF for ; Fri, 21 Jan 2022 05:19:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233730AbiAUFT4 (ORCPT ); Fri, 21 Jan 2022 00:19:56 -0500 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:58006 "EHLO mx0a-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232204AbiAUFT4 (ORCPT ); Fri, 21 Jan 2022 00:19:56 -0500 Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 20L042lZ017774; Fri, 21 Jan 2022 05:19:54 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2021-07-09; bh=q39737gsC3QYFuDpHX64S9UR73mdulO0VNCkjKd4fJc=; b=cogesHc54ibjuDZatYRrrZnzJIY38SEuj7yfdO5p9DRF4vtcUwQ0ba0t2MNojbWAUP4R Zg4A6rQrfJ2qg+Z52c3U6URtFpebTyak4nkblbpvMwWchdZEVkffDMkfMtQGbdkJ+GEm vBf6yPPS4FVs2t/VeeFux6xaQAePDSFvJvkd1IRNg1FHwFOoaEfL/k/Us5lnU0n5x7Kd V2lrqI8mm/tgQRlVvGu1YjDjRblvk9+/NmIgA4CPjsohQDPYGGmNlq8MUSO2OSKrQrxc RaxZPJCEAKpzXY72Bj/k+7wgGnRRZjPKh0bdYFNArDCgpX0L3M/5Ae4PPBfNdzLNiqCG 3Q== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by mx0b-00069f02.pphosted.com with ESMTP id 3dqhyc0d2k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jan 2022 05:19:54 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 20L5GUIN190228; Fri, 21 Jan 2022 05:19:53 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2176.outbound.protection.outlook.com [104.47.59.176]) by aserp3020.oracle.com with ESMTP id 3dqj0sh06j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jan 2022 05:19:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MN9RWdfp1obvghk9WcV/1F0g5ZffPNuZWGr0RW+lfWCG01uV7HkbI0zbwRYkY4yL7E1m5Biu8sRHO73w6pw2trQi4/EpxkFGRuPkdxdjGMFjoFFoOJCZnhi7c1fm4t+OtgdxmlzwSAzE0JsGJqMCd3WQppksPU/RC1ZtSprFrp3hjwGEGlzk+J+aDtUHUsjEwe6kjl69ZmdEg0n/9I1L1KsxR25/4SUh22lxS8I0Tur1j8rONiI8MbZAcOP0Ybx6B/Hpdes8tPeMUcu7f2NYxPTHfBl4krdBF73llABpNjgXFQGbLa1qOZxeuW90MWhxm/7xwLixK47TGUgvg1tNig== 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=q39737gsC3QYFuDpHX64S9UR73mdulO0VNCkjKd4fJc=; b=kvyVOrw36GNbRBO9BZuOfyduvk6L/P9JJl4cb+Ufw1vDcb6wP/W9ZG9svKfgUF1i61YJ9VdfJgA0pJHj5Tz0KEpympU2mJP8PeV4fbbIcNjFnbzGCBhB48nRJzIEXv0DrsUo9HRnUVVa8a3g2cQBEIhyuFJXxO8h8G2JyTHU0G4KdEBFBL1LqBZEQV2AE13sIlLm25glCy5piplv6Nyt7YoQFn5r2hdQ+7Fn7Mb5roWi0rNn3CEbG1DIByygbvafTcG1gR0LKbs0QM+U53QVpBpvm6JmA/2m+YEqcM7vu9UCo4gt/S1YTvJy8z0VfjL4msVjgTsJV6L2KvJs1B/a4Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=q39737gsC3QYFuDpHX64S9UR73mdulO0VNCkjKd4fJc=; b=M3YrzcAbvVCnfCtYyVDxxt9MTj3VPt2jYaf/pqv+9rxpaYVVPIvzEMGIyL2cdS4w6+PP0wZAq7IPCszKF9kCKC9dZX+8CStlJ5sRn6LNldLFT9/SXfxdse225R4LOx9dxrRFua/TIaDuB/VfllW/ZcZTbZJeHurbPvEtY/fAvzs= Received: from SJ0PR10MB4589.namprd10.prod.outlook.com (2603:10b6:a03:2d0::16) by CY4PR10MB1287.namprd10.prod.outlook.com (2603:10b6:903:2b::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.12; Fri, 21 Jan 2022 05:19:51 +0000 Received: from SJ0PR10MB4589.namprd10.prod.outlook.com ([fe80::3ce8:7ee8:46a0:9d4b]) by SJ0PR10MB4589.namprd10.prod.outlook.com ([fe80::3ce8:7ee8:46a0:9d4b%3]) with mapi id 15.20.4909.011; Fri, 21 Jan 2022 05:19:51 +0000 From: Chandan Babu R To: linux-xfs@vger.kernel.org Cc: Chandan Babu R , djwong@kernel.org, david@fromorbit.com Subject: [PATCH V5 11/16] xfs: Introduce macros to represent new maximum extent counts for data/attr forks Date: Fri, 21 Jan 2022 10:48:52 +0530 Message-Id: <20220121051857.221105-12-chandan.babu@oracle.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220121051857.221105-1-chandan.babu@oracle.com> References: <20220121051857.221105-1-chandan.babu@oracle.com> X-ClientProxiedBy: SI2P153CA0027.APCP153.PROD.OUTLOOK.COM (2603:1096:4:190::22) To SJ0PR10MB4589.namprd10.prod.outlook.com (2603:10b6:a03:2d0::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a971b841-8e2e-422b-4d53-08d9dc9da64d X-MS-TrafficTypeDiagnostic: CY4PR10MB1287:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1013; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6Gk3GPptTSQdf/nwJG5qpMBrOndOvgIS/aZKrOcmfnJBETWU0yUNCasXrraLDVdm3QzOKjog41v5GsaMtJhgEK/SQxCoGdKPAL0CEDsrhXJpYzzyAgnP3tEQvNu/4c2SgpOXZITgnzpbFlzd2ZeW2/bvuBdBDihMP8DaX/NIvh190lJ/iegQb5kV8e6kT9NazjxpWakw4tuhuc6OQtjrFGeZ2/uUI2AGODL5bHh6L8/9KjKjQlJqsABPHe0N3b2lxEILOOZn3GD2SWSb71IOQzjBNxUr5v4K9eh9y2FN26MzV6zylj+ERszwn3tcazJzvWKMB7lNHawdH3Zdq9JWWDOQO/38tgZncGFycxrRckpkKar1X1JnswgCtBMArlFL3qTcEUej7sD08CN4cQzdGQ4JDrafTYBzeWHR/VndAEUcpGfMHwXfmGMHSSpOkwjPVR6b1T+frQNW8THn45oaINX1nZeO3y1X488ZPKYKSZWZKmQ+uA+p6/RTpVM7OwPn5C1PLlo9r9IrX4CW71ozoZgS+wev9JmZlO27m6QrovDqdnrNFlAEJFM6njGU/eTq9QCY8XFLzQhmdjFzuNmBdlD+jESVo2gKMtVRUtcM7h0naalTgw9w5tV9CEnaUgden40nhcm5qneTa0x23SgKZWZIYTXjgJIE9mRjU52aSk82TlZiIBoNneJ0pyDvlLhn8oHxE78r2eFXvrZezOcg/g== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR10MB4589.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(508600001)(186003)(52116002)(66556008)(26005)(6916009)(2906002)(8676002)(5660300002)(66946007)(2616005)(6512007)(1076003)(4326008)(38100700002)(83380400001)(66476007)(86362001)(38350700002)(8936002)(6506007)(316002)(6486002)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: E0yGsX7yp63T5FgNgrthpewQIqTeH9n7eeFlrqZLf/PP03nYPi7RSiVup285x0sjiy37I+FdMR1IQq/o0fztBd6096XA5bdBZj0q/lJJmoAstinoYrIyQlQTB7KERlkC6rztrXC/P8VSjxkywArO3k7DY/74twOv1CmeJv/O2eTjECERsn72nQGIZhTRJq6PYxkt5W+hkujcisLaoqynoMzDkl2C2kiNO+eaunxc7n9ayLpCv6saI2KyM3LyZge7b6n4GXjuNFcjBVR+QzhiHUhvV+TJyXUoX++WnPCvt/XsvcRVdNH5OizEOqF9ipH/seQwBC29UIOwc9SbNXGS4CBIWXVgU3sDtDPxaDgWjntqThxPqAaJln3/hUI6aS0wEWtPQH99az2hH2EMUopGfACmcBe328iC0Bn60evj/ohdln4xPqUKCHu/UoqPnEHGjIFAJpsitKypkOm4N259bk0zTPekyhRyYtm+utPNPRPklIhTzR/TOZZTaq3gwcJpfAg63M2HJYvsn4K6BwhzB3+7u0m09la2b+SweKrFVAIMClIGh3w/SblAquVOD5TbOf8S7SV8BNz0YC+D0W6uhebNNO2hrTeF2hRE16L6EQB1Qyugs86CnniHz95HG0+kTY+ZCOHGYRgIQxCGGePd4FWjcu5KZnnQ/zLygggaI+GfxhlO6Nm+K3856UAkXUyjJQSKlb8q7H+qtmP0GZN5/TYe9Jz7HnyEe91pzDxfFin5JEj2w8SQ/37if3nNsFF3rXeuov3UGkAqjjNmEM+sQ2R9gH5a/AhkfkpoygYZ/lBWbCLmSWd/CxuYhPUleKReWmxKMatfkrhrkloWZZyiTUw4JKtDv0XotWpkGeYFKczt4K2GtQH5vf9Wi6m6bnlcNVlyBMKykZ5yj9VBTqsDB1yJMSZpS9seosFXDsIthWyfgou2Dsg2pcfeccOWGr2AozWB8QSbJSgTj7VyZzgKax8n4xwmKvQ2YpRI8hIKUaUznSUr42/gUdVsbSB/pkSTZ5UwPN5reTi/cs3bLCynxovJEOEdn4GT22UeEE1Y2qAu+sn3wkEikGSsrGBTepJj3Zm7eCTKyS2Oe4/7kyp0W6Ild+o4/JNy4FOPIw9UWP8LgkAlPGNQwJVSQY2y6R272mJVFaW4ilWV+w74isOTUBeufIxJ/2rcpj+C41gqSQmX51Xssxs5ekUxsf0pJlbZEDu+dKypQVXmZy3DoSYADQLMyyVVSd9Zge1DQ3YTOztsWbgk8sRjH96YFPAJ+O7GP7CS8DUpMsfh3PHw0BnYRwAUho5f6kVYLqb/XwZd/Tb4q8XCZ39WBWQSlmFVAXXB4wsRJNvXnnZYexWqS5CPj+gzlcRQ5MFOsFqIc8nPHgreeSBxHFWCGM6HABn+l2SsV3DONdlli7VoP2/7dtn7yqmfqtFTqLkQh6gaax4seSuJfiFWF5C+uorR7Bp7VIhEjUMGyWzRoAtGjippyIuyXXHyZNP6f+nc22uCgdRHEkxbsvskGYg2wu87Ne79mZ2LPid/QK7teFY4utr9pwiGlaWW77f5YgeesyM3U5I+L7BOf6hl1beqL0qdPGBsEN+07DD0cvn51a3wBTW650HfBpu3+1H39wxj0baGVqp0Ou8= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a971b841-8e2e-422b-4d53-08d9dc9da64d X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB4589.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2022 05:19:51.0664 (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: jUvP1uw+ZyTydR6wtMVVVQXNZqfVyNb8X0pnGxoDRK0i0dbvr4zjsI7p9EnFhg+Raw9yroFkO3FUX0Sq5U0uCg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR10MB1287 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10233 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 spamscore=0 malwarescore=0 phishscore=0 suspectscore=0 bulkscore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2201210037 X-Proofpoint-ORIG-GUID: kIacoMeAU8qYi-NcsVCxojBvEY2hK9Bc X-Proofpoint-GUID: kIacoMeAU8qYi-NcsVCxojBvEY2hK9Bc Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org This commit defines new macros to represent maximum extent counts allowed by filesystems which have support for large per-inode extent counters. Signed-off-by: Chandan Babu R Reviewed-by: Darrick J. Wong --- fs/xfs/libxfs/xfs_bmap.c | 8 +++----- fs/xfs/libxfs/xfs_bmap_btree.c | 2 +- fs/xfs/libxfs/xfs_format.h | 20 ++++++++++++++++---- fs/xfs/libxfs/xfs_inode_buf.c | 3 ++- fs/xfs/libxfs/xfs_inode_fork.c | 2 +- fs/xfs/libxfs/xfs_inode_fork.h | 19 +++++++++++++++---- 6 files changed, 38 insertions(+), 16 deletions(-) diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c index 1948af000c97..384532aac60a 100644 --- a/fs/xfs/libxfs/xfs_bmap.c +++ b/fs/xfs/libxfs/xfs_bmap.c @@ -61,10 +61,8 @@ xfs_bmap_compute_maxlevels( int sz; /* root block size */ /* - * The maximum number of extents in a file, hence the maximum number of - * leaf entries, is controlled by the size of the on-disk extent count, - * either a signed 32-bit number for the data fork, or a signed 16-bit - * number for the attr fork. + * The maximum number of extents in a fork, hence the maximum number of + * leaf entries, is controlled by the size of the on-disk extent count. * * Note that we can no longer assume that if we are in ATTR1 that the * fork offset of all the inodes will be @@ -74,7 +72,7 @@ xfs_bmap_compute_maxlevels( * ATTR2 we have to assume the worst case scenario of a minimum size * available. */ - maxleafents = xfs_iext_max_nextents(whichfork); + maxleafents = xfs_iext_max_nextents(xfs_has_nrext64(mp), whichfork); if (whichfork == XFS_DATA_FORK) sz = XFS_BMDR_SPACE_CALC(MINDBTPTRS); else diff --git a/fs/xfs/libxfs/xfs_bmap_btree.c b/fs/xfs/libxfs/xfs_bmap_btree.c index 453309fc85f2..e8d21d69b9ff 100644 --- a/fs/xfs/libxfs/xfs_bmap_btree.c +++ b/fs/xfs/libxfs/xfs_bmap_btree.c @@ -611,7 +611,7 @@ xfs_bmbt_maxlevels_ondisk(void) minrecs[1] = xfs_bmbt_block_maxrecs(blocklen, false) / 2; /* One extra level for the inode root. */ - return xfs_btree_compute_maxlevels(minrecs, MAXEXTNUM) + 1; + return xfs_btree_compute_maxlevels(minrecs, XFS_MAX_EXTCNT_DATA_FORK) + 1; } /* diff --git a/fs/xfs/libxfs/xfs_format.h b/fs/xfs/libxfs/xfs_format.h index 9934c320bf01..d3dfd45c39e0 100644 --- a/fs/xfs/libxfs/xfs_format.h +++ b/fs/xfs/libxfs/xfs_format.h @@ -872,10 +872,22 @@ enum xfs_dinode_fmt { /* * Max values for extlen, extnum, aextnum. - */ -#define MAXEXTLEN ((xfs_extlen_t)0x001fffff) /* 21 bits */ -#define MAXEXTNUM ((xfs_extnum_t)0x7fffffff) /* signed int */ -#define MAXAEXTNUM ((xfs_aextnum_t)0x7fff) /* signed short */ + * + * The newly introduced data fork extent counter is a 64-bit field. However, the + * maximum number of extents in a file is limited to 2^54 extents (assuming one + * blocks per extent) by the 54-bit wide startoff field of an extent record. + * + * A further limitation applies as shown below, + * 2^63 (max file size) / 64k (max block size) = 2^47 + * + * Rounding up 47 to the nearest multiple of bits-per-byte results in 48. Hence + * 2^48 was chosen as the maximum data fork extent count. + */ +#define MAXEXTLEN ((xfs_extlen_t)((1ULL << 21) - 1)) /* 21 bits */ +#define XFS_MAX_EXTCNT_DATA_FORK ((xfs_extnum_t)((1ULL << 48) - 1)) /* Unsigned 48-bits */ +#define XFS_MAX_EXTCNT_ATTR_FORK ((xfs_extnum_t)((1ULL << 32) - 1)) /* Unsigned 32-bits */ +#define XFS_MAX_EXTCNT_DATA_FORK_OLD ((xfs_extnum_t)((1ULL << 31) - 1)) /* Signed 32-bits */ +#define XFS_MAX_EXTCNT_ATTR_FORK_OLD ((xfs_extnum_t)((1ULL << 15) - 1)) /* Signed 16-bits */ /* * Inode minimum and maximum sizes. diff --git a/fs/xfs/libxfs/xfs_inode_buf.c b/fs/xfs/libxfs/xfs_inode_buf.c index 860d32816909..34f360a38603 100644 --- a/fs/xfs/libxfs/xfs_inode_buf.c +++ b/fs/xfs/libxfs/xfs_inode_buf.c @@ -361,7 +361,8 @@ xfs_dinode_verify_fork( return __this_address; break; case XFS_DINODE_FMT_BTREE: - max_extents = xfs_iext_max_nextents(whichfork); + max_extents = xfs_iext_max_nextents(xfs_dinode_has_nrext64(dip), + whichfork); if (di_nextents > max_extents) return __this_address; break; diff --git a/fs/xfs/libxfs/xfs_inode_fork.c b/fs/xfs/libxfs/xfs_inode_fork.c index ce690abe5dce..a3a3b54f9c55 100644 --- a/fs/xfs/libxfs/xfs_inode_fork.c +++ b/fs/xfs/libxfs/xfs_inode_fork.c @@ -746,7 +746,7 @@ xfs_iext_count_may_overflow( if (whichfork == XFS_COW_FORK) return 0; - max_exts = xfs_iext_max_nextents(whichfork); + max_exts = xfs_iext_max_nextents(xfs_inode_has_nrext64(ip), whichfork); if (XFS_TEST_ERROR(false, ip->i_mount, XFS_ERRTAG_REDUCE_MAX_IEXTENTS)) max_exts = 10; diff --git a/fs/xfs/libxfs/xfs_inode_fork.h b/fs/xfs/libxfs/xfs_inode_fork.h index 4a8b77d425df..e56803436c61 100644 --- a/fs/xfs/libxfs/xfs_inode_fork.h +++ b/fs/xfs/libxfs/xfs_inode_fork.h @@ -133,12 +133,23 @@ static inline int8_t xfs_ifork_format(struct xfs_ifork *ifp) return ifp->if_format; } -static inline xfs_extnum_t xfs_iext_max_nextents(int whichfork) +static inline xfs_extnum_t xfs_iext_max_nextents(bool has_nrext64, + int whichfork) { - if (whichfork == XFS_DATA_FORK || whichfork == XFS_COW_FORK) - return MAXEXTNUM; + switch (whichfork) { + case XFS_DATA_FORK: + case XFS_COW_FORK: + return has_nrext64 ? XFS_MAX_EXTCNT_DATA_FORK + : XFS_MAX_EXTCNT_DATA_FORK_OLD; + + case XFS_ATTR_FORK: + return has_nrext64 ? XFS_MAX_EXTCNT_ATTR_FORK + : XFS_MAX_EXTCNT_ATTR_FORK_OLD; - return MAXAEXTNUM; + default: + ASSERT(0); + return 0; + } } static inline xfs_extnum_t From patchwork Fri Jan 21 05:18:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandan Babu R X-Patchwork-Id: 12719268 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B0DB3C433F5 for ; Fri, 21 Jan 2022 05:20:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232204AbiAUFUE (ORCPT ); Fri, 21 Jan 2022 00:20:04 -0500 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:2680 "EHLO mx0a-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233242AbiAUFUD (ORCPT ); Fri, 21 Jan 2022 00:20:03 -0500 Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 20L045wO018299; Fri, 21 Jan 2022 05:19:58 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2021-07-09; bh=yTqoNYUJRp3MWWVOWJQAoBZGef4ZwxEz5QWcDu4UXNo=; b=OIGUFe8QT3F0dCM34db9dSuFOY6/cgamHaRm/nqN87Wh+YL2uj+5eSAg/7X5S7spVa/I L4WZdkXsmrNAcb2CAbuzBJ02iYD6bVWI9o9iBgs6csWOTGJMIkwxDQ2WxjaPixOYaHMq tnDWc7TeitFa12rcyCKBmpwZHNhI47LjzqmtEAsA/Y+rC+QwSBtUrYSshxS5GEz5da5X GmiG/IlMxREAS55WyJ9GPta6rZpNQ0BtNoGMIUkpTcpKWbkrFxNb6rjDBjPLbFTlqfcI zvLXRe9ReUA7mqA7w61+96g3kz8deT6hZG1nZ/99AdycPMRXHckt5oYeruak/7anr7Pr 3Q== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by mx0b-00069f02.pphosted.com with ESMTP id 3dqhycgcqx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jan 2022 05:19:58 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 20L5H26s018998; Fri, 21 Jan 2022 05:19:57 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2043.outbound.protection.outlook.com [104.47.66.43]) by aserp3030.oracle.com with ESMTP id 3dqj05h2yv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jan 2022 05:19:57 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hntQeF8dNE11rezZEjuoFhRzRcuxfnucs3o0Mi+9KeC7c80qN9LvE8lXl4BnSd11WKtxYg0jiBC4D1vHVFmffosSsSswu1fr/717Vb2KsDTTm+REUkFGY2Bajd4Pom+sC3cQc2VosBy00AXx8usvlFeaZw0+hwmJcJ98GkEEnAJC3wYeVaB5VAChs2YxJkkO7DF6Ql1mjzSZ7lxtpRy+DC5dJ7MhCbrTESEId3zlBcjsqaC43LIyGmpohPy4G1mdoMcAaOqqvHn7NqPcVDq0Jxz0Vls2MaGEi+8KD7N5bkmYTfP+igviQzTglOd4ui5FrcRX3kyL6gk+JUGzX+PucQ== 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=yTqoNYUJRp3MWWVOWJQAoBZGef4ZwxEz5QWcDu4UXNo=; b=gPQjozcXyJjBSVEHtFb5nNK2BKTWq1kihcv15NuBvRF+b+NRNqWOYdpyEJUSNJ0v5/lBRo6f2sg0MrHIUyCpDwNJEBCoNCrrimFYlluhKj9Cqx5IDSbeQ3yfC6GHMkZFUyevxObTbvuTGiBfq1HoVsgBknGnGxaJ6It8BJjdagnEbCmXwEfuqMWqHQp0O/ECiu5HvzjG9n3EwwOW/+ry++nPQqMmT4d16NI7XF8UtqjQsrNC+pq54f2EXUwp9zSDg/VUNMmGJ40phOVNjeq1PtL5K4Y2oFZ65ho0D6bb0AjlfdoLV5vMs00hO/s/r/vxJjwB2x1TgAAoSO9I8heJTg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=yTqoNYUJRp3MWWVOWJQAoBZGef4ZwxEz5QWcDu4UXNo=; b=PTV3jM8jSWrWRR+y/BszHqHlIl2KuZ23QTZgAiM/0EQFm4s+yMs6siIgvGsJ6qb9x736ho/EN2xWOvpYxe9cQL+q1yKr0xxF6Lz0sBhQMSbVZNQStqy2vZ5Tko2dEE3YQXUD26xKtcaX7ArT2NbqqIj739ekuJ6g4PqLTNJuYSU= Received: from SJ0PR10MB4589.namprd10.prod.outlook.com (2603:10b6:a03:2d0::16) by CY4PR10MB1287.namprd10.prod.outlook.com (2603:10b6:903:2b::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.12; Fri, 21 Jan 2022 05:19:54 +0000 Received: from SJ0PR10MB4589.namprd10.prod.outlook.com ([fe80::3ce8:7ee8:46a0:9d4b]) by SJ0PR10MB4589.namprd10.prod.outlook.com ([fe80::3ce8:7ee8:46a0:9d4b%3]) with mapi id 15.20.4909.011; Fri, 21 Jan 2022 05:19:54 +0000 From: Chandan Babu R To: linux-xfs@vger.kernel.org Cc: Chandan Babu R , djwong@kernel.org, david@fromorbit.com, Dave Chinner Subject: [PATCH V5 12/16] xfs: Introduce per-inode 64-bit extent counters Date: Fri, 21 Jan 2022 10:48:53 +0530 Message-Id: <20220121051857.221105-13-chandan.babu@oracle.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220121051857.221105-1-chandan.babu@oracle.com> References: <20220121051857.221105-1-chandan.babu@oracle.com> X-ClientProxiedBy: SI2P153CA0027.APCP153.PROD.OUTLOOK.COM (2603:1096:4:190::22) To SJ0PR10MB4589.namprd10.prod.outlook.com (2603:10b6:a03:2d0::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 79fd5145-9cd1-4cbb-a373-08d9dc9da7b7 X-MS-TrafficTypeDiagnostic: CY4PR10MB1287:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:125; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dg3l5Fr3ynUQPfD6YoiyKVRuqBb+zUqXpE0htxKK1KCzMc1qyfxgS8zr28sqsK3BnrHDCjuRrqI5MSVdJduPLHqaXfRzP9v0Xmt0wx3y0o82uJBY6LWsLBkLl2aM4aj6GP9tOv49P3kdIjHuEh9FcR8zguOVREgmdVX3XC2sGy0RogqXbwFxT8OFNiX/yWCe/d7l6YFeG4KBrZMD0MvK0aa5qma1S67AVXNlbnHVk1rohLxXM8p43HhQQy1MknFsek9mWBy/uCx5+rjZC1BgEG09YbkrgSHdAtE0Nmn9W4QZ+0M3/H6UwFOwJbT1rK3N2EAnJWxsBDBnQ8xgWuB6ROO9lz4fQ0KuSCoEBg5NR+XL8NQH8OVOzAWc6ff1ecQAwK4YKY5liFsr9x0P6LH+H/BUKlqwz5dAuCKKgbHAPblBkXcRvoPD015uMZmu2JKfGnRmjslqDyFJAOX8zQCNa34JS+CxYe8wVBNTK4lwP179pilDM1YPdY61VCylqQKP5MbbU0sC0pRaHWO+K0M41z1nWcZ8BIk1dUlF4l4e+rg1W8Vc1NFaCoOP9JM7+Jh0SbXRn3r7a3g29PyOn7lzG6Uok5jlOC/3tqKt8x7eumNQsl/RRxItjuprjtzSQVtOdby6bfjbEGU1BDZhSige0V6V0oDJRTP/og8fb+xKZgrZ9cR7u9HjR1uxFGmYxIxb X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR10MB4589.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(508600001)(186003)(52116002)(66556008)(26005)(6916009)(2906002)(8676002)(5660300002)(66946007)(2616005)(54906003)(6512007)(1076003)(30864003)(4326008)(38100700002)(83380400001)(66476007)(86362001)(38350700002)(8936002)(6506007)(316002)(6486002)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Lvyhh4RRO1cg3wnse2B268bPJ98pop+JyGLMKyy1mdmkRNgcq4tWm66RKdRpUjB+zBeYKFZB5NrKwD/3k+sYdNpMryeY46ID0CE8Rh1/sLkyn+Lp5Entvz8MYMR7tnkigy5Xs7LaSv2NG8rgYR2Ij3yWI8llUCfCMotLyXD3YkVQ3vHcIXE7gQK1wS3VSgW6OuG68vCNsNTq0FOSd3gpwieCTJyrwOk9C6D808dm+Nv95asMHYtwv3wJhi+zY9IKOg7jf/syDbcsPpWFTrcT/MyjHwDGbzKq2CrYbIuRyOeRwxIpYGUepMV6NE8X3z3DvIFoxHckdqsMiEnrmh//GM89t8lyvI9Nw24GSCDNkMosAu7r33xjL0Kslon0xkjfRei1/uKJ0U26eWi4PU/cXCvE9Dw7aFqSlfJivUt+t3+rWuKo91g+xExf3ckSpf+CvhDL/XbtjgshAiamB/HsKxesFzep7WTUoNSVCGNCkr0WBioPojFri3cRubF2/65iD5yA/aTn0C+3zhOhMTeB6KiBbPKZJ9yIXbzhySB7e6SmOErSx9vSAFy2q7/yPe7IP202Rx3DzMAvjqL7AGbP8F0PkK0R2UQnROvI0VjIRXp79agQN+DUPVWgrMWXXdokqQMKxHu6mnsEYb6sbhgv6wfU63gS1S2ovowA9QwJEsN0Njd37sC4cfrszvxAbUfkYKsc41uZoKZPQIASfi1PUfF8yswIzAFSk2pA5bgDcCPbQJ3CpbBroVLTguHwSaTqUr7stdQSDdgM4dHNf77V68ktNt6pyBO1pst6Wpyj6KlcQECkLblS7cxo5k39YSu6cEg3rBM2b0dceJfbcGIyHL6i8p2vVn7dzldS4XwKo+HWKE4XgOcLY9uoGosH0pyBZIndbb1TuNKc2TG067YDj4FgLpsLCVaRCdz9uLRvd8LD4Kcn2vOgOnKc16w+zvhZ6vGvP++iZ8I+3BTHuiyc0NZHhzGyv5CTqZkT8hiqiQbiKDzbZGNu0+uKqaOBSWbASlU52P15WHrQ4b2l1Tc65vJn2tzaHa6hUk5KdAWKGRPv/+bTUkM6tCZtuq+9a9uYj8vuEBcreUo4gLHxEifhxoTXnsRQLJnECOxcFO/sa511ushLcRK0DB7IdcX1N4AEYj68jna4cN186lzSSO1ybeLU+XNERYtrAJBUbo+kXyXWKJ0kNHnBEWtzQ9CepM0Ea+b3IxhrZWKY6+/jDEbaLKrCmp8DOFh8BNXR0+R57TVE2mrkp2+kB+pRVnTAp4vgpNtxJ5tRiIb4p8mwJCnQ3DHhGXiZvW4StM8Mz4oth0Ezwc25UHOYieW9FW6GwVJZwghtin6/qj5F1QSWl0j29vK64xzFIidQ2yusp0DN9wEF3PMRiqwOcS6cMsMcp5PZXImAZGvDF/+T6vblI87yyIYcWJHj8dxn7LgztXLSz2CMYxm/OFLzV52YtOKp4RlnrvYceTeKZlCkCJOXTXuNWlcWhw+9gne6D2qjGvEmz5dhtiXj0CLO3XNBQSWMSIC1c4lTHIIzdvdM/gKDSCJSjJLWIbKYTfRbAFps99o53HszLHDllnXHKl2jIiI3b/6JwZc1TZYM+m0rukpEDkiGNo6C6fjPr4gcfB7JDmPU/Wk= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 79fd5145-9cd1-4cbb-a373-08d9dc9da7b7 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB4589.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2022 05:19:54.6498 (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: 0dDuaU7WRYBSej3DQZMr5A3qA/dotdMZf4C3gg72V3c0+pH8Oy8015n0UFpEHZzbYktJgteBKQnem4xyNv+fIg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR10MB1287 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10233 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 spamscore=0 mlxlogscore=999 malwarescore=0 adultscore=0 suspectscore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2201210037 X-Proofpoint-ORIG-GUID: z6knVUF9TmXssIGvlnYcUSPfThI_Gnsu X-Proofpoint-GUID: z6knVUF9TmXssIGvlnYcUSPfThI_Gnsu Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org This commit introduces new fields in the on-disk inode format to support 64-bit data fork extent counters and 32-bit attribute fork extent counters. The new fields will be used only when an inode has XFS_DIFLAG2_NREXT64 flag set. Otherwise we continue to use the regular 32-bit data fork extent counters and 16-bit attribute fork extent counters. Signed-off-by: Chandan Babu R Suggested-by: Dave Chinner Reported-by: kernel test robot --- fs/xfs/libxfs/xfs_format.h | 22 +++++++-- fs/xfs/libxfs/xfs_inode_buf.c | 49 ++++++++++++++++++-- fs/xfs/libxfs/xfs_inode_fork.h | 6 +++ fs/xfs/libxfs/xfs_log_format.h | 22 +++++++-- fs/xfs/xfs_inode_item.c | 23 ++++++++-- fs/xfs/xfs_inode_item_recover.c | 79 ++++++++++++++++++++++++++++----- 6 files changed, 174 insertions(+), 27 deletions(-) diff --git a/fs/xfs/libxfs/xfs_format.h b/fs/xfs/libxfs/xfs_format.h index d3dfd45c39e0..df1d6ec39c45 100644 --- a/fs/xfs/libxfs/xfs_format.h +++ b/fs/xfs/libxfs/xfs_format.h @@ -792,16 +792,30 @@ struct xfs_dinode { __be32 di_nlink; /* number of links to file */ __be16 di_projid_lo; /* lower part of owner's project id */ __be16 di_projid_hi; /* higher part owner's project id */ - __u8 di_pad[6]; /* unused, zeroed space */ - __be16 di_flushiter; /* incremented on flush */ + union { + __be64 di_big_nextents;/* NREXT64 data extents */ + __u8 di_v3_pad[8]; /* !NREXT64 V3 inode zeroed space */ + struct { + __u8 di_v2_pad[6]; /* V2 inode zeroed space */ + __be16 di_flushiter; /* V2 inode incremented on flush */ + }; + }; xfs_timestamp_t di_atime; /* time last accessed */ xfs_timestamp_t di_mtime; /* time last modified */ xfs_timestamp_t di_ctime; /* time created/inode modified */ __be64 di_size; /* number of bytes in file */ __be64 di_nblocks; /* # of direct & btree blocks used */ __be32 di_extsize; /* basic/minimum extent size for file */ - __be32 di_nextents; /* number of extents in data fork */ - __be16 di_anextents; /* number of extents in attribute fork*/ + union { + struct { + __be32 di_big_anextents; /* NREXT64 attr extents */ + __be16 di_nrext64_pad; /* NREXT64 unused, zero */ + } __packed; + struct { + __be32 di_nextents; /* !NREXT64 data extents */ + __be16 di_anextents; /* !NREXT64 attr extents */ + } __packed; + }; __u8 di_forkoff; /* attr fork offs, <<3 for 64b align */ __s8 di_aformat; /* format of attr fork's data */ __be32 di_dmevmask; /* DMIG event mask */ diff --git a/fs/xfs/libxfs/xfs_inode_buf.c b/fs/xfs/libxfs/xfs_inode_buf.c index 34f360a38603..2200526bcee0 100644 --- a/fs/xfs/libxfs/xfs_inode_buf.c +++ b/fs/xfs/libxfs/xfs_inode_buf.c @@ -279,6 +279,25 @@ xfs_inode_to_disk_ts( return ts; } +static inline void +xfs_inode_to_disk_iext_counters( + struct xfs_inode *ip, + struct xfs_dinode *to) +{ + if (xfs_inode_has_nrext64(ip)) { + to->di_big_nextents = cpu_to_be64(xfs_ifork_nextents(&ip->i_df)); + to->di_big_anextents = cpu_to_be32(xfs_ifork_nextents(ip->i_afp)); + /* + * We might be upgrading the inode to use larger extent counters + * than was previously used. Hence zero the unused field. + */ + to->di_nrext64_pad = cpu_to_be16(0); + } else { + to->di_nextents = cpu_to_be32(xfs_ifork_nextents(&ip->i_df)); + to->di_anextents = cpu_to_be16(xfs_ifork_nextents(ip->i_afp)); + } +} + void xfs_inode_to_disk( struct xfs_inode *ip, @@ -296,7 +315,6 @@ xfs_inode_to_disk( to->di_projid_lo = cpu_to_be16(ip->i_projid & 0xffff); to->di_projid_hi = cpu_to_be16(ip->i_projid >> 16); - memset(to->di_pad, 0, sizeof(to->di_pad)); to->di_atime = xfs_inode_to_disk_ts(ip, inode->i_atime); to->di_mtime = xfs_inode_to_disk_ts(ip, inode->i_mtime); to->di_ctime = xfs_inode_to_disk_ts(ip, inode->i_ctime); @@ -307,8 +325,6 @@ xfs_inode_to_disk( to->di_size = cpu_to_be64(ip->i_disk_size); to->di_nblocks = cpu_to_be64(ip->i_nblocks); to->di_extsize = cpu_to_be32(ip->i_extsize); - to->di_nextents = cpu_to_be32(xfs_ifork_nextents(&ip->i_df)); - to->di_anextents = cpu_to_be16(xfs_ifork_nextents(ip->i_afp)); to->di_forkoff = ip->i_forkoff; to->di_aformat = xfs_ifork_format(ip->i_afp); to->di_flags = cpu_to_be16(ip->i_diflags); @@ -323,11 +339,14 @@ xfs_inode_to_disk( to->di_lsn = cpu_to_be64(lsn); memset(to->di_pad2, 0, sizeof(to->di_pad2)); uuid_copy(&to->di_uuid, &ip->i_mount->m_sb.sb_meta_uuid); - to->di_flushiter = 0; + memset(to->di_v3_pad, 0, sizeof(to->di_v3_pad)); } else { to->di_version = 2; to->di_flushiter = cpu_to_be16(ip->i_flushiter); + memset(to->di_v2_pad, 0, sizeof(to->di_v2_pad)); } + + xfs_inode_to_disk_iext_counters(ip, to); } static xfs_failaddr_t @@ -397,6 +416,24 @@ xfs_dinode_verify_forkoff( return NULL; } +static xfs_failaddr_t +xfs_dinode_verify_nextents( + struct xfs_mount *mp, + struct xfs_dinode *dip) +{ + if (xfs_dinode_has_nrext64(dip)) { + if (!xfs_has_nrext64(mp)) + return __this_address; + if (dip->di_nrext64_pad != 0) + return __this_address; + } else { + if (dip->di_version == 3 && dip->di_big_nextents != 0) + return __this_address; + } + + return NULL; +} + xfs_failaddr_t xfs_dinode_verify( struct xfs_mount *mp, @@ -440,6 +477,10 @@ xfs_dinode_verify( if ((S_ISLNK(mode) || S_ISDIR(mode)) && di_size == 0) return __this_address; + fa = xfs_dinode_verify_nextents(mp, dip); + if (fa) + return fa; + nextents = xfs_dfork_data_extents(dip); nextents += xfs_dfork_attr_extents(dip); nblocks = be64_to_cpu(dip->di_nblocks); diff --git a/fs/xfs/libxfs/xfs_inode_fork.h b/fs/xfs/libxfs/xfs_inode_fork.h index e56803436c61..8e6221e32660 100644 --- a/fs/xfs/libxfs/xfs_inode_fork.h +++ b/fs/xfs/libxfs/xfs_inode_fork.h @@ -156,6 +156,9 @@ static inline xfs_extnum_t xfs_dfork_data_extents( struct xfs_dinode *dip) { + if (xfs_dinode_has_nrext64(dip)) + return be64_to_cpu(dip->di_big_nextents); + return be32_to_cpu(dip->di_nextents); } @@ -163,6 +166,9 @@ static inline xfs_extnum_t xfs_dfork_attr_extents( struct xfs_dinode *dip) { + if (xfs_dinode_has_nrext64(dip)) + return be32_to_cpu(dip->di_big_anextents); + return be16_to_cpu(dip->di_anextents); } diff --git a/fs/xfs/libxfs/xfs_log_format.h b/fs/xfs/libxfs/xfs_log_format.h index fd66e70248f7..7f4ebf112a3c 100644 --- a/fs/xfs/libxfs/xfs_log_format.h +++ b/fs/xfs/libxfs/xfs_log_format.h @@ -388,16 +388,30 @@ struct xfs_log_dinode { uint32_t di_nlink; /* number of links to file */ uint16_t di_projid_lo; /* lower part of owner's project id */ uint16_t di_projid_hi; /* higher part of owner's project id */ - uint8_t di_pad[6]; /* unused, zeroed space */ - uint16_t di_flushiter; /* incremented on flush */ + union { + uint64_t di_big_nextents;/* NREXT64 data extents */ + uint8_t di_v3_pad[8]; /* !NREXT64 V3 inode zeroed space */ + struct { + uint8_t di_v2_pad[6]; /* V2 inode zeroed space */ + uint16_t di_flushiter; /* V2 inode incremented on flush */ + }; + }; xfs_log_timestamp_t di_atime; /* time last accessed */ xfs_log_timestamp_t di_mtime; /* time last modified */ xfs_log_timestamp_t di_ctime; /* time created/inode modified */ xfs_fsize_t di_size; /* number of bytes in file */ xfs_rfsblock_t di_nblocks; /* # of direct & btree blocks used */ xfs_extlen_t di_extsize; /* basic/minimum extent size for file */ - uint32_t di_nextents; /* number of extents in data fork */ - uint16_t di_anextents; /* number of extents in attribute fork*/ + union { + struct { + uint32_t di_big_anextents; /* NREXT64 attr extents */ + uint16_t di_nrext64_pad; /* NREXT64 unused, zero */ + } __packed; + struct { + uint32_t di_nextents; /* !NREXT64 data extents */ + uint16_t di_anextents; /* !NREXT64 attr extents */ + } __packed; + }; uint8_t di_forkoff; /* attr fork offs, <<3 for 64b align */ int8_t di_aformat; /* format of attr fork's data */ uint32_t di_dmevmask; /* DMIG event mask */ diff --git a/fs/xfs/xfs_inode_item.c b/fs/xfs/xfs_inode_item.c index 90d8e591baf8..8304ce062e43 100644 --- a/fs/xfs/xfs_inode_item.c +++ b/fs/xfs/xfs_inode_item.c @@ -358,6 +358,21 @@ xfs_copy_dm_fields_to_log_dinode( } } +static inline void +xfs_inode_to_log_dinode_iext_counters( + struct xfs_inode *ip, + struct xfs_log_dinode *to) +{ + if (xfs_inode_has_nrext64(ip)) { + to->di_big_nextents = xfs_ifork_nextents(&ip->i_df); + to->di_big_anextents = xfs_ifork_nextents(ip->i_afp); + to->di_nrext64_pad = 0; + } else { + to->di_nextents = xfs_ifork_nextents(&ip->i_df); + to->di_anextents = xfs_ifork_nextents(ip->i_afp); + } +} + static void xfs_inode_to_log_dinode( struct xfs_inode *ip, @@ -373,7 +388,6 @@ xfs_inode_to_log_dinode( to->di_projid_lo = ip->i_projid & 0xffff; to->di_projid_hi = ip->i_projid >> 16; - memset(to->di_pad, 0, sizeof(to->di_pad)); memset(to->di_pad3, 0, sizeof(to->di_pad3)); to->di_atime = xfs_inode_to_log_dinode_ts(ip, inode->i_atime); to->di_mtime = xfs_inode_to_log_dinode_ts(ip, inode->i_mtime); @@ -385,8 +399,6 @@ xfs_inode_to_log_dinode( to->di_size = ip->i_disk_size; to->di_nblocks = ip->i_nblocks; to->di_extsize = ip->i_extsize; - to->di_nextents = xfs_ifork_nextents(&ip->i_df); - to->di_anextents = xfs_ifork_nextents(ip->i_afp); to->di_forkoff = ip->i_forkoff; to->di_aformat = xfs_ifork_format(ip->i_afp); to->di_flags = ip->i_diflags; @@ -406,11 +418,14 @@ xfs_inode_to_log_dinode( to->di_lsn = lsn; memset(to->di_pad2, 0, sizeof(to->di_pad2)); uuid_copy(&to->di_uuid, &ip->i_mount->m_sb.sb_meta_uuid); - to->di_flushiter = 0; + memset(to->di_v3_pad, 0, sizeof(to->di_v3_pad)); } else { to->di_version = 2; to->di_flushiter = ip->i_flushiter; + memset(to->di_v2_pad, 0, sizeof(to->di_v2_pad)); } + + xfs_inode_to_log_dinode_iext_counters(ip, to); } /* diff --git a/fs/xfs/xfs_inode_item_recover.c b/fs/xfs/xfs_inode_item_recover.c index 767a551816a0..fa3556633ca9 100644 --- a/fs/xfs/xfs_inode_item_recover.c +++ b/fs/xfs/xfs_inode_item_recover.c @@ -148,6 +148,22 @@ static inline bool xfs_log_dinode_has_nrext64(const struct xfs_log_dinode *ld) (ld->di_flags2 & XFS_DIFLAG2_NREXT64); } +static inline void +xfs_log_dinode_to_disk_iext_counters( + struct xfs_log_dinode *from, + struct xfs_dinode *to) +{ + if (xfs_log_dinode_has_nrext64(from)) { + to->di_big_nextents = cpu_to_be64(from->di_big_nextents); + to->di_big_anextents = cpu_to_be32(from->di_big_anextents); + to->di_nrext64_pad = cpu_to_be16(from->di_nrext64_pad); + } else { + to->di_nextents = cpu_to_be32(from->di_nextents); + to->di_anextents = cpu_to_be16(from->di_anextents); + } + +} + STATIC void xfs_log_dinode_to_disk( struct xfs_log_dinode *from, @@ -164,7 +180,6 @@ xfs_log_dinode_to_disk( to->di_nlink = cpu_to_be32(from->di_nlink); to->di_projid_lo = cpu_to_be16(from->di_projid_lo); to->di_projid_hi = cpu_to_be16(from->di_projid_hi); - memcpy(to->di_pad, from->di_pad, sizeof(to->di_pad)); to->di_atime = xfs_log_dinode_to_disk_ts(from, from->di_atime); to->di_mtime = xfs_log_dinode_to_disk_ts(from, from->di_mtime); @@ -173,8 +188,6 @@ xfs_log_dinode_to_disk( to->di_size = cpu_to_be64(from->di_size); to->di_nblocks = cpu_to_be64(from->di_nblocks); to->di_extsize = cpu_to_be32(from->di_extsize); - to->di_nextents = cpu_to_be32(from->di_nextents); - to->di_anextents = cpu_to_be16(from->di_anextents); to->di_forkoff = from->di_forkoff; to->di_aformat = from->di_aformat; to->di_dmevmask = cpu_to_be32(from->di_dmevmask); @@ -192,10 +205,13 @@ xfs_log_dinode_to_disk( to->di_lsn = cpu_to_be64(lsn); memcpy(to->di_pad2, from->di_pad2, sizeof(to->di_pad2)); uuid_copy(&to->di_uuid, &from->di_uuid); - to->di_flushiter = 0; + memcpy(to->di_v3_pad, from->di_v3_pad, sizeof(to->di_v3_pad)); } else { to->di_flushiter = cpu_to_be16(from->di_flushiter); + memcpy(to->di_v2_pad, from->di_v2_pad, sizeof(to->di_v2_pad)); } + + xfs_log_dinode_to_disk_iext_counters(from, to); } STATIC int @@ -209,6 +225,8 @@ xlog_recover_inode_commit_pass2( struct xfs_mount *mp = log->l_mp; struct xfs_buf *bp; struct xfs_dinode *dip; + xfs_extnum_t nextents; + xfs_aextnum_t anextents; int len; char *src; char *dest; @@ -348,21 +366,60 @@ xlog_recover_inode_commit_pass2( goto out_release; } } - if (unlikely(ldip->di_nextents + ldip->di_anextents > ldip->di_nblocks)){ - XFS_CORRUPTION_ERROR("xlog_recover_inode_pass2(5)", + + if (xfs_log_dinode_has_nrext64(ldip)) { + if (!xfs_has_nrext64(mp) || (ldip->di_nrext64_pad != 0)) { + XFS_CORRUPTION_ERROR("xlog_recover_inode_pass2(5)", + XFS_ERRLEVEL_LOW, mp, ldip, + sizeof(*ldip)); + xfs_alert(mp, + "%s: Bad inode log record, rec ptr "PTR_FMT", " + "dino ptr "PTR_FMT", dino bp "PTR_FMT", " + "ino %Ld, xfs_has_nrext64(mp) = %d, " + "ldip->di_nrext64_pad = %u", + __func__, item, dip, bp, in_f->ilf_ino, + xfs_has_nrext64(mp), ldip->di_nrext64_pad); + error = -EFSCORRUPTED; + goto out_release; + } + } else { + if (ldip->di_version == 3 && ldip->di_big_nextents != 0) { + XFS_CORRUPTION_ERROR("xlog_recover_inode_pass2(6)", + XFS_ERRLEVEL_LOW, mp, ldip, + sizeof(*ldip)); + xfs_alert(mp, + "%s: Bad inode log record, rec ptr "PTR_FMT", " + "dino ptr "PTR_FMT", dino bp "PTR_FMT", " + "ino %Ld, ldip->di_big_dextcnt = %llu", + __func__, item, dip, bp, in_f->ilf_ino, + ldip->di_big_nextents); + error = -EFSCORRUPTED; + goto out_release; + } + } + + if (xfs_log_dinode_has_nrext64(ldip)) { + nextents = ldip->di_big_nextents; + anextents = ldip->di_big_anextents; + } else { + nextents = ldip->di_nextents; + anextents = ldip->di_anextents; + } + + if (unlikely(nextents + anextents > ldip->di_nblocks)) { + XFS_CORRUPTION_ERROR("xlog_recover_inode_pass2(7)", XFS_ERRLEVEL_LOW, mp, ldip, sizeof(*ldip)); xfs_alert(mp, "%s: Bad inode log record, rec ptr "PTR_FMT", dino ptr "PTR_FMT", " - "dino bp "PTR_FMT", ino %Ld, total extents = %d, nblocks = %Ld", + "dino bp "PTR_FMT", ino %Ld, total extents = %llu, nblocks = %Ld", __func__, item, dip, bp, in_f->ilf_ino, - ldip->di_nextents + ldip->di_anextents, - ldip->di_nblocks); + nextents + anextents, ldip->di_nblocks); error = -EFSCORRUPTED; goto out_release; } if (unlikely(ldip->di_forkoff > mp->m_sb.sb_inodesize)) { - XFS_CORRUPTION_ERROR("xlog_recover_inode_pass2(6)", + XFS_CORRUPTION_ERROR("xlog_recover_inode_pass2(8)", XFS_ERRLEVEL_LOW, mp, ldip, sizeof(*ldip)); xfs_alert(mp, @@ -374,7 +431,7 @@ xlog_recover_inode_commit_pass2( } isize = xfs_log_dinode_size(mp); if (unlikely(item->ri_buf[1].i_len > isize)) { - XFS_CORRUPTION_ERROR("xlog_recover_inode_pass2(7)", + XFS_CORRUPTION_ERROR("xlog_recover_inode_pass2(9)", XFS_ERRLEVEL_LOW, mp, ldip, sizeof(*ldip)); xfs_alert(mp, From patchwork Fri Jan 21 05:18:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandan Babu R X-Patchwork-Id: 12719267 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1644C433EF for ; Fri, 21 Jan 2022 05:20:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232440AbiAUFUD (ORCPT ); Fri, 21 Jan 2022 00:20:03 -0500 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:1164 "EHLO mx0a-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232204AbiAUFUC (ORCPT ); Fri, 21 Jan 2022 00:20:02 -0500 Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 20L04fiK009111; Fri, 21 Jan 2022 05:20:00 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2021-07-09; bh=E1/rZKke48a/2qy9gV7gAk78ENKJhFUxMD7u+pqn2Jw=; b=MzVUjPVNpNw91oMbbX79jjtflMDcQwaPAMdqX5/SkLC8zPlHNNFHUaHnenBXb+WV0/Bh X0r27vPgNBwJ49FVgMWTlNvmjfTYo3lEJI7LOSmgaGfUS04IdpKPzKGpfAhlx1WzNY81 NzjcDweh+siLk4EiQPy+4seXFLhTLRVmMLwKvm3bD1/zNYdUP7QM2MM0xb4VGWiknt10 LXybMA+nv/hsFXxzg/SInoN7PUThMdcfkHbVfiE8Unb6i3hR/gU8HnEN/auJPFi4vEXf 9gUooBKkcZ2IBQcAUo1tPJhotjc0Sz2aYoQF2fNwtPHs5Aiy/A5tEKUvq2Z41TkHeOQZ Hw== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by mx0b-00069f02.pphosted.com with ESMTP id 3dqhykrcp9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jan 2022 05:20:00 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 20L5Gg4h081935; Fri, 21 Jan 2022 05:19:59 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2045.outbound.protection.outlook.com [104.47.66.45]) by userp3030.oracle.com with ESMTP id 3dqj0vbk6v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jan 2022 05:19:59 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fXOwoaowg7ZSyCR/0yb0XWgDiRuCpX6VGt06IK6m87UGTKxb1i4c0cAK41wL3SGAEhoyXZ51VlycmsU0Ey8xBp/rGFtRsaTqqT5DqNkQ5EuHQMYFs3OEllYmgErlCblPsw3g4jUKqRdzOLVmbGQG4MmvkGld6hqzJMj63gwsRXP9NUefhIAwOOHLcadHLtlgzL3hjv8Rt63/yDKRfsRRnaaATbiOIyD6WozhQLiXdu/Zy0WQ+cDpRncn47pIGuLIYITz8IlH9El7KQcxWSrKPo6GSOzpDY8+EI6aHQiF7U2J74cwS6KvbG9C+xjvJULe7mi7JxBV4005lDQlOL7ylQ== 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=E1/rZKke48a/2qy9gV7gAk78ENKJhFUxMD7u+pqn2Jw=; b=Y1g6+tPc4XQewQDQACvW16DgTU+iYaYIWxuqshS/LQmdMoHGqgSfKyX//MVQaci4zrA9YZ72ing/RJl4NO74hhcLEwHgbSxxRvJbE46BDNfyGacOfL47zLPy4oYNl6V/g1iWUbJ6ffdY3utBft9UZ4Y8X/ZiwBPOIby4MDSY+AryMkPP6haFidlZhbvExNHE4At++R6V3JRUXc++C++hbD8uAciL+2efxD87UljN2njdyFCaqdxO0ehaQKZD32Mj7je4GAF/9d0AVJVcawAZYvR9v9K/H+a3q3kgGzwl79jkG3BUcPIOi1+m9atQ+PzPqh5/W3SgpgSKRAC3peCuTg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=E1/rZKke48a/2qy9gV7gAk78ENKJhFUxMD7u+pqn2Jw=; b=fXq0xDx1/YthPOCRSneROUvfE6VWZ8fpYaBG6v3HLrrgMBn8o3lsjTocRFNK63nXK7NPiL0OMjV7Jc0DcJrvMla+Y/d3acWqK62QthJSmnTN6VgcxLwhesT0L6m9kWZHKHrkFgtdzmz1PPMmii+ZuI5ryd1RmKtiwwkDU9/MZ4A= Received: from SJ0PR10MB4589.namprd10.prod.outlook.com (2603:10b6:a03:2d0::16) by CY4PR10MB1287.namprd10.prod.outlook.com (2603:10b6:903:2b::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.12; Fri, 21 Jan 2022 05:19:56 +0000 Received: from SJ0PR10MB4589.namprd10.prod.outlook.com ([fe80::3ce8:7ee8:46a0:9d4b]) by SJ0PR10MB4589.namprd10.prod.outlook.com ([fe80::3ce8:7ee8:46a0:9d4b%3]) with mapi id 15.20.4909.011; Fri, 21 Jan 2022 05:19:56 +0000 From: Chandan Babu R To: linux-xfs@vger.kernel.org Cc: Chandan Babu R , djwong@kernel.org, david@fromorbit.com Subject: [PATCH V5 13/16] xfs: Conditionally upgrade existing inodes to use 64-bit extent counters Date: Fri, 21 Jan 2022 10:48:54 +0530 Message-Id: <20220121051857.221105-14-chandan.babu@oracle.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220121051857.221105-1-chandan.babu@oracle.com> References: <20220121051857.221105-1-chandan.babu@oracle.com> X-ClientProxiedBy: SI2P153CA0027.APCP153.PROD.OUTLOOK.COM (2603:1096:4:190::22) To SJ0PR10MB4589.namprd10.prod.outlook.com (2603:10b6:a03:2d0::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3833377c-90ef-4faa-06c6-08d9dc9da9bc X-MS-TrafficTypeDiagnostic: CY4PR10MB1287:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:47; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xjTdXtAV6eVG3btLeGp/tO4AwaPtsv/1IYhTk90Ql0ce9I0kbBZsVdhM0jJyirpO+QVE6ks/uX4FwIoYHxDCcBttqcMMQH02nSOFhjUk1Okmulv4WCUbsCVHldiYU3MAtfRq7jaorhiVwKluhDtDrk663E8Nzy7vha/6YUrOVlfI7/83YL5LsPIMjpyfEs1j1FgNr63bAXKUh2lOPqnmBSxTgFqTvhXWEB2VJSX5LzOWIjGqJdAJeaFyhqEz7YVgqpb5Tw1JI0AWioSxjGcLd0k51g+kMy0lsSZxVYyE/CwePsiLBePKjtHZP33yb9RK2VkvYkaE1DI+yHxlJzCRLj09KLpfVeJX7maAwnsJyxtJPE9DTlWoghG7RgAFz48bzXpzHg4CK5ahFtmu6XZBpBCpXoHgM1OiWSRnsU210piRDYlkWdGWsjZOWMZj8FxPH+ybxCjMxKzmEokM2tVP/2e0srZXxITwrFvUdqd4iLuqoxF3UZvZhykg+/ClIs5wmWA1Mx+I6V277VeQwYGU1HECeW8HQvOhHYW9XkISnUi+XmLE4ezqwmQhGXh5GaE6zcTFlJiEAHhlASqd3Tst66Lq59zoo3yB1TAYzvh6NwA8N+aVW0M7kRYlRJ1qofwuoe8ZIjour/u4Nuf+gq7EpbWCJm3T/5i8qjpl7fBu0v4kLxxF7FKRW1Lj3hILMaIWzZOfLumt1TbpK/QHqTxrwQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR10MB4589.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(508600001)(186003)(52116002)(66556008)(4744005)(26005)(6916009)(2906002)(8676002)(5660300002)(66946007)(2616005)(6512007)(1076003)(4326008)(38100700002)(83380400001)(66476007)(86362001)(38350700002)(8936002)(6506007)(316002)(6486002)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 6V4pDHojyZdQZ0AesYXIRi1d0rzHOinqW8mHya6d21Mjz9ARTwaqYXb899xHh6+O0idQFeTdmC0faC9mfUrdUozYB1QZ2+yiE8bGj41bFW3CC/FAiqKQ64ixvzkILP8niytSiuz3vgbnG06PyQxew0+nPrYBEZBHGxq+D4k8rHEl8foDh5GdkkFHolKHa1gHvw6uEvXRt4Nn03+VeahWCUR0oEt6S+oGTYH3rUS1RbrfUeE2FC/95erYMV0OFLNo9SgsupDpLCMdSKmxp2FbnL6aR7NspwysFQtEtcHoRKU4wR9JKnCchMzOe07zweppByG778zi3i5p6jisDQ2mP+Ki0mz7oEFQ4hQkilLK8Jqg5x2BY146Uux+KN+LKreI9XuzYlqfPbSkJv5pMBS2xOZZV7jFHv7cXair+EFE8pqquoXvdysIHGoKe7BASleog60cP0+RX+Gl1TpprtckWPEXfRN3FOYJAFmYr7/6L09iCUa4APMP6jXUezDKZ+tivF0GoFTxRjuxZmT2+m9QaEt6GpUlZXT5ukUyqem18GBgKTQX+o1mI2Ln5pNLIFN7MgJXQ9CrVR3SQn6jwqdR7Sb4GHiP8D44hr7XNPTt/KUvj0OZPUW8i74d3tJiaSfFVDKkNkZI9zJNBhfm8dbwIgJYtWwoqyBYsEpwrkdPAoblJ3O/AKQZd+8KBrg4+SvBSUhUjgmIJtQGJJAYSi/DjrPt453n5JMnlykJV9UAVLchar32qqzVyOd/PW2V6hMI1AbbbeDIbwM8D2qINjy90gOMNt2ZUuiiai9XekEGG69Ia4ZLDVMlW7BG/DD7yHiwSF+V52454BM4DFWmaRdEOlhFrs9r+IKEevDD8Y4djhNYGnFl+eegCMSGkm6merQVd34Lxi8qbgWhg9yb11BuG5C/dUnG3K7Qz+rYPhLmBVGxER5nSQmxEEoIHGw7uMiKXssCu68V02OgIzWAw6oq1uyR7NZTRlFZ+koXgdno+CqNrqBui/HJV0vXTB/odkbyMhHCMTQVSfhRjlYhP6IGZJNBTEp5FMfMAUT9xEBnlajaJdlgQkoAdUqfxrFe0/0fLPOF4Fe1CYTb6wBpocZgR+Qpk17BzAqK/80zdJJ7h165k5pT5OWp0SVJme2oC9vuT5WfceBFI+dyKluj/lKibbsxngvOT8k7u0KDisbjjIFc43q0Jacln12F9VS7KcXIRTKN98fGB18mLUHh7Qiag5qxxjNHRmsNQKeh0suZSBQFAifgCnPuT8pLouguhuA1YIUqgLY7sgfWz+xHxePrJ5wa8DqB0jFWcx2Ga/2m4PCUvCmEPANaoYaKZbwlYjzMYGow6QfNAefGaFXWLZVWU7nmg/J80Ry3dt7NcbAVRCnO2Oe2xsksBE3/fujCv8POT1WYq4p94JuhZCipBUXwar1I2Hlm82HDKJ9iAnouXrIvrHzFz/rc2F66bWC3Aizueg7FSTd222bbq3Q+PtGYC2mJ/Y+1ZypJW5UD6Kp8xH3WDbrijEWLQ4QWLzsA3v79JWolIl80tAzfPxXQ70xlC6nupXOiS+uWdAUeF0axffqItgyGwkeQLkTEM7bSgnTZtPJIyOk2uwpz5/BY8Aa1jQzlcjc+xNU5I48WLlWOe1M= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3833377c-90ef-4faa-06c6-08d9dc9da9bc X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB4589.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2022 05:19:56.8096 (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: lvzqrYKdhY+awpNlmKYzgyOItVqMGXzUDIaolUFufaHpLEfnbnX2f5jrQIVqFsmN+y6w4limgn0qZdEduK7TOw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR10MB1287 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10233 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 mlxscore=0 suspectscore=0 spamscore=0 mlxlogscore=999 bulkscore=0 malwarescore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2201210037 X-Proofpoint-ORIG-GUID: gk6cXxOwB44XQVCUPt4pdTtw_6ViRwrv X-Proofpoint-GUID: gk6cXxOwB44XQVCUPt4pdTtw_6ViRwrv Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org This commit upgrades inodes to use 64-bit extent counters when they are read from disk. Inodes are upgraded only when the filesystem instance has XFS_SB_FEAT_INCOMPAT_NREXT64 incompat flag set. Signed-off-by: Chandan Babu R --- fs/xfs/libxfs/xfs_inode_buf.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fs/xfs/libxfs/xfs_inode_buf.c b/fs/xfs/libxfs/xfs_inode_buf.c index 2200526bcee0..767189c7c887 100644 --- a/fs/xfs/libxfs/xfs_inode_buf.c +++ b/fs/xfs/libxfs/xfs_inode_buf.c @@ -253,6 +253,12 @@ xfs_inode_from_disk( } if (xfs_is_reflink_inode(ip)) xfs_ifork_init_cow(ip); + + if ((from->di_version == 3) && + xfs_has_nrext64(ip->i_mount) && + !xfs_dinode_has_nrext64(from)) + ip->i_diflags2 |= XFS_DIFLAG2_NREXT64; + return 0; out_destroy_data_fork: From patchwork Fri Jan 21 05:18:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandan Babu R X-Patchwork-Id: 12719269 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 69BADC433F5 for ; Fri, 21 Jan 2022 05:20:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233242AbiAUFUH (ORCPT ); Fri, 21 Jan 2022 00:20:07 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:5458 "EHLO mx0b-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233731AbiAUFUG (ORCPT ); Fri, 21 Jan 2022 00:20:06 -0500 Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 20L04vTT017314; Fri, 21 Jan 2022 05:20:03 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2021-07-09; bh=rgPecD+NF6IOyXQDH55NX1ykFjKz55FSuUaIpCox/0g=; b=C6DoTORlWSa7s6g9wxPR8Zp5auLcrzpkKypM6qUz4aqgVXO5IcEFOnCyEQV/uv7BiE/3 HgDsldlOmlmzIw+4AiurVQpGacA1Ma+0U12YaN79ljpDKrNGV4HdPv+PybRnYjs6+3JF hQWeBr6mdVoMjqN9dcZ+zG7Jqykec7V4YwOopV+HPJH8aBtEzuhDnvk6Lllu4lpgLqPQ Id7Lq0B4dknfZM9E3DWbdOFQexFgjQbpLhZ+2Be80vollJ3maf1+A6NI+k3gwirKKNRL gi1E2tW3jUFPTSDnet7xzbQVGT0vyr19vFoxcIYBoJJSRSG0C2xmxIXSTOqD5yrPu2p1 jQ== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3dqhydrc76-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jan 2022 05:20:02 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 20L5G9lP156890; Fri, 21 Jan 2022 05:20:01 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2047.outbound.protection.outlook.com [104.47.66.47]) by userp3020.oracle.com with ESMTP id 3dqj0maupf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jan 2022 05:20:01 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WcBvAWnuS/JU5lc3RFE6mp9AeTOEhYkjitu3MPnt2IeDcvUScPSfwEMAkT/we1lwT3MVr52hAHkSe/aIgkrhbo59bnolPxNA4iILxxFd+FYzL9Zi36Sns0PuKAlR1vjCLRxmQ5/KhluHJCJh2DqR51WLrXvAc6MIQXmuFmvnh37FV2RU5B1BMm+sKade3eJQGSpv3nFnwOC0NFftdLtCxxowF0mcALshcJcMf+BXKKo9DjJMlVvU9V0vc5Ox9WOqKDbxPFJ/9cb5LP96TWOxi0h2OB7f63WI6DJjGuonnzcjuIJivVml3YT9kAstgcQB6Pa1CPWKiP8/oLZ+iHK5zA== 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=rgPecD+NF6IOyXQDH55NX1ykFjKz55FSuUaIpCox/0g=; b=YzRLTjj8bGiybOYXWQ3Jp1a1VqElpCtbmZGpu3Uh8auuuSZXfwa1FIzYkQttBrvuF+tGJYN1z5LbNPv9pmtXehW8e5XgG/EuCRykHXO2+OIp6q+YOQhmNGyb2LlQj5jyMrGjl4E2+cwb3052itBqJHS8hh3ouK+aJXOkwIMWp+IY2E4/PY9sulGdEve847+K3Wv3MSxH7HgyY6aFoCfos9uVk0zaS7Dj9F1bhn/RBO66JaQdV4zmdw85c6TQaMSfSn1N+LRDqkVjLlWB+aFaxHPHU3sy+DZOTeLzC9q29PG8tvncJu7ZwWgUSC3c6Zqd5niWK3akkpj/9CVldA61Xw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=rgPecD+NF6IOyXQDH55NX1ykFjKz55FSuUaIpCox/0g=; b=fbq6KPPDFPWp4bWVUIUb/Z4QdRr6Sy4CRw6jAofC+f5Wiqy4T/9myLfsQPTwczsrfmax2xoj2SH/SeLAvBHSgNqcOD+xMgIywVUVCo7nGLpz+jkPMZ8QvILdrN7veg2yU1V2ridTsJ5ueNGNnLyBC9zGOmlTSLvrkwzojdYfu2s= Received: from SJ0PR10MB4589.namprd10.prod.outlook.com (2603:10b6:a03:2d0::16) by CY4PR10MB1287.namprd10.prod.outlook.com (2603:10b6:903:2b::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.12; Fri, 21 Jan 2022 05:19:59 +0000 Received: from SJ0PR10MB4589.namprd10.prod.outlook.com ([fe80::3ce8:7ee8:46a0:9d4b]) by SJ0PR10MB4589.namprd10.prod.outlook.com ([fe80::3ce8:7ee8:46a0:9d4b%3]) with mapi id 15.20.4909.011; Fri, 21 Jan 2022 05:19:59 +0000 From: Chandan Babu R To: linux-xfs@vger.kernel.org Cc: Chandan Babu R , djwong@kernel.org, david@fromorbit.com Subject: [PATCH V5 14/16] xfs: Enable bulkstat ioctl to support 64-bit per-inode extent counters Date: Fri, 21 Jan 2022 10:48:55 +0530 Message-Id: <20220121051857.221105-15-chandan.babu@oracle.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220121051857.221105-1-chandan.babu@oracle.com> References: <20220121051857.221105-1-chandan.babu@oracle.com> X-ClientProxiedBy: SI2P153CA0027.APCP153.PROD.OUTLOOK.COM (2603:1096:4:190::22) To SJ0PR10MB4589.namprd10.prod.outlook.com (2603:10b6:a03:2d0::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 58981698-c647-4df8-d7c0-08d9dc9dab1c X-MS-TrafficTypeDiagnostic: CY4PR10MB1287:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9qDse1QIZG0PXTt5ncBfswZVI+MqMVUXag8DuCl2Ehab78q//tZTIjYVmZtdpMoV6vMuvpXHiMugiKMP1RXY53X0ghWprEm/NqWFtx87YbfX0PQMSiqGJDnOmuOkhxcf4zOR7VX7yG1sU/fOHYS2XA36wIUG7EYql3oeiXdSkAZfwh4YLOGa4a/tL5UscbaqeCOvTimRaUuVNDbr+IDyeCr5UmiFlOrHWmRQX7E8ZFD+m6/qkkJ8WhAub168U4Ed1Ri9cy53Y6HvkaN8TZgBYM4Ka0PGWEL3eMIB0DLvlnxmCLaUWISQYswUjV387PLykNXTzircWTvNWtQzmXa+qep8uvObuXB0XGVsYJhOAKDqY9dH0Y1gdojb6LBnticytp6DGBnvTklZrOAL+503GmuOoo/5thI9Jknd/fioD35Yc0HN4/u/wXJ8O+UrHQycN8SHL2lD0GHHVItKw/0lGb9rpW5p3EffLsHKoWw6BOWGM2ovSuBr80W0S3mD8VNmQWKq29+gyN9+jzrfHDT8IbV9yXbFJW3vKEkBTb+M0VoWPcQFsaiRuriYC8ywNBsRuaQpAvwpj93W2k+eB1zLwZijzQHJ1oUx1B/8o942KEHvc7IJMX9dkuLpzfL1KGo81ICZNtSRt/TzfF/1vgVAKee+RoKtKAvfGbd7ImSXWTa9D2lCXmOfr03Ldl+cyfwPYtqn7CQ9B9iHIyzHHWtt/w== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR10MB4589.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(508600001)(186003)(52116002)(66556008)(26005)(6916009)(2906002)(8676002)(5660300002)(66946007)(2616005)(6512007)(1076003)(4326008)(38100700002)(83380400001)(66476007)(86362001)(38350700002)(8936002)(6506007)(316002)(6486002)(6666004)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 9xu6lQZTmux/dXwQ4IpuzAnPiNeocGxsbZftV0GIRljyjSLeq0muiI8Uq+9FyVQQGsQVnkXWYLdVCz7ZCZor09sSSlAr8LcuiT+f8DydsH7Kq4Lg0rMFMYaPS1sB4qnVR7dmVwTE6AUbtoS6TttDy8nPPZz9dC1EQ9hNKIQeXU0xs+DUWba85x1G8DA4+t7s/clmTlfs2UEag4SOKN3Q2kxsSTN8ftKTdd870eBTuQ63f/uUszTWh2/K+MY8YmNvpkrssd2vhb2rinczM16D/5ndzXcIp9TmLiWtG4AbaVRsVX1eVclemVv3BjrJgS5Y6WzVdoJPGZUvMRy08dV9DEgxyIwloMehOwhtsTXBig1UsR3kYD6ph+42e74tOrafmORp05NrGxNyed0+bwqgdc61TVJQvTF3hi340kFX3YwXuCpkLNnt/rirYDvYzGqot/cE/uET5puJrd00HPhF49FWmCIJPuTViXAIugAPnIzGd9FUugccN1++6kgH/JdREg7EH2Al8CReSTmz8in7U8RxjX0t9vMq9uv5UZns5tHkX2Bc+pMO3+JDlyY2Nd1VHizW4aV8WaPdl5K/jcoO4Evqh+c3GnZDRn/YwFsbBf+EPN+WEQ2uTw7PW89Pde37DLdpVAnYaAQayCkGYGH9j8Y0w/AwsXbryPl9AY7YKKCkvwopjUvR8DM5QR1cgc+mKXfnmwhUoGMPXZVxODtVr8yEhIOb4sPJx24SNCqWXPVPmuH7bjym5dBkX8ehpY4DQZgZwY7BFvLx00ZUWeNGGEpuz2AQ1X4czHxa7WU7CBMpwXCdgsTlsWnfdDmtnASXrorKGm1HbTm6NdpY27A1NFzO8ne6uPb7fM8WV24FNxXHkUz3UnqcbmtzJsZWRcLtlLZ+vsSmuRY8nZvsS5vhEgGvpYSZnbUvoiKugX21CTjGkvpZpi95exA/3tsZGx8s0Iw4tbE/vvDRF4MMSC+n2/CZ3UBqE4ZvfBMmArzIr3inNqA68wo6drBlwAjNDBCpDV4UszI7AdtTobo2tD8JmQfL4IG6vIS1gC5JWY37yBE0pwKoVi0yWPG1uulvI0UR9eExnV5MtJpclMPAQHyVTC1JFxLs9q+kWqd8z4NIUXu1S8N0gatFu99RzfZ8b3dbSWaNwKuNmLeQbdeVMI+S302Qb1pw04bspczd9DFWeLbHlEBi3UtWNXcpxTFXPV+u5CEEqpkJ1lZQkbBG1w650rixwuex3cFO3+hodkb7e8EXJaLd4aclnm9ZWBBrriFo9LfdmnVfDuKZKBbP43b/Y0qWQpctHWzdVpl6TgF+l1LsZ/yg/fYW2mEVLzdv0wMnGhGuY6VS6GR74wlu5yrSgiw9XOWl6JCGQI2RjnwzDqxSZDX8HGiktRW1ITD25XuCZqluIroD0rmmioJADdnSkudiY1VqvwR/AmyMVxpQ0JE8t/Z0rtfo5c9ccXJgPju4h0sA6CUbO7Zm8x04OFSJe9LhU1elrwwWR+1wBdHZ2e84oRuYlrEyiraXgQrrSHF+2yDdWVmTbhc6qECIUh87q5HfLmiUg/ngerqUhyE6UBa7lPSEDpDSHk/fk90gQrPp8oAQrprsh0D0bvRXbmvJlbpAyovnnDKmYAvVBe1JT3Y= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 58981698-c647-4df8-d7c0-08d9dc9dab1c X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB4589.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2022 05:19:59.0749 (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: 9V7NHQak8dkW3yntbgUI1oLwAKrpW9IEWitqLsIcJBczwsxYq7WscoPykftwngkcvSZZgrPkPSaPn7dU9uyXUw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR10MB1287 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10233 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 bulkscore=0 spamscore=0 suspectscore=0 mlxlogscore=999 phishscore=0 malwarescore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2201210037 X-Proofpoint-GUID: xLriYk5k-f_It5ddoXf2eQCErz8s6UlO X-Proofpoint-ORIG-GUID: xLriYk5k-f_It5ddoXf2eQCErz8s6UlO Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org The following changes are made to enable userspace to obtain 64-bit extent counters, 1. Carve out a new 64-bit field xfs_bulkstat->bs_extents64 from xfs_bulkstat->bs_pad[] to hold 64-bit extent counter. 2. Define the new flag XFS_BULK_IREQ_BULKSTAT for userspace to indicate that it is capable of receiving 64-bit extent counters. Suggested-by: Darrick J. Wong Signed-off-by: Chandan Babu R --- fs/xfs/libxfs/xfs_fs.h | 12 ++++++++---- fs/xfs/xfs_ioctl.c | 3 +++ fs/xfs/xfs_itable.c | 27 +++++++++++++++++++++++++-- fs/xfs/xfs_itable.h | 7 ++++++- fs/xfs/xfs_iwalk.h | 7 +++++-- 5 files changed, 47 insertions(+), 9 deletions(-) diff --git a/fs/xfs/libxfs/xfs_fs.h b/fs/xfs/libxfs/xfs_fs.h index 42bc39501d81..4e12530eb518 100644 --- a/fs/xfs/libxfs/xfs_fs.h +++ b/fs/xfs/libxfs/xfs_fs.h @@ -393,7 +393,7 @@ struct xfs_bulkstat { uint32_t bs_extsize_blks; /* extent size hint, blocks */ uint32_t bs_nlink; /* number of links */ - uint32_t bs_extents; /* number of extents */ + uint32_t bs_extents; /* 32-bit data fork extent counter */ uint32_t bs_aextents; /* attribute number of extents */ uint16_t bs_version; /* structure version */ uint16_t bs_forkoff; /* inode fork offset in bytes */ @@ -402,8 +402,9 @@ struct xfs_bulkstat { uint16_t bs_checked; /* checked inode metadata */ uint16_t bs_mode; /* type and mode */ uint16_t bs_pad2; /* zeroed */ + uint64_t bs_extents64; /* 64-bit data fork extent counter */ - uint64_t bs_pad[7]; /* zeroed */ + uint64_t bs_pad[6]; /* zeroed */ }; #define XFS_BULKSTAT_VERSION_V1 (1) @@ -484,8 +485,11 @@ struct xfs_bulk_ireq { */ #define XFS_BULK_IREQ_SPECIAL (1 << 1) -#define XFS_BULK_IREQ_FLAGS_ALL (XFS_BULK_IREQ_AGNO | \ - XFS_BULK_IREQ_SPECIAL) +#define XFS_BULK_IREQ_NREXT64 (1 << 2) + +#define XFS_BULK_IREQ_FLAGS_ALL (XFS_BULK_IREQ_AGNO | \ + XFS_BULK_IREQ_SPECIAL | \ + XFS_BULK_IREQ_NREXT64) /* Operate on the root directory inode. */ #define XFS_BULK_IREQ_SPECIAL_ROOT (1) diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c index 29231a8c8a45..5d0781745a28 100644 --- a/fs/xfs/xfs_ioctl.c +++ b/fs/xfs/xfs_ioctl.c @@ -893,6 +893,9 @@ xfs_bulk_ireq_setup( if (XFS_INO_TO_AGNO(mp, breq->startino) >= mp->m_sb.sb_agcount) return -ECANCELED; + if (hdr->flags & XFS_BULK_IREQ_NREXT64) + breq->flags |= XFS_IBULK_NREXT64; + return 0; } diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c index c08c79d9e311..c9b44e8d0235 100644 --- a/fs/xfs/xfs_itable.c +++ b/fs/xfs/xfs_itable.c @@ -20,6 +20,7 @@ #include "xfs_icache.h" #include "xfs_health.h" #include "xfs_trans.h" +#include "xfs_errortag.h" /* * Bulk Stat @@ -64,6 +65,7 @@ xfs_bulkstat_one_int( struct xfs_inode *ip; /* incore inode pointer */ struct inode *inode; struct xfs_bulkstat *buf = bc->buf; + xfs_extnum_t nextents; int error = -EINVAL; if (xfs_internal_inum(mp, ino)) @@ -102,7 +104,27 @@ xfs_bulkstat_one_int( buf->bs_xflags = xfs_ip2xflags(ip); buf->bs_extsize_blks = ip->i_extsize; - buf->bs_extents = xfs_ifork_nextents(&ip->i_df); + + nextents = xfs_ifork_nextents(&ip->i_df); + if (!(bc->breq->flags & XFS_IBULK_NREXT64)) { + xfs_extnum_t max_nextents = XFS_MAX_EXTCNT_DATA_FORK_OLD; + + if (unlikely(XFS_TEST_ERROR(false, mp, + XFS_ERRTAG_REDUCE_MAX_IEXTENTS))) + max_nextents = 10; + + if (nextents > max_nextents) { + xfs_iunlock(ip, XFS_ILOCK_SHARED); + xfs_irele(ip); + error = -EOVERFLOW; + goto out; + } + + buf->bs_extents = nextents; + } else { + buf->bs_extents64 = nextents; + } + xfs_bulkstat_health(ip, buf); buf->bs_aextents = xfs_ifork_nextents(ip->i_afp); buf->bs_forkoff = XFS_IFORK_BOFF(ip); @@ -279,7 +301,8 @@ xfs_bulkstat( if (error) goto out; - error = xfs_iwalk(breq->mp, tp, breq->startino, breq->flags, + error = xfs_iwalk(breq->mp, tp, breq->startino, + breq->flags & XFS_IBULK_IWALK_MASK, xfs_bulkstat_iwalk, breq->icount, &bc); xfs_trans_cancel(tp); out: diff --git a/fs/xfs/xfs_itable.h b/fs/xfs/xfs_itable.h index 7078d10c9b12..38f6900176a8 100644 --- a/fs/xfs/xfs_itable.h +++ b/fs/xfs/xfs_itable.h @@ -13,12 +13,17 @@ struct xfs_ibulk { xfs_ino_t startino; /* start with this inode */ unsigned int icount; /* number of elements in ubuffer */ unsigned int ocount; /* number of records returned */ - unsigned int flags; /* see XFS_IBULK_FLAG_* */ + unsigned long long flags; /* see XFS_IBULK_FLAG_* */ }; /* Only iterate within the same AG as startino */ #define XFS_IBULK_SAME_AG (XFS_IWALK_SAME_AG) +#define XFS_IBULK_ONLY_OFFSET 32 +#define XFS_IBULK_IWALK_MASK ((1ULL << XFS_IBULK_ONLY_OFFSET) - 1) + +#define XFS_IBULK_NREXT64 (1ULL << XFS_IBULK_ONLY_OFFSET) + /* * Advance the user buffer pointer by one record of the given size. If the * buffer is now full, return the appropriate error code. diff --git a/fs/xfs/xfs_iwalk.h b/fs/xfs/xfs_iwalk.h index 37a795f03267..11be9dbb45c7 100644 --- a/fs/xfs/xfs_iwalk.h +++ b/fs/xfs/xfs_iwalk.h @@ -26,9 +26,12 @@ int xfs_iwalk_threaded(struct xfs_mount *mp, xfs_ino_t startino, unsigned int inode_records, bool poll, void *data); /* Only iterate inodes within the same AG as @startino. */ -#define XFS_IWALK_SAME_AG (0x1) +#define XFS_IWALK_SAME_AG (1 << 0) -#define XFS_IWALK_FLAGS_ALL (XFS_IWALK_SAME_AG) +#define XFS_IWALK_NREXT64 (1 << 1) + +#define XFS_IWALK_FLAGS_ALL (XFS_IWALK_SAME_AG | \ + XFS_IWALK_NREXT64) /* Walk all inode btree records in the filesystem starting from @startino. */ typedef int (*xfs_inobt_walk_fn)(struct xfs_mount *mp, struct xfs_trans *tp, From patchwork Fri Jan 21 05:18:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandan Babu R X-Patchwork-Id: 12719270 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B837AC433EF for ; Fri, 21 Jan 2022 05:20:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233731AbiAUFUI (ORCPT ); Fri, 21 Jan 2022 00:20:08 -0500 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:6318 "EHLO mx0a-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233792AbiAUFUG (ORCPT ); Fri, 21 Jan 2022 00:20:06 -0500 Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 20L043Op017784; Fri, 21 Jan 2022 05:20:04 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2021-07-09; bh=x9gjtR4poZ9x8gJyxdP3vODSwZfFQmfBDTc5TlLuE/E=; b=inVuHDbKoulTWqA0y4YaPnM3xbWbgm/5gqVPGxGqglfVg/3c6KDuuCBuWYnJnlYx0kFO AQT2lkZjio8hvlkR4tPG32Ju5JPfGwL1kTE6cx70Y1kZ8TeP9hun2t6wDGLxtmAfnd7A zCbRGQvG++PM1FZKCqOIux/wYsvCMpvGCKvm14/e30mwFoPZvvhYMlOJmQNujmGvFS/q 0vRgOvLoWIgO/qjheWeSiakf14OebQye6VfBai3gm0ILXJtM493jLQQd6HDmse4kfT7D KKXOuha4MuVR8dsQwlkNeoSWLAIaYwFz4CI4wIGD+Lpl9CshwIaKEZuH7FQ1ltIsGA3x Lw== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by mx0b-00069f02.pphosted.com with ESMTP id 3dqhyc0d37-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jan 2022 05:20:04 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 20L5GYTV190410; Fri, 21 Jan 2022 05:20:03 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2049.outbound.protection.outlook.com [104.47.66.49]) by aserp3020.oracle.com with ESMTP id 3dqj0sh0ac-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jan 2022 05:20:03 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LGPDb3URkNQ+glc1LaJNXH7SlVTlHDRShAQ6o8XhuOnTcrcEukuFbGtl39D4HuABRJ7CuxBW7QelcaBnuhw7TkjLiRtJYjRYf15Bv4m0TyiJQOyG8oSC/St/TBKGEd115FQYpm5APtwqSUieT6wQSxz8LJXhXH0JZdZTb2ooiWc2KUWa0k/cybdfcTrevvEYFDFcAnydA3K8HwBhQKnwLRDDjkLzblQ47viZSz3/lh9VqHEyoK5EF/5Kc2chRyX2YNwn72y6akqmo9R31V2HSw2JRrXU6ZWvLBiLo0074Qi934CBV3xsULtmwjw25fZfz0Nz1POOnQLV/sucwzbHSA== 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=x9gjtR4poZ9x8gJyxdP3vODSwZfFQmfBDTc5TlLuE/E=; b=RgflWbWCBQdQg0CEDkoZSQmmB+QF9dWmaSjKW+7nUCwxNCY4oW/F+7x5LPtLXhM1cha/dkJAulFgbqifFJic7W1gHfQfauvFJsY2/5d4WkCBJqUh6qwR/VhtuFFb3/4DHX534UzBnN+aCgqGF7HgJvwEfyoqvgyG84E7UuzBEMwRyJM1tgFPpjUYc55pNencotTaeVHVI+yRAeD30S1TxXvALIEzgp6oa+KRZfMyPbAFELsEUVs2VnsdvvbpQEpRRTnrjKiVnm+K1U3mkZC5pEbmAtTYf14EpSOyZpQKlFyiJKVCYh+4J5K9dRWaGQ/ER6AbjSJWtljYoh7drAEqhg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=x9gjtR4poZ9x8gJyxdP3vODSwZfFQmfBDTc5TlLuE/E=; b=QmU93EYSIijtmivn3f3y/USKOEkj2SozS7ANoTSCZlOuGY0hnZCwP0rVp4Mh7CaECyiFx00f3HVxAEEC6DT+gqq0plrgZKkdzMFhYmty7iPk2ApLu1F+2ZixezfGVR5I5zkjY2JNZZQ8BJvRsemXwFPtPB1Ogr0ZvQI9lTyEMTQ= Received: from SJ0PR10MB4589.namprd10.prod.outlook.com (2603:10b6:a03:2d0::16) by CY4PR10MB1287.namprd10.prod.outlook.com (2603:10b6:903:2b::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.12; Fri, 21 Jan 2022 05:20:01 +0000 Received: from SJ0PR10MB4589.namprd10.prod.outlook.com ([fe80::3ce8:7ee8:46a0:9d4b]) by SJ0PR10MB4589.namprd10.prod.outlook.com ([fe80::3ce8:7ee8:46a0:9d4b%3]) with mapi id 15.20.4909.011; Fri, 21 Jan 2022 05:20:01 +0000 From: Chandan Babu R To: linux-xfs@vger.kernel.org Cc: Chandan Babu R , djwong@kernel.org, david@fromorbit.com Subject: [PATCH V5 15/16] xfs: Add XFS_SB_FEAT_INCOMPAT_NREXT64 to the list of supported flags Date: Fri, 21 Jan 2022 10:48:56 +0530 Message-Id: <20220121051857.221105-16-chandan.babu@oracle.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220121051857.221105-1-chandan.babu@oracle.com> References: <20220121051857.221105-1-chandan.babu@oracle.com> X-ClientProxiedBy: SI2P153CA0027.APCP153.PROD.OUTLOOK.COM (2603:1096:4:190::22) To SJ0PR10MB4589.namprd10.prod.outlook.com (2603:10b6:a03:2d0::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e737beb7-d217-4f07-ebef-08d9dc9dac52 X-MS-TrafficTypeDiagnostic: CY4PR10MB1287:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:151; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OLQUv1tIbKucygeb4XhoAzmyfZjghyZnip5aOin0LewozKyDeXXIRNRbLMQOKZnf79+0k2zYTKSNwDQXUd9g2EYaxCkKtDmKCYmUnD3eAavMvJmhQNFwwdE9WAgYfTOUeB9EZA9LzObV06bnWanrS0kr1L/MQql4Q9O5OXRlA2GBESLELy1NEgYC3ge2XGiQMQ5ShU/Q66HPHYmo5nx8cAlbiHg7wJ+CcrFmGGFhyiB0P+PbbwgF7zJtc393d3/Wsy0ZsFA88Dm5k2XYMAlWmhaAiLCbe4mR3VXXxdzMQdpIUgePaaSmzgqCPvBoz2y2KzDs4hKEZ1aSlSO66HZzU7g1IMFGUAPrDlUBLtjmrkIjt9QxKEGIcgOVdMRqPjMEyCowQkDQGbKQDVX/2RdZQHiq6nqUoqEPZOaYghffI0ORw1Vus0JMuWl8VARvjEY+qaxLsPZ42hdvxZJcjclUHsKZxVjxZZhZIZMKNNS22BYJ07RJ6wrfj3ue6+RVDStyZFOMYAYGnGVWCh/Xt9YtlPupRQNF/e6lWxBJdjyaTMQ4Ke0ONYvj0rhz3ni/WoY55wgSxAvcH41te2O55hqDkbufULak1fI2boRSRz/1RDi0EUG4cezYDlxEGCffov+R1J0My+zgZbpiZSQLMT3OOOwxLQSM2KzLx3LVC1SCTIlaUr5h/AdrkCqAekqhh3pWiPFwc+NntoXBFcmZdQtDMw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR10MB4589.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(508600001)(186003)(52116002)(66556008)(4744005)(26005)(6916009)(2906002)(8676002)(5660300002)(66946007)(2616005)(6512007)(1076003)(4326008)(38100700002)(83380400001)(66476007)(86362001)(38350700002)(8936002)(6506007)(316002)(6486002)(6666004)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: beCVbp2GGQ2wS63ETMaeH508ZRwbsWLHp6YjtzijELV0nB1cqmgzz24/m7U0xLYPU1pgDpqi5ULx2NcKrr7Ni0Zc1nipX8Y7gzMWtXS4iuyAxCzfLp/MGD+Vy/MEeg9fte+8QHiLqLcJIMbKisa7ChpnD97JVs+YzWIaQ8w23x9oHhnSfRFxW327p6V9g7j8R5KCQj0DHfaVQENLDfbVAydaBIB8SNQbBSsfOUipdRmeMjHEGk5inY40Jna+hyNRCPQAUXLYj0ItIYRoAKRSROsRaEpYd6DtGY6FXKz4qw9FEd7AQXZPW+4UTDegLT/tzFf5NyPgGgXzXcF0/MIcPN3w610c98KYCN2R5CrPUdidY/B27qjTX9XeEfY0pXjYPrtg1N2EAEKhhcHJ81jT2nCYMJbQzFXkRiThqrX054uqya5DXNU9JADFPtnKL/8buU+yXVYzCvDKyP1Gaa1UhZKkMzzuGPOuWw2DqNQOFT0EAuz+8vroVZLT3ndo+7OvZ3xg2AuuNNND5XKobc2jwuaOlPHUdmB12/VU8Yjxcdqe8Zc4fLDe7ducjj84c1l7SXgBlBXU3REt2aWM908v0zfKyj4NpRShqNChseftqFaZc9C//YvONpHo0HWeREYxNc3jQ+dPX7+ByXI2l+OOzvNIdZ6i6zdWTeGP8Zh0ROQoUAFlJ12eVRM3OdX2MwEHr6OMOACzPAaIxloB5T5qvNOUc9mPl7xdVY9ylUDYI1rZPhg4vSEWwLTdtcYUYbE4pd/abL32E7SxCz0KAEZ7E2Ik9ZOZWA7VtTuQPvS/RfinSlJLNhxanEXXvfftIiM9s61Vb8D1KYVracZzVwtSPSBH4wPT+/5Arfq4ivwVkSwl3q6yh2dgxdJ48fKsxRwIt/XFzA2AQ2eChXjtgysAl+Nx8Exl2rVBoyefirpR9doUrZ5lyR2KVscp9jk3RTetraJehQsOvlmf+JbTrv0qKWKmY73W98bLrxVcIOFPdci6x5wuBWVeFj8k/QcF/R9b04J7IHjXn1/C4T/KLCCrgNevRIhwB0zadSK5nd99mzHYxXOCjXznjHTbQLjABWfiu2t+Zl5ruiOGmnp+jrgw8oCcJ5Zbss8lo4HJZKJy4Ekeb7GfYBHNfQPPgPOAxnIoYrR/1FWN6IBDW9FDPYj+FGtmNmj+RLN1klogRGZcQDwCrqieQ4YPuU8vBUaGNRkI3qnmj+eqGsIEww8ihXbM1E+6twDH1CBcl4ao0rKCNbPS9pW+8gNUjxfkSXlS10ZCy+2/RlI9IDyeY+htwgd0UuvH06RX4ERbOgeaXH5+VMeS8bKC1AMGYmcs9Bt27fn7Nmhv6hVM8oKjrDO98PVEoGnukNSkr+ekHP7AQtNMOF19jWEnBSSY+o7nutirf9IjIl193xygeho2JJWzwqz1FePdRL9vCqjcWwdzYXdemlf1Z/Aftb5dS7i6aShiU9vAJ+BkN7vUReLesRC9NSMalXWUZ5m7TVxZ4X+h3yowo82cLZla4BHqsSMzqxkQkx75yL5/b4OcwDP+EaGNuNLlp1emWJG9kiDFp9MU0h8MrEiyYMq+5V/GGQkbD3PU87J0/m1OSmMhuAJO32FoFdiUZCs0qNiV+LncR0rLY0g3EEE= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: e737beb7-d217-4f07-ebef-08d9dc9dac52 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB4589.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2022 05:20:01.1383 (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: CXshM5k/vzkvfKwELED7dUR7lIAAJIdLa25xmQRHOH5HPdFZ52ryrM/si1FZNQDIoa9UjjMarnPGqo18fFt6AQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR10MB1287 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10233 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 spamscore=0 malwarescore=0 phishscore=0 suspectscore=0 bulkscore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2201210037 X-Proofpoint-ORIG-GUID: tMqW40CpFeDweoxL0aCxG61OvzIcAYNc X-Proofpoint-GUID: tMqW40CpFeDweoxL0aCxG61OvzIcAYNc Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org This commit enables XFS module to work with fs instances having 64-bit per-inode extent counters by adding XFS_SB_FEAT_INCOMPAT_NREXT64 flag to the list of supported incompat feature flags. Reviewed-by: Darrick J. Wong Signed-off-by: Chandan Babu R --- fs/xfs/libxfs/xfs_format.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/xfs/libxfs/xfs_format.h b/fs/xfs/libxfs/xfs_format.h index df1d6ec39c45..b7521c1d1db2 100644 --- a/fs/xfs/libxfs/xfs_format.h +++ b/fs/xfs/libxfs/xfs_format.h @@ -378,7 +378,8 @@ xfs_sb_has_ro_compat_feature( XFS_SB_FEAT_INCOMPAT_SPINODES| \ XFS_SB_FEAT_INCOMPAT_META_UUID| \ XFS_SB_FEAT_INCOMPAT_BIGTIME| \ - XFS_SB_FEAT_INCOMPAT_NEEDSREPAIR) + XFS_SB_FEAT_INCOMPAT_NEEDSREPAIR| \ + XFS_SB_FEAT_INCOMPAT_NREXT64) #define XFS_SB_FEAT_INCOMPAT_UNKNOWN ~XFS_SB_FEAT_INCOMPAT_ALL static inline bool From patchwork Fri Jan 21 05:18:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandan Babu R X-Patchwork-Id: 12719271 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 85D48C433EF for ; Fri, 21 Jan 2022 05:20:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234023AbiAUFUQ (ORCPT ); Fri, 21 Jan 2022 00:20:16 -0500 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:19082 "EHLO mx0a-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234018AbiAUFUQ (ORCPT ); Fri, 21 Jan 2022 00:20:16 -0500 Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 20L04Xn7009038; Fri, 21 Jan 2022 05:20:13 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2021-07-09; bh=LBajtJ4mfv5AXObl0n7/iijujwZ93hyZ60/38RNTtAE=; b=sMdtASrP0baILKYOw3Tz6VhcOlpYlFIV++l8zaOfiq690louRF/NRCZniX3zxwKOecCf zUrvM6o5A7d+NX4f3fRNY00fTQiPDyaQd+JJuJ9FYybM2A6S3QWc851FRBc0mi4K3KJs ZTm0ewkz4TzOVExI5siq6zzmDYgWTd1bv8foWOd2bs44K+EgsIdeMSvB5gKHy7220V9O ztJMpfbaZv7b+cu201dDtzViadJFe4xO7Aj14LRpZwoYr7ysE29502rmAvsUyL3LaSrW 79PpUIMONnLpchcOGbCgtT00G5to4h6HM//zrIztbFcGD3xeKy0ZtkHYmu/E8AC7c+8b SA== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3dqhykrcpt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jan 2022 05:20:12 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 20L5K9G8170161; Fri, 21 Jan 2022 05:20:11 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2040.outbound.protection.outlook.com [104.47.66.40]) by userp3020.oracle.com with ESMTP id 3dqj0mauvm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jan 2022 05:20:10 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oAYQKu0yhzUT0tCkFEPW+a/Rnfem8K/xHOBCZDHRCLjIfB1qq2BQAH7ecjwsq6bLzb+PDsnhGu2QIUZOMBZaWHfBNP5MJ+A6ZYbuyghdmDhOapKK8NLE9BAHKl53/VEOQ1TkHHyxj8HtKGrQ+EPL8bPNSpflXkrVC3NGP3rP+iOWA5TL0IsP3ekrylzGf6fn0LRJ/2Y1SqzSq/4YmP8M/7FYnNZ8c4tJ+WTvMNDyHeflBoslmLHNN7fXRZLkEHnnzeGAgX7gM4fZc6oaLfiXnfVuPVBByec/3QUhbt2GpnrkWX3RycuFaE2ehQ9G1ixMxVZvoBTd6vFBb/AWncyozw== 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=LBajtJ4mfv5AXObl0n7/iijujwZ93hyZ60/38RNTtAE=; b=FIRMX/CqAeMRvst5U/4VU7hCTOQ52IjAEYIyq4BhTzTezdtbp3qUmaGrzkyKM1KRPIKyZyiADQILCLYcQXQ96RbgaNNH0E12L9nSVl23ZkLglWTHxsHP+sqIMsSbx7hZEf2e2p/q9bl5Ke61fCFY4TJNP0+0+kPVoEogF2xtxevOyj/mMLXyCLSf/8DhRJbQFV4ZxJ78yg54XygN49xKNYc3gsTqvu3sBbLMIRBTalvuFxYpJC5ZshuII/mb0UOOioAYLq1Dt4MKV3Ho0p52k/Yy1JaQgYYpj5Jg2Tp+j8m8Y3xwZSL1wfKcLkxqiRG/0hueMfLcfkX+jEWxnA/wzw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=LBajtJ4mfv5AXObl0n7/iijujwZ93hyZ60/38RNTtAE=; b=LQn7miBhvMwHg5aMZPftq21FHHa6sDz3D0E2BnQszX0RGXihsn9W2oLhVdykaAjW4RKfjWztONVNEA0OOCU5KpV2LSpIwQUMLA9WDfU7y4Ra+Y8kpXsyM0qGl/OkxNc3Xn09HIBGIKfZxMq3fsCZ8z/2EGj4OrK4VBECUef6+xQ= Received: from SJ0PR10MB4589.namprd10.prod.outlook.com (2603:10b6:a03:2d0::16) by CY4PR10MB1287.namprd10.prod.outlook.com (2603:10b6:903:2b::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.12; Fri, 21 Jan 2022 05:20:04 +0000 Received: from SJ0PR10MB4589.namprd10.prod.outlook.com ([fe80::3ce8:7ee8:46a0:9d4b]) by SJ0PR10MB4589.namprd10.prod.outlook.com ([fe80::3ce8:7ee8:46a0:9d4b%3]) with mapi id 15.20.4909.011; Fri, 21 Jan 2022 05:20:04 +0000 From: Chandan Babu R To: linux-xfs@vger.kernel.org Cc: Chandan Babu R , djwong@kernel.org, david@fromorbit.com Subject: [PATCH V5 16/16] xfs: Define max extent length based on on-disk format definition Date: Fri, 21 Jan 2022 10:48:57 +0530 Message-Id: <20220121051857.221105-17-chandan.babu@oracle.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220121051857.221105-1-chandan.babu@oracle.com> References: <20220121051857.221105-1-chandan.babu@oracle.com> X-ClientProxiedBy: SI2P153CA0027.APCP153.PROD.OUTLOOK.COM (2603:1096:4:190::22) To SJ0PR10MB4589.namprd10.prod.outlook.com (2603:10b6:a03:2d0::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f2a100ce-a210-4dd2-9b82-08d9dc9dadac X-MS-TrafficTypeDiagnostic: CY4PR10MB1287:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1332; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ikRkpkhSgxwSBP8MZ8jhCInpqcHNVUeHuKt0o+j5pv+C/OnFZ4rg7rcOLz6Z5t5lP/hAMuReCxjcWip5kACoUvcyLuq97TMVY/x7HThohbDMnGmQI2KBwpH68Kvz7ZSXHGhosbOXp0uNAIrxMbWQkI2oGgRSR8J0wVL3wDKMe23eIY0z1M1ynAqo7oNYlK6mKW4c4cIk/hnAoELGEJSU18xTYm1JMvZzwQ7mzkFcqPwNwfTKS4XH+ksB+kGmEgkZaSyh5zyW6nrflhST+p5KQCxM1U5ktcqkmNNKMXagswuNjUtlF6Gxu5lsM2K+qV3h3dAbrttSpW4x/teEHxGGPb63Og0LKoAN6HkN526J0DWUAUQ/628lAR/NMwlTYV3J0HxwE3Xz8Z8sShEWXIR3wiE9wqVUta9VfFAVnyreK0YyOuWAmSyClzcMcE7mO9MKq2FZhUqKxlfmM5FM+Z4W82C9Nme5Eu+hI3UykR8j8UZc0iAOOCzmHlS0Idj7MG1YRMCPWEF4gbu66aKkPl6os1rGXdAe1ruIfUCAt8tecTJOcdyWIi1DEDaE7iG/nyy+ApRF9+bnWVAfXJmySJhp0KizGDNXDFv7xuRQ2MYmAq883hbCgr+if9IV1GKwFTo6HPcqXikBPwSFE62AVbxmsMEHERUURXq2voFKu9tRAwW8ve8edMPpPaRa+f6DgiqDvUKMw/WQUP5XoQ1XYN7/Lg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR10MB4589.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(508600001)(186003)(52116002)(66556008)(26005)(6916009)(2906002)(8676002)(5660300002)(66946007)(2616005)(6512007)(1076003)(30864003)(4326008)(38100700002)(83380400001)(66476007)(86362001)(38350700002)(8936002)(6506007)(316002)(6486002)(6666004)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: WSSWhThTMUx44GQYFh6Otw0Z4742tkt3B/GNiP526KKFx+cmjTzaHjk9RUDHam+Yd0GRkx81QKmgqOT5V16aPPnh8fnQTBVvlinpLJApmHLwGZVp3PHNkH1Xk7IqBsN663JZsekvqFXSEs31Th9ml8wLcca7mKTwqcGLbFPkBJ+KekW0S0EcCDDdWU1XIUDjn/YayjMTBf9BpTOU/7aKox+c8yCRHeW5mHNTm/PEj/3qvGzPYcaCSsspAhi/vHQzRZ/kLWwGeTJ4snxXp3oKOM7qPSUGOnUS25D6h+3SNcN+T/0yqPRda/rQdbP4vPZVnDpXGj6YlMvwjBPZVp0ei2iz5zb7PM0iuqO0bmgqCSSlBJWaWlP704v1IQIuVUreRnuwEg3ljpNggv9Cl+fFg6KkXJoEQqNkGB10ZnhJZDhMv4JYunCqY328m/SH0wX8J6vO51t62kTBRHuc+ZpD+Q9u2CKqUM4G1ZEw85zwrF3SVP/zguMKmtaysJwXXTzhyEh+XO2RIWxUMwtwN8kLq9gG7O41yh8jNgdwA099ygTo0Y2VzlgJ9lYdeut41heUD2PxB4zWzUBgJJ6hIzYFvUiTGMPR/VeNhu/IGohCujwQAWbN0NJ8UHN7REzSVdHt+aMB6zMWJ38yub8h/sGE1w7rmMkC2teR5+XL7NRWAzKc8vnd1rjAhzTbdtHfGfiEGOq9vY8UHPsQ/PthdkanzoCpoZO/Orr0F/ehCyZC/J03ciZSEVaA6+ph22oWfErKT1ulyJWf/DUQAosutQ8+UQv549t3tReyKyRuQUVfj89n7XDgPrlF1xCQjlSF49tfOg3/mHuaf27l6KSPAb4vrfyMEQJL0DrPzwud9TrSrP+12on1aP8YLMxhuONB7td7NebJYRQEwfSnXMP7mpduBEkp1bL9mYWsxsnpUu1EFSqVoZ5nJKWwvYTXmXxReeuxkK0mOnIFxbQ/aIJsAJ0FOk50IqHw/qwXmJtCS3BEiaGsIyLY2/d7029AeWmZFXm2oeHcYVUkIvewJGRoDFWEcOdl7Q2GZCRvVf1eY/rOTN82OLhQrmosm0lmOtmHbS1bQrhPLjM7JlBd0Pw9qnT9VDhXwIUuh92FIhEJ/NVQ70hLbscGrbUp9zCVNw/uedhaD59SIwzky77/rvXT5gafJdFTMBVyLrIURhUDqJV3FzioQZGS8z/h3uALerp3TV0+RsYXWGClFRXUEdEFYqt0bqZzgCVS3ofnXJZ+TMQUa88HiX9JiMqIU99/H+YpkLe5BWxyrdW8jBrK25sJ9rFjPlp8gpj6GSXW+K4pR0v4yewl8FJOJolX84oTriB/zCDA+ZL9SIdZipFo7RoVujsjPV8vm0TvtjkEo8ctA0vCYXODfFU2YmnMCnC9HgKY/CKwJ7VYSD6tj4M06bUvY+KeV1N2IK53AkyT4L7W4s11U5AJRpDvwKnVvoo2/0J2QkI66Ird0azdQofSTXPyoRPDVjti4vLD8i5WeYw8+K94K3G4P/8CAqKkaNR3GsSWGw+0xoV0OduM0xuo8Ok2JK269wU26b+1IuW6HRJjNwtf6R4Xj6O8btsTf9SkDlsnSs8Um8FQUyFFi10CIXtAqB1lzNn2rxg+uGMPwnZCytosLDE= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: f2a100ce-a210-4dd2-9b82-08d9dc9dadac X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB4589.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2022 05:20:04.6872 (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: TY8M3P8PxR+BqJG1DLLPwgy4VkfR3yDj+/JAH8szL7OHjf98LgNpVHxqBumy6z2GYBDbwcwMduRZQPNZ+dzVDw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR10MB1287 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10233 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 bulkscore=0 spamscore=0 suspectscore=0 mlxlogscore=999 phishscore=0 malwarescore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2201210038 X-Proofpoint-ORIG-GUID: 0aA6NZ1RsJIv54An01ysz7I_dLfnc50_ X-Proofpoint-GUID: 0aA6NZ1RsJIv54An01ysz7I_dLfnc50_ Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org The maximum extent length depends on maximum block count that can be stored in a BMBT record. Hence this commit defines MAXEXTLEN based on BMBT_BLOCKCOUNT_BITLEN. While at it, the commit also renames MAXEXTLEN to XFS_MAX_BMBT_EXTLEN. Suggested-by: Darrick J. Wong Signed-off-by: Chandan Babu R Reviewed-by: Darrick J. Wong --- fs/xfs/libxfs/xfs_alloc.c | 2 +- fs/xfs/libxfs/xfs_bmap.c | 57 +++++++++++++++++----------------- fs/xfs/libxfs/xfs_format.h | 5 +-- fs/xfs/libxfs/xfs_inode_buf.c | 4 +-- fs/xfs/libxfs/xfs_trans_resv.c | 11 ++++--- fs/xfs/scrub/bmap.c | 2 +- fs/xfs/xfs_bmap_util.c | 14 +++++---- fs/xfs/xfs_iomap.c | 28 ++++++++--------- 8 files changed, 64 insertions(+), 59 deletions(-) diff --git a/fs/xfs/libxfs/xfs_alloc.c b/fs/xfs/libxfs/xfs_alloc.c index 353e53b892e6..3f9b9cbfef43 100644 --- a/fs/xfs/libxfs/xfs_alloc.c +++ b/fs/xfs/libxfs/xfs_alloc.c @@ -2493,7 +2493,7 @@ __xfs_free_extent_later( ASSERT(bno != NULLFSBLOCK); ASSERT(len > 0); - ASSERT(len <= MAXEXTLEN); + ASSERT(len <= XFS_MAX_BMBT_EXTLEN); ASSERT(!isnullstartblock(bno)); agno = XFS_FSB_TO_AGNO(mp, bno); agbno = XFS_FSB_TO_AGBNO(mp, bno); diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c index 384532aac60a..1c3da6aac2f9 100644 --- a/fs/xfs/libxfs/xfs_bmap.c +++ b/fs/xfs/libxfs/xfs_bmap.c @@ -1449,7 +1449,7 @@ xfs_bmap_add_extent_delay_real( LEFT.br_startoff + LEFT.br_blockcount == new->br_startoff && LEFT.br_startblock + LEFT.br_blockcount == new->br_startblock && LEFT.br_state == new->br_state && - LEFT.br_blockcount + new->br_blockcount <= MAXEXTLEN) + LEFT.br_blockcount + new->br_blockcount <= XFS_MAX_BMBT_EXTLEN) state |= BMAP_LEFT_CONTIG; /* @@ -1467,13 +1467,13 @@ xfs_bmap_add_extent_delay_real( new_endoff == RIGHT.br_startoff && new->br_startblock + new->br_blockcount == RIGHT.br_startblock && new->br_state == RIGHT.br_state && - new->br_blockcount + RIGHT.br_blockcount <= MAXEXTLEN && + new->br_blockcount + RIGHT.br_blockcount <= XFS_MAX_BMBT_EXTLEN && ((state & (BMAP_LEFT_CONTIG | BMAP_LEFT_FILLING | BMAP_RIGHT_FILLING)) != (BMAP_LEFT_CONTIG | BMAP_LEFT_FILLING | BMAP_RIGHT_FILLING) || LEFT.br_blockcount + new->br_blockcount + RIGHT.br_blockcount - <= MAXEXTLEN)) + <= XFS_MAX_BMBT_EXTLEN)) state |= BMAP_RIGHT_CONTIG; error = 0; @@ -1997,7 +1997,7 @@ xfs_bmap_add_extent_unwritten_real( LEFT.br_startoff + LEFT.br_blockcount == new->br_startoff && LEFT.br_startblock + LEFT.br_blockcount == new->br_startblock && LEFT.br_state == new->br_state && - LEFT.br_blockcount + new->br_blockcount <= MAXEXTLEN) + LEFT.br_blockcount + new->br_blockcount <= XFS_MAX_BMBT_EXTLEN) state |= BMAP_LEFT_CONTIG; /* @@ -2015,13 +2015,13 @@ xfs_bmap_add_extent_unwritten_real( new_endoff == RIGHT.br_startoff && new->br_startblock + new->br_blockcount == RIGHT.br_startblock && new->br_state == RIGHT.br_state && - new->br_blockcount + RIGHT.br_blockcount <= MAXEXTLEN && + new->br_blockcount + RIGHT.br_blockcount <= XFS_MAX_BMBT_EXTLEN && ((state & (BMAP_LEFT_CONTIG | BMAP_LEFT_FILLING | BMAP_RIGHT_FILLING)) != (BMAP_LEFT_CONTIG | BMAP_LEFT_FILLING | BMAP_RIGHT_FILLING) || LEFT.br_blockcount + new->br_blockcount + RIGHT.br_blockcount - <= MAXEXTLEN)) + <= XFS_MAX_BMBT_EXTLEN)) state |= BMAP_RIGHT_CONTIG; /* @@ -2507,15 +2507,15 @@ xfs_bmap_add_extent_hole_delay( */ if ((state & BMAP_LEFT_VALID) && (state & BMAP_LEFT_DELAY) && left.br_startoff + left.br_blockcount == new->br_startoff && - left.br_blockcount + new->br_blockcount <= MAXEXTLEN) + left.br_blockcount + new->br_blockcount <= XFS_MAX_BMBT_EXTLEN) state |= BMAP_LEFT_CONTIG; if ((state & BMAP_RIGHT_VALID) && (state & BMAP_RIGHT_DELAY) && new->br_startoff + new->br_blockcount == right.br_startoff && - new->br_blockcount + right.br_blockcount <= MAXEXTLEN && + new->br_blockcount + right.br_blockcount <= XFS_MAX_BMBT_EXTLEN && (!(state & BMAP_LEFT_CONTIG) || (left.br_blockcount + new->br_blockcount + - right.br_blockcount <= MAXEXTLEN))) + right.br_blockcount <= XFS_MAX_BMBT_EXTLEN))) state |= BMAP_RIGHT_CONTIG; /* @@ -2658,17 +2658,17 @@ xfs_bmap_add_extent_hole_real( left.br_startoff + left.br_blockcount == new->br_startoff && left.br_startblock + left.br_blockcount == new->br_startblock && left.br_state == new->br_state && - left.br_blockcount + new->br_blockcount <= MAXEXTLEN) + left.br_blockcount + new->br_blockcount <= XFS_MAX_BMBT_EXTLEN) state |= BMAP_LEFT_CONTIG; if ((state & BMAP_RIGHT_VALID) && !(state & BMAP_RIGHT_DELAY) && new->br_startoff + new->br_blockcount == right.br_startoff && new->br_startblock + new->br_blockcount == right.br_startblock && new->br_state == right.br_state && - new->br_blockcount + right.br_blockcount <= MAXEXTLEN && + new->br_blockcount + right.br_blockcount <= XFS_MAX_BMBT_EXTLEN && (!(state & BMAP_LEFT_CONTIG) || left.br_blockcount + new->br_blockcount + - right.br_blockcount <= MAXEXTLEN)) + right.br_blockcount <= XFS_MAX_BMBT_EXTLEN)) state |= BMAP_RIGHT_CONTIG; error = 0; @@ -2903,15 +2903,15 @@ xfs_bmap_extsize_align( /* * For large extent hint sizes, the aligned extent might be larger than - * MAXEXTLEN. In that case, reduce the size by an extsz so that it pulls - * the length back under MAXEXTLEN. The outer allocation loops handle - * short allocation just fine, so it is safe to do this. We only want to - * do it when we are forced to, though, because it means more allocation - * operations are required. + * XFS_BMBT_MAX_EXTLEN. In that case, reduce the size by an extsz so + * that it pulls the length back under XFS_BMBT_MAX_EXTLEN. The outer + * allocation loops handle short allocation just fine, so it is safe to + * do this. We only want to do it when we are forced to, though, because + * it means more allocation operations are required. */ - while (align_alen > MAXEXTLEN) + while (align_alen > XFS_MAX_BMBT_EXTLEN) align_alen -= extsz; - ASSERT(align_alen <= MAXEXTLEN); + ASSERT(align_alen <= XFS_MAX_BMBT_EXTLEN); /* * If the previous block overlaps with this proposed allocation @@ -3001,9 +3001,9 @@ xfs_bmap_extsize_align( return -EINVAL; } else { ASSERT(orig_off >= align_off); - /* see MAXEXTLEN handling above */ + /* see XFS_BMBT_MAX_EXTLEN handling above */ ASSERT(orig_end <= align_off + align_alen || - align_alen + extsz > MAXEXTLEN); + align_alen + extsz > XFS_MAX_BMBT_EXTLEN); } #ifdef DEBUG @@ -3968,7 +3968,7 @@ xfs_bmapi_reserve_delalloc( * Cap the alloc length. Keep track of prealloc so we know whether to * tag the inode before we return. */ - alen = XFS_FILBLKS_MIN(len + prealloc, MAXEXTLEN); + alen = XFS_FILBLKS_MIN(len + prealloc, XFS_MAX_BMBT_EXTLEN); if (!eof) alen = XFS_FILBLKS_MIN(alen, got->br_startoff - aoff); if (prealloc && alen >= len) @@ -4101,7 +4101,7 @@ xfs_bmapi_allocate( if (!xfs_iext_peek_prev_extent(ifp, &bma->icur, &bma->prev)) bma->prev.br_startoff = NULLFILEOFF; } else { - bma->length = XFS_FILBLKS_MIN(bma->length, MAXEXTLEN); + bma->length = XFS_FILBLKS_MIN(bma->length, XFS_MAX_BMBT_EXTLEN); if (!bma->eof) bma->length = XFS_FILBLKS_MIN(bma->length, bma->got.br_startoff - bma->offset); @@ -4421,8 +4421,8 @@ xfs_bmapi_write( * xfs_extlen_t and therefore 32 bits. Hence we have to * check for 32-bit overflows and handle them here. */ - if (len > (xfs_filblks_t)MAXEXTLEN) - bma.length = MAXEXTLEN; + if (len > (xfs_filblks_t)XFS_MAX_BMBT_EXTLEN) + bma.length = XFS_MAX_BMBT_EXTLEN; else bma.length = len; @@ -4557,7 +4557,8 @@ xfs_bmapi_convert_delalloc( bma.ip = ip; bma.wasdel = true; bma.offset = bma.got.br_startoff; - bma.length = max_t(xfs_filblks_t, bma.got.br_blockcount, MAXEXTLEN); + bma.length = max_t(xfs_filblks_t, bma.got.br_blockcount, + XFS_MAX_BMBT_EXTLEN); bma.minleft = xfs_bmapi_minleft(tp, ip, whichfork); /* @@ -4638,7 +4639,7 @@ xfs_bmapi_remap( ifp = XFS_IFORK_PTR(ip, whichfork); ASSERT(len > 0); - ASSERT(len <= (xfs_filblks_t)MAXEXTLEN); + ASSERT(len <= (xfs_filblks_t)XFS_MAX_BMBT_EXTLEN); ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); ASSERT(!(flags & ~(XFS_BMAPI_ATTRFORK | XFS_BMAPI_PREALLOC | XFS_BMAPI_NORMAP))); @@ -5638,7 +5639,7 @@ xfs_bmse_can_merge( if ((left->br_startoff + left->br_blockcount != startoff) || (left->br_startblock + left->br_blockcount != got->br_startblock) || (left->br_state != got->br_state) || - (left->br_blockcount + got->br_blockcount > MAXEXTLEN)) + (left->br_blockcount + got->br_blockcount > XFS_MAX_BMBT_EXTLEN)) return false; return true; diff --git a/fs/xfs/libxfs/xfs_format.h b/fs/xfs/libxfs/xfs_format.h index b7521c1d1db2..fa11e4c1cc41 100644 --- a/fs/xfs/libxfs/xfs_format.h +++ b/fs/xfs/libxfs/xfs_format.h @@ -886,7 +886,7 @@ enum xfs_dinode_fmt { { XFS_DINODE_FMT_UUID, "uuid" } /* - * Max values for extlen, extnum, aextnum. + * Max values for ondisk inode's extent counters. * * The newly introduced data fork extent counter is a 64-bit field. However, the * maximum number of extents in a file is limited to 2^54 extents (assuming one @@ -898,7 +898,6 @@ enum xfs_dinode_fmt { * Rounding up 47 to the nearest multiple of bits-per-byte results in 48. Hence * 2^48 was chosen as the maximum data fork extent count. */ -#define MAXEXTLEN ((xfs_extlen_t)((1ULL << 21) - 1)) /* 21 bits */ #define XFS_MAX_EXTCNT_DATA_FORK ((xfs_extnum_t)((1ULL << 48) - 1)) /* Unsigned 48-bits */ #define XFS_MAX_EXTCNT_ATTR_FORK ((xfs_extnum_t)((1ULL << 32) - 1)) /* Unsigned 32-bits */ #define XFS_MAX_EXTCNT_DATA_FORK_OLD ((xfs_extnum_t)((1ULL << 31) - 1)) /* Signed 32-bits */ @@ -1635,6 +1634,8 @@ typedef struct xfs_bmdr_block { #define BMBT_STARTOFF_MASK ((1ULL << BMBT_STARTOFF_BITLEN) - 1) #define BMBT_BLOCKCOUNT_MASK ((1ULL << BMBT_BLOCKCOUNT_BITLEN) - 1) +#define XFS_MAX_BMBT_EXTLEN ((xfs_extlen_t)(BMBT_BLOCKCOUNT_MASK)) + /* * bmbt records have a file offset (block) field that is 54 bits wide, so this * is the largest xfs_fileoff_t that we ever expect to see. diff --git a/fs/xfs/libxfs/xfs_inode_buf.c b/fs/xfs/libxfs/xfs_inode_buf.c index 767189c7c887..409be63fd80d 100644 --- a/fs/xfs/libxfs/xfs_inode_buf.c +++ b/fs/xfs/libxfs/xfs_inode_buf.c @@ -691,7 +691,7 @@ xfs_inode_validate_extsize( if (extsize_bytes % blocksize_bytes) return __this_address; - if (extsize > MAXEXTLEN) + if (extsize > XFS_MAX_BMBT_EXTLEN) return __this_address; if (!rt_flag && extsize > mp->m_sb.sb_agblocks / 2) @@ -748,7 +748,7 @@ xfs_inode_validate_cowextsize( if (cowextsize_bytes % mp->m_sb.sb_blocksize) return __this_address; - if (cowextsize > MAXEXTLEN) + if (cowextsize > XFS_MAX_BMBT_EXTLEN) return __this_address; if (cowextsize > mp->m_sb.sb_agblocks / 2) diff --git a/fs/xfs/libxfs/xfs_trans_resv.c b/fs/xfs/libxfs/xfs_trans_resv.c index 6f83d9b306ee..19313021fb99 100644 --- a/fs/xfs/libxfs/xfs_trans_resv.c +++ b/fs/xfs/libxfs/xfs_trans_resv.c @@ -199,8 +199,8 @@ xfs_calc_inode_chunk_res( /* * Per-extent log reservation for the btree changes involved in freeing or * allocating a realtime extent. We have to be able to log as many rtbitmap - * blocks as needed to mark inuse MAXEXTLEN blocks' worth of realtime extents, - * as well as the realtime summary block. + * blocks as needed to mark inuse XFS_BMBT_MAX_EXTLEN blocks' worth of realtime + * extents, as well as the realtime summary block. */ static unsigned int xfs_rtalloc_log_count( @@ -210,7 +210,7 @@ xfs_rtalloc_log_count( unsigned int blksz = XFS_FSB_TO_B(mp, 1); unsigned int rtbmp_bytes; - rtbmp_bytes = (MAXEXTLEN / mp->m_sb.sb_rextsize) / NBBY; + rtbmp_bytes = (XFS_MAX_BMBT_EXTLEN / mp->m_sb.sb_rextsize) / NBBY; return (howmany(rtbmp_bytes, blksz) + 1) * num_ops; } @@ -247,7 +247,7 @@ xfs_rtalloc_log_count( * the inode's bmap btree: max depth * block size * the agfs of the ags from which the extents are allocated: 2 * sector * the superblock free block counter: sector size - * the realtime bitmap: ((MAXEXTLEN / rtextsize) / NBBY) bytes + * the realtime bitmap: ((XFS_BMBT_MAX_EXTLEN / rtextsize) / NBBY) bytes * the realtime summary: 1 block * the allocation btrees: 2 trees * (2 * max depth - 1) * block size * And the bmap_finish transaction can free bmap blocks in a join (t3): @@ -299,7 +299,8 @@ xfs_calc_write_reservation( * the agf for each of the ags: 2 * sector size * the agfl for each of the ags: 2 * sector size * the super block to reflect the freed blocks: sector size - * the realtime bitmap: 2 exts * ((MAXEXTLEN / rtextsize) / NBBY) bytes + * the realtime bitmap: 2 exts * ((XFS_BMBT_MAX_EXTLEN / rtextsize) / NBBY) + * bytes * the realtime summary: 2 exts * 1 block * worst case split in allocation btrees per extent assuming 2 extents: * 2 exts * 2 trees * (2 * max depth - 1) * block size diff --git a/fs/xfs/scrub/bmap.c b/fs/xfs/scrub/bmap.c index a4cbbc346f60..c357593e0a02 100644 --- a/fs/xfs/scrub/bmap.c +++ b/fs/xfs/scrub/bmap.c @@ -350,7 +350,7 @@ xchk_bmap_iextent( irec->br_startoff); /* Make sure the extent points to a valid place. */ - if (irec->br_blockcount > MAXEXTLEN) + if (irec->br_blockcount > XFS_MAX_BMBT_EXTLEN) xchk_fblock_set_corrupt(info->sc, info->whichfork, irec->br_startoff); if (info->is_rt && diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c index 73a36b7be3bd..36cde254dedd 100644 --- a/fs/xfs/xfs_bmap_util.c +++ b/fs/xfs/xfs_bmap_util.c @@ -119,14 +119,14 @@ xfs_bmap_rtalloc( */ ralen = ap->length / mp->m_sb.sb_rextsize; /* - * If the old value was close enough to MAXEXTLEN that + * If the old value was close enough to XFS_BMBT_MAX_EXTLEN that * we rounded up to it, cut it back so it's valid again. * Note that if it's a really large request (bigger than - * MAXEXTLEN), we don't hear about that number, and can't + * XFS_BMBT_MAX_EXTLEN), we don't hear about that number, and can't * adjust the starting point to match it. */ - if (ralen * mp->m_sb.sb_rextsize >= MAXEXTLEN) - ralen = MAXEXTLEN / mp->m_sb.sb_rextsize; + if (ralen * mp->m_sb.sb_rextsize >= XFS_MAX_BMBT_EXTLEN) + ralen = XFS_MAX_BMBT_EXTLEN / mp->m_sb.sb_rextsize; /* * Lock out modifications to both the RT bitmap and summary inodes @@ -840,9 +840,11 @@ xfs_alloc_file_space( * count, hence we need to limit the number of blocks we are * trying to reserve to avoid an overflow. We can't allocate * more than @nimaps extents, and an extent is limited on disk - * to MAXEXTLEN (21 bits), so use that to enforce the limit. + * to XFS_BMBT_MAX_EXTLEN (21 bits), so use that to enforce the + * limit. */ - resblks = min_t(xfs_fileoff_t, (e - s), (MAXEXTLEN * nimaps)); + resblks = min_t(xfs_fileoff_t, (e - s), + (XFS_MAX_BMBT_EXTLEN * nimaps)); if (unlikely(rt)) { dblocks = XFS_DIOSTRAT_SPACE_RES(mp, 0); rblocks = resblks; diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c index 093758440ad5..6835adc8d62f 100644 --- a/fs/xfs/xfs_iomap.c +++ b/fs/xfs/xfs_iomap.c @@ -395,7 +395,7 @@ xfs_iomap_prealloc_size( */ plen = prev.br_blockcount; while (xfs_iext_prev_extent(ifp, &ncur, &got)) { - if (plen > MAXEXTLEN / 2 || + if (plen > XFS_MAX_BMBT_EXTLEN / 2 || isnullstartblock(got.br_startblock) || got.br_startoff + got.br_blockcount != prev.br_startoff || got.br_startblock + got.br_blockcount != prev.br_startblock) @@ -407,23 +407,23 @@ xfs_iomap_prealloc_size( /* * If the size of the extents is greater than half the maximum extent * length, then use the current offset as the basis. This ensures that - * for large files the preallocation size always extends to MAXEXTLEN - * rather than falling short due to things like stripe unit/width - * alignment of real extents. + * for large files the preallocation size always extends to + * XFS_BMBT_MAX_EXTLEN rather than falling short due to things like stripe + * unit/width alignment of real extents. */ alloc_blocks = plen * 2; - if (alloc_blocks > MAXEXTLEN) + if (alloc_blocks > XFS_MAX_BMBT_EXTLEN) alloc_blocks = XFS_B_TO_FSB(mp, offset); qblocks = alloc_blocks; /* - * MAXEXTLEN is not a power of two value but we round the prealloc down - * to the nearest power of two value after throttling. To prevent the - * round down from unconditionally reducing the maximum supported - * prealloc size, we round up first, apply appropriate throttling, - * round down and cap the value to MAXEXTLEN. + * XFS_BMBT_MAX_EXTLEN is not a power of two value but we round the prealloc + * down to the nearest power of two value after throttling. To prevent + * the round down from unconditionally reducing the maximum supported + * prealloc size, we round up first, apply appropriate throttling, round + * down and cap the value to XFS_BMBT_MAX_EXTLEN. */ - alloc_blocks = XFS_FILEOFF_MIN(roundup_pow_of_two(MAXEXTLEN), + alloc_blocks = XFS_FILEOFF_MIN(roundup_pow_of_two(XFS_MAX_BMBT_EXTLEN), alloc_blocks); freesp = percpu_counter_read_positive(&mp->m_fdblocks); @@ -471,14 +471,14 @@ xfs_iomap_prealloc_size( */ if (alloc_blocks) alloc_blocks = rounddown_pow_of_two(alloc_blocks); - if (alloc_blocks > MAXEXTLEN) - alloc_blocks = MAXEXTLEN; + if (alloc_blocks > XFS_MAX_BMBT_EXTLEN) + alloc_blocks = XFS_MAX_BMBT_EXTLEN; /* * If we are still trying to allocate more space than is * available, squash the prealloc hard. This can happen if we * have a large file on a small filesystem and the above - * lowspace thresholds are smaller than MAXEXTLEN. + * lowspace thresholds are smaller than XFS_BMBT_MAX_EXTLEN. */ while (alloc_blocks && alloc_blocks >= freesp) alloc_blocks >>= 4;