From patchwork Mon Dec 5 05:10:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuezhang.Mo@sony.com" X-Patchwork-Id: 13064134 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 9DC8CC4321E for ; Mon, 5 Dec 2022 05:12:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231545AbiLEFMR (ORCPT ); Mon, 5 Dec 2022 00:12:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231648AbiLEFLy (ORCPT ); Mon, 5 Dec 2022 00:11:54 -0500 Received: from mx08-001d1705.pphosted.com (mx08-001d1705.pphosted.com [185.183.30.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E04313F10; Sun, 4 Dec 2022 21:11:30 -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 2B544ADq000617; Mon, 5 Dec 2022 05:11:20 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=sgu6yPQ8lCayHzTODsx17It8x6n3yW2mxMZFTeqPLqM=; b=ZdEpSbvRQZbidrd0Y8HwuQt6QRwMLTWNH+bcq27NNYptiGrgCRSu2OywfX1O5WpRIxhD FHj1+WvIbbxOpO9Y3FV4r5lfdrIOhh/gsr3vYAkrw4kZ6khasmvMb68jkm8oWpI1kHSL nHVWG0Y/JfsljG7dDCkk6Q3Hy9ik5JyS5MeJObzVtlwYayisdU8GQ7eU1kx+/1NYF4KH j6xvYjU2FSCQnNov4+NmDImuQYnB8YMX/xGPiX9eiX0pqp/lp1mFrki7g4jNzSsY2iY0 GIoFEBVZEmGc4lMQg39hIIfaSqIv7OdZRHxx611DBuIf/wXPbyAO87MDjJ8C+QfSPuKD Qw== Received: from apc01-tyz-obe.outbound.protection.outlook.com (mail-tyzapc01lp2049.outbound.protection.outlook.com [104.47.110.49]) by mx08-001d1705.pphosted.com (PPS) with ESMTPS id 3m7ycb1aj8-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 05 Dec 2022 05:11:20 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aNlwVsL0tpWDC97+lMCR+DIYqUAlmyQPXtatzyhONEsCtTk6ePEZLr4lhDlCbaW9+5W608Hp6dYYkd7GC0YvhaAiSUs1VwESf1yxI6nzfWUlS0TggmC8XF2nc9Fq+Z4kb5vpV4MyUScNh91AXvc/UL7mvIdCNEZ1nUdZMc44QIzJv5xG1NgCzuugsxIcA2bp3C4FFWHUQBKSlxtApUOWCyyRWQP4nmBtZo1c47/s9rxu1iwtUe8+To+IuItsDzTOE7dgW4GoHlMa+5eVLSevbzvVW/Q1zKwehr6kVEiwnwRYZvdQ8wY64FKdFh9OcNKGdcQeKrwVNoWJi6+H9ydmyA== 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=sgu6yPQ8lCayHzTODsx17It8x6n3yW2mxMZFTeqPLqM=; b=F8ofg05qVNuhUi0HqThynO1rLmoItAaeNbHwa6U+K3ifCs4bo6Ggt6q2BzzJ+KbM2fKHtug9WMUOYbx6BVNJ7koS7HsCmcu/o3tVFgZLkDrCayJ4r6AENZNOCP3hCGihszh/wt7Vz2xlRFYqZrt6ekv//X8z1cqEHqlFnNZhWhSAG1ehW0DswU05Egz3dq+So+pB0TOccbt6nKCNH7fPWwvkzHHcZ1ex+ucN/MOQ964pCkoNe8j6VGPWgsvLBHKqWff6oeIFWouUViZhAe5F+cyKEGoPzKLfcr8pA4EWK+wrsSMS33H6pbgzT3aKsA9ZWyQDFD8gGgZT05TNitLVrg== 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 HKAPR04MB4035.apcprd04.prod.outlook.com (2603:1096:203:dc::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.13; Mon, 5 Dec 2022 05:10:00 +0000 Received: from PUZPR04MB6316.apcprd04.prod.outlook.com ([fe80::c689:d665:b3a2:d4de]) by PUZPR04MB6316.apcprd04.prod.outlook.com ([fe80::c689:d665:b3a2:d4de%6]) with mapi id 15.20.5880.008; Mon, 5 Dec 2022 05:10:00 +0000 From: "Yuezhang.Mo@sony.com" To: "linkinjeon@kernel.org" , "sj1557.seo@samsung.com" CC: "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Andy.Wu@sony.com" , "Wataru.Aoyama@sony.com" Subject: [PATCH v1 1/6] exfat: remove call ilog2() from exfat_readdir() Thread-Topic: [PATCH v1 1/6] exfat: remove call ilog2() from exfat_readdir() Thread-Index: AdkIZagE89nZwe4ETVe4ZwLM5E9ACQ== Date: Mon, 5 Dec 2022 05:10:00 +0000 Message-ID: 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_|HKAPR04MB4035:EE_ x-ms-office365-filtering-correlation-id: 2c122c58-b7c9-403d-43c2-08dad67ef5b8 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: rYDqkSuVYkd6EVySXyn+ShRUV4063dZUnoVFoK/D2TF+4FOt678RLKKb3kh7PcHJW6ooLJ0Xp5gVIqDNlI5p9qZHEgVJMNzvIHBqMimn8cJa40ybvcUCLu3J3FM/6zf+p52vnN7piwP7NdzeOyJv8ND0iE+f2J6neKgHmFxEzJXFxEWPJSSEcbF1jXUSG4FCUFtX/GAUfLWw9IHDQt3kWB75QAfAaD9hWJ8DTwx5n712xELCk1JPZHNgd5sfYLyIvVojdL9xfqDNfFi9ONZm/DdPhTK7rqO179quFkRNQTkqxVaubXHPY9OqdCFr9Fgu63I/D3SR137tovG4PrLaehQ37idhok0bIEUiga16vUzWurlqzfNFO7DY1cDnYf9aAk24uTRekDi7AyWnalxT2f4fCP9sf9cEzmoaEjbaf0jJ83ZeDmoynOsppULZVrGhs4HR7BRRrtyrxBRhGIOJfubZoJi0NzSvWdOJ0FH0C4sIdLnuSz2+KDYNhCfNE5yAd4rpeQy5NSiXuME4wY2bB9eFGfvwNcysdWv9Az+Dzku7BICm31dxVvfgqtAi7Z28zui4cQpmiTi7WF8E9JEv0J1azsdtEm1CiQvJkgt9CevK1XcibFSC4rm9Q5d6JPk0o+evGn8H+VG7ZvyIz3lyeC8E6JkAkJ0k/cRCN9HjHU3IVpHUB6/XMRIj12GAddrHFWJa4Z6kZfU+lOIMcpp7WQ== 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)(376002)(136003)(346002)(366004)(396003)(451199015)(33656002)(82960400001)(2906002)(122000001)(41300700001)(8936002)(186003)(52536014)(5660300002)(38100700002)(86362001)(83380400001)(38070700005)(55016003)(54906003)(66446008)(110136005)(316002)(66476007)(66556008)(64756008)(71200400001)(76116006)(4326008)(8676002)(478600001)(107886003)(7696005)(66946007)(26005)(9686003)(6506007);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?JvlwP5G1bm1JJtIJOqgNr08FD6pq?= =?utf-8?q?FSPObTe1UWsZUEwR9WqRhTi9bVzPStn8mTHK8RdPBM9JgCLd4rS0x291M2zzn48iB?= =?utf-8?q?S9oL+u8KaaYiI99L/RIGUw9TlKbzXcNj6+nxErtEtGeHaeRS2jXmy/1cUMhwEi+Ua?= =?utf-8?q?qCdLGInz4CQ4v0esvCgnKDgbJ/CR+BJJemq+KMLycspncaQr0WMB769M16XZXc+Hn?= =?utf-8?q?V49kcMVCZ73YOEEok+eKZR8C8MOOlT2B8HNPRTCHSwYlQSInjSIxy4sS9tNAjTIyY?= =?utf-8?q?fUQttvCsAw/9hCd4v8pQBIYP3N4dtkA4Dk3U5S+Jg/PPMGB/pAvYGnDAg4IMa6Ffd?= =?utf-8?q?4QCv3vpHJr6VD2WL41kt3eBdWTXGgVcJR5hWEXdb042UYLYPrSrpRJ8PbfddIcpWr?= =?utf-8?q?nDKnFzGcFdHcX4ShBAZcO61zSH3SceIMVb0sMcmYaJW+UJ/FlNnZZV29k20QTkrzy?= =?utf-8?q?7Dt7QTU9f+SIZp2tmTTn4g/scM4ir0qt69q7mAfNGyanChzxQ2J7lNSK+k507OIlB?= =?utf-8?q?F5L9T02P+wdA31qkXUQRSy+/x5mKmlEsb0wArX55Np2MhBAqFhiFddmKuxdkvZjFN?= =?utf-8?q?m1XlhfzBW3MhT+72NDkDFaWAKty8Qg+H0l3PbORP7OgLZbuEr5ohVE9YSm/cHqzCk?= =?utf-8?q?wxDA9ppreB+zhQR3ccrIw7icxkSi8U/jVEGAVIYmnqF+lCapDUqN+Pb1Fn4F3BefH?= =?utf-8?q?K2hKCsWtKsvZdiyxAxKBaGlmxNhl5z9bNQv2B3EF4LM+zSCIGj07C7r3Wl+bfAURA?= =?utf-8?q?wQE7kaXAZotdIoUGG345jFYDd6HyIoMHeAAvkcvCaupofuKO6rUPJ440+d5bEU9FO?= =?utf-8?q?ac1xzDNQUUba+lIpfdPvtpbA+6/1Uq+4w/FEdBGniRu2Xsx9tIYo5HLyvyP2yNqYl?= =?utf-8?q?DmYZcE8WUi/mgH25Jo+UNN1xB6p7SB1A7L2KW+HZTS9abva4WCYIlQGMoU8Tg8CK6?= =?utf-8?q?fkQgelXyHjBKycKSg8JQrphrw++kH+Sog+0yxacA9my/OkKM1HMs6xvxknMtVVBZZ?= =?utf-8?q?ykaw6FC5cjDFSEyCPgzz3Yphm2aEQ8HrgszLD6wbLpBkMCzhshZTgpvhc3HDnRv5f?= =?utf-8?q?V9bGOq8bSiKH5KU6ceyO/tiHTdGhjbAI/YMO8ezsVMAuXBANgaN6snJqY6kWbK9Xi?= =?utf-8?q?ptsHVnCgdgiSuRvMzS6P4EuybRg9REXCXsKlDdJneJn6WPbArNJyCJwI4tePRoHKD?= =?utf-8?q?iZ3XIqhV0ofJ+qKMD7SYcI+4Q7oROVrARDHJWgxue+eMGw9b3lwHkKBxKW66abfZR?= =?utf-8?q?VbStVnEfXhSky/+LtDPhcsGwt0mxMVm4BAP3TI1RYTnZk/j8cYvbik407rFRMnzpx?= =?utf-8?q?RhI0F2RZq8yqAALG+FTgvOI5TAMfVPbj5bzpoWzmNYA3S8QjUui1Zt9hjYBUFKoE+?= =?utf-8?q?PAJTruiWRtQVCkqvnNh6J5ptFZNlyq4prIKxWUYHITgKGuuINGswsA8L1E/+iObTO?= =?utf-8?q?MmnaBhOaUHr3fOch1XvUus2j904q3eHajN639d9QHOkWBfK5h5zhm7z7oDXx28t9a?= =?utf-8?q?/zuqxSYLKVFs?= MIME-Version: 1.0 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 5qF60nQq3jhlvZmweg8VeO7NsSoDqf+sSHVHZRMHpD7rLQBPnTtqzZm1T4zofip03dlEi4Tx2oXO8v92Mb9sQ6x6cMu+MubratWcB+s6zNNWqeO3dZT4VVvj53sST1HjhGrLs0gq86CG05nWUydbGF8qzoVKwxlS3NQbDtXNVYzfnsVK+Yyn+35VIOL2GjN51CpMAPiwIv69bxweBbpoZO1uqatkgtZwy5oGqqvYg6sctSjcdhA/o9MR/pyT7gFpMoJzMfyIGBGVhpHTmBnzTn7Ioa73aTecB/MdcfGsEKde8EqE2dRFlJ6eJIOfr+qqAauCmzsCzB3MpFRE/wVOTXXLtC4wqpaUA9j0p8GPp+d7FEfImoE+jGVVt/7FVHn3lQWbBduKBJhDnQ232Xt+s7Rb6QJ2FWsNq4CaDnTii7TUl9Q4CTkCyfsZRvYrJtFbuIbYL/45I1SrgzgmYsWZJXwKKOsjHe7ujrRHF3/6H0iUsLok1bckiBSLXbuyCxs71Cr+w9SkPJX0s/B97MyV2BP1uakDOJIia+ZVJ9Q1kmczyzhABDqfx3XqxOv209y1dl4KwKEA+IZbHVX2zfGjA6AaMnsCtaDE60RKYNokXVICSfNqux94Gh5iSsl1rIk5g2cBdSXStdEu0r8+JJqzBzgjN0vXEzFTeNhsq7vEqevPl20jdy+6A9KHmY1C/aSkcVWn+cW+P6M6uG2pRPUOm3J4lG7M5DDaE+GNjXJVZJuZ7yKsP2s+iyGieZjM73oa3H30eYtYy2JI/Iurawb7My/ca5+e1KLk4phb+OQyC0q+MtmM2sHdHw07VIz+q18lyLoZi/3BKC8LIgyReALZnCIwLYbR3l+ALkWZowv/eqrM79KLqrF48jELP8MWheiJ 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: 2c122c58-b7c9-403d-43c2-08dad67ef5b8 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Dec 2022 05:10:00.2595 (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: my17+UVvlbVWw8iGR9BffwN7cF5eYUguTixFZz72hYefoxyt1Rr5biGQbIMaUheK9F077MKWrI6v64fQ2y5e+w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: HKAPR04MB4035 X-Proofpoint-ORIG-GUID: 6RS2H4Y59rOtN1htMyceAIpqss5IQGyi X-Proofpoint-GUID: 6RS2H4Y59rOtN1htMyceAIpqss5IQGyi X-Sony-Outbound-GUID: 6RS2H4Y59rOtN1htMyceAIpqss5IQGyi X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-05_01,2022-12-01_01,2022-06-22_01 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org There is no need to call ilog2() for the conversions between cluster and dentry in exfat_readdir(), because these conversions can be replaced with EXFAT_DEN_TO_CLU()/EXFAT_CLU_TO_DEN(). Code refinement, no functional changes. Signed-off-by: Yuezhang Mo Reviewed-by: Andy Wu Reviewed-by: Aoyama Wataru --- fs/exfat/dir.c | 9 ++++----- fs/exfat/exfat_fs.h | 10 ++++++++-- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/fs/exfat/dir.c b/fs/exfat/dir.c index c05493fc9124..397ea2d98848 100644 --- a/fs/exfat/dir.c +++ b/fs/exfat/dir.c @@ -61,7 +61,7 @@ static void exfat_get_uniname_from_ext_entry(struct super_block *sb, /* read a directory entry from the opened directory */ static int exfat_readdir(struct inode *inode, loff_t *cpos, struct exfat_dir_entry *dir_entry) { - int i, dentries_per_clu, dentries_per_clu_bits = 0, num_ext; + int i, dentries_per_clu, num_ext; unsigned int type, clu_offset, max_dentries; struct exfat_chain dir, clu; struct exfat_uni_name uni_name; @@ -83,11 +83,10 @@ static int exfat_readdir(struct inode *inode, loff_t *cpos, struct exfat_dir_ent EXFAT_B_TO_CLU(i_size_read(inode), sbi), ei->flags); dentries_per_clu = sbi->dentries_per_clu; - dentries_per_clu_bits = ilog2(dentries_per_clu); max_dentries = (unsigned int)min_t(u64, MAX_EXFAT_DENTRIES, - (u64)sbi->num_clusters << dentries_per_clu_bits); + (u64)EXFAT_CLU_TO_DEN(sbi->num_clusters, sbi)); - clu_offset = dentry >> dentries_per_clu_bits; + clu_offset = EXFAT_DEN_TO_CLU(dentry, sbi); exfat_chain_dup(&clu, &dir); if (clu.flags == ALLOC_NO_FAT_CHAIN) { @@ -162,7 +161,7 @@ static int exfat_readdir(struct inode *inode, loff_t *cpos, struct exfat_dir_ent dir_entry->entry = dentry; brelse(bh); - ei->hint_bmap.off = dentry >> dentries_per_clu_bits; + ei->hint_bmap.off = EXFAT_DEN_TO_CLU(dentry, sbi); ei->hint_bmap.clu = clu.dir; *cpos = EXFAT_DEN_TO_B(dentry + 1 + num_ext); diff --git a/fs/exfat/exfat_fs.h b/fs/exfat/exfat_fs.h index 324acc57d029..37e8af8042aa 100644 --- a/fs/exfat/exfat_fs.h +++ b/fs/exfat/exfat_fs.h @@ -101,11 +101,17 @@ enum { /* * helpers for block size to dentry size conversion. */ -#define EXFAT_B_TO_DEN_IDX(b, sbi) \ - ((b) << ((sbi)->cluster_size_bits - DENTRY_SIZE_BITS)) #define EXFAT_B_TO_DEN(b) ((b) >> DENTRY_SIZE_BITS) #define EXFAT_DEN_TO_B(b) ((b) << DENTRY_SIZE_BITS) +/* + * helpers for cluster size to dentry size conversion. + */ +#define EXFAT_CLU_TO_DEN(clu, sbi) \ + ((clu) << ((sbi)->cluster_size_bits - DENTRY_SIZE_BITS)) +#define EXFAT_DEN_TO_CLU(dentry, sbi) \ + ((dentry) >> ((sbi)->cluster_size_bits - DENTRY_SIZE_BITS)) + /* * helpers for fat entry. */ From patchwork Mon Dec 5 05:14:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuezhang.Mo@sony.com" X-Patchwork-Id: 13064135 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 41D15C4321E for ; Mon, 5 Dec 2022 05:17:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231555AbiLEFRN (ORCPT ); Mon, 5 Dec 2022 00:17:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231175AbiLEFRL (ORCPT ); Mon, 5 Dec 2022 00:17:11 -0500 Received: from mx07-001d1705.pphosted.com (mx07-001d1705.pphosted.com [185.132.183.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 061A9331; Sun, 4 Dec 2022 21:17:09 -0800 (PST) Received: from pps.filterd (m0209326.ppops.net [127.0.0.1]) by mx08-001d1705.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2B54TTSq024648; Mon, 5 Dec 2022 05:16:57 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=iBj07h2SdMFEsf8LZAE/mWaTKdfHGp4yQIyyvjn2Kdo=; b=E6Mg1wU/V17L2tQYDvjdwoANzaarcIrBbJwshs6osd1bz5rAU2lu06H5EWwpy7HWS3gB plysGeod7wWV7bJW0mBQHPbiy+kKXkYBde97Be8yf8YugYwZDhGrIhCOkFJJlFssLJ/q H3Ublts3HvPRsTj3wRlcBJd7b6KaQChQEMPNksdrM1kVZt5a6kCb1oyerA9wgINlqmQ2 xiUtobLEpaJdRj9GFz97RRyEkoojBX8giBPxqP43iRs1x3Nt2SsuAt3fzNE9OWQPfbT7 MGXPkcKqBwmZbrvafHEHo5gnIujLMb0/RTyYjJoVrE/2LoUSYvJmvsHEq4uYX6zYD7Of UA== Received: from apc01-sg2-obe.outbound.protection.outlook.com (mail-sgaapc01lp2111.outbound.protection.outlook.com [104.47.26.111]) by mx08-001d1705.pphosted.com (PPS) with ESMTPS id 3m7yen19vp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 05 Dec 2022 05:16:57 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JSGhgaProBxfAgBbQ9zxorrq6xyK7vzIAD5Ot/JiG2fWv62PLpfN6EaZdZlcUND1sEG/u7w7XobcG3MEUR7ZZRCLtom1ojKGlPV1RADiLDc8gsQvNMT9jtkSB3/1hRGb2xd1nctrSCJH/uKGYNBOjwo/CALhVBhGHb+mpJbXYfhesioVXS3uCo9KF5qiiA84ZCL0wxBYa2/yFjDf5YGtjlaYReEv86k/bGm8HRfXMa1szVrOvWt2BGMtzCZH7/mw4rNzz4tf0MLsrnlU5P6kQSXL4uVYK/+WiY4Cap2HHDSMHoWcaTIH7eFF5M0W5ACE6pDKh5qx8SWl3AIhKv20mg== 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=iBj07h2SdMFEsf8LZAE/mWaTKdfHGp4yQIyyvjn2Kdo=; b=akSbij0Mn6TEwGPNoZ5hYGVKdYWnWm3w4iAqZSfPpO2MEDrgvKv6LV0UuWuTQ3SsHj9sUfEMW0e8VyGpdd4OAeiaDBwGQK9mp9nbQBGFyT3x7m2wASEGoNajNS7w/IfGFCQDH6QCYUsQK9tdosg6iEXds2hw1P4bi5EuVzMZPkeBfEJLT+czHjLkpOHLiLLKh2DkcCgVRl4+/H0G60WIqfrzBefi5PLmnYFvbWnZhhfXraTZHeSCCpZDU4As1uPzFTAaDABnMvASvKcBu3iEbtTBc1T2U1wmwJMw36UTguH8FHpDNz+390gk8HCQbyyRKgknJzw/1X8zP+/noAF89w== 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 PSAPR04MB4166.apcprd04.prod.outlook.com (2603:1096:301:3d::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.14; Mon, 5 Dec 2022 05:14:05 +0000 Received: from PUZPR04MB6316.apcprd04.prod.outlook.com ([fe80::c689:d665:b3a2:d4de]) by PUZPR04MB6316.apcprd04.prod.outlook.com ([fe80::c689:d665:b3a2:d4de%6]) with mapi id 15.20.5880.008; Mon, 5 Dec 2022 05:14:05 +0000 From: "Yuezhang.Mo@sony.com" To: "linkinjeon@kernel.org" , "sj1557.seo@samsung.com" CC: "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: [PATCH v1 2/6] exfat: remove unneeded codes from __exfat_rename() Thread-Topic: [PATCH v1 2/6] exfat: remove unneeded codes from __exfat_rename() Thread-Index: AdkIaFX5kufhihWgQh+oIh/p8AZ4IQ== Date: Mon, 5 Dec 2022 05:14:05 +0000 Message-ID: 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_|PSAPR04MB4166:EE_ x-ms-office365-filtering-correlation-id: 8f794ed1-b7ef-40db-3649-08dad67f8814 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 8cKXA1q5xcG5rrw0tqT5qz2CvUzepBUk1uxwWsNpFL/MxPncds7poDDuPcTVEWSx2S5ax32DZbixeAdQYzBfx9UQXJA6YHuLa8HZ3YDea2Q03kl7JUk19avBcXOAraXY5scOtxU6YuayqHutmDPCBJJxtSXf1ChzD/VjVGCzjzPsJPqUgCcNDLPJPwhPRQ1ZdVXtKNTP0FrZnvY4gkUV/Wh/JdxvwIKGtgPgCOcGsBxfbJ7Z3M97KqedjdVJa6I/kCsS7jv8YuL+XC0TE9QyceFZm+NXQg/BTMHZdNoBkyCOt4p5lcmZ2f1wdYav0GmU6ShgFpXvcsdyrwQL0f6ijQ+YUMDUsVuSPaDyCwCjtGrAq6F8q//Gw9ZJrrfGYXWBs5Dahn07q0enTmtKXs8QRgPt4uvk4iYTtaHrypZuSJDPYCVuP7OekFCB10PhG8dMwQDRijpFLDqiL+ANaodo+faEc+j6SZTpuFBqLoVbbMc0vyEuaGlu8z5gQrKmTGmT9rMPNpPBkrUZUuY0k2Wh1mbR2x+XUT/HRViTSLCT9v084qnUlTZ94d4r6G9GTY+5rNeY8dqRlCglZ8bkqDxIbPatFJ4tOP1FZEiEp8F6p4JrZ5fo2iMZB6CkrCcv8CADEw1RL1AktbkhoXoyHXpeGD4eGKVbpUgSnHcP1NEu22g8W1zgqzHHmADfCO+qk9YD8UGM6hkfPG3DBdJ+ElSZJw== 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)(376002)(366004)(396003)(346002)(39860400002)(136003)(451199015)(8936002)(5660300002)(316002)(8676002)(4326008)(66946007)(41300700001)(110136005)(64756008)(76116006)(66556008)(66446008)(66476007)(54906003)(86362001)(33656002)(478600001)(71200400001)(55016003)(9686003)(7696005)(6506007)(2906002)(38070700005)(26005)(186003)(52536014)(122000001)(83380400001)(38100700002)(82960400001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?fgy4P+9tnNJdnu80vrxRIVESbiMi?= =?utf-8?q?hlWYEh+/RANungiVK/r6Ux15ypmn+DEVlO7K+GABSTabOQrknLcfHU+K7OLggmlUJ?= =?utf-8?q?6S5VoWJj9l8I/Fi+oDW6d0iiL71SU8mHHtmljX5+iBEENVefP6fKPmjP7zwDBblVK?= =?utf-8?q?ys9gfjVxrXysK5sSg2EXsTb9RwqLOXH7OeZ1xejl0UgUmgC9n0FAbDHQ9JyR1eVi5?= =?utf-8?q?OI0ezXfS602FB4TQp56Y5X7g999wZydRjNU3V6TmBuMDaa1PCdArHlQA4XlCRkDg8?= =?utf-8?q?AqCMwHI2gCk4TYKKD6ho26X608XYKRc4j8jN8s6DPJb76yAGujNEywSV4tBDZutWZ?= =?utf-8?q?t3x5RxcnDK1erLAHofl5iATvNxIl3VEHdpubL5A9/lBq9OTH9UhpxPtq9qN4WQiK2?= =?utf-8?q?itIHbJefuvIO3mMFsSDgi5RFRXvEVQxdcBveOj7lkSuqnLPYj3Je6gXrMZ0QdFQtR?= =?utf-8?q?mpeFduSoJ3PV9TB8QQpAc83NaaWpYvgZpPrMHPXQqgX6oesnZQu0NNkNVNihiztva?= =?utf-8?q?KsljvHyrSEepoGqKjIIdZPpfBVsQxU4OH3bDk0dgu5K3jnQTS4HuW2zLzF5Hgz7Px?= =?utf-8?q?38hGPyxO1FX2y6gq3D6QUkXM9I5fYon57FqclqkdbTPysLWancaJ3kwKKhGVsPd2j?= =?utf-8?q?qrlGXc6GY/YXT0kjpiWwyxZ3oiAy8DImwHpm68F9yczJPl2uT9m/2lq0fVwa8tKTQ?= =?utf-8?q?jewTq8778DVvqiPL5y74yTxCO1Nmza7mn3vJWdZn/YxxO9MTmx9QKeqCNZv7KZQdh?= =?utf-8?q?c90PYsowHU4EKb94yqSNoBn3xm1KjAD62mp8C1ca0QCs8eC3p0ZIzaF9Wf8/z0T5H?= =?utf-8?q?4VPTWWFgk016ufj8DOD6AAHdV4u/wPxW8+9/l6YTDY3bnOd87ZMUuXsmt06xWJng5?= =?utf-8?q?jRfi0PdMf9MWusvkqcqBUCcyQvctOM1GGAKS24myI7ogEIp+kwOpRp1i1mWucoXgx?= =?utf-8?q?b9g5JvJlyQdsYkzY3I64+vc8WaNIjw4VbIQToPbtgmEKoajUuAa78v1yxWlpqrfQj?= =?utf-8?q?L9l+9LjvZWtuXbhzP0eEuTDtsgPxXATDBsqA5Hr/CDi9M6E8CdgLI52HY5Edho+b/?= =?utf-8?q?ou98Dhl6StPbQBIWh+sg35+aeLV7ZRlc2quQxo5ZozyOjy5C/ECnIiXV4yCkk+3vN?= =?utf-8?q?bAeYudasGtaT2auv8upYzPqBl9L+NhVqWlP74DKUvfuyu7xHUH0v0WITwpd3TMap1?= =?utf-8?q?nQtKJ7f56sjfLNifjpq+2Dbf7T+QKxPLJ6GZmCXHohU8YCIRFokFomrXNPN4r+MHz?= =?utf-8?q?uorHl4W+6D4Dg+F2msr0Kk9cpXSG+kquk+V2vTQBC4RqMw7Je7n33mCrct5fo1vEe?= =?utf-8?q?6WH3tbA56iiPrJ4MSBfbAHBtw+CJoBwvlmUyWP55J47rGSZuEwxyFqRVY+1ZfHBwy?= =?utf-8?q?JIV2qKoGVcNxa+dCWILsk4yKijoB2A38bDdmLdNtj+GiWmquYD+AcZDbw+PWk1L49?= =?utf-8?q?VZs8lCl77cyV5S6o6q6nCaX91rYfTOy03zbfQZzux9aKwljG6qACOjskcbj9/DTil?= =?utf-8?q?GqXsIiCJk3yM?= MIME-Version: 1.0 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: igmAgz0sW5UOKg25TV1XR7cej1wamFSJvtsJ4GJ3mf0iayeUbyChnSYHrrlodLh0ShUpZc27e3Plpk0aF6v/vugUeNfG3WCYJEu8A4HMKb3SzuVSUILudqrsWYHTjaXNRe8b5fnRBeFepU+eHELURMTStNO2L6FDvr3oddv0rI0NUH8itsvul0GOBfwHGFkOCO2AXmrJ/QCl/f4NGkqsgWFIKzbVZjMch/rjaXAXDygbcf/0+YzuEDR6M8RuryDzXOgsSQy9BlFJ3yxS0zEhDa2IISqB6w096muUv5LH4WuIv+0AJ4f3/vtqcNMkOmaMpzTi0KqS5RqSNYnL05/N/TA4CIpSNNI11C3PmobkHGBxdnbj7iLbt8HWiSX2xFJoh/u68jXtl39I549nPjXv4FdzQDto2JpWxYzxh64SVKLvKxLxlvnY45F1nEMSLXzRnqwn7mnKhfmeaN+FQcczflYXrODiHf9Ad49NYz2Gr599NU4prB4nrjysQzxCfB7DC42na9+36Dno6q2xzN72YxH/348tm+JvgiPnx3o0xw98aIWHqSEAkpKazV6N8h4Ola6U0tw+1SU/IgnlFxE2A6vPxdHVoQzEMJdFhbqZZYZNKDo1I6PcjS0IlbUHKdg6J/KSuExCz0C/pf3NDWuPlnxpfoW7u625LK/IsVfsT9XMAy0O25P0AKFdhBQoI8I4CZjFfVGdTu2q9k55BLUAJOR6sopGQkJeFSJkBOEBBfVRMnxd+FboP96pHNSTvKq9xQBGEBWRQJ69pRDsa1nkqY5VafQcF9R5w1GBaFfJNEHUIdFqOkvLHJIV+0UEBHpa3S5i9nLyYC3kA/YmGcQDHKdPpHoPYv3JCiDpT0Vco82msDaMP77uADVCHBwfwzLr 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: 8f794ed1-b7ef-40db-3649-08dad67f8814 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Dec 2022 05:14:05.8406 (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: VzVmPkOb++Q87pkTRnZH5YMEicj81ryZ9KvNG1eAdX2/hl9w1T+CffQI2hYAmP0Lk2PgFS0UvOe0CGDHDIwSVg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PSAPR04MB4166 X-Proofpoint-GUID: IwZujAylVIf3ATr5bYp4FXk0UpLDz5QD X-Proofpoint-ORIG-GUID: IwZujAylVIf3ATr5bYp4FXk0UpLDz5QD X-Sony-Outbound-GUID: IwZujAylVIf3ATr5bYp4FXk0UpLDz5QD X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-05_01,2022-12-01_01,2022-06-22_01 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org The code gets the dentry, but the dentry is not used, remove the code. Code refinement, no functional changes. Signed-off-by: Yuezhang Mo Reviewed-by: Andy Wu Reviewed-by: Aoyama Wataru --- fs/exfat/namei.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/fs/exfat/namei.c b/fs/exfat/namei.c index 01e4e8c60bbe..347c8df45bd0 100644 --- a/fs/exfat/namei.c +++ b/fs/exfat/namei.c @@ -1175,7 +1175,7 @@ static int __exfat_rename(struct inode *old_parent_inode, struct exfat_inode_info *new_ei = NULL; unsigned int new_entry_type = TYPE_UNUSED; int new_entry = 0; - struct buffer_head *old_bh, *new_bh = NULL; + struct buffer_head *new_bh = NULL; /* check the validity of pointer parameters */ if (new_path == NULL || strlen(new_path) == 0) @@ -1191,13 +1191,6 @@ static int __exfat_rename(struct inode *old_parent_inode, EXFAT_I(old_parent_inode)->flags); dentry = ei->entry; - ep = exfat_get_dentry(sb, &olddir, dentry, &old_bh); - if (!ep) { - ret = -EIO; - goto out; - } - brelse(old_bh); - /* check whether new dir is existing directory and empty */ if (new_inode) { ret = -EIO; From patchwork Mon Dec 5 05:10:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuezhang.Mo@sony.com" X-Patchwork-Id: 13064130 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 E2204C47089 for ; Mon, 5 Dec 2022 05:10:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231500AbiLEFKg (ORCPT ); Mon, 5 Dec 2022 00:10:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231463AbiLEFKe (ORCPT ); Mon, 5 Dec 2022 00:10:34 -0500 Received: from mx08-001d1705.pphosted.com (mx08-001d1705.pphosted.com [185.183.30.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2894FDEA2; Sun, 4 Dec 2022 21:10:32 -0800 (PST) Received: from pps.filterd (m0209319.ppops.net [127.0.0.1]) by mx08-001d1705.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2B5445uA006120; Mon, 5 Dec 2022 05:10:15 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=QhH9VyPGdNTGqWkZmSmt0Hm58Ex/kwEIfhsELooyTIE=; b=S91fQx3+IBD5ElcY5WOHeBtm+TE1VnE0GNOoYrvd++2PeGpHNHY1SQAQqTmuW3bimwTo I+DmTGZYrQ3cr4XvJobquhiEu3DY9PDvMVSN7+xmC+Vyj+tQgkywxtz0kPM8nhhUFqLe 14nw6IkUM92t7FWiaRoM48UFY4AQcNteWex/K2TIM6Eju0kbVdzOLV4pcGY5Ob8UHTtF HAu9W6LczccKFKBOkt63AFw5R8l022Zc9FDcw86bKiRi54DiOg040JvATa+7cFtamxA4 GE1FOkKhI+Z4zG8TQ5b7x8Jmm+Es2AQQY+XPKOKdgg/gdB0xdBohMVYps/qIFuE0aJ8X ZQ== Received: from apc01-tyz-obe.outbound.protection.outlook.com (mail-tyzapc01lp2040.outbound.protection.outlook.com [104.47.110.40]) by mx08-001d1705.pphosted.com (PPS) with ESMTPS id 3m7yfghadc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 05 Dec 2022 05:10:15 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WoAS7B1vg3XKg85ff5lYLxBayoujEYxA/WSbj4XZBSSCijPXQYy8nFcEwWnXPrApyhxCLyeYC57LM7yYYICQZSRAHx6Ja8Q9f6iUrG4JH/ZpAbYLRSz/4YViAKECjvLldSOAt80CMFfVW5feHfzExlWqTdU1kPpErHHUF2zNFdQJQW/TSvwuFbcP4PenVZCTJiQY7ZAh1i+oqpkp4yMNqv406IrBAOsEMBoGfIQ7hsTjoLI/WFG0rlBEL/1I7/6pKln9S0ox1/h9GM4T5utcNaldRPnTJNozg7xQQO+50pu8fMbpNc3JMVEJwI3SCggk8eoLgC+U08V1ezFN4nqTOw== 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=QhH9VyPGdNTGqWkZmSmt0Hm58Ex/kwEIfhsELooyTIE=; b=S4GTRvgFICEuJRhPyZ9xcpxIKmiI0JbTY0JU7CaLHmOY2FE7lL0Myvo5PFAuFEDjuQph56qfBjFVBzxdWMtZ9tPDQSp4CYDOu26aE/gbWAJ9vHTrouGYgaEdixvNzPAvs7IBO9yK5nVltjKt9FN7WWkdmMAzCu/Ihv0pO/tTryUYn/D7HOVsKh/3Z7JtwPNcgIvEmM9IUp8yaDM3+PHCjQ/a6y8nOAnrmsYWnDKDUlOT4BNvkKpWPNWp3mtcx381tE1m28QkN13w+jFwjARbJ7P7lzVwwpH6xU8ZJMbIkqaF8hSi4iKobbD1XyVMisCKI41/5d+FyAldm9e4MKFi4w== 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 PSBPR04MB3909.apcprd04.prod.outlook.com (2603:1096:301:2::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.14; Mon, 5 Dec 2022 05:10:10 +0000 Received: from PUZPR04MB6316.apcprd04.prod.outlook.com ([fe80::c689:d665:b3a2:d4de]) by PUZPR04MB6316.apcprd04.prod.outlook.com ([fe80::c689:d665:b3a2:d4de%6]) with mapi id 15.20.5880.008; Mon, 5 Dec 2022 05:10:10 +0000 From: "Yuezhang.Mo@sony.com" To: "linkinjeon@kernel.org" , "sj1557.seo@samsung.com" CC: "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Andy.Wu@sony.com" , "Wataru.Aoyama@sony.com" Subject: [PATCH v1 3/6] exfat: remove unnecessary arguments from exfat_find_dir_entry() Thread-Topic: [PATCH v1 3/6] exfat: remove unnecessary arguments from exfat_find_dir_entry() Thread-Index: AdkIZj3HTv953xMKQy2/a3f6bPetrQ== Date: Mon, 5 Dec 2022 05:10:09 +0000 Message-ID: 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_|PSBPR04MB3909:EE_ x-ms-office365-filtering-correlation-id: a3c5e62f-2e23-4360-a968-08dad67efb83 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: GIF/UtOfx2FewT3uqEKEtTERSABuFl/p7mVkNcepqm442VXM2SONxnt/vlFMtXryX/LKrnSAercIoG6k55ftqcddYEH4DlLsXeFZB2uuoSmE5sZ4VF5BcJdfUGpIGFtp+tcX8EOMLzWDVQQFZkiX6DeP04XG8e8xnA/omp9ExieGRIsMTmCmaAtuZDeMtrZPDG3w2Uiqp67syPyOCD0FNp7uQTSAK3OTlTTISFKP4mKp/cX0iYQc7Rc/BQ9t7jDjaZI5YVhilzogF40hYsOd6zxBvbs6wPNoedVHsIPHMo/G4KErrhVUQAPA0uKBV63atX6K7AtOeCAlueX3Ahd31UB/Sm7NNxdzGBj5w4NTrnFn+pokFMzbGWnbK16H/sGnJkmFa7Gp9yr6Y42wog9BU2IjODkjsnuoN3D+1feO8dTQ4TD+Rqm5JlcIjp+AJZEwLTUyX+mAVcbh9zcMiLeDPV+2e68XjxHswf0PN+C596ZT+lQoeRX8jrZxlhnGAYG8D1RsYGW2AZREMd2SwwsRgsy6TGTUMvy+ggkdapYXP0o8By6OmFoDauLXdGx9HemdCz3PHlqUp6spfWs4hZ8I8xJR/mtU5KqPbx1oVGujpWsKa5hFKJDlVBUxWcKggBtJGIwbnaRODfAXQPqqX/xnc2Hck2s8OkElcRGEl+scMhpjLv4QuNtmMLp/IQrsJFzJtWgtW/Db1JKIBbUxd15i2w== 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)(366004)(396003)(136003)(346002)(376002)(451199015)(26005)(316002)(107886003)(478600001)(6506007)(7696005)(54906003)(110136005)(9686003)(71200400001)(76116006)(66556008)(66476007)(8676002)(66946007)(4326008)(64756008)(66446008)(8936002)(52536014)(5660300002)(186003)(83380400001)(41300700001)(2906002)(122000001)(38100700002)(82960400001)(38070700005)(55016003)(86362001)(33656002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?Ax9vyVHt5hj017zB/jU36jBKe226?= =?utf-8?q?H7s+elrLT7ODSPe7EhRidUv7w0uicE7JuiOUYmmxLm9A4qdw51Ibi+CYOdFBS8YV0?= =?utf-8?q?ademNUt9szanX/VTZE6+tLb9B8RFIGMv95Gun1r77gKJtI1OmyHk6RR0XQwha6QNo?= =?utf-8?q?7WVGatC4jM6YBxXyMPfnPdnMfjmuVjF1joHFlSq3+asFsXRFHASmR70slOkyDJKQm?= =?utf-8?q?wJIczN3kBQdQ6TPIhQjC/j8fAWC6yOZ+HxKCtU4L8wdAI/diMY8WgzQqk7CerUlea?= =?utf-8?q?BXzmjv15xc65hhtM608+bPy3HTi0vB5Ys3ekwlZeTHRGjXu+OqJeNmQOCvoJCKtnt?= =?utf-8?q?S1vc0WH3/hARMNvDvKm4Z158Wg5aWM01run4kKfCpjQpvwYtBvvcufIZcIil72efh?= =?utf-8?q?uowU9/HW8SWpWbukbIMjLUx+Dt398PpQnxnF8u4yus4VRCXmCslKlJTvmP4FZFWc9?= =?utf-8?q?zqS0zx2jhS1fTniITqiU46PZ/a16s1kLbi1yJgtwV8lcQlFQ1gULkoWBrxxVJsGPK?= =?utf-8?q?GnEU2dtd34MnwP1zNB0Ji/labCCd4F1tM/PmUp+U2mlHRzMUQDCMOor/VNqQmKMnc?= =?utf-8?q?C7XCdH1d7jgeBdIR1mZwo2cFgMvpCyWQA8820kr3PQSPAH+zgFRWGMFgx2uvueInX?= =?utf-8?q?SpqcW9wjFKSsCn4LOySdck7HPNi/XS303wpXlrzYx5gLvWT0wUCRsc09QXht1tgF4?= =?utf-8?q?zq/PsGYvHNBfj39xdW/bVQ3gvHJWTBET1JUKLVcGtZcuCU5u/1uoFPq37RNpytvQN?= =?utf-8?q?w0z/nxRwS7fQgqDeBTapVgmCeKdaP60h9lc+kAQYenknYzaVSoNdvRxhXrPwkguXp?= =?utf-8?q?3k7ExHlui9KUhZww9D08tFX+pJmBtwpdcGSsgIaj7rnfIRdGlU5TiKVPgeJLK3cWH?= =?utf-8?q?zoe152rHs3v/9H/CBpWDVZbwL31cTv13v2gCoi/BhuwxBUbaEVu9oT0xVKdTKucdU?= =?utf-8?q?2WM0gJdwGlobX2vbrCqWRaTmeR1zcrXuRBpy8PcXKqbnbeaBYM9OlKUfjQzlwaed/?= =?utf-8?q?lGgETTlKYQQIpcKoVaDZZ+zDd4INaIw4lvLQa1jiW3jKBKThPsNlvWd2XKBk8byS9?= =?utf-8?q?Li2kgMoQV9BNYVIgy/9S5uIBPbZO15/O9nHGVNUu/BK+zFJUCwUK52FB+Qp+wlQb1?= =?utf-8?q?2dj65Kj/n9GB5g9Sh39ZzL1SIGeF4DCCNwzkhbTdKx7kFLAtRvI+eHgxpFsPXTP7e?= =?utf-8?q?x5TlPuGuYTXpzLK+fXIO5La4uyTzsikZUNaPNwZ+8zkEiHrKkkfz1A+cRqHLuv0U5?= =?utf-8?q?7AG+bn4kLuwFrh4nUPmRVnFZB+GvmrRxruIchLgbw5VGrzKEP5JgTHFCfLH1+hOA+?= =?utf-8?q?AGUc7iwZvVyDdnMIDOy4k8i3ifS5zrjz4rc8ZbVWhAVbSA08AvV0KViqvQbfIr7YR?= =?utf-8?q?gtkgevbtzs0nA+aOOeB6OorK0VYVnmekgwVmE6CHEDs66DenDWRO2Cc0pP6okOWK0?= =?utf-8?q?1TQuLUJmYMF2qr//tXDyzp2oXVpQyjRO1OjtJlmB6ty/oHHiqz/Nge66li7gBA/+4?= =?utf-8?q?BEkZZvSXx9nY?= MIME-Version: 1.0 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: AupgN5D95/UfZA9hs42AWpHeP/wy7ozjAqq8437uYa7iK1ux0OumeN8JbPTxKW0Cl32c3h2SIVIbJD+E2HJI613KCBl309OyR6RWkCkhzcxqzq+HhhLmflPqez3XBaKJ5oiJ5l1DwxVROPDvJMVeHPO8S41j72hDRhHOJOBrBYFBkqwwoTzlhkKylRUHeyFoMIhdzaiYMPu2Qasq5sCM1DNAOsn+sqmZlj9gzfuhc1iW9nyW5D4Jpf21HSapkcTYJHd4Y7/YzuBP9lGGWnnP4yATDjlD/lNIM/bCiI1XBSxMcIqx0EKLM4cxTpd4IUl2o2uawalnD6T0Ueef/4HtJgBUUMOsnutdBL9U2YHvC5+EIa+DPa4UyPu+r+6Ncg+y+zflN4LTQh2OBxZUu6DyQiEUURiCTUOtQtfhfo9jkBYLYVs0gtkh4kSAmJGMjbP/gDLvQRmEbXmvdQUc0hVPD4UkuT75DGfA0zNjztZuRDAOi1btfJ2U1QTmjMSBQAPs4zzAgYsJ+itTHAN0B3TSjntM6+qta3/sYfBP7tUZaIW8Jh8v+yVbLmMh5KJ/VqSM7j3Nv4A+okpQyHQsag4pAGOyknrY3WMB7bdbRcLSfM4Df+qZ1Dmd4vwdu2WUuGR507FP0cZl5XdoRT454BhFluw++GY3sLnto7DXHZttSYF3JVV2BXtTMuZ6WyyFTASGSrVMXIFvfZAzyw/lAQna+R+Glx/PvzgVJLKXzu7OXqJlHk4vr/+BuAzUZAQQUm94do+ShztLScvR0jne1Kvykn0KljurDU2mcyOEPTSajC5wmOFkMBdIhOsgr2/5sreJFnUQgPsrmV82q5U+iM5mN2pPoKBbMlViCoKdMC0moriRJ1yWzKcSIEVmoz8af7ND 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: a3c5e62f-2e23-4360-a968-08dad67efb83 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Dec 2022 05:10:09.9654 (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: Sk5VaZwQmJFJw13bycR41tEbvpyXHHoC8rzKGgcwo30pB0v1kjxW3zy+iin0gb22rxqjlXxEO+J1nQHxXX8HPA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PSBPR04MB3909 X-Proofpoint-GUID: H4u1S6m0n4qdrO1IqV--v2ATmot5yZ2L X-Proofpoint-ORIG-GUID: H4u1S6m0n4qdrO1IqV--v2ATmot5yZ2L X-Sony-Outbound-GUID: H4u1S6m0n4qdrO1IqV--v2ATmot5yZ2L X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-05_01,2022-12-01_01,2022-06-22_01 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org This commit removes argument 'num_entries' and 'type' from exfat_find_dir_entry(). Code refinement, no functional changes. Signed-off-by: Yuezhang Mo Reviewed-by: Andy Wu Reviewed-by: Aoyama Wataru --- fs/exfat/dir.c | 12 +++++++----- fs/exfat/exfat_fs.h | 3 +-- fs/exfat/namei.c | 10 ++-------- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/fs/exfat/dir.c b/fs/exfat/dir.c index 397ea2d98848..8121a7e073bc 100644 --- a/fs/exfat/dir.c +++ b/fs/exfat/dir.c @@ -956,7 +956,7 @@ enum { */ int exfat_find_dir_entry(struct super_block *sb, struct exfat_inode_info *ei, struct exfat_chain *p_dir, struct exfat_uni_name *p_uniname, - int num_entries, unsigned int type, struct exfat_hint *hint_opt) + struct exfat_hint *hint_opt) { int i, rewind = 0, dentry = 0, end_eidx = 0, num_ext = 0, len; int order, step, name_len = 0; @@ -967,6 +967,10 @@ int exfat_find_dir_entry(struct super_block *sb, struct exfat_inode_info *ei, struct exfat_hint *hint_stat = &ei->hint_stat; struct exfat_hint_femp candi_empty; struct exfat_sb_info *sbi = EXFAT_SB(sb); + int num_entries = exfat_calc_num_entries(p_uniname); + + if (num_entries < 0) + return num_entries; dentries_per_clu = sbi->dentries_per_clu; @@ -1020,10 +1024,8 @@ int exfat_find_dir_entry(struct super_block *sb, struct exfat_inode_info *ei, step = DIRENT_STEP_FILE; hint_opt->clu = clu.dir; hint_opt->eidx = i; - if (type == TYPE_ALL || type == entry_type) { - num_ext = ep->dentry.file.num_ext; - step = DIRENT_STEP_STRM; - } + num_ext = ep->dentry.file.num_ext; + step = DIRENT_STEP_STRM; brelse(bh); continue; } diff --git a/fs/exfat/exfat_fs.h b/fs/exfat/exfat_fs.h index 37e8af8042aa..21fec01d68ff 100644 --- a/fs/exfat/exfat_fs.h +++ b/fs/exfat/exfat_fs.h @@ -71,7 +71,6 @@ enum { #define TYPE_PADDING 0x0402 #define TYPE_ACLTAB 0x0403 #define TYPE_BENIGN_SEC 0x0800 -#define TYPE_ALL 0x0FFF #define MAX_CHARSET_SIZE 6 /* max size of multi-byte character */ #define MAX_NAME_LENGTH 255 /* max len of file name excluding NULL */ @@ -490,7 +489,7 @@ void exfat_update_dir_chksum_with_entry_set(struct exfat_entry_set_cache *es); int exfat_calc_num_entries(struct exfat_uni_name *p_uniname); int exfat_find_dir_entry(struct super_block *sb, struct exfat_inode_info *ei, struct exfat_chain *p_dir, struct exfat_uni_name *p_uniname, - int num_entries, unsigned int type, struct exfat_hint *hint_opt); + struct exfat_hint *hint_opt); int exfat_alloc_new_dir(struct inode *inode, struct exfat_chain *clu); struct exfat_dentry *exfat_get_dentry(struct super_block *sb, struct exfat_chain *p_dir, int entry, struct buffer_head **bh); diff --git a/fs/exfat/namei.c b/fs/exfat/namei.c index 347c8df45bd0..5f995eba5dbb 100644 --- a/fs/exfat/namei.c +++ b/fs/exfat/namei.c @@ -597,7 +597,7 @@ static int exfat_create(struct user_namespace *mnt_userns, struct inode *dir, static int exfat_find(struct inode *dir, struct qstr *qname, struct exfat_dir_entry *info) { - int ret, dentry, num_entries, count; + int ret, dentry, count; struct exfat_chain cdir; struct exfat_uni_name uni_name; struct super_block *sb = dir->i_sb; @@ -616,10 +616,6 @@ static int exfat_find(struct inode *dir, struct qstr *qname, if (ret) return ret; - num_entries = exfat_calc_num_entries(&uni_name); - if (num_entries < 0) - return num_entries; - /* check the validation of hint_stat and initialize it if required */ if (ei->version != (inode_peek_iversion_raw(dir) & 0xffffffff)) { ei->hint_stat.clu = cdir.dir; @@ -629,9 +625,7 @@ static int exfat_find(struct inode *dir, struct qstr *qname, } /* search the file name for directories */ - dentry = exfat_find_dir_entry(sb, ei, &cdir, &uni_name, - num_entries, TYPE_ALL, &hint_opt); - + dentry = exfat_find_dir_entry(sb, ei, &cdir, &uni_name, &hint_opt); if (dentry < 0) return dentry; /* -error value */ From patchwork Mon Dec 5 05:10:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuezhang.Mo@sony.com" X-Patchwork-Id: 13064129 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 F1ED4C4321E for ; Mon, 5 Dec 2022 05:10:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231448AbiLEFKd (ORCPT ); Mon, 5 Dec 2022 00:10:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231175AbiLEFKc (ORCPT ); Mon, 5 Dec 2022 00:10:32 -0500 Received: from mx07-001d1705.pphosted.com (mx07-001d1705.pphosted.com [185.132.183.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06D6110077; Sun, 4 Dec 2022 21:10:30 -0800 (PST) Received: from pps.filterd (m0209327.ppops.net [127.0.0.1]) by mx08-001d1705.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2B50r8Zi001701; Mon, 5 Dec 2022 05:10:20 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=/4nCqGhymcqBsWRZN90JpJHo+c7h/d3+KXFuEzngCRM=; b=i/wxrna6RwxHKOZOTZm9KZrJAxeAZlKNwG632xtnKPcF+uFgaGrwAkpaJprEA2/WJfUZ j2VNnY47TTMwm868Uc3HF/afGAr0PoShn3P4ThZmxlRouiJrdONXyLOjSU2l2p4Apw3n Rf5B1oLAzE5TBTccFplu4qG/Z7PacaPIxAlvziay7tHcBJwF1rYN8hqBguL7eQA7Zgn9 +DPe7EYjm6koBVJGlaAubMfZ4ejknQDPWh68ClaLX+ZQj72TYmrqpqpJ0kp6Vu8/WmJF UQfUra+ti/vhdosC+1ytWOLhYdLFJ8wiwRnEIPDdaPnqqH8gUF+M8Z5g6vt1UlV7YwMZ qQ== Received: from apc01-tyz-obe.outbound.protection.outlook.com (mail-tyzapc01lp2046.outbound.protection.outlook.com [104.47.110.46]) by mx08-001d1705.pphosted.com (PPS) with ESMTPS id 3m7ygd19pu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 05 Dec 2022 05:10:19 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=L36XPPP78C7qdU6WXHwRTT9Z3k7kBg8BNq8j8gdC58vJbHNqeAC7WiWOrCzHsLfMphX13Rq3NW5lO+awmzMC7e0v1OYLKq8nEntzIgqylM8gKyJbAc90uIAyDSyeGPkAfkKF7oPrWNQ3NjGtbFQnqtVQPt8RHc7gyMIKifiUbUXNdkhFnyS6ViRpHwO4MXu7WUuT/1ZwvAc8e6fLNteJ0hBN/kxB5WZMsdzmkLGjUq7W+1oYqbFhmoHpWe/mW3Uc3ryGSGG/YYKjztk3KSaiESIQeKVmVupB1uCq4ukKBv1b3amk9bzrCESkS5K31XGQ+XCHZAUbTgJ7awpB2raVHg== 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=/4nCqGhymcqBsWRZN90JpJHo+c7h/d3+KXFuEzngCRM=; b=eghAcuBFIHJxnEoi6yOj1OYY+f38iSNqOeciL6QxCaZUYbfo/god+wBZEiKDIKxe6QmomZp78apT8SexRna6No/Ue/zQuUsMZq6THsppDVDKLHw+N3vaGo2/q3uMybYl3EijRUnqt8Ui9TG151XhHN7WKC44UbVYL0yKeodCtDZRqj4P7hymJXLwdvJqKB7YqKOuG/gbMMfn3fEzECMaI5tW4E6B42CSvN5ApJr8JKim78uqWupJF8FP3x5eOOuUVqCSIqwopgDidL77FT97BwMBTgd+ELWYzU4xekkXPAvNrUuyV2bjmntiF21GxSoXi0AOBose/j5cQ/+Fm3YSaA== 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 PSBPR04MB3909.apcprd04.prod.outlook.com (2603:1096:301:2::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.14; Mon, 5 Dec 2022 05:10:14 +0000 Received: from PUZPR04MB6316.apcprd04.prod.outlook.com ([fe80::c689:d665:b3a2:d4de]) by PUZPR04MB6316.apcprd04.prod.outlook.com ([fe80::c689:d665:b3a2:d4de%6]) with mapi id 15.20.5880.008; Mon, 5 Dec 2022 05:10:14 +0000 From: "Yuezhang.Mo@sony.com" To: "linkinjeon@kernel.org" , "sj1557.seo@samsung.com" CC: "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Andy.Wu@sony.com" , "Wataru.Aoyama@sony.com" Subject: [PATCH v1 4/6] exfat: remove argument 'size' from exfat_truncate() Thread-Topic: [PATCH v1 4/6] exfat: remove argument 'size' from exfat_truncate() Thread-Index: AdkIZnhxe+TqMJXuT+WIfdRVSGaD1Q== Date: Mon, 5 Dec 2022 05:10:14 +0000 Message-ID: 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_|PSBPR04MB3909:EE_ x-ms-office365-filtering-correlation-id: 785c21d4-ddb0-420f-2996-08dad67efe1f x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Auq8BRJf28TbcTMvhw2SL+svj3hgSLNtnu3VvxNC6v7JQSCWe1qkZ3amKnPvWASTlH2nq4y/AudomOBanbi/xllye/Gkiu/Cxhku/tZ9BCmc1djTilGIcHOErMvozg5c3XQq8W3dnwkZUx1WgQOw+M9sIfiFxcKjrS3+HuE9n7gHO+CEydT/XIPdfnbXGfVY/zxuRF9Yl2BC2JkLofJl0O6BEZLhyjRSjSnCxzC0Mr8cOR4jsfpw+PnXDtNuyvJ12rTkIJi5wgE5swx0WoDsSV2JtZsY02MZeKwkS7VsnlcJIsB2lZzUJJJlNdnRhXTdEe3UrRI0NaLktb+65xfAOY8a8fl+qMSoHS3FwOQC7n8qVsv1BBEyyr6h7Fl/W5saQrch4+rtbSzSXuKcQbrvYQrOjAkzL1FZVoyP1EQE4ZJrPCGrIDO3dRsWsaxxGXhHy/08INLVlhPGkDcjDgzZ1zvAT/gg1+FNXKFkR59JVpa1hy8VAIkHtvXkJtI03TK1MBoJTaUKzFT9sb1yjr2T/9xR3HguvyQs0qQ5ccKNF55T7NPckYSYP7oY8J6uh5rjJreNf21sZlXiO0CeWJm3lCeF0FDhkVDIdtz3ySo/lymT/2c1z7xT2kRwaniFX2SJUbGDt26u99JjLOCr7TDgOBb7ElZcuWWm51ZaE00svPkjUumDH3I4eVuw6z5NY+APJDNTFobU5BwiIR5aeuhZvw== 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)(366004)(396003)(136003)(346002)(376002)(451199015)(26005)(316002)(107886003)(478600001)(6506007)(7696005)(54906003)(110136005)(9686003)(71200400001)(76116006)(66556008)(66476007)(8676002)(66946007)(4326008)(64756008)(66446008)(8936002)(52536014)(5660300002)(186003)(83380400001)(41300700001)(2906002)(122000001)(38100700002)(82960400001)(38070700005)(55016003)(86362001)(33656002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?CEe35UDmNMUzOhKP3HtLgBFdP78u?= =?utf-8?q?SFi0q+WwNOvHK2eSywCbPTLEJqouDnyumReHR34xKpKZFrhlMEEJs8sXyEYiuwVGw?= =?utf-8?q?1vN5jb7Kzouzu8GIhZr+HVgrlu53VjV+RXp6rq4+yQEet0VgwxxBWUHks1uKV7EUC?= =?utf-8?q?mXHQKzIVGl08N6kiBUqoevp5lE0l8pU9yBCtQbswaZeCAFLGSMCyvMRVFtAzpS8R8?= =?utf-8?q?rRiPVvUufOxqTjJ6n4tztXa1jU/FnQ8vQloHTpuLhDanZLMoPOFo5NCv3OSz93355?= =?utf-8?q?bNTllF9PZSQ35+luHa5fJh4GbxoI6VlUkdJRJHfnI5iTL4MUrzLT2UoE8/8OZn/ef?= =?utf-8?q?hmtXesLX4fd7Kf0TkgBO6NjW3ehZQOtGBOoYC0gLc0C9nVQ6B50/XPyHdUGPffi2b?= =?utf-8?q?dSJyFHi6ZZEdweRwAFgLrRWP6lG3tIKDTRDjlrAJW0ZkTHNd62eBLR8c1WhRJr/s8?= =?utf-8?q?sJT+NlttUmasTC5ufPFgGKvEn1jnl8xyqKn/eVm1sjfB2SWB+WeFAtkkTWpjzUh5e?= =?utf-8?q?XaB1LqDzK+6NUr9nr74pjENl0H9YX4v1dwWeaGXauDC4G6IYSAemZudpEMvNuY/RQ?= =?utf-8?q?V1v94LqESCMKafbin3AP4f1lPjle1RcMcKziu9NZ4zfE91PuqeYZxQy+8Epi3s734?= =?utf-8?q?XL/OkrN+s9r/cGoAxfhpypDy/eOJYvUPJW4KyNwo/Tvjojd1gj1GBT1HwNxz7goAk?= =?utf-8?q?kghyQX3AIcUF7gWBtXPxlgMATCsWeVIKFvYU9CyoHHjv4kBF5V52rX/RedR4g0eH7?= =?utf-8?q?qJBdLZmF+LIz4GRtXeNEizktKmn3XnvihkoLhc9+KBcl57peIDbkHy9WK1qrOl4Xn?= =?utf-8?q?qrQlXR5DhBAXUwhb7ab0dg5vpTwpIeE9VzzlDHIcq0z351ONX29g8cGQ1sD9mLWUQ?= =?utf-8?q?yMrAp7hpOl5g1HEJZ6kKkEN49aYL6nQ6B5K0TUFAqF4hPMbSAWgB5e0eHYDJoLYCo?= =?utf-8?q?oQHS9VmYdYBAhNlMF3mU46rsTDYhG6Xdi8B6s9jEWzvoBo5biTPbeoMG5CgT5UpMu?= =?utf-8?q?sXs0wn/BSy3bx7jL4PcL8lJA/c3H40i0X45vHk9+SZup2RIvh+eDJ9Kk1lATZfcC1?= =?utf-8?q?8G3VCBk6ukZSZX4YHPpyKwRUVDk9Gb2eK76724NYxsopcSxX3C1f7n24IuuoBLSKc?= =?utf-8?q?0Xi0vpinJmPhLpXB05g6NMUiQHEx4CSPqoE/txN1BRh9sVc/om4ORDXyYGnGoVBR4?= =?utf-8?q?LK3rtP9akvnVJ9xLgaGc/RbqVAGVzCyfRffKFv6Xi+eNTniVt9qotnYESAygmdDo2?= =?utf-8?q?Vqpw0XEDgW/Qe4BDgGMJuleMfytqgZlaO3PjS1OSeiijpgMsZdyzIxyCsaVg6/cTG?= =?utf-8?q?A3ttU/WyHMfxHYSl/XguGa/RfAURpNcYB+O8zZypp6AaPo3md/yo4an+NTru72Wv+?= =?utf-8?q?oGrluW381wOp2gYsKoc8Mz6a8TY86cvR1Ap29LN78rpUz1nLmH9LVwl2Bf/sxF4ya?= =?utf-8?q?UdhbdA421m/6Gv4BH+qFwu6xxBWZW6ht/CcYeiY29hrHCewfJge6Pt8w3Y8rU68mr?= =?utf-8?q?3QdFnr45ZQtw?= MIME-Version: 1.0 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: vJGpsztWbBscb4dr++D0fKjAs88J+m69Ls/Ua2vfRQgk3TP23LGx3f2Qop/Mu9Jt4kg+65TDNQgwagOrGjlA2H9txmv+jdXEhtdv2ALdZs4/RtkMamZiUBwop08NLCJv1K+5fHjLp0MFsZ2Od7E6SX1JpQ+3a0GuRxCc5WvF0qb+hip621R0gKDAQya9DYCf5PrnfHqsSIknh55gOK5PsFbTDlEj9R8aco16QjlMWDMQbK17RbCw1QmS/MSsLidOV8OpwbiOSxSW5uaATeUYjclH3kbfVBhsJ5sjvbOVE/qYvhgpUai//MU2ai1EArkifPfaGWVxmoyUSWNiFkk4ZfaeSDwbpfld0xKHO3h3ceU+qKsxx60yatyLcRQZNGIOnR98VNU3L5kWz0siKvYeoX6MKCwopphRRpeRnrtTQe0b7Bu4cBwD4fklqPGuT3EtdrhnUZPWrZe/L9RC5w3KTP5WA5pYz2BNU437IUP6rJmBxM31aLfgTV+eNvHerO2V/yJQqDvMdAP68DBPOVjIHUkHfZZsNoWxxSipNiNa17IM1RLE0S4KfACvCSji285wBV7LkP+zv0hrcu06xuPGF4jHgciidgDwkeKbScMMFRCotL8NPg9wKKGborTabm8J34fZSMgM0tS+Jovb4C9T6rR4Si+NwdvIFbK/cXbWw4pvg/oEqEIMLzvS938bW/ZCSaNOq5TuNnMSyP0Tj48NNIKsJtI2LhXXrpTFHR7tNSoviPlY6BBcKp1wjEL7vKyRR24A6YIDETHBdfztx4XJ4RyOUvJ3gPCxtjX+PF0e3aKVIHfgPro4nUckRVd1cn/Hvzr+U/7B3cWUGxlgIDq7ScXmFarzgI2fN+gWttNvKgv7pJl9qIenWZGpAWp6tXdr 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: 785c21d4-ddb0-420f-2996-08dad67efe1f X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Dec 2022 05:10:14.3868 (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: DVQhdKk9VX9xvxkKtF8UyYWOvkKav1cYq5bwoV0uBQVjjKxHdDgoEvWK40EU6902H83gO264GBm1DzUMevpBkg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PSBPR04MB3909 X-Proofpoint-GUID: _BX3BBEK1vPaugjArhJwD-SpISUmOwD- X-Proofpoint-ORIG-GUID: _BX3BBEK1vPaugjArhJwD-SpISUmOwD- X-Sony-Outbound-GUID: _BX3BBEK1vPaugjArhJwD-SpISUmOwD- X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-05_01,2022-12-01_01,2022-06-22_01 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org argument 'size' is not used in exfat_truncate(), remove it. Code refinement, no functional changes. Signed-off-by: Yuezhang Mo Reviewed-by: Andy Wu Reviewed-by: Aoyama Wataru --- fs/exfat/exfat_fs.h | 2 +- fs/exfat/file.c | 4 ++-- fs/exfat/inode.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/exfat/exfat_fs.h b/fs/exfat/exfat_fs.h index 21fec01d68ff..ae048802f9db 100644 --- a/fs/exfat/exfat_fs.h +++ b/fs/exfat/exfat_fs.h @@ -449,7 +449,7 @@ int exfat_trim_fs(struct inode *inode, struct fstrim_range *range); /* file.c */ extern const struct file_operations exfat_file_operations; int __exfat_truncate(struct inode *inode, loff_t new_size); -void exfat_truncate(struct inode *inode, loff_t size); +void exfat_truncate(struct inode *inode); int exfat_setattr(struct user_namespace *mnt_userns, struct dentry *dentry, struct iattr *attr); int exfat_getattr(struct user_namespace *mnt_userns, const struct path *path, diff --git a/fs/exfat/file.c b/fs/exfat/file.c index 4e0793f35e8f..7c97c1df1305 100644 --- a/fs/exfat/file.c +++ b/fs/exfat/file.c @@ -189,7 +189,7 @@ int __exfat_truncate(struct inode *inode, loff_t new_size) return 0; } -void exfat_truncate(struct inode *inode, loff_t size) +void exfat_truncate(struct inode *inode) { struct super_block *sb = inode->i_sb; struct exfat_sb_info *sbi = EXFAT_SB(sb); @@ -310,7 +310,7 @@ int exfat_setattr(struct user_namespace *mnt_userns, struct dentry *dentry, * __exfat_write_inode() is called from exfat_truncate(), inode * is already written by it, so mark_inode_dirty() is unneeded. */ - exfat_truncate(inode, attr->ia_size); + exfat_truncate(inode); up_write(&EXFAT_I(inode)->truncate_lock); } else mark_inode_dirty(inode); diff --git a/fs/exfat/inode.c b/fs/exfat/inode.c index dac5001bae9e..0d147f8a1f7c 100644 --- a/fs/exfat/inode.c +++ b/fs/exfat/inode.c @@ -362,7 +362,7 @@ static void exfat_write_failed(struct address_space *mapping, loff_t to) if (to > i_size_read(inode)) { truncate_pagecache(inode, i_size_read(inode)); inode->i_mtime = inode->i_ctime = current_time(inode); - exfat_truncate(inode, EXFAT_I(inode)->i_size_aligned); + exfat_truncate(inode); } } From patchwork Mon Dec 5 05:10:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuezhang.Mo@sony.com" X-Patchwork-Id: 13064131 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 E18A8C4321E for ; Mon, 5 Dec 2022 05:10:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231520AbiLEFKj (ORCPT ); Mon, 5 Dec 2022 00:10:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231488AbiLEFKf (ORCPT ); Mon, 5 Dec 2022 00:10:35 -0500 Received: from mx08-001d1705.pphosted.com (mx08-001d1705.pphosted.com [185.183.30.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D7091007C; Sun, 4 Dec 2022 21:10:33 -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 2B54ssoh014669; Mon, 5 Dec 2022 05:10:24 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=PSMaimujD+GcIpTakMpqfamqwhGTGdsLu8ggA+LdFq0=; b=i8mzUZ0Gj0RgefCIdReg3EXpq95aeA/fn0H+fJWolttIRyo/bsj94twD6esIUTGSDC1u JgpC3+jM2Oen6G8i3oj5vl1K2GAIy5F40HTMg3loa0dmSxH9/3jzgXe7ZldqOzvnnYjl MnHTJP+Ir3OMiKg9RDC130NPv0OQes0piuiNnymu/nlaQ5Nn6rJyljWLRg1GuGRz50tY HEc7b6dR5uaNBE/Vil2wD8yKKX0MPVDI99NzCEsrA9wgrqEf42OXX3AtKbbzD7av4Pdx kV/yZSYUMjXxSujvzKytfOtg0Vo0JrmVtvmxgE5tlepa0btRvGIMxbLA+i9u43CPd+bm MQ== Received: from apc01-tyz-obe.outbound.protection.outlook.com (mail-tyzapc01lp2044.outbound.protection.outlook.com [104.47.110.44]) by mx08-001d1705.pphosted.com (PPS) with ESMTPS id 3m7ycb1ahf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 05 Dec 2022 05:10:24 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Xh1xx+LKo2RbGTNUjiDXam5WVx1rkMY1+OfI1h4hv3drFqL2P8DD0RxCNqzFpt8BFpvmYyeYo2kqgCpFao36l9qZO018e3wGRjOKXH7RDtHYQgC1i/nMBuFIZfZc1b5KurRkDvGZcPF2bD+4xSjzJrNU8KvOngSWmrEm8E5CnSLKklcugft328l6bVllsLrYGuvOjFE6pEY9g712CxVMz6Zt7u+jzlWtj0aP1i0LktmYEwz8wmrGvDEZJ4dprP+bPPyyR7CWVsZMFQnvtmqk073R10jHs45VBr4LmMU8qDk9QgYLkdEGRYS9yoMbGicjzkcSFppjByExrPIKJtCwDg== 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=PSMaimujD+GcIpTakMpqfamqwhGTGdsLu8ggA+LdFq0=; b=XIZCze8a7jpvgE+FX2pa8p1AwEVi8qxhIOb5D/mgqQkGMumt1hLblNZiZXUYVHIwoI1IbcozzqJmZij7ExniikGb19Idr4dD8djJOdUd6HSuu8SUWSqJPMzIRgmXuAIsyglosdDTgS31qn6OXmrmmWLeKwyhXkvIB+EpEiiryuZQOLJ23mIVhsr0R5zc4bcoU/Z0nTMrXxx1q1/kz6bNGmORFE5xd4qQqYi+2SwLUOMelwxt79sGBhfCsOb1PZ3fHHWuplNiC+b2UvcaMaYSo09mtNFYrVDnRMzAGbWJRHzzjY0xKYb4aQHUSPdhpGj2c1BBqZRt6wfVTiRWF9qLiw== 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 PSBPR04MB3909.apcprd04.prod.outlook.com (2603:1096:301:2::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.14; Mon, 5 Dec 2022 05:10:19 +0000 Received: from PUZPR04MB6316.apcprd04.prod.outlook.com ([fe80::c689:d665:b3a2:d4de]) by PUZPR04MB6316.apcprd04.prod.outlook.com ([fe80::c689:d665:b3a2:d4de%6]) with mapi id 15.20.5880.008; Mon, 5 Dec 2022 05:10:19 +0000 From: "Yuezhang.Mo@sony.com" To: "linkinjeon@kernel.org" , "sj1557.seo@samsung.com" CC: "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Andy.Wu@sony.com" , "Wataru.Aoyama@sony.com" Subject: [PATCH v1 5/6] exfat: remove i_size_write() from __exfat_truncate() Thread-Topic: [PATCH v1 5/6] exfat: remove i_size_write() from __exfat_truncate() Thread-Index: AdkIZqkGDJStBxJVRvqAguPRIr3LCA== Date: Mon, 5 Dec 2022 05:10:18 +0000 Message-ID: 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_|PSBPR04MB3909:EE_ x-ms-office365-filtering-correlation-id: b9af9feb-a35a-40ee-d321-08dad67f00ea x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 91yTOwbdmIdNS/UM75Z8MHPziZexYOYD+xbNQI84R7EhFbkXO43QR+8pVZHWWLQTvxLqn67HHNdxE2d+u9OloLFN0I+zev6mlVyg9g9kUhvJWUUX6x3aCN/6IerQoqyZCxJa5uYtsaWYU0MDo4utVdzlBInJlacJYwmKzahipAuqtjSRJ4SlQIkAsK2GjyJaI1CgBqeZY2d9q0WjobvoeGLO9v46WnFv4Nt4BB7cXW+9q8IetfTt1CVoGHQNQuDT+LA2oHXpWV5/gUJJdEkK6KSx2MfNRN8h/bEAxwE9DhHGLJB5oBEAx7TgLiGHfpLYupC+Pm2i+Zxi760hhbjYJjQrmicE3WQ7rI7TN6ncP0Pelwx+bsgWoeJwAdXkkVYG1kWM0E/xQs+6mQ9yS2LP89ZrE5G3KF2KpjdR+dIBjmdfoP1YO9wwq1Jo2EIVmfxNxQ25Kq8PYBDvkbJ9df3PMkQV8y0fchvi7aCFdV6Sq9UiZdbT5e3ycVYs52rDy9c3CuN8zOR0QfclYpR8tidKxqJyn41tXN0OEFnUqDJJcIpa6VzQkyBOsnJtsDP7CCSIHJB8Kn2Oldek9TFARYZ++as/5lBVBQumEmLkiF5/51GZk8eIcpjcWxNHiCmrRSGz4WWHlG2/YG1tGRiu6JTuepRsYfS9w1a7Q2YJz3YW2cDGZGj+6E7aqSsgGhyPuEB9tiBuU/08ZDifFe2Jw7xfxA== 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)(366004)(396003)(136003)(346002)(376002)(451199015)(26005)(316002)(107886003)(478600001)(6506007)(7696005)(54906003)(110136005)(9686003)(71200400001)(76116006)(66556008)(66476007)(8676002)(66946007)(4326008)(64756008)(66446008)(8936002)(52536014)(5660300002)(186003)(83380400001)(41300700001)(2906002)(122000001)(38100700002)(82960400001)(38070700005)(55016003)(86362001)(33656002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?JRTuwVPmO+OB3l680JW39aveno++?= =?utf-8?q?lj+Bb/+/qD5mQFn7LJPSmcimtAzBGg6CLvQBdXCj52TdpeFEtxca1aEw+UepijSLx?= =?utf-8?q?ZjMu42ic5R8yw7wCc2zbfVPQgVTwfampWfIAdVastiphe060wc6b7/0FJW7Ereu3l?= =?utf-8?q?oC5aHxyR54mViTqijCiFCx03fILhOc2+SazqTDmoLFbWQOSK1zvLBcWxfKXNTT+34?= =?utf-8?q?Ph8qiOfxbZ8vLHKNq9eSh0JuzBGL688isvkEkmZd08R+ivw+ZpiFvn8q0tKkxVayE?= =?utf-8?q?9GBt6krPTy8SRqBfdpEZXCgr99p8z9nCRtobX+Yo26CZQIzgCYThZvGxrBeEpnCuy?= =?utf-8?q?r3mDfTkBVvX7bxEj4A4Fj1SQa4fSmSZRg6r/TCPewHqhiR7ODbN7B6f/mY1SKX4bk?= =?utf-8?q?xm1WBdNiyy3y3gFYESMKMTQVkToZEP49BL07DU9YOkppLfWo+FiGLH7P4nMoipmwT?= =?utf-8?q?AuiuXXHtBhXvAnBb29Lj4ZJ6XsQbZ7FKIKnADnIV/gOQqmpVeksktaY3BXDERRDes?= =?utf-8?q?xtSX8eMNGFM63Q2BwRULP4zsFnEiFifyYGV3lcz2nsv/bSODcl9SjlM2t+sQByuzt?= =?utf-8?q?1YbLFZZcEsO5pjur2fR/GR6zJIbJYWqAnutZ41Fz9nJulajTv0ejk/sTCw7T2sX/5?= =?utf-8?q?pwHtEFEb4rJ9jxg6Ochoa0Zb0yD2yOlkhNNz4i8mn8LOJVVQnncy5Sj2M5M1pF6Pv?= =?utf-8?q?D+gBgKDPuIF2yPJXOZbemkOqxVQSRdR3d3qvP4ZP2LmQFB2lTbjLT0hDnOZYFKhvZ?= =?utf-8?q?UML3vOGS280Cgoh9aRqVa2t9GYtZKp0GJR6s1hoVcFD/D+955eHhjZFgcq9QavGWP?= =?utf-8?q?aOkbJealezip5tss85Bz44arbzurb9EwEeZ9S1BsUB/3pmQmsVs0OXExHXoI0uZ1h?= =?utf-8?q?ZmGaudWkYuLUJxRrxp6QlXQ0uQZ8S6e5Y2SbWp4Qgx4rLxUplKD5raqFCLR7Hlpja?= =?utf-8?q?LF7ecstgItR9YlFm7ccbOzKWDLUxHSvsHR6AQg4zmXWY8PcmNMSxHZn0bdx+6NqEl?= =?utf-8?q?HQ43+uFrvCBiGXqlHyqXXWN5JXmkYgj/3CLRkXgp0K20edoC+r4MtQxvm0wOe/phO?= =?utf-8?q?FtHArQTI6ZyTT3P5mBQGzgWtviO1mRIeB93rjtNpVK3m54NUi0CiU+CCn1RPpzHNW?= =?utf-8?q?ChqugPZOeEo9YEIhFAXsaDZy2B++qUeYQjzUIZt64b3BO4m433BWo5yo3adKHZNha?= =?utf-8?q?x/OKIuk2QSfIH9VoIQPY6c11U+DCWpRxorOO7ObX/3NWS4DQu89rTw4pYngYaxD8z?= =?utf-8?q?BigVf4Hag+yMhi//snRpt+x7fM6+IB4Yy6xGWvE/r4D0VSyMDayJtexSPRlW/B97N?= =?utf-8?q?QjGA/V+TSjftcYS3TnMK/GMskk5IWu5EtP7zPCkv2GcY35BF01dV5MO7na28KSIJZ?= =?utf-8?q?V20wcT8i0PMDidSyzKB1OulPVW08KDD84bBXgHWzHTKT/dlaUuAxt6J/JKU3Hga7B?= =?utf-8?q?HLflqYISUOYyZQEfCprE6JbiBfl0qvNT+xw9qBogGhmQXuCIhy0OdGXlauAOX/W5E?= =?utf-8?q?ohOvLXj7DSPL?= MIME-Version: 1.0 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: WaR/8hleepkupXMpaA8a8ZV81DDscynRR3HTbHPRN3fEGqeD8ta4Yx6iIPHVCMHhCFLl8ZaBhyCxROvtwlXfaB1SIj9+c5TC7He9IzHUQa6H4lfKVC7x9PYoolL+c1m0XanG9JkMuBj/nVI60dkHtkVeuuSIQXziszyZDykCcRkgyT8MEi8rsTmitjWhf/8nP3HhGmRyOk+xQUClmI9hBV1VjoKreVRnOLcccqkWDZVSfp1h8zqR7xWBGBylOCSTFzzMhQ/5mewclCq4qq/YY0jVZqFlnSG8343y9KVYVx9gb16L4ByXdFYzGliRiEHABi7JpCf4ZrLt+p6j+Loj6Xj93sc/aXLJc5eRncCVJKDZ2HnVesZYXeBJTHBeAfQ3RmVniEqThgN/ZJiYzcvTW44kxX/fv1SkEMoSuPG/UBpCK1RRHs+HNIWwPSAIW9V4f+ltDH7OA07IJtoREoc9Z4XYi/UNG3cqaQ/qT9ofJqS9Kk2EgFrmWajaGYtf33/4PU438Nvu6u39a6xZSxq/Kg0M6rMzy/5iqtvsAWw3c7itH5CPf4Ymo/nnf6T93K6NNE8ilxni7KoI3tmKjnCPj4T9fSrXtZ2eSIeP5Sfu0QF29f5KtX6QbqYy2Q/o3X1ckkz3XSQS+vM0ZUq1qTdda4tUPdEhEZKbyWpLVN7u8vzf/mS7/VD5AX5R9NtgiwpaGWQ+RQZhrhjXwUe0MzyUQv9LCHA77/3tmJLd2I2yxbi+GBpsl4F1QWbi1Xu++5orfg+6oDpwUJK5CmqozLo2iV3SGaADYYtCv8eYWE9xZ56zPDY/NW7Htjs+hoZTZdOE5m2sya1CGD0OeiKngoVF6qkaL6odWN42abE+6y3YKIboTNwmF3wUeJAyy+RcW8/s 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: b9af9feb-a35a-40ee-d321-08dad67f00ea X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Dec 2022 05:10:19.0301 (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: qILIC8eybYI7nqtph9szwgqZ2wcAWjQOAg5+EPZG4J2+bQzJJwnPSx/7HWNaZz0kZi0vld+J6EpinKuctOQ0Hw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PSBPR04MB3909 X-Proofpoint-ORIG-GUID: cOA1nKQpeU4WFVRvITZCwCuweMQOfAIN X-Proofpoint-GUID: cOA1nKQpeU4WFVRvITZCwCuweMQOfAIN X-Sony-Outbound-GUID: cOA1nKQpeU4WFVRvITZCwCuweMQOfAIN X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-05_01,2022-12-01_01,2022-06-22_01 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org The file/directory size is updated into inode by i_size_write() before __exfat_truncate() is called, so it is redundant to re-update by i_size_write() in __exfat_truncate(). Code refinement, no functional changes. Signed-off-by: Yuezhang Mo Reviewed-by: Andy Wu Reviewed-by: Aoyama Wataru --- fs/exfat/exfat_fs.h | 2 +- fs/exfat/file.c | 8 +++----- fs/exfat/inode.c | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/fs/exfat/exfat_fs.h b/fs/exfat/exfat_fs.h index ae048802f9db..a1e7feb22079 100644 --- a/fs/exfat/exfat_fs.h +++ b/fs/exfat/exfat_fs.h @@ -448,7 +448,7 @@ int exfat_trim_fs(struct inode *inode, struct fstrim_range *range); /* file.c */ extern const struct file_operations exfat_file_operations; -int __exfat_truncate(struct inode *inode, loff_t new_size); +int __exfat_truncate(struct inode *inode); void exfat_truncate(struct inode *inode); int exfat_setattr(struct user_namespace *mnt_userns, struct dentry *dentry, struct iattr *attr); diff --git a/fs/exfat/file.c b/fs/exfat/file.c index 7c97c1df1305..f5b29072775d 100644 --- a/fs/exfat/file.c +++ b/fs/exfat/file.c @@ -93,7 +93,7 @@ static int exfat_sanitize_mode(const struct exfat_sb_info *sbi, } /* resize the file length */ -int __exfat_truncate(struct inode *inode, loff_t new_size) +int __exfat_truncate(struct inode *inode) { unsigned int num_clusters_new, num_clusters_phys; unsigned int last_clu = EXFAT_FREE_CLUSTER; @@ -113,7 +113,7 @@ int __exfat_truncate(struct inode *inode, loff_t new_size) exfat_chain_set(&clu, ei->start_clu, num_clusters_phys, ei->flags); - if (new_size > 0) { + if (i_size_read(inode) > 0) { /* * Truncate FAT chain num_clusters after the first cluster * num_clusters = min(new, phys); @@ -143,8 +143,6 @@ int __exfat_truncate(struct inode *inode, loff_t new_size) ei->start_clu = EXFAT_EOF_CLUSTER; } - i_size_write(inode, new_size); - if (ei->type == TYPE_FILE) ei->attr |= ATTR_ARCHIVE; @@ -207,7 +205,7 @@ void exfat_truncate(struct inode *inode) goto write_size; } - err = __exfat_truncate(inode, i_size_read(inode)); + err = __exfat_truncate(inode); if (err) goto write_size; diff --git a/fs/exfat/inode.c b/fs/exfat/inode.c index 0d147f8a1f7c..95adc4b2e436 100644 --- a/fs/exfat/inode.c +++ b/fs/exfat/inode.c @@ -626,7 +626,7 @@ void exfat_evict_inode(struct inode *inode) if (!inode->i_nlink) { i_size_write(inode, 0); mutex_lock(&EXFAT_SB(inode->i_sb)->s_lock); - __exfat_truncate(inode, 0); + __exfat_truncate(inode); mutex_unlock(&EXFAT_SB(inode->i_sb)->s_lock); } From patchwork Mon Dec 5 05:10:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuezhang.Mo@sony.com" X-Patchwork-Id: 13064132 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 4D998C4321E for ; Mon, 5 Dec 2022 05:10:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231530AbiLEFKm (ORCPT ); Mon, 5 Dec 2022 00:10:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231494AbiLEFKf (ORCPT ); Mon, 5 Dec 2022 00:10:35 -0500 Received: from mx08-001d1705.pphosted.com (mx08-001d1705.pphosted.com [185.183.30.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ACF961007B; Sun, 4 Dec 2022 21:10:34 -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 2B54ssoi014669; Mon, 5 Dec 2022 05:10:25 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=KYCcM1idfex/9lRd28q6AkXweqmzSou4GSyVK+Y3jbw=; b=IUXbxzsU8/r88J0yfIJLopqOpmCWBab6XClmMSc3J2lYBBr9xNbNWkPyYuimPsxB6TSf isqSalErxdRqfoDzKyqQV/FYcsOucmgMgJsWYMXTEQ8oQrtrMI8rHxJ0k/pjdnKifaF/ QIFu8KaPC1L4XFcCseXzXeg9zzd1D0HFxa1CIYmTlqgvuIIA9zZDPeooYdTOeUCw8Cl1 3wDP+xqj7LS8Tw2bHR2NxfKiIPGCp8ZmyLRVVC/mf1nkKfvBfAQdcSl4fVN5GJBwWzT8 3D8ySIa09hPCl3lYkg3BPldnJqrkFMs9IelIZyLMlokKuz4ci4gZbNsbfVkyhUjlsvHT +g== Received: from apc01-tyz-obe.outbound.protection.outlook.com (mail-tyzapc01lp2044.outbound.protection.outlook.com [104.47.110.44]) by mx08-001d1705.pphosted.com (PPS) with ESMTPS id 3m7ycb1ahf-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 05 Dec 2022 05:10:25 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ezgT5ui5cuGlLvYKveym/+XOAyrvskqO3DWbjlkSorbqX9gvYY3mQ7KipqEpLFtKkC+GnXP96S4XjmAbEOFoSpyqbPiSx5Szx4LXsUaIHleln3XStlgXw1qPgmC6sEiFAcZppdXkAzAwYooClcfD8ygtwr/K6U/v/wFC8SvI27Skyxwl90jEWW21W4yMCKftiAUAQ6P3739ClcvstOYB8cpBXAvVuKYDe4ZuZ87IP16AiKQaK3poYtJk6XwQkZOZf45RIjbdQJLflss1zSkJE5f/OXOq2KBHXsSOBJJlkzhhQ6L8xdOlNaHa4XvbbcsH2DO9AqQ0vJcwrxWb+uQpng== 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=KYCcM1idfex/9lRd28q6AkXweqmzSou4GSyVK+Y3jbw=; b=Zae3TfqEDQb0mIdr4Uyi6ke/rVQ5fQyajpeSbVa9zmU12dGKSFRHv0PmAy7WyhXi3fcOu96V0T47rUyHa6ud1ctHCBJZ8+nEq8ICOKjOFBlm7Kh7we9QUq4SiGw3t6adg6wM10BzDmdq4uVOdGZR9aaBfIr1nqd6bYo0/+PKQ4syCrewrA4GBPiMaRAISZz0UDTu1am/jBCt9eHtjg9q4/44z3eGnkVoggEtPkDy85BEr1TIqTAzh1V5WUP/W69u+9GaVh4t9colmRXwvr8OU/q31JZMRrSzD3dQJVJJfPJMtJz51OA6yBstnvKr1OSnnA7PLtmDQZKxm0+elG935A== 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 PSBPR04MB3909.apcprd04.prod.outlook.com (2603:1096:301:2::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.14; Mon, 5 Dec 2022 05:10:22 +0000 Received: from PUZPR04MB6316.apcprd04.prod.outlook.com ([fe80::c689:d665:b3a2:d4de]) by PUZPR04MB6316.apcprd04.prod.outlook.com ([fe80::c689:d665:b3a2:d4de%6]) with mapi id 15.20.5880.008; Mon, 5 Dec 2022 05:10:22 +0000 From: "Yuezhang.Mo@sony.com" To: "linkinjeon@kernel.org" , "sj1557.seo@samsung.com" CC: "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Andy.Wu@sony.com" , "Wataru.Aoyama@sony.com" Subject: [PATCH v1 6/6] exfat: reuse exfat_find_location() to simplify exfat_get_dentry_set() Thread-Topic: [PATCH v1 6/6] exfat: reuse exfat_find_location() to simplify exfat_get_dentry_set() Thread-Index: AdkIZxYuFGc68+38TxOwJ6/NYKH6qw== Date: Mon, 5 Dec 2022 05:10:21 +0000 Message-ID: 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_|PSBPR04MB3909:EE_ x-ms-office365-filtering-correlation-id: eaed9b83-58d7-4664-e8d2-08dad67f02b4 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Vnfb5eOlbQn+jlCA5xtiqKjtbyiXDZALBUvhSxxCENsb59/dP4rgmtNvfQK3GzpXk4Lo4Vv+hFTxmIBxreODEtu7IMShtaiLuZQI9vVOsiRbmFcIjkbkmRqoHW3XxHR9Psb//DY0EzJSNZ8ajH+meb82q4MxdGSVTvfqme8lv5RBFyi7b9IekfBCB7z37b1ExMM6mzs0zg3UB6sZCzWHUBb430P90n0sfrbS3WeMj6HXwvEx02aODRKKwhxegSSNDDdH9VA8YXlZihQX1ULT2ROxdbsMnC2i6bNEN77NXXM+23cY+fmLs8OC5RCDN9WN6c9pPmK2eO+JDGRxPvGJpdwCVPGsso2Vr4SOf6jYSAJz1oaFqgSMx8gYS5LBvAUvyU4h8Dp6HUO7K2Zeb0txYKzT0Fnj6+yKPhEM571dLQt5v5SU4yNEyDLJpNoppvoeWTUblokZbOmmi0ZBguTimGuK6qeMDw+CCMLyOJq8eelczxW3Yu5Xp7foceRnrG6PETcJ26YgCQ/XaJgHxalXRyrcR2e3qXswOSlJGuqVxdXOTxI/DhV5Oev0k0h2FGAh1RqQPK0i9mNUwKsP0V80dvZTL/+H/wzUVsHSMtbWWKb1VD78W7eX9L12vb9WuKwjGMgAfr8lq2jpzT0U6ODTQ8OOFq0tQz+uia0ct+Tgz0b76Sj6ds35nCDgaQqE/rg3QFjfAuALhu59ezEqHuw8gw== 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)(366004)(396003)(136003)(346002)(376002)(451199015)(26005)(316002)(107886003)(478600001)(6506007)(7696005)(54906003)(110136005)(9686003)(71200400001)(76116006)(66556008)(66476007)(8676002)(66946007)(4326008)(64756008)(66446008)(8936002)(52536014)(5660300002)(186003)(83380400001)(41300700001)(2906002)(122000001)(38100700002)(82960400001)(38070700005)(55016003)(86362001)(33656002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?lm64/RWcU/G8ON/0NQvSFSyrV612?= =?utf-8?q?rygIqGGssHqLOMOyMZJanobe3RpOrTSWZdwV7X/jplsFfYrmvwMmKkjPC3ZXoAdFs?= =?utf-8?q?cewP9qWbRXYIQ+wLav7r2ucwCFD6J8RNjmjM2FQmbk9RZS7Fh6oygJhbU/etH7wZm?= =?utf-8?q?R0VgOhHSUgkCPzhbhux6+UOlvRUQEU651Eh9UyHPvMlGbNoeTzAvMBZQXeHo9/IBK?= =?utf-8?q?GFPhaeU3nsD5kxHll4PYUbc+AEyM/SIJjEp+qOq99JI9Jy5wB+OvxatLFUcrW3mYV?= =?utf-8?q?4IflmduvkytAvKACjwLc1gmDclIM+c66cbfJeqerH9p/BDI3AWpUUuIqmCXVG1wRw?= =?utf-8?q?ATPEYgvE4PtOPq4G7LddXEEn3cDxuQQepR2HiRQ1T3+P3Akxik7GcHU+AmAiUGq0S?= =?utf-8?q?++u8+xxHX9dMeAvJsWvDV6vX1f7TamjhLCoQtL23x4dLXDnySdw56Ve5+CvE8dbO+?= =?utf-8?q?gAnPLtRnomB+zwJ0tkFrDQGAx1ADjcvGTSYRdgUdq8LWbyr2T78CJ3P/lo/OIyHNY?= =?utf-8?q?zoHEaLrmt5HSfJpCKE8PY0MtI8pCF/s0BHGIJSVi0OOHtbKVemn3mZET4ZPXR2vhp?= =?utf-8?q?XN/F7HVsz0AynNgRXhu+dOFriXATi0e7pBhhwzDJwTGhNdRWqiRCFBEIxEsb0hw7p?= =?utf-8?q?Tce75+6Tloynt5koVFItEIrXaoNPRDkvIHmwbi4/VZKrAy4indRmysHAGX87fvHn/?= =?utf-8?q?HAqMUdPo7HkNvojzqx4+XLcOA9sdyMOm3t8w2StfHg9ivEhzjb8JvwF++M9OrnNYv?= =?utf-8?q?GKZ1mWdVtJtEvn7GUUOr8GbvLoopgmwF/apCr2C8CcVnB8gvHCq+hdqfxJPfgTGTr?= =?utf-8?q?Od2TQgkGuWbI8XOB6/8mcoJOoukjH6jHIi0zPY76ojvTxIJKKNB38qiBAdhU9RvDC?= =?utf-8?q?p7B+gFr6WqRkkM+KwdRV/sbFcTCyjFn7NyPEEQetN9+VyFxroz0Bv2lon37bNX2vw?= =?utf-8?q?gGGYruaPLd26NpwdqoD5PVH5eFRnulYP+BWJYjHCG90eq4mTKmTIThr01nvnsCpK3?= =?utf-8?q?TaU+XxmzoQ3MxFbSQvZ33egbaISvvK3bmPQsAgsOe+++D1a2ypyB/gXtfRwHOQQkr?= =?utf-8?q?fQpmbhDaPfy2iHFnwKL/90wiKS2A1cF8A0N+Wgb9wJ6jDLYvrAV3Z0Q0d0cMTNyT9?= =?utf-8?q?Cq0oGBdJVMRjIog28cLFDLcvQcx95E2XQ3xA5IMvEJ5bi0U04odhAnd24cQPit5+R?= =?utf-8?q?LzzMm9oiWkrpVDScg3LE6PbrWOH9Kr8chw4mtEb6kYAnuFVk0grbUWHoW6pJXEoER?= =?utf-8?q?+I0KSZ+xzIb8K6Qor7WtVSVqQIpOPnbW/H1mM3wdOjuIQvMkAdyk3F4vHwKnA/Pws?= =?utf-8?q?ayuqgV/Rqip2rSC1YiN6siFldEvvWCukGztRECaJRMhG1PRckxvV4NG753JB1UIH1?= =?utf-8?q?xTYjKGdGMNJuK7yrFuXLnBy/pdUdr3sqoFQ4fv8ahIhO/U6St8Vkycn5wrfNVQ8/3?= =?utf-8?q?YVT/DkJzELOHytgMR2uc+2+WSchVjInd5Iuw30q5HGnXry3o02/EpT9/Das8uMA3a?= =?utf-8?q?l1AUx+zPrkM2?= MIME-Version: 1.0 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: yd6H32pePViWfSjmdy+RAd6B7TnwkaBaW21HxOgJQ7Ux5OESwzQPliw0Rq5ZrCj9rd93vISSgV+c7I6yH6WxoCKpz9ns/oG6aBfvOzK57NBUsONxVmzWYh9jrqMKOoC2gRnqBw2mkN5QmXTtNHe463QV9O5xs7SE5n0MkUW8Z+a6SBVGlqPDgh5iteDd007FzoOnbgTtrw67SflnRQibYcQknX9sQyTub54t7O/Wg0FZHPQFAFn9MzG3jyIpEkyAfzMEw1LxCtWEJLZxdslkkBMFf9FtLTRJBy8tYwnhpMbyj78blp0YNO2gNuGJI9wnQO+3cXfNAmdHOQnP32/evF6bgPG8XCNF/ABIuinLShQvwi0Iii4I2coFxtvg2hqgX8KuYzREy4ZHy5VfJ3ntfUKXXPwiB0TblMSDmGRgzBxlmirut4Sl/esNQuA9vyoPCa7CiiRDFUkCY+SAJRtn3TgfFZ4fX+Q7ODaYvkuCiWa+A8GGKjkAFqtnTMYpqFXOK9nQ2hvNw1aev0G9M573FwvUFIQGvvAaNbjlxukybFyVgmiNtt5hEJe1iXazrHFF+J2QvfkcBffWPiowSxYvIfvQKq0+0NLOpaERWmlq0h6nue/vI0kGv5QIdaPKa2z2EWday+Il4qdC8UmXp2JbswJqCY74RHopczIxXYy44yXHpCa3Y54qWcxoFNgObhU8HFlnRHRsm/3ccq+vRaMTOwWAeT0U6a3nw63HSbpA6JejQ0VnNxah3YJrlBY/UuoiX2Ny/sCQOPrfKFaMearPJR7qjaijfAZqdAc+1LGGili3On0xxlFqy9VVewwckg71Z8529itfrP68L3dFoHgywsUql6AgJyPwSijQqd7FaijP+ZYDpFc/xH1FTcW7uosf 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: eaed9b83-58d7-4664-e8d2-08dad67f02b4 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Dec 2022 05:10:22.0478 (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: oWNnLK+ZqrO6bTPk0TcmhS2A86v0LDaxPxjRGDYEg2WLLzc91XSpauNoITIHZnw0GdRsS/52KynuLpH3Lia+Sw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PSBPR04MB3909 X-Proofpoint-ORIG-GUID: COszx_92MyhTaBCaPQCIuB1Lbic_VTwb X-Proofpoint-GUID: COszx_92MyhTaBCaPQCIuB1Lbic_VTwb X-Sony-Outbound-GUID: COszx_92MyhTaBCaPQCIuB1Lbic_VTwb X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-05_01,2022-12-01_01,2022-06-22_01 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org In exfat_get_dentry_set(), part of the code is the same as exfat_find_location(), reuse exfat_find_location() to simplify exfat_get_dentry_set(). Code refinement, no functional changes. Signed-off-by: Yuezhang Mo Reviewed-by: Andy Wu Reviewed-by: Aoyama Wataru --- fs/exfat/dir.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/fs/exfat/dir.c b/fs/exfat/dir.c index 8121a7e073bc..834c0e634250 100644 --- a/fs/exfat/dir.c +++ b/fs/exfat/dir.c @@ -818,7 +818,7 @@ int exfat_get_dentry_set(struct exfat_entry_set_cache *es, unsigned int type) { int ret, i, num_bh; - unsigned int off, byte_offset, clu = 0; + unsigned int off; sector_t sec; struct exfat_sb_info *sbi = EXFAT_SB(sb); struct exfat_dentry *ep; @@ -831,27 +831,16 @@ int exfat_get_dentry_set(struct exfat_entry_set_cache *es, return -EIO; } - byte_offset = EXFAT_DEN_TO_B(entry); - ret = exfat_walk_fat_chain(sb, p_dir, byte_offset, &clu); + ret = exfat_find_location(sb, p_dir, entry, &sec, &off); if (ret) return ret; memset(es, 0, sizeof(*es)); es->sb = sb; es->modified = false; - - /* byte offset in cluster */ - byte_offset = EXFAT_CLU_OFFSET(byte_offset, sbi); - - /* byte offset in sector */ - off = EXFAT_BLK_OFFSET(byte_offset, sb); es->start_off = off; es->bh = es->__bh; - /* sector offset in cluster */ - sec = EXFAT_B_TO_BLK(byte_offset, sb); - sec += exfat_cluster_to_sector(sbi, clu); - bh = sb_bread(sb, sec); if (!bh) return -EIO; @@ -878,6 +867,8 @@ int exfat_get_dentry_set(struct exfat_entry_set_cache *es, for (i = 1; i < num_bh; i++) { /* get the next sector */ if (exfat_is_last_sector_in_cluster(sbi, sec)) { + int clu = exfat_sector_to_cluster(sbi, sec); + if (p_dir->flags == ALLOC_NO_FAT_CHAIN) clu++; else if (exfat_get_next_cluster(sb, &clu))