From patchwork Mon Nov 18 02:02:15 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: 13878025 Received: from mx07-001d1705.pphosted.com (mx07-001d1705.pphosted.com [185.132.183.11]) (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 8571C2AC17 for ; Mon, 18 Nov 2024 02:02:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=185.132.183.11 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731895355; cv=fail; b=aTRbv1WvhvjUSQ8XaHL66jY5KYzQDaj86n5lwXlC9zs0bowK7ODDBtE+Ms8AvqhORXqZdRiLmDzzoWBcw+ME5gqHZukvu7kChs6ZcoXmJoSZGric92nMU1WvyCtj6Zi5srdxm6F0wFIrdMqpqbLU8NEcGpJmeeBAPYvMWebACXI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731895355; c=relaxed/simple; bh=vryzNcwLyfZVGYRl2uswP1MxTcdF2jankqCdCx3klrs=; h=From:To:CC:Subject:Date:Message-ID:Content-Type:MIME-Version; b=mJOdTHhGP8T36d9xZZUyuX+piTKXhJyZPf0D3F+htp3KdR4uj9evG+CNNHfiBS0zEZzwglrDD8U3M5SYg31zBmOFob5cDH1mp19cFv2Mi1U2Oid67Ag1lxXtHi+pWcwOWwtR9WRQFlnpMOgnUdygsdrUpdIJBAwIRv/PPQjday4= 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=M+nxLrVa; arc=fail smtp.client-ip=185.132.183.11 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="M+nxLrVa" Received: from pps.filterd (m0209329.ppops.net [127.0.0.1]) by mx08-001d1705.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4AHNOHjd007526; Mon, 18 Nov 2024 02:02:22 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=vryzNcwLyfZVGYRl2uswP1MxTcdF2 jankqCdCx3klrs=; b=M+nxLrVaLdTNDFgYIet0wvcW5D+0Xx+HIF7kH4/wLf/Sz RfoTjUUDZoANTEIRB7UWRiJRE0Q1vxWNMmOTSYm7nOrXHJ86IR9pQljTHX+yC+TZ 8ngwPFzQgRMv4v50tW7AjrkEbJdg0eSYZfEYLJys9sds16GLraPHhGiHKOVZPHrD 7eB5bpY6N5DphbhqvdGncucf00ss/q2eV0FKaQAe4cx85ib8gcC7ngW6TUkbaUmq Gae/yI/dOZdvdHnlOk0B0fNlLUIl4auGgq+4CPUT104UoADETWq0mk59LxuCZYb/ SO2co0hAsPx6aJvjcxgsTQr/IeS81pWALOwBf/Z/w== Received: from apc01-psa-obe.outbound.protection.outlook.com (mail-psaapc01lp2043.outbound.protection.outlook.com [104.47.26.43]) by mx08-001d1705.pphosted.com (PPS) with ESMTPS id 42xm9613ut-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 18 Nov 2024 02:02:21 +0000 (GMT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=VHCoT1BfWSNC+ICfwcJghql30kL/OPgYbXcpmRLkp4wy8d5wUY7szJ+hdEyAneNOEfxA5smdLNlAh0BGPo78ecbIRlcBjd8u4ktUitfKyyyUqgo3Ke5OGHugUaGNgvwXBzCFAsvNSjihIJg7kR652UHmJKDKqFYmzGem1KDg7KMoXM6yxa9yrxaHXzQqGyy7vgwoCShzfVWACo/BCQA38TukfvyK3rJTwVZZSCFuYaBVwADao/5Tr3sZE+OPwqJctjq78ELGI+D6mj/N8XhxSiQHVvLOxGOXBc7IO4M7NQwm65URoHOUW9f9JKanPn6o3Gn/7Xa90YikaYSNm4YImQ== 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=vryzNcwLyfZVGYRl2uswP1MxTcdF2jankqCdCx3klrs=; b=VuaMCc5yuYmmORPr9i8awN9zMlYgg/G9LhN4Iv3dStOwMX5tx8HkwpLe8w1yepR9AWCYLUhZ2fOs7o81QgPmu091ilbSBAhEoWrSwSFOX0/Rw75nMqHw0q/IQDTeLGUusU3/VZvOxKHDfYnw0qEnvYSSQzC55qfohiPdt4kMuexRazEcKZpBxsl7tJ8ZigAswYxq0lZP4tSAWUp40G86O22SMwO3LQjS9w4FbA2klPuJ7MvyoOwH/UR/PSI1KRVyjkOY50GEj284ZrMGRgm4Vv6GRtmTWP8F2Q142v1RtFXIKZirIZ4ChzfRdUOEIAQRR/xZAItVGOiztASsl5eOww== 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 TYZPR04MB6119.apcprd04.prod.outlook.com (2603:1096:400:258::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.22; Mon, 18 Nov 2024 02:02:16 +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.8158.013; Mon, 18 Nov 2024 02:02:15 +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 v3 6/7] exfat: code cleanup for exfat_readdir() Thread-Topic: [PATCH v3 6/7] exfat: code cleanup for exfat_readdir() Thread-Index: AdsE8yC3W8n48hAWScyp5o4nMOvEXw0aeInQ Date: Mon, 18 Nov 2024 02:02:15 +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_|TYZPR04MB6119:EE_ x-ms-office365-filtering-correlation-id: 3168202b-b137-4f37-61dc-08dd0775068a 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|1800799024|376014|366016|38070700018; x-microsoft-antispam-message-info: =?utf-8?q?IyYmr9LnKt6v2zeZnYnOzX6GjwGVyJD?= =?utf-8?q?ihK4eb/il7kQnyOJ2fi25YTsfwaY13F9BoXeo6TUWuLw9cMV+ra7TEEF65YwgTcYN?= =?utf-8?q?d0mXcsikjcKoPuFGVnxq7+30H1TCM8OcvMy2rgS9jNBtPpzWRJOEq6YDaXCEwyaVo?= =?utf-8?q?ARJmgmrZ020wLE1t9LIEitf6kXXXxF3zZ17hGJMzPvDvi1riimHlABbPOlriGvvCg?= =?utf-8?q?Rsa1/9vwC133SBHinG2L7MjTGC+F8QBtuMQDS9wrIDDgxMn9tgIn2LH9+MzWfbpYE?= =?utf-8?q?ewhnFQZyO9tJjl02LKSXpXNfHo/oOOM5Y8pBH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B/EATH0EO3/gQH++03YCy0?= =?utf-8?q?caUahGvleMgrHyuDsh/86baEI80mU1qN+M5V9xx4VHTrNdXerXvBXxE/AZeuFbWfj?= =?utf-8?q?D8UDOHhOJ4ku8QbvADJKehKG3BpGFyCsBKBfetc6Vbab+Z6HPQ8NQYp4=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)(1800799024)(376014)(366016)(38070700018);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?1GbVp/H7Dl+FP95lp9BHbPo9mP6B?= =?utf-8?q?Hfp74hwUbHeK2gCcvGXXF2BvZGUBKHwGoDrmvQ91bOYYg7rYGu2f4McB3g50W1Z3T?= =?utf-8?q?S+or8pf+QP29y2WHKYQv1THcZNZioF0Q38wHwEl4GosrRP8LKzYKVcuu23GoW7EBB?= =?utf-8?q?GWzAoBX7KYD7cU9gdqIk4iCYfduiPKcZUfCiphm4P1AhAfLfxC9FjI9khuOoKJj5r?= =?utf-8?q?+HnzlGPTAJJZKDBvYWE2mudjoMKvEpqFLpGo70BP0jtaMOhliHikBKJIkvp4MKYnl?= =?utf-8?q?Yw6iN/dEeHLSnutA3pzRY9iQV04ofP8gHa1vzxwg42G8+t1rBF5up1S3rtPL60jbD?= =?utf-8?q?EgmmRXSWLGSgE4mj5L35sUcnIWU/OUAhwEMikMEPylUL85mO0UYml3TrP6okyFC/Y?= =?utf-8?q?ggY6h67VLt1iHg15jQwmRDizdTLLQkn/5sXQEix0EIep4I3DxarZI1XtFnmDDG3kF?= =?utf-8?q?60sGbKAMPmjUS4eUd8zabfD7E3W53atrQEr+nzfRSjIf3TC7bcGkS5D2FmH//GdO8?= =?utf-8?q?urm8/4Je13RFk1LsTUvW9omMSJSky9rUmf+dTzMtoxCXa3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pXZPpeYUGL61LYZhshidhBBI1k230Wx?= =?utf-8?q?fn6TrJBSuY+AUj7IJpYQgAZfA24M4C8HlEYZKGhf0emzbstBViZZ2HRJeCweYsAwb?= =?utf-8?q?w8LQSkqjY+uv?= 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: rlW5V+xh3sOQ9HH5VZ01iSStFLJ+lNdfqdNKPrj8gdD7v8UqppNPBC7aYbiYJxKl9yLVWdM83VZvmSPMY1LAibHpYCEE8SQYJvgU38H50+kkxE47Xgn+J4gq91Z2d4I9MeYLnmpkAaC8+vuuCuPpogj7vKBBu87rmVpNzMnnVdECYAKdYkoO5KeHCkfkjs0T2Umlu7I4Q81qpHIEN7UbEuZb4mTHq/y3iyTHtFFxnrm/gKp5uNPdQjHdo3PevM/Wzk2MtrOgX0LuG+dWFhwCp5yh6Y+JZ6AMs/pByjXfwDIlfTKxZRjT2t/F4gbeJQtVBMJbRq3B+XqeEB/Yinbg7jJv0IBlM8HrJt1WA97lPG+6P2gV8kl9C1XcrcHQnxpj45hX/g1QRqWnlLZ5/Lvx0qKFIwoyun1W+WiENMdlMAuJOxbLUu5nzGxjFl43eoft7eAN+YuEWYPbsHf1Z9F9au+7rUGY0I5ZZXuzKsEqvHXBkNP6E1dyjnjSToBUe1VlVhHm/BGm+ogFikVBSP6cz2rdEAF4H/KV90ewVc0o6Xx2vVtShRsRD+RsSVVQ5mkJ4WxsssS5IpC2h8tLZlxrk8MFtecTLlOevAczVTpUQR/upMnwBNNewSiiRxCXEmvC 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: 3168202b-b137-4f37-61dc-08dd0775068a X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Nov 2024 02:02:15.8546 (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: VaXnK+N1TntRb10T5bzQI7RjHWhLJKWj+NTxkR12L6fKANn77lrLb06n6T7RJejMmpv5dX7/DgitCO5D1go6mw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR04MB6119 X-Proofpoint-ORIG-GUID: DnhsbdQ9ay1tw4QL6QQH05YQP4KbeCLd X-Proofpoint-GUID: DnhsbdQ9ay1tw4QL6QQH05YQP4KbeCLd X-Sony-Outbound-GUID: DnhsbdQ9ay1tw4QL6QQH05YQP4KbeCLd X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-11-17_24,2024-11-14_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 7446bf09a04a..24149e0ebb82 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);