Message ID | PUZPR04MB63162A898D74090614E33B32810F9@PUZPR04MB6316.apcprd04.prod.outlook.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp3227912wrr; Wed, 23 Nov 2022 22:49:47 -0800 (PST) X-Google-Smtp-Source: AA0mqf75i8emZAC6AOZM3SxnBtLT66R9xJ1GmOSgI9zPeQvEzKGchow0e0WQ/kyW0UfFmKghn9AA X-Received: by 2002:a17:90b:3d0b:b0:218:b258:f5b0 with SMTP id pt11-20020a17090b3d0b00b00218b258f5b0mr19031999pjb.119.1669272587049; Wed, 23 Nov 2022 22:49:47 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1669272587; cv=pass; d=google.com; s=arc-20160816; b=LxPMs6ksxvja3koLgHBW9/X0haOicCvFzWb4hTpgfX1YWYkQUB33XvmInOOpase5Zw GgotFN+L8Zk8oTri+nntX53jj8TWlvTm45U5cArnDR60iNbJer3Jhh336QwLY0l73jLz AK1jzsMXCQEV459fEBCsU+Z85cXnGIyGVK91PiE5fFJOZKGiLbEtOWR9wLhESayAhvHI TjRGZ82G2pPysWX3rjY/S3JC+26CofFfreqxRGPhAu8Y9TlF8VEOGRT90x3msf12QU7A P4qnVti8yQ6+j/669e+wsJS5kILUVl5QdPI32FVl77Kf33P5PIdy76YVWZ8d6WZmYzVQ 8crQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature; bh=wIX8Tc1UFkB+/p/X0Mj7veETRAIdZTUGHtiCNC1GTS4=; b=Pjq240nP1yi1TLY/pRDo1b6jxb0c/B/r3WTG4CiaKsb2KgTAm8CvA7/lgQ+Wk5EFqJ ot7UX2xRRRj5xh8Q1WkdTRRiK0VmsnbulKR6M1PYWFIX4Lgtc8+pjKnwzsnc2nYOdnaF IDEc0mO/cTKOtgZR1gVJa6iP3EfuEOHG+QL4rZn8dQP0N+PcewwwvmskWPEWpve277Hf CVTW6uK7UxlbRUSW4GVzQdVKaWquqnM7A4KXMmgphHTmtLUyQnET5td5MRINdjbfps8+ CrTRYIvFC4B1saXdjbY0uCP2SK1CJ3213sNqulVlW94+glahL946H+VA9LJaXZ9hlvEt eUjg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sony.com header.s=S1 header.b="jtx/FBTn"; arc=pass (i=1 spf=pass spfdomain=sony.com dkim=pass dkdomain=sony.com dmarc=pass fromdomain=sony.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sony.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y63-20020a638a42000000b00473d2c2c06bsi524573pgd.423.2022.11.23.22.49.33; Wed, 23 Nov 2022 22:49:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@sony.com header.s=S1 header.b="jtx/FBTn"; arc=pass (i=1 spf=pass spfdomain=sony.com dkim=pass dkdomain=sony.com dmarc=pass fromdomain=sony.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sony.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229525AbiKXGlD (ORCPT <rfc822;fengqi706@gmail.com> + 99 others); Thu, 24 Nov 2022 01:41:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229680AbiKXGkv (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 24 Nov 2022 01:40:51 -0500 Received: from mx08-001d1705.pphosted.com (mx08-001d1705.pphosted.com [185.183.30.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D881DAD27; Wed, 23 Nov 2022 22:40:48 -0800 (PST) Received: from pps.filterd (m0209321.ppops.net [127.0.0.1]) by mx08-001d1705.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2AO6OH5r001748; Thu, 24 Nov 2022 06:40:31 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sony.com; h=from : to : cc : subject : date : message-id : content-type : content-transfer-encoding : mime-version; s=S1; bh=wIX8Tc1UFkB+/p/X0Mj7veETRAIdZTUGHtiCNC1GTS4=; b=jtx/FBTnAzSoUIphrTXVr/bbJzYDYRRgIFucXU5Tiq6ITf4MozX1g3K8ivX+cxohVwKo 3HgV+mfE56c+/aBTNBW9W3gRhEAJkIJk6SM9wMiztC1d8pwTpUJRJjA9HVFVs4PLsBqo gTCX9m4zBmeNGCIr7IL6s0YFjJ478Om8vpNpHaST5PumX6b5zIUcZgnTcRacd5YoZtHu kDmJrN2XbohzKgqOouCUfHumH9YXC9v2pCNDH4vXCGYkpr3j2VqeMQTvp2Nmdk2afN7+ Fr0ubl89ctLT/iqgzrRIiUEjVc+0tiDhMBTijbEcwx477OhLZmz8WnZSYPq2icErZkf/ LQ== Received: from apc01-tyz-obe.outbound.protection.outlook.com (mail-tyzapc01lp2047.outbound.protection.outlook.com [104.47.110.47]) by mx08-001d1705.pphosted.com (PPS) with ESMTPS id 3kxrb94t31-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 24 Nov 2022 06:40:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Uq12ZB52w1zaoQH6onPLRT4KWU5F7EdW4dXA+FsimsRSbSPU1ODwy+NayStD5Y+Y6LwgQiapT9pZlI1qHLxpPD+7CJpg8A6FYbbKXblGXi7Kj1sWRgJWtzHAM+677kHK1C0q5+OilWSM8yGWu5hNU+wgWP/nFZ3Y41+rYW61xOLrVtTfu0Eq5wUlyN6eizMxLOcq2fbgxAbGIpPcRpaX7DH2CNpBpAIXArIT84247Xk7h01NEU6Vgks3ZxFordjXtSB20DWWAK0ntYtr2XUhEvoVKJAyvA5L0o7MrKenjlWQG/oSStzgGiL4KVkLERRdTbq5zmnFmqpl9wp7YDtwEQ== 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=wIX8Tc1UFkB+/p/X0Mj7veETRAIdZTUGHtiCNC1GTS4=; b=eHb/a2E6eBnVvFgFIlKpg9m6v+Azl3WnbcbGvWWGnLTm6v2a1a26zk9Wm95hELDDRWTDHwg0Q+DuCMScxeCcSuv32KR9nGh9Y6c95XaflBBr8M97nQRto7D/vrXGSzuS7yKBnONmLqLMGMt6JmYfditG2gZWfmKg7LXitDkXEVL88U2r1ureDPV9UTyVZRolcX+Dbp0njVfUD0PppuglYuRiYf98mty3Sdc3TMPK3K1Fyg+OscK91nq7UycvvF5wdT52A3R8d6tiN5FZBvBodma2kiyP8GueQXHdhSBwEc2uKcVEH/Vyq/rxH+CEql0G61MKn328d0Zu8YNAXzy2dw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=sony.com; dmarc=pass action=none header.from=sony.com; dkim=pass header.d=sony.com; arc=none Received: from PUZPR04MB6316.apcprd04.prod.outlook.com (2603:1096:301:fc::7) by SI2PR04MB4425.apcprd04.prod.outlook.com (2603:1096:4:e8::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5857.17; Thu, 24 Nov 2022 06:40:24 +0000 Received: from PUZPR04MB6316.apcprd04.prod.outlook.com ([fe80::708b:1447:3c12:c222]) by PUZPR04MB6316.apcprd04.prod.outlook.com ([fe80::708b:1447:3c12:c222%8]) with mapi id 15.20.5857.008; Thu, 24 Nov 2022 06:40:24 +0000 From: "Yuezhang.Mo@sony.com" <Yuezhang.Mo@sony.com> To: "linkinjeon@kernel.org" <linkinjeon@kernel.org>, "sj1557.seo@samsung.com" <sj1557.seo@samsung.com> CC: "linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, "Andy.Wu@sony.com" <Andy.Wu@sony.com>, "Wataru.Aoyama@sony.com" <Wataru.Aoyama@sony.com> Subject: [PATCH v2 1/5] exfat: reduce the size of exfat_entry_set_cache Thread-Topic: [PATCH v2 1/5] exfat: reduce the size of exfat_entry_set_cache Thread-Index: Adj/yZ7/ZJx2fxByTueAE189lTyjlA== Date: Thu, 24 Nov 2022 06:40:24 +0000 Message-ID: <PUZPR04MB63162A898D74090614E33B32810F9@PUZPR04MB6316.apcprd04.prod.outlook.com> Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PUZPR04MB6316:EE_|SI2PR04MB4425:EE_ x-ms-office365-filtering-correlation-id: 0bf6b9a8-5f3e-48d6-2629-08dacde6c40e x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 8niHfsphtpCfT7FGnEST3eWyynL5/9N60AFAzS4PZYtJqgJPgl0GQybKi6sg161g0qVo7+abAFUGBAJ2I49a0Gti6qDVEc50NECZAN+EyAtWKE9ZhsbMeiAJb/ANEDNvdLUMH3hXOJm3cZLp00ed9XyFX5vzxX3/S6DcanRJkRpeK4muWa06si4yTKEgYTJaot+2CtdyIDhMd7UZWsYg95N1OSw0ca+Vj9QDSjmsWKIkJykyBNHj4DAKyG5QZvSsI1x89Kbx6RQpXfuCHekepOITnQ0Fq0NBWbbYp9rEKgPZVUVdc3tuvptCFM0UGVOps0521qiQavWGjvh8N6xJPECVElg7PoNe+UmCsuOvylaMLR1594BkDevBvlg3Eyat+20xW7gt5uUjeUD9ADnhQIzYHRh1MjkzYP01onTKRLSnxw7LDsUiF303p890sLE9cgAoVf4cfvEqgS8c2qJkwUkJjPXF6vPJKR2lEX8p+2/yQa4GWhlPUbC8DNWjbn8mqaCq7GjBJsqFyHX2o2LE8G2x4AjfYcIbvscB7LC39VTruvul50cBINNkT6i4ra/mIgcqKVEAirFEz60UhJ93aqJU8V2LrqO204XxPA6aprH+wXNp090OPcPHpikQnB4+gEDKQbKbnhBIdNEXCw4xsR90kxGvCXijJQRaD2shB8WmhpZWHJi4wyOnySJsflrrkzIv/iK+v4Ybr2u87/QrRA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PUZPR04MB6316.apcprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(39860400002)(396003)(366004)(376002)(136003)(346002)(451199015)(41300700001)(8936002)(478600001)(54906003)(4326008)(5660300002)(316002)(66556008)(66476007)(66946007)(76116006)(52536014)(66446008)(64756008)(8676002)(71200400001)(107886003)(2906002)(7696005)(6506007)(9686003)(186003)(110136005)(122000001)(26005)(38070700005)(38100700002)(82960400001)(86362001)(83380400001)(33656002)(55016003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?wKJ6vzFjI7A1/QgAzkFWOHWbV0MM?= =?utf-8?q?bdAMQy/ytTymOOyBjcwChwVbzSgzC6pKXN+ml+1vQQYIC6dst8NmIv1Ka88RLrtEW?= =?utf-8?q?m7ONxHbtUvF7aWR00HhfBQfOguvs5PLnYzZ5WoXWVkXwxt3ubfm7kpj0ggHBW1Ohk?= =?utf-8?q?CBp6/b3A3IQfwS7mdRVNCY8Pu9yoL+KXBpaUq2RCwl2l+9TATy3SnfzVojxkG92cO?= =?utf-8?q?4mJn1qJ8l+q4ZDIHyKrNGkWYrneWvScRj/+bz0/HdYfJpWWVNqerjmI/VEwYgTngb?= =?utf-8?q?L73wpNGDSJ/tdakml9mUVdCN31g3xroWcncf6mu48N/FdeFhceZRu/u1oaWpiXIGA?= =?utf-8?q?/rt7gztY2KXaq4QbVO8C0WFT08p2qq7dXNf8Bn7Xvpbzp7EO63TZAgv2qgX5zk2Tb?= =?utf-8?q?WY63OY0ZNP102785Wz9SNSj2gaydRAURGyOxQ+K5WugIKXDRXHf21cIf1KdEZNehk?= =?utf-8?q?1T2u+PUtaafdAL+vx9sG6aKVtEZa8x7TKPHixYk7QZ9/QaIUlnEC4aYHEPzZU8S0V?= =?utf-8?q?+pGll8Kt0ELYqPvnmAk1rFg1FYq6cjpyDBQSgj6bAuy6G4RZknNQqLhJSmbG5bXgc?= =?utf-8?q?FMgMkIVfWujh+KgEAVTLsuB9zZa0B3iRptHjeeGI59fEp5U5Hn+AUYejzM2sKHThc?= =?utf-8?q?OTU0heLnAOFtNqL0BzHu79psxL8LTvzRHy29zb8fW/ip23ES5qjFBM5DrQTRWzCsM?= =?utf-8?q?AurhZYuBUNmeGAwCoBdRFECgogV3vLDOV0Wy5X1Lqyrp+B6qKOJj23slIR8Py271k?= =?utf-8?q?avdQzjrKCR1vqfsqp11kcg34Y/oOq44rUd+DBjGUWMTzyOBC1RsVHAcos89EeyaBj?= =?utf-8?q?Ff8sBp6Ojs2VPNfsD74OSLCj8JPBGqyCt8Kyael4fNsCN/xYSJLB8nUiH6J8knMw2?= =?utf-8?q?73PYFVanuDy6dk5Xk9lEqnOg+dzCVn6uIZbb1ddwdCl1DkJyuPtUt50W8Ak5lg/H5?= =?utf-8?q?Zi1/gsnI/r7N6U/c0LoRtAd2UXQPJ+iA8/5JjaRyywTtzSXsNojZHQVjcnonDRyan?= =?utf-8?q?jyz8RCO+k5XStHxbTm78SD14pGPo9ibQtYEaTeNRP2BTDuVj5/zDARgrDVMsBjO4T?= =?utf-8?q?QL4kz0VFMhZiaunlD4yKUntE+cHBIKlm4/62/sRXu68MoWqDFut+AOQojeAMxFwWe?= =?utf-8?q?66c5dtzzg1QVD7tlBsGRQUpDjySvfbUwqDfq+4QOVKAckYCEIekPikIBiIPtkXKMO?= =?utf-8?q?Lp1vBhDTe3DS4R0Bfc1zBv7PbF2p4aumzNkHFR7IzL31D+SIAKhIxuyq2IjGTunC3?= =?utf-8?q?qzzWoJPvI0Kk4zg1aS6MlBR8XetTOuVbdhePcLpBQIJojsVc9/vS1GgPy53owYnkI?= =?utf-8?q?htD545LtT0PkV+dVQPF7ZcB7ACnpifnsnRY7QHmhOPJInh4VqgstKW/yxy0X6Bm+n?= =?utf-8?q?lHg/+9lqmUZ7TmgBWCAlFNaTo1SOHomaQj4shjOF9lJpHXgy3l7XPUlBiZwpfpxSa?= =?utf-8?q?Aynha3Awg3uuL0vnSrpG8w5+JcDQ8ObLchfuiribtOkhqnG2hl71I8yJFfbQDMQg1?= =?utf-8?q?GlztICjCZsnz?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: kCaCHYa+LR+l5i5vDkuCZqc3ezmgHoxlj1WBX9WdSTPdsx1oc6nqR45h3fDZtn88HDjeFqSDxbWhi95mQC/YxdPJELbfBsJoHh4/awc+nS5rXqzio8jM6aa1pb6lw8BI+3AyYc4t78pfQBvcMooYZ0hOiujBI+4WsH1bJtDbKN7ZO7Nk4XLy4P8vCzNehg7/mMHJXhIrQ3qmqfjLV9KvM1QnlOZLEfSTMUpS6TSkcmPCLFa4LVNJ75R7wydRekoCSNwW09wg2yS5DBQz7Sd6hRrcaZiYi/abogIKWx1fx5spZ8TSCcTFqPS2xfktvedpU3LuVHMZBd9pZO556ehC+bxydqOMwOHrL8s9SBVRZlSF+hZnNxiMX1G57+fSa1sVcuU8z5lOIvhklL9P7TaCCcthaF5yG3i2KSn0/Xyv+bSIzMIVWyPBx5A4ocQzQ3PfwzKwKhU75uvNbcABYVTyeEgV6sCSt11FDp3noLA7ErLEzQhvq9dlZ6wbse6xxkvQgG+zg/c2z5h82QTKdiiaLp7GRCmr74OURhdMAc2dYg64jJDDKS00bqKA4cQ9qFS3IPuGzNzqkGuI5uQgX6havOrXL4I/MjDMbikOwNzLHfWNO655K40u4HHpNfPLy2jvMzJk/KhW0Hjd3OYAD/so3e25MXP2I8Wdjb7/dmhC8mWixm8rm9WVv0bGubXxlNjoP9oLLcQeJ3ZVakO/a2J/t0s0B7nYqv3GGqEtvfhiNRWbrQbVSb3raQxeyxchq/krkv/gurB8yCGRj7SwJOR3rxJ0FVKj0a2Xq1wc/VnS76MpzOGm4gtzgSmLCUsJGR+YPnqL0gamBfD6tllXobTgSXZwNKeTZa7y3pIXdQmwAQeQicGbEmW62pY0SM5efu7o X-OriginatorOrg: sony.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PUZPR04MB6316.apcprd04.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0bf6b9a8-5f3e-48d6-2629-08dacde6c40e X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Nov 2022 06:40:24.1624 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 66c65d8a-9158-4521-a2d8-664963db48e4 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: wuLJLDTRCJtvo82xcZvB4/8nt58fcefY4UZiPZpTyEr9hr9WBS62t+s1i2Xjz8cERScS5G7U3r3lpuJolwlIuA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SI2PR04MB4425 X-Proofpoint-GUID: ELW1dhsxZXR2tZ7Y-KoLyvFXVq2shLTh X-Proofpoint-ORIG-GUID: ELW1dhsxZXR2tZ7Y-KoLyvFXVq2shLTh X-Sony-Outbound-GUID: ELW1dhsxZXR2tZ7Y-KoLyvFXVq2shLTh X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-24_04,2022-11-23_01,2022-06-22_01 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750359172327117847?= X-GMAIL-MSGID: =?utf-8?q?1750359172327117847?= |
Series |
exfat: move exfat_entry_set_cache from heap to stack
|
|
Commit Message
Yuezhang.Mo@sony.com
Nov. 24, 2022, 6:40 a.m. UTC
In normal, there are 19 directory entries at most for a file or a directory. - A file directory entry - A stream extension directory entry - 1~17 file name directory entry So the directory entries are in 3 sectors at most, it is enough for struct exfat_entry_set_cache to pre-allocate 3 bh. This commit changes the size of struct exfat_entry_set_cache as: Before After 32-bit system 88 32 bytes 64-bit system 168 48 bytes Signed-off-by: Yuezhang Mo <Yuezhang.Mo@sony.com> Reviewed-by: Andy Wu <Andy.Wu@sony.com> Reviewed-by: Aoyama Wataru <wataru.aoyama@sony.com> --- fs/exfat/exfat_fs.h | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) -- 2.25.1
diff --git a/fs/exfat/exfat_fs.h b/fs/exfat/exfat_fs.h index a8f8eee4937c..af55018ff22e 100644 --- a/fs/exfat/exfat_fs.h +++ b/fs/exfat/exfat_fs.h @@ -9,6 +9,7 @@ #include <linux/fs.h> #include <linux/ratelimit.h> #include <linux/nls.h> +#include <linux/blkdev.h> #define EXFAT_ROOT_INO 1 @@ -41,6 +42,14 @@ enum { #define ES_2_ENTRIES 2 #define ES_ALL_ENTRIES 0 +#define ES_IDX_FILE 0 +#define ES_IDX_STREAM 1 +#define ES_IDX_FIRST_FILENAME 2 +#define EXFAT_FILENAME_ENTRY_NUM(name_len) \ + DIV_ROUND_UP(name_len, EXFAT_FILE_NAME_LEN) +#define ES_IDX_LAST_FILENAME(name_len) \ + (ES_IDX_FIRST_FILENAME + EXFAT_FILENAME_ENTRY_NUM(name_len) - 1) + #define DIR_DELETED 0xFFFF0321 /* type values */ @@ -68,9 +77,6 @@ enum { #define MAX_NAME_LENGTH 255 /* max len of file name excluding NULL */ #define MAX_VFSNAME_BUF_SIZE ((MAX_NAME_LENGTH + 1) * MAX_CHARSET_SIZE) -/* Enough size to hold 256 dentry (even 512 Byte sector) */ -#define DIR_CACHE_SIZE (256*sizeof(struct exfat_dentry)/512+1) - #define EXFAT_HINT_NONE -1 #define EXFAT_MIN_SUBDIR 2 @@ -125,6 +131,17 @@ enum { #define BITS_PER_BYTE_MASK 0x7 #define IGNORED_BITS_REMAINED(clu, clu_base) ((1 << ((clu) - (clu_base))) - 1) +#define ES_ENTRY_NUM(name_len) (ES_IDX_LAST_FILENAME(name_len) + 1) +/* 19 entries = 1 file entry + 1 stream entry + 17 filename entries */ +#define ES_MAX_ENTRY_NUM ES_ENTRY_NUM(MAX_NAME_LENGTH) + +/* + * 19 entries x 32 bytes/entry = 608 bytes. + * The 608 bytes are in 3 sectors at most (even 512 Byte sector). + */ +#define DIR_CACHE_SIZE \ + (DIV_ROUND_UP(EXFAT_DEN_TO_B(ES_MAX_ENTRY_NUM), SECTOR_SIZE) + 1) + struct exfat_dentry_namebuf { char *lfn; int lfnbuf_len; /* usually MAX_UNINAME_BUF_SIZE */ @@ -166,11 +183,11 @@ struct exfat_hint { struct exfat_entry_set_cache { struct super_block *sb; - bool modified; unsigned int start_off; int num_bh; struct buffer_head *bh[DIR_CACHE_SIZE]; unsigned int num_entries; + bool modified; }; struct exfat_dir_entry {