From patchwork Wed Oct 30 06:12:21 2024 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: 13855958 Received: from mx08-001d1705.pphosted.com (mx08-001d1705.pphosted.com [185.183.30.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7B78D1D0F74 for ; Wed, 30 Oct 2024 06:12:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=185.183.30.70 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730268769; cv=fail; b=CHHTBTNUpFBUhcj/YohDFEF2HYu8td1/uo2/ZHF4/T7H71JbcK/9gwi9EqP/zY2R3VLISlnXkobJQGTLfvszuoL+i6DdEcLp9xRhLweRIPcG39T7+47x+kKcgO/iPL7Lhf7I9+fd88hhhvx3hKSb6NPNBZx/drxiURvcZfng+Ew= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730268769; c=relaxed/simple; bh=HLLAjmP0VQImJyvzcMRKGxpig8Eevi73YdUOjHllyV4=; h=From:To:CC:Subject:Date:Message-ID:Content-Type:MIME-Version; b=irTlhlAr6H5Gp7JnOAf5e9bQ3FnTGAX2pGZ286JxLSOjG+s4b5MW6AVYaLaLTnxsRi4hj5fU6Y3caOXkHAVMvjdTEPAeEZfUTqFElhFArHoSLyeiFmRgjJ+e4Az9+tKY/Leq26U7QTR9zcK2lc/TRvVP7TH+JKrD9fnay5Hlj7A= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sony.com; spf=pass smtp.mailfrom=sony.com; dkim=pass (2048-bit key) header.d=sony.com header.i=@sony.com header.b=R18ilEUv; arc=fail smtp.client-ip=185.183.30.70 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sony.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sony.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sony.com header.i=@sony.com header.b="R18ilEUv" Received: from pps.filterd (m0209318.ppops.net [127.0.0.1]) by mx08-001d1705.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 49U5rtij020979; Wed, 30 Oct 2024 06:12:35 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sony.com; h=cc :content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=S1; bh=HLLAjmP0VQImJyvzcMRKGxpig8Eev i73YdUOjHllyV4=; b=R18ilEUvwCO5J/MdWYusrZ8Aa/NRkHfIDl8zG2QrUw8cG 9hXq2MVhdiPSooR/u+anQDWBqE69faCD/ewVnakHgAg7/KV1JJ3oqPvecu2UVaTc o9zfGeXc9ZjQGjJ9cVgaajq3BLk95T6TIEg/NuHQETFafPNtekD/gBXYJFQ3hZvj DDywlKKpYKkZjwAzZBPw7TxQf9yTbYh+gyy9XzhlqH2rGbNadbC3YAtbcJ6oTATz PHK/w4QR2A9Q+5cnPj1WiPnfSvJJl4fIUBxesaZAzuJrYtp5s9EHKvieyqHQAU4n 8QvqAiDsew3cSEDM5//4e4XLW0WaKfci0TZjNjIsA== Received: from hk3pr03cu002.outbound.protection.outlook.com (mail-eastasiaazlp17011029.outbound.protection.outlook.com [40.93.128.29]) by mx08-001d1705.pphosted.com (PPS) with ESMTPS id 42k2yq8hs8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 30 Oct 2024 06:12:34 +0000 (GMT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=mblONxvEn9lvPuOARpABdha9Tk/4ydvfyMhZkdYCCG4eSB3Iaw8m+wBwCLz0dwAFn0wOkPg+yjFR84VVYY9V4HBDqZd1fwbcn/SqliUUFibNRJeZCeKNoMkrmgh7zbsDWLwSOdz3SJNkXKPeYStmaUvg66pR7w3pKAeo5bkxfNZXgcfl9q2PV0z3rxZ9hycfCer5CtWRGemdEdVt0iGm9b0QfhfVb25lc7g3Y4WKK3dze6kbuxSz0ah+yMgngNOyFDycWUtLR0xOvOu6oe61WZJ+WxkzSy37xuF8GxMfayJ2xdFmpxk40lhyEJWTpmsGufOXs5bVgVdVCqVcRJa+WQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=HLLAjmP0VQImJyvzcMRKGxpig8Eevi73YdUOjHllyV4=; b=JPHnXM2Q7Mp093OJkHm7oYukYAmDxf23hIVtw/Ab5+/Rjbay1wZiEefvjGbQOr476RUTe0/ZygMDYqqvLo6ZOtyG9vtcPkDBHtXD0edbe7650wGK4xh7KWq7KRI3Ml+qrDw8Czaick3C1HbzS6a3IeUp3bdp7rO1pkJ9rD9c6OJUjwDRHTwe4cIXDLhLnBf816eK5O59VFsD0fyFvYEW9hv+DE7NQWZuicyBJlF3A8PIC+a+oPY+4xpled/ooOARC9tI3o6mMHDJwn1ai6NrYqch7ygacHy1mkq9EeFP9/uyRNGt+IO1aoOLyIruLtahrNIb+GWH9+FaQj138mRmtg== 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 SI2PR04MB6115.apcprd04.prod.outlook.com (2603:1096:4:1fb::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.29; Wed, 30 Oct 2024 06:12:22 +0000 Received: from PUZPR04MB6316.apcprd04.prod.outlook.com ([fe80::409e:64d3:cee0:7b06]) by PUZPR04MB6316.apcprd04.prod.outlook.com ([fe80::409e:64d3:cee0:7b06%4]) with mapi id 15.20.8093.024; Wed, 30 Oct 2024 06:12:21 +0000 From: "Yuezhang.Mo@sony.com" To: "linkinjeon@kernel.org" , "sj1557.seo@samsung.com" CC: "linux-fsdevel@vger.kernel.org" , "Wataru.Aoyama@sony.com" Subject: [PATCH v1 5/6] exfat: code cleanup for exfat_readdir() Thread-Topic: [PATCH v1 5/6] exfat: code cleanup for exfat_readdir() Thread-Index: AdsE8yC3ez3tc0L+Tei8vqLbbtrSjglnt1DA Date: Wed, 30 Oct 2024 06:12:21 +0000 Message-ID: Accept-Language: en-US, zh-CN Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PUZPR04MB6316:EE_|SI2PR04MB6115:EE_ x-ms-office365-filtering-correlation-id: 68a0a6d1-bacd-47b4-2576-08dcf8a9d0fa x-proofpoint-id: d8690225-876f-412f-87c6-a7cb45557a4c x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|376014|1800799024|366016|38070700018; x-microsoft-antispam-message-info: =?utf-8?q?9jnSuNMj4dqgj2RNGU22O4DwrdYvHVh?= =?utf-8?q?w7ykmOwaroAwqLYsptrPe3gTi1Kw6GiLggeV9qyapWokyCpX4ODnBo13atiIJadFw?= =?utf-8?q?Qh5Jbe6Ce6PVQHNhMjp2zbzTuZjFU8YCpz+krlbUH9YZyCvGZWFIzZIW3VEpQlI3U?= =?utf-8?q?bGrjVXN/wmQcGG9P4yLrtH4uvpNBuNPCH/R17oPk6wKg/FtqjAoDKZyeuxWarld+0?= =?utf-8?q?OT1smHNGfBWX1Wa27FSwbvWM8L4ZTqcMEX3LYo/jdlaHePHcWkxoP9VyZbvo3VUs1?= =?utf-8?q?n7ehZ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iTX2VkLV5F/8DmBjhd3F0cNFyWwDFa2S0ivx/u5Ng8ux6oc?= =?utf-8?q?YVJq9eUwjniYN8bpxxJ1AFRbcXaJYa6B1jvteH7F/AD43D5MeX/Td+jVfEcieZ348?= =?utf-8?q?9iTBr7Vm0ACUiepkAdaUdbbPdD7Zuyz1s9RRh6fyRsEyLY0Hvn/b7Ilg=3D?= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:zh-cn;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PUZPR04MB6316.apcprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(1800799024)(366016)(38070700018);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?i2wz1h8946BLw1wZrCbEzXF5GOOo?= =?utf-8?q?Ikshiy+Ka3DPSRACABhyBvDfL2N4L+Rdze7Gg0bzapHN84eIsMyD91DIDR84MJhN1?= =?utf-8?q?jY/ZvJ3R3G42UYA5EyWfgN2CzYWDQ68dvcszhEXYDYaBr4yeIwrevjaksi2wK1qLX?= =?utf-8?q?4lw5FjIeMWRECzgUINwLLk3S7m74DVUHhTW7Ocs1Ag62LbFf1NRxypV4lZfLZJW0L?= =?utf-8?q?8HdkNwVQuOuXe5uYxpYexMvG+eVhey+7HWJfLVmp8uAa/ra9IFHrhy/h3JsE8pQhv?= =?utf-8?q?UCfsnf1KE0uFa3xPn40jshVWjS6pDDTltw/vBjtSJAVh3QQIL1c85rcefpSOHf+1D?= =?utf-8?q?411jVubYQ4W30pc/Az2zg4veceFzyusK8WhfaCPm61pwlYXBG2DpKK+CXhlCRobs7?= =?utf-8?q?q8boNdqyJ4H+XQF7u6WXWeg2mc4tQ75X6MXKKdIOBJnMkIpSQMhSZj3U6Nw3WKzSO?= =?utf-8?q?yDSkU53Vbm6m/+Usb0otwozetRhaw3HzMK/z948EHKK3X4/eg7avxoQ6Mn/+hx71O?= =?utf-8?q?wpR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?q?D1dq0wVf/kS6SMVHyjQYaMfStZhxoQr0N1OtH7Zf4BisL8zw927P8iCM4YsTOI/4O?= =?utf-8?q?RCj4er1i27hvWIHV7USmDLu+dSpiZ652V11Ay9VjMOJ9eAk9svO3X+6vGorCf1bmH?= =?utf-8?q?6q8wVS/RSShB?= Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: L/yfX2S7sIVaSjS8GIY4WqKyfYPIcPhHZPuq+Ywo1bR3NCZQYtAFEuxXxrJ2am+I/FJHtndsGCOeDdGX7/kc0rTGYSLhEamlpZ3ODpDJyiQ5WhzAuTd2dQ1+m+XJdN8Q8QPadd2NszMFiAXyFRxWdBnTBy9UQewiI+RyZx5EXLXlT3ZsLsQFnBpXulwfxShLJXLZDPzsX7rMBOywaiTDNqImIrb7G3DXqmantwTIv9An4gtXzxx6iFYI++7lALV/gOJ6FQISb1ymMZ2wtICPbndE8yuIgtpGHoQ1TZoezoRpYeud8NkwHx/GkxoZTVsSmkZ+CbLq1o8TrpcZiNt3cgzSgDWV8WVPCug0oIq0H4lwxZupYPl4ufBoLHTRIJ4ZFJwwL69pNfkLsPrRsyILVu2Tkzj2r3Ws7/ObxAvtXRBH+qJXiu+zNpAkpq+AZOX27qYMjHwJGGwDehKkpKUoeDjh9d1fGIZ8F9G4SB4TqexiYz3HG3y5F326B92zonrCW3fBcEE2eMWqn36mPxWayZe0qIsECQgRogzE1xRNuXFqwVKPBeh8PvdDRAz0PZ8ecv+YiBzu5kjvQDQspNRAgkgylc+9kz09Z+dqs+28fndbtsGmErsb0iI9r5obm5jw 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: 68a0a6d1-bacd-47b4-2576-08dcf8a9d0fa X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Oct 2024 06:12:21.8698 (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: Mk8qatuFTM2hTNN1xIWGZA/nwIL4uKupxLSJ/uFdogC24kqMAXyDiI8Ieab3xkmdBvfQzVZ3Rrl3nm9vc1nPiw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SI2PR04MB6115 X-Proofpoint-GUID: 0eX2Ly4VKz3s4_5Qj3yHxAYU_A2eR8hA X-Proofpoint-ORIG-GUID: 0eX2Ly4VKz3s4_5Qj3yHxAYU_A2eR8hA X-Sony-Outbound-GUID: 0eX2Ly4VKz3s4_5Qj3yHxAYU_A2eR8hA X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-10-30_03,2024-10-29_01,2024-09-30_01 For the root directory and other directories, the clusters allocated to them can be obtained from exfat_inode_info, and there is no need to distinguish them. And there is no need to initialize atime/ctime/mtime/size in exfat_readdir(), because exfat_iterate() does not use them. Signed-off-by: Yuezhang Mo Reviewed-by: Aoyama Wataru Reviewed-by: Daniel Palmer --- fs/exfat/dir.c | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/fs/exfat/dir.c b/fs/exfat/dir.c index 61221c59547d..e2d3a06fb5e3 100644 --- a/fs/exfat/dir.c +++ b/fs/exfat/dir.c @@ -82,11 +82,8 @@ static int exfat_readdir(struct inode *inode, loff_t *cpos, struct exfat_dir_ent if (ei->type != TYPE_DIR) return -EPERM; - if (ei->entry == -1) - exfat_chain_set(&dir, sbi->root_dir, 0, ALLOC_FAT_CHAIN); - else - exfat_chain_set(&dir, ei->start_clu, - EXFAT_B_TO_CLU(i_size_read(inode), sbi), ei->flags); + exfat_chain_set(&dir, ei->start_clu, + EXFAT_B_TO_CLU(i_size_read(inode), sbi), ei->flags); dentries_per_clu = sbi->dentries_per_clu; max_dentries = (unsigned int)min_t(u64, MAX_EXFAT_DENTRIES, @@ -135,21 +132,6 @@ static int exfat_readdir(struct inode *inode, loff_t *cpos, struct exfat_dir_ent num_ext = ep->dentry.file.num_ext; dir_entry->attr = le16_to_cpu(ep->dentry.file.attr); - exfat_get_entry_time(sbi, &dir_entry->crtime, - ep->dentry.file.create_tz, - ep->dentry.file.create_time, - ep->dentry.file.create_date, - ep->dentry.file.create_time_cs); - exfat_get_entry_time(sbi, &dir_entry->mtime, - ep->dentry.file.modify_tz, - ep->dentry.file.modify_time, - ep->dentry.file.modify_date, - ep->dentry.file.modify_time_cs); - exfat_get_entry_time(sbi, &dir_entry->atime, - ep->dentry.file.access_tz, - ep->dentry.file.access_time, - ep->dentry.file.access_date, - 0); *uni_name.name = 0x0; err = exfat_get_uniname_from_ext_entry(sb, &clu, i, @@ -166,8 +148,6 @@ static int exfat_readdir(struct inode *inode, loff_t *cpos, struct exfat_dir_ent ep = exfat_get_dentry(sb, &clu, i + 1, &bh); if (!ep) return -EIO; - dir_entry->size = - le64_to_cpu(ep->dentry.stream.valid_size); dir_entry->entry = dentry; brelse(bh);