From patchwork Tue Dec 13 02:36:52 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: 13071667 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 B2B11C4332F for ; Tue, 13 Dec 2022 02:38:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234377AbiLMCiY (ORCPT ); Mon, 12 Dec 2022 21:38:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234314AbiLMCht (ORCPT ); Mon, 12 Dec 2022 21:37:49 -0500 Received: from mx07-001d1705.pphosted.com (mx07-001d1705.pphosted.com [185.132.183.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 701121E711; Mon, 12 Dec 2022 18:37:14 -0800 (PST) Received: from pps.filterd (m0209325.ppops.net [127.0.0.1]) by mx08-001d1705.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2BD05pfX016439; Tue, 13 Dec 2022 02:36: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=sgu6yPQ8lCayHzTODsx17It8x6n3yW2mxMZFTeqPLqM=; b=erQJDY38kNphiUmalOhmkX5pNhQbMS+d8y/d/68M3lN6eHV1PBtKZ8e++1cEvEUU9MuV kR30f8ztj375OUufB7qahpDcgWXYOP76PxnaLv7LCjwm6duJFNjsEny89NgWAaMZvFrJ pp3Ld75AYUHsIUs12C+Qi59UJkEykPl7AyU65H2HWm+6WAlTMwzhVU2y2myTn9zO59Gt CvlPCE6jWDVUMOj10yDOlMkYHbYU7uB47MC44/0px27MAYwqYojIRokwHutCX00C2DUl HGn+0721opeogU8ouGvSvHsrstazliSbol4k5AnWfPVvz8zlkttbZn3R8bHjtHCk3TaQ pA== Received: from apc01-tyz-obe.outbound.protection.outlook.com (mail-tyzapc01lp2043.outbound.protection.outlook.com [104.47.110.43]) by mx08-001d1705.pphosted.com (PPS) with ESMTPS id 3mcfbytma7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 13 Dec 2022 02:36:57 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MPTNL/UkZJ7oFJKkz4nDYDqF1qp8HzIjirpPdKLRK9F8j3Il/1q5S2ija3SnH9o3Y4gNlJppipfCqiSF2KsjbSHaZ2DgTTkapn87l2e8P6gy/OKcjexZCWt+jY52SGlaloUqddv9ODcOjmYA3oQU5KSsewQwrehteayo9ua7mfW9JcDZg+GCm3DhhKNTm2ennTZbuUDpKqohfAvUt02rCAyvUtY1VKdnnEvjj8KrvaUxSJnVjko2hX2rMGBqgapspLxZ4PYTiwstqMlXIh14T+gpsWr4kj3jRIVCo39pPHcvq7YkEOHuh9Bu+DTXDiB94tbyW0sbhsrUWJwE8b1pxA== 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=hNOGIOEJKqZXsOWeBu8sZc7MzD3kpi19CbkXv0CkeWIVHvbEjOk/W2jUPsB94fyKgJxgDqAvTJIDOgNw+p7+qnQrdnTmMQtHShztuTseQmUvaSQBwENISiCStbrPd269d+kK1ndOHYR7xk7THdnzv3mzZ3bHgdZWBDTtEoAO+HaK287IsALKxOaP8Uk+IQIhzceMLDaz02tKlIpXK/OkwvLYWyTcCFoH/LQ/Js2C2O5PcVA9NBWBCHdsv+C0i6qNsspy7tQv4EhhwWoKs3HWzyxgBeS4Lp4VDsROBhik0DXw364k+yx/ecEfjQILFQNFK1U1IJriwxxTMvGYAS7lUg== 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 SEZPR04MB6948.apcprd04.prod.outlook.com (2603:1096:101:e1::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.10; Tue, 13 Dec 2022 02:36:52 +0000 Received: from PUZPR04MB6316.apcprd04.prod.outlook.com ([fe80::c689:d665:b3a2:d4de]) by PUZPR04MB6316.apcprd04.prod.outlook.com ([fe80::c689:d665:b3a2:d4de%7]) with mapi id 15.20.5924.009; Tue, 13 Dec 2022 02:36:52 +0000 From: "Yuezhang.Mo@sony.com" To: "sj1557.seo@samsung.com" , "linkinjeon@kernel.org" CC: "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Andy.Wu@sony.com" , "Wataru.Aoyama@sony.com" Subject: [PATCH v2 1/7] exfat: remove call ilog2() from exfat_readdir() Thread-Topic: [PATCH v2 1/7] exfat: remove call ilog2() from exfat_readdir() Thread-Index: AdkOmXOzasUmLwpnSf6xtnBDY8gbaA== Date: Tue, 13 Dec 2022 02:36:52 +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_|SEZPR04MB6948:EE_ x-ms-office365-filtering-correlation-id: 9d89c779-51b4-4f02-189f-08dadcb2e479 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: R/qawWOmNP90qSJTPwlxQJQTII7D8o1tdGaepBDS3B1UdxmPlscu9RVlKoZXFCCFiFkKvW3nHLKPTvmvrquhRGM+EakOPO0rJy4mwN8Zu7Q+8ozpGm9H7zTolGrILF2qru4S4BE9f8SOR30NKO5aDfj5mZUIvHjYsuowGtkvVikO53TOIQS+y6Jl38FHRfP7r/JLWHrY5UKtNKjGMw8M1H5o3rrobZcWlDoZRjXm+gyKhGlFvcaB8nN67BTVNAtkIyCnqoyT1kiRdt7VwObRFcBHeU5mCOiNqsdbMNJoDUm4w1U9oJ7IBfw2mSSy8v1ipv+/kj63mcNjxFxAVNmMnAAOy2TIpy6ceqVnu2ZlQiWgGaeAaxkMpvXQ1/jDMaSNbdpUwNsZjaj7G/UGVuVmfNiqCLJtKOgL06GyPf8UMY5n8ChYGKfxJdVsrtrD0WeJanbOFdgUKXaEbLbX27LJD+FX4Of+T+MiYVtDlOIVxLm3LfQAP6ROyhwJsJIkxIN5GkxYHhr4DCrRkrEM+pi4U9HY+pAUiRp+2xPdZrwg16diQludZFSEqsK2ibl2jfOG2BPV77L/0TMpul7N2u3YPSFjAxaD7IapQYVRh1085EimXvMobXBXO92Ny10scELbgJqoC7yEF6SC/+roJ/n42lpzgUp2scyp5sF4eCext3LqzOHd5sz4Rvs6Zxkc1k+h9HPsUeXKwnv/2jKrLDd8ww== 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)(366004)(346002)(396003)(451199015)(86362001)(82960400001)(38070700005)(2906002)(8936002)(4326008)(8676002)(66946007)(66476007)(66446008)(64756008)(66556008)(5660300002)(122000001)(38100700002)(33656002)(83380400001)(478600001)(110136005)(316002)(54906003)(71200400001)(76116006)(55016003)(52536014)(41300700001)(6506007)(7696005)(26005)(186003)(9686003)(107886003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?RWrGlgYLfaPwsnK2uhbmZSXY5iRp?= =?utf-8?q?gG0yWJbkPGg79n4y9JA9kJgcqhx7owtMoN/nSDkbfrCrH2ODNyMku0ewja+7FOwar?= =?utf-8?q?4bRgBg8ibKBYhQ0F0IfDPJFsRyFOuwZqN/++hEAxvZ+aYYxIGqgZqDZbOaHHHmesn?= =?utf-8?q?PWnBP/4xCup/RmevRbtw229xjHwUuqRVmATghSgFda5ZvfivKHrWD2CfQZVFbSybJ?= =?utf-8?q?yONuzAwOswhUe7vUT5x4OUywGjaaLkpMFLQpALBpRNlijIS1G52hNWyJ+gbMPvmfZ?= =?utf-8?q?VE0cR0v3oJFQu5MRDvwYkL45uy/yQqdSMmfcFgygDs0w0607e99GANhAY/Sc9/C7l?= =?utf-8?q?IQBsnyLPRZRViOhH7EtVVM4BEyIDOxI7euK6gfK6HsLV+DLgac4hlthF8el2BBZGA?= =?utf-8?q?uvi5XhK2I2xJrdp1VNRBTfEzaxHztngf0ahcGqACTF1cl3GYRUoiLe6ywWa4Mu9nW?= =?utf-8?q?ChPR41lhDuDeOkueVuHr8nkwuzj01lelt6ErIGx1AoylAwEbKwyFuqiQSw8bFq2jp?= =?utf-8?q?beg7QVldUPmJhZykNLU+dZPov4dpFWJODeF+CGQ8iBFkN++5u4/tkOCTtu/wgOWej?= =?utf-8?q?4uRBvI1W5NKLQLyEzrQWA7K4j1z+JmFaUfZ7TW9KYorCQ65DJTMYcvn9R1gQFT4ny?= =?utf-8?q?t/H9zqC3LlCuUrEkqiqsoNrW5NE0FgGkSOD5lzopXX9I4RNEGaQuaK8eXr2gc5MG4?= =?utf-8?q?UaGoHjuLICAOs+h8zivd1tuyzxnDPRCm1h1M/CAP67TdYx0jSuJ1nXwUzz6NJhCjT?= =?utf-8?q?fcIoQ+mkBKmmsD3Fa6xDl50seu1IGeQD+Rc4uWlmrh3OhtTWojNGENGghkdS5tKKa?= =?utf-8?q?KPWdXrloifZrYcu2NzhqwXiWM1pWBwk3FrPJR2W74LW4RijaAohLKDvgihXJLvUCb?= =?utf-8?q?08GEA6bNp38YNRkHxtGZ0+nKNEQskiRiqHqE70txkvnD+Hmq3isVzMS4c29nO2E7d?= =?utf-8?q?nu02TtPRT8MPqKDLGMuqpDYoEh8ApPqeicAW3CkMC3t0K0zwSgJ5wfJRTlpuZdf9U?= =?utf-8?q?5tTfYrbJDN9zGlb1/aVuqjOQwC3CG9YV5gUmgo3ovmQaDWrB9TowSrpmltLiGMnSa?= =?utf-8?q?4jNQNY04vYi8Vm7TmgVcG7M4eu8ny1VkrkLTip1Tbsj11pYwV85gqih2PjilpNEwe?= =?utf-8?q?2vWCBETTL6sgMlUHgSHip/k5ycZocP1ksfjh4B8bhkoEw4ibdeovA7qhTJ7XjNqgm?= =?utf-8?q?fzZJ+ny5KUjS7Rck5k5Ch9yiljIV1RNeHto6fDQ9raK2S8jnTqizkUSwPHSOT++ah?= =?utf-8?q?2Cu2VKMn21iyp9KL5nwKVCfKGY6kO/cCwu5Cc6GQfA6/keBikW873Hv7KRt632Oy+?= =?utf-8?q?WGe8B7BD6tPC6MxN6/A6UAosrnlDsOpclDctyfsZ29ptJDiSX51huyzdKRpS5b4Q3?= =?utf-8?q?Msxr4Nj5M8YQiCzbqzNqYFsQl02DbW6zi1CPw3LYNcwIpj5OUKRuPUEkOjOGWuPtY?= =?utf-8?q?GwhQOOlipiEqrWKEi+0IvvdUGQRN+p+OXkdgv6ckOSdmH1xJozoo7/vqLFbxhPUzv?= =?utf-8?q?HGYySMR41rYu?= MIME-Version: 1.0 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: 9d89c779-51b4-4f02-189f-08dadcb2e479 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Dec 2022 02:36:52.1308 (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: wF3l+p1JpQY7pRkT9TnVtI7TPJ9m7W5h548HkKWyeT0poPCsspAUqfAjC+SJ88mLC4nePLKUAlpo2twpzHyplA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR04MB6948 X-Proofpoint-GUID: jefesoyQjk3DZS28J8mm9URqE8fRskkR X-Proofpoint-ORIG-GUID: jefesoyQjk3DZS28J8mm9URqE8fRskkR X-Sony-Outbound-GUID: jefesoyQjk3DZS28J8mm9URqE8fRskkR 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-12_02,2022-12-12_02,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 Tue Dec 13 02:36:55 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: 13071666 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 D1139C4167B for ; Tue, 13 Dec 2022 02:38:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234317AbiLMCiV (ORCPT ); Mon, 12 Dec 2022 21:38:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234180AbiLMCht (ORCPT ); Mon, 12 Dec 2022 21:37:49 -0500 Received: from mx08-001d1705.pphosted.com (mx08-001d1705.pphosted.com [185.183.30.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A57E1E70E; Mon, 12 Dec 2022 18:37:13 -0800 (PST) Received: from pps.filterd (m0209322.ppops.net [127.0.0.1]) by mx08-001d1705.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2BD1YF55012328; Tue, 13 Dec 2022 02:37:04 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=Vb99SBR71tBj5P2x4EVBnpt2G1zmKK5RQGup03t/yHWHqmnuJdpUncIf3E/EEWIY9LcE fNBsVsVWZsuy2rYLrDDc644twpqSiAqkvJWgS42RjzTwZtwWL5iNHQ7bxZE9drcDa8a0 oMPNgSEFhhmYXgEayqANVlmls4NPVWsybaX+4zW0hjDiETc2xA7qE9GkdMUJ6eKlUxiz ghlI3D/py4sefSvDZoggXAAcS/4UqojGs9AySh1MTKqGYc0qnLtlpxbHzhlyW+bOQ1H9 Cxp6TwK405qKAsEoYz4C7M6Rs4CJAluCs8dF7hSCO0UXQ0X/6bAppkE+4gOaXDrhXHyA pQ== Received: from apc01-tyz-obe.outbound.protection.outlook.com (mail-tyzapc01lp2047.outbound.protection.outlook.com [104.47.110.47]) by mx08-001d1705.pphosted.com (PPS) with ESMTPS id 3mcgw7th26-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 13 Dec 2022 02:37:01 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=G7GKnZzsYfRnIvUd1T8uGfScWB9KkSoxrXNgZXQ2bTbJPhWklbvk1RHn7nuVL4In7KVZ5q8qN6wKO7n7hAHeLtD8MQNP0vZ/7qMdWpOt2Tyy1TqUwXgDDX0SvRaDgHprtHM/2QjqEqi2dyXwgm2wqt7GjONEjccvf9Aj1zYJ7V/q8UlByIOTa6G0JXq76aZ6Eruvm7531pxosgTzpkeh+e18UGCSWEHnxlCZA003mnf+zju0pOMA00L4c5QyXHGqBeDlKL1dWSkTOPwO2ccD9QIJBK7zpMkYRoUxEY22hmaVUFFFBXzujd3mQv8gWy5FNMVel1ikzctMN/mNKybnQw== 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=MvqkuGIwjawTjfwJPjwJvOMvBrgB4QKBuvw/U01OTPrU2dDrCKnYXBnAx9Et21RqnD8ONf0jE2sE2WuG8JepYsErAnn4UG0ncA0EMBr2or9iuKIPgetcCdMsoUK7IT7i71yZ5lIHEQSyEBbD/Un+TwTpAoX/ZTq34b0n6lv4PauP5bv1LaQfx7/0/vKh9KBNm0utIMMISCeo3YcWlBDyQto4efZIX0qo14vmuONqSubSCyzQZdaf3nVcEFmctsiRMPm7UoGqcG+uJfv2TkQPGpFShcRCLQBZ74piVZFgqRqWgRtMrmk5Ba/I3hRwbaQob6IMXfcof99itNtGJTrZ0Q== 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 SEZPR04MB6948.apcprd04.prod.outlook.com (2603:1096:101:e1::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.10; Tue, 13 Dec 2022 02:36:55 +0000 Received: from PUZPR04MB6316.apcprd04.prod.outlook.com ([fe80::c689:d665:b3a2:d4de]) by PUZPR04MB6316.apcprd04.prod.outlook.com ([fe80::c689:d665:b3a2:d4de%7]) with mapi id 15.20.5924.009; Tue, 13 Dec 2022 02:36:55 +0000 From: "Yuezhang.Mo@sony.com" To: "sj1557.seo@samsung.com" , "linkinjeon@kernel.org" CC: "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Andy.Wu@sony.com" , "Wataru.Aoyama@sony.com" Subject: [PATCH v2 2/7] exfat: remove unneeded codes from __exfat_rename() Thread-Topic: [PATCH v2 2/7] exfat: remove unneeded codes from __exfat_rename() Thread-Index: AdkOmaed8wnUZh9jSXqXATN8Nxo26Q== Date: Tue, 13 Dec 2022 02:36:55 +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_|SEZPR04MB6948:EE_ x-ms-office365-filtering-correlation-id: f68da264-21ef-4b1e-0704-08dadcb2e686 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: sDfLlNZwzDI+HRQYhs9jVeSWEf9UBV3qTiXOAZpEj8xEWajvakEiml1KTAZ5b6fS/KdJ/Vx1U96kNfV9guoBtJoK2rz3egoccO8qvPQgfZCYh4WWZxsl4YnWPISse1BB3RBBgoXCavpjXtSkybz3miQl8n34tYmw3ARznYrP0p7WFyZfr0eM5S9DUZGb1ZrnAib/hkwXbl0jt+QXOXkU6rj737Bd98Gto1z9FPhii5OdJ3bjkE5zg9i2rD+kUivkk505NSvO7TXgro8bm1zf9mg0f8pLGRkQO3hInDfc4ayadkhOzF6kkv9jtDJeat0GuuQV3EScd/1Y/N0OfG5YtX3hUeEtDpCW967syjdC9jsoZ57MO8WVCJv1wq9TOXX+xSOfTQIU1URTLbRoiXxzB8PM9QwP9/HQW3sAFYY3Q+XOXrg5qt9V2f9VfU+QrqI2BdvQcIZSNPPw0kD4DKRsxl5DAzM9ozkCV+dv/6I7F/NYQYUTRxOS6NCJdj3bvc9qkitAbjlFtuaUTwrPhQ2aSuCpu3Y+wBz/dkEA5OU0seE8Mt328w6Rl35HUUIXVrquWB7kCS1w57dRK+g+28tTk7jQrdoAzQbGEn5CzYff7Za7xLFtwo/QfTKpYZE23r9VqrzPB9TWmMP54gaCbd+f2evgIbu8xz5ltBJ1D4S9iMJhegOLDx5dxBnIoXPYjmtYbX8/nktsd9v2trFkz0eLqw== 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)(366004)(346002)(396003)(451199015)(86362001)(82960400001)(38070700005)(2906002)(8936002)(4326008)(8676002)(66946007)(66476007)(66446008)(64756008)(66556008)(5660300002)(122000001)(38100700002)(33656002)(83380400001)(478600001)(110136005)(316002)(54906003)(71200400001)(76116006)(55016003)(52536014)(41300700001)(6506007)(7696005)(26005)(186003)(9686003)(107886003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?5Sn0PavLwvXSxpwkK0u5qZl9fDb6?= =?utf-8?q?TKJ7eqL8w8TEfiRSlsGQwvHBn0OGU//d6kAGsdaffHqKInwrUoPfd2CmeQmTR7WEc?= =?utf-8?q?46qRBVIM8OYPVkPdCqcxLDp7Xd5mJWcSwYm2zB7HtgO4nkcdHPjspM9vTohXcQZ21?= =?utf-8?q?WDvyQWhYOqagoIB3q5mXbEI+z8II/5mtRkN2amPegGcAURUUtriRpGiRkQgJKQ706?= =?utf-8?q?hfRUMZJwE+Hw1Z3J5fpB/3PvEidItwYGwuChYI0H7ly9qgHlMZ+foS45EmqqvF+Wh?= =?utf-8?q?umS3/1CJl7nEYY+DjBSHmWdm4zGCbD25Utnj3Wa+NjTiPvR+ns+ATlTb0HJZfOFvY?= =?utf-8?q?U0OiBgEjPYmzVUjDhD3jXQirhvQ2p6ep0j76mwBCbY/1WEbzxVBO/1bBf8QTv11wf?= =?utf-8?q?WKBO5F2SVoLSNiL8T1bHCiLM/GREnlWqnXJytKIONmlqLBM5PpHtYwO0PRf1mAzSH?= =?utf-8?q?XhfLMTCA0Rv98aOz1tPA93oZ+5K3n466oqiFmUoQe8SwOYmX+BG0MY3RUXHzNggzh?= =?utf-8?q?ukvm0ve2wLWBo0ave6eY6Ff2+fG7aGWm4/b0xRZcLriVsYsWx0J5YqSMWOpSD2K49?= =?utf-8?q?NEF1Bgp1tsfa8V9pVlAmnPvNqZj9+tfgVDIc3Dqsgmdch6Y965HBfZy+jDPPm0GVW?= =?utf-8?q?MRwEyaHZWNkE89MvUlchLyFrhRED4RrQpzXKenadV6o7yEh+8XpffqV3lq4wlaOnR?= =?utf-8?q?8TcCG4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Internal X-MS-Exchange-CrossTenant-AuthSource: PUZPR04MB6316.apcprd04.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f68da264-21ef-4b1e-0704-08dadcb2e686 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Dec 2022 02:36:55.5710 (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: /qkwMK/XJChcas+xCqCBORCMA8OtLB+f2PAmv0UdRuc0MN5+l2vDwuERnCR56Go9NtzhIm+0BeRE+6CbAHWpWA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR04MB6948 X-Proofpoint-ORIG-GUID: wMBJregojqql3Fwa1t7V2-leddumCxAq X-Proofpoint-GUID: wMBJregojqql3Fwa1t7V2-leddumCxAq X-Sony-Outbound-GUID: wMBJregojqql3Fwa1t7V2-leddumCxAq 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-12_02,2022-12-12_02,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 Tue Dec 13 02:36:59 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: 13071668 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 6C782C00145 for ; Tue, 13 Dec 2022 02:38:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234382AbiLMCi1 (ORCPT ); Mon, 12 Dec 2022 21:38:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234193AbiLMCiC (ORCPT ); Mon, 12 Dec 2022 21:38:02 -0500 Received: from mx08-001d1705.pphosted.com (mx08-001d1705.pphosted.com [185.183.30.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97F5B1E71A; Mon, 12 Dec 2022 18:37:15 -0800 (PST) Received: from pps.filterd (m0209322.ppops.net [127.0.0.1]) by mx08-001d1705.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2BD1YF56012328; Tue, 13 Dec 2022 02:37:05 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=RsWUC/zRObHxOPv1FlIyfmC6cM7JQtBg9nKz/ys/nhI=; b=niFKY06E1GJGkcqp289P1A32iG3N6xiTzUsHx1Kd5JfOiW1MNfTFaAs9ZK2ZmyNpu+TN i1xJrP4dX0o0fNO2hVr4Ov2l6U8NKP2PsKl87uBa6Xii1S9WzAAOgDJaBTYaTcGjz2VY J3H+rXN5zh5P6e4pZ+GeQofeXpYafy46LMalyNkddcrEABkmQ9o9+jpVDxkItWTyw8EU OJFLdJOq9LQHbj3b8Q87tlZD9lrXZj77ac/O230Obh34GAEulGNMhfsTnP3m4rWbnFTI b13O1PZ4BAw1Cjq3BNjByt09CgLoWHqCVxpDG6PCAmGwJwm5FBn7NMaYRZZ+Kjhhp1FY pg== Received: from apc01-tyz-obe.outbound.protection.outlook.com (mail-tyzapc01lp2047.outbound.protection.outlook.com [104.47.110.47]) by mx08-001d1705.pphosted.com (PPS) with ESMTPS id 3mcgw7th26-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 13 Dec 2022 02:37:05 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=C647pOu+Zt9x27LqMS3/PkkHOaxVTUWWlhM0bOIsfOj3YCM8ly6KEjHXV+6Pl7ziiDknEcbmnXBjBtlTMAnhddTZEdLC/Wg8gYcBhZ3VA5W3nH4TDA7rCD7v7Rdqnoz3tmZaPxF97uxPFQUtC1lB6WFicwg8IcqoVbX/ZgVSvCS5dX9oVMjNvtpXFviLgZF3CHylg4k0TyVppkQdkZSRlgcUhGIqcOtEFOPg1BQv/r+rkxqvgbRBGDOKWvQcryF+BSNhbiD1SPpzTKmiIdLzbz96srk1BmKGrqbJMFcoXwfuHClxc0eWpBf1418SHVSnaKUobHj5FWI9/Nm8dO7LCQ== 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=RsWUC/zRObHxOPv1FlIyfmC6cM7JQtBg9nKz/ys/nhI=; b=CD9bYMM87tQuvmXDId/SOAz67odRjVmJGTE9k3lR6XJG/DuvcR5zy1AS+wjRofNTtlZx4O4x1+e6noy4peYn25kAXe9hZNbFqfocjuP4yPRa0MWtYTZv5SvLtUz8EZEuxO6vyD2+cKdac+A+8GTWrrLm7fC3a2K172DVgrUYvUICJY5X8ZYKScqzZ3IgzHSavXmIN9OpULfdPxmRpP2HO56YyZCLRdIEK6t5PHGvPEGc8aAxh1Fx56bYtRue9VDY1Hq0BPL6/ZEtRdcVz1ONu+suWNtsqFHZWVD94meM4iGGqZ95lhzeLRgwqBUhs9HDf6/zsC5+MvP3OMaoU5kC1A== 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 SEZPR04MB6948.apcprd04.prod.outlook.com (2603:1096:101:e1::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.10; Tue, 13 Dec 2022 02:36:59 +0000 Received: from PUZPR04MB6316.apcprd04.prod.outlook.com ([fe80::c689:d665:b3a2:d4de]) by PUZPR04MB6316.apcprd04.prod.outlook.com ([fe80::c689:d665:b3a2:d4de%7]) with mapi id 15.20.5924.009; Tue, 13 Dec 2022 02:36:59 +0000 From: "Yuezhang.Mo@sony.com" To: "sj1557.seo@samsung.com" , "linkinjeon@kernel.org" CC: "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Andy.Wu@sony.com" , "Wataru.Aoyama@sony.com" Subject: [PATCH v2 3/7] exfat: remove unnecessary arguments from exfat_find_dir_entry() Thread-Topic: [PATCH v2 3/7] exfat: remove unnecessary arguments from exfat_find_dir_entry() Thread-Index: AdkOmduhIQbmVfGOQoO6mEOmIBBoRg== Date: Tue, 13 Dec 2022 02:36:59 +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_|SEZPR04MB6948:EE_ x-ms-office365-filtering-correlation-id: 781109f2-7eb1-41cb-4ab1-08dadcb2e8d5 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: NzYQNyXSBcYGgIJKihKtBrLhktBEn7lM08KIjNQYqH4hXRMkIn/aqWlYUtTlUNPxvts5BSYlq+r2aC4mjBhRmLQQRlUG20rxsAPgjDIUvn+C7H5rn32mj3ftAVXnxFdGsp6U5YwfbxwfQu4WSOyPLdIUanHm3eYowQjeBx/gDfwEKz9cSRUJUAIc5yXSjbmA5SWGbsWcTYdneKQnsI4uwnQ3RdQ1o9k54ItyVMBFoFwPALeX1qQwxCDvSSj8jVk6YFsr2lXc/4hLw04YkA7Mml3Cxd6R5FZ9eQ4TDcwRjjx8ahFtUCAJ/ZbReuSc7XKWF+VkND+lnQf3x7sY3CUTpOTnPXXKFkUrCp/F0l6qU0PwQA6/DqddVA7TPMA2mAkcZafElWA9gL+HnBRK5DXS7CLPhKWGfFgP1GT/X8/3RD8go7mus00itNz7MAozBKjZYPASn82i7cTmJp99C5pFVmvwbie4Nxg7v3tF3BrLREO9QxO8HI6kvx/iARKB3vNpgZa72+Ywfs1W4anLrlXlF/yLRtAcPVs4YP5I9uskAuccHRs3gBc1n9sxJXFZRf97i8WzEXLXQ1ubWuxmKbD6KKI1D1skHZjyPhSVoguanvCuS7XDPAkCnb1d5j9nof4+1weS/p6A4GCluj8arpdZfWomJ7K7tCh4e4pc1CgsoFRne07x2MBJC3XdDJnHg9aghpTL+lboa78zHoy1UI4iHg== 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)(366004)(346002)(396003)(451199015)(86362001)(82960400001)(38070700005)(2906002)(8936002)(4326008)(8676002)(66946007)(66476007)(66446008)(64756008)(66556008)(5660300002)(122000001)(38100700002)(33656002)(83380400001)(478600001)(110136005)(316002)(54906003)(71200400001)(76116006)(55016003)(52536014)(41300700001)(6506007)(7696005)(26005)(186003)(9686003)(107886003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?A0rz7rAUv1lUbkCtbQ3CaOdw6wPv?= =?utf-8?q?RyS/6uwupjP4tGPOknvb9Zh2wmdtzPoBKoExTNnGlALZ5GrQDJzUzmEplkfonykg+?= =?utf-8?q?LZkU5EPgo2CCvbnzYZAxc7VWLz1eYnB2QUWfOH90kl2VRU4JSw+RNDduaG1wGTW3C?= =?utf-8?q?20NPkwgCqzvV3Swn8LzE57bhJobXfjMu+mV5X5uUi2FfP6oAGY3/8yxNeDhWC4yz5?= =?utf-8?q?d5VR2kxVC+f1xY91EUlcl7q1nJTfUCiclvNg9bO10YC6uBORikeWAA+DcVOI4o1uW?= =?utf-8?q?TgyCuQoayPluJNsDtC24PYnfRavDUIDaEdi+qq8atmfVGtDWUGezmWRpzGb1q4f+D?= =?utf-8?q?EGUAStXh+5y+U/tdVRDnm2pAO7HBzep17e7RWB1MYD/5t43vAObX3P0RsQHGNHKBL?= =?utf-8?q?EbwKxLrDFlFnENAIeaI0VP7uRlRLn+QwSkGpaC9eLwLa1jS7nbHthwWEy6xMFbQGh?= =?utf-8?q?uitWL/jJVMYOunRTO/oYGjwyVHADO4diEQEl/Oeo+K5WUYo39B0XQZZBR/juNLQVY?= =?utf-8?q?xOyWa6in+jef+/6aDv/g7MDKnlxh8g+IxF3wGoUZft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jGt6N+x7sUEBCM?= =?utf-8?q?38UpE0FbA+zkNtFG5KhRsS8fzyVdLwHFzADRHXjR9mPUkJvh1pPAQp0mo4dKnNix/?= =?utf-8?q?+xBcIqZyJG5l?= MIME-Version: 1.0 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: 781109f2-7eb1-41cb-4ab1-08dadcb2e8d5 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Dec 2022 02:36:59.4615 (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: 4IPrWCD8JbcIW3J1B+ZWPiWQsxOf1MIeIswAqt1O3AAA6mCuyYLt0IJB1WHSxcVS787OPXpqCO9KUN6yAxOHJw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR04MB6948 X-Proofpoint-ORIG-GUID: y-3SaFqLa4hnE3K0r3K6T1McdrWNpHih X-Proofpoint-GUID: y-3SaFqLa4hnE3K0r3K6T1McdrWNpHih X-Sony-Outbound-GUID: y-3SaFqLa4hnE3K0r3K6T1McdrWNpHih 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-12_02,2022-12-12_02,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 Tue Dec 13 02:37:02 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: 13071669 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 6FC8DC4332F for ; Tue, 13 Dec 2022 02:38:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234385AbiLMCia (ORCPT ); Mon, 12 Dec 2022 21:38:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234319AbiLMCiC (ORCPT ); Mon, 12 Dec 2022 21:38:02 -0500 Received: from mx08-001d1705.pphosted.com (mx08-001d1705.pphosted.com [185.183.30.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 456351E71F; Mon, 12 Dec 2022 18:37:16 -0800 (PST) Received: from pps.filterd (m0209322.ppops.net [127.0.0.1]) by mx08-001d1705.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2BD1YF57012328; Tue, 13 Dec 2022 02:37:06 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=4Tn8j2rkPQ6pIp8ncNbqL6SPmdDap+l2SdSAFKIjnDI=; b=UhMChztCSCDTD+jgrw3clB1n77sefKTIwX6yKPL50LaaxORXfKxh5kFnO8ZLoVrrCsiy y29o+B4XFlAf+ZdnqjOwe5bdOJGcxbgsPnLUNQYZ+mGGgOSc9GYO2TyVtw+XsFbpRpYT PXX+tdbokewwN60PsQeL1xMsiFhD/6SBwTRlBjYsVQYzW/9Iawf0d65aIQaWM2S/W59j 7g85BHlLaT1vHbsfGGMcsGd//kK4nbr4TEgdwg1Z2jG76hiNYEAb0wc23uG0uicFj0Pj 06vEhSlJeLAtzUmQI/cM3DoZJNKNY3lNJLwMILiyKlTqwlXjArw7QWcdaTBH5FO+jnlH kw== Received: from apc01-tyz-obe.outbound.protection.outlook.com (mail-tyzapc01lp2047.outbound.protection.outlook.com [104.47.110.47]) by mx08-001d1705.pphosted.com (PPS) with ESMTPS id 3mcgw7th26-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 13 Dec 2022 02:37:06 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QELjKoHCcyYPiSeAp8HLX55FfqAQ5kw4UesUF6BHxM04siRoI6FnEZgwJzXtqbztP/3k8d8NGS8+DD+9Q3C415OTOmVZAbjWkQAq2ieqNDYK5szFbuptEIk9LKCTJIcCZoy9pFMg/VCgtZLaK88U6Qd0rSwCwfNvXaoTPaZykBwrXnhZ8/uncsNrsB3FwBRiSTqJnMv0rcZIx+8f2Lm7ehZ1/e9rgTCOwSMuL7IEvuEUpp1VhFiTvnhHFpUvpemlPs4qzjt2iPDlnrmpYmMbwicURbkDJ7NbI4kil0MiJcAmRoYU5XfD6y7PCELmEJD0HICp/cJQqMN3viRRr1MhPg== 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=4Tn8j2rkPQ6pIp8ncNbqL6SPmdDap+l2SdSAFKIjnDI=; b=V7gCtbuUJKXbedIfEK0cc1abKbp4v3iUkwAfPPGKMB6zWlWjglpCvYokawn9FIvb7nOjkclDnqLcJjFX1zcrEiklKb2a0+LeKADz7F3A7BUw8dxJy6AQJ5/Z+W2IgfWaLN3sKRdVBMPh0caejhByKhvIj1FoPDi0ZKK6UE6F/Kj6R/yGPrAvFEpr3F1BiUQTmWySkoPAXuj7SZPTA78m7TqK9w/PKml0G5kRss2vs81fJGQ2HsCmwn+bXAI/W9a/7vij1d+Ha2IeOyGUFDQnSFkec0MUzVAPGkd0aX5xk/YAtbTMLznQkMXhyKxuB9yclgi2Ba5HtH+GLjzgTVdxeA== 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 SEZPR04MB6948.apcprd04.prod.outlook.com (2603:1096:101:e1::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.10; Tue, 13 Dec 2022 02:37:02 +0000 Received: from PUZPR04MB6316.apcprd04.prod.outlook.com ([fe80::c689:d665:b3a2:d4de]) by PUZPR04MB6316.apcprd04.prod.outlook.com ([fe80::c689:d665:b3a2:d4de%7]) with mapi id 15.20.5924.009; Tue, 13 Dec 2022 02:37:02 +0000 From: "Yuezhang.Mo@sony.com" To: "sj1557.seo@samsung.com" , "linkinjeon@kernel.org" CC: "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Andy.Wu@sony.com" , "Wataru.Aoyama@sony.com" Subject: [PATCH v2 4/7] exfat: remove argument 'size' from exfat_truncate() Thread-Topic: [PATCH v2 4/7] exfat: remove argument 'size' from exfat_truncate() Thread-Index: AdkOmgiDw4qXtseLTQWWkAs2aAiRcA== Date: Tue, 13 Dec 2022 02:37:02 +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_|SEZPR04MB6948:EE_ x-ms-office365-filtering-correlation-id: 2408866f-47d5-4102-4eab-08dadcb2eac5 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 73CLvSnSfPJiI8v/bCE4trZjT91N5YeQfX3yXnuY/VNceUJnOQmsm+A37kEftU2VKo0ei0ciCjIWUBbP2A21NOIz+ejftzcuTOaOxwILEdek37dmZwgtyA+oonwxi2SLggzM2VsxVkzcbeRaGyuQ9koo0m0laWbTz+x2BLo8DEpANvaMWO46MMma/lDMoxRdA2/U2T7mLQBQE9oM1IXjNb4YagkHLTPI1MTBnKR52PdvP9O2ehOOyXILqVDw1kmiqBj5kA/9Og42RaHuYofUXrtsBA99GQ1B7pRjuyRvFiqOVJYMOs5UrHH1Z7m+TbWQWFxla/vKq5cqjg6QtdyJfoTnZAWGFGVvhQSOMmbv2Rmy9OXVKGl5qKOzi2wNwE0JqHz9KEN4xRu8OAp/40o/tlzxwO0Zq8jaAYrb+CygW3NM7I9mrc+4LYKUM8VvJsYWJIGDR8rgg1/+xIogE4c3sSVcedozMQ1WLA/Je+1zs+Y/4VAkNjWxnVouvzj48jkg+vHJhfoLXGlHF5BsArNH6iHLgc+lST/TA5P2H6iQd92eBt+XqpZarC9iwA73a2DMZBlvFy8hAJEkkqPoUbSgI8FStrYXyUXps9ZPdlAOnZaSAr3TdgJVjaYDThfmDG5gYh2pdjMQnnI4NMGKxrtYaxvyaT3PrSxlYs/BGIFI20rj5qEldUSHLlOzgUPgU5uooh/RVNionm8jTOK+5nqXEA== 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)(366004)(346002)(396003)(451199015)(86362001)(82960400001)(38070700005)(2906002)(8936002)(4326008)(8676002)(66946007)(66476007)(66446008)(64756008)(66556008)(5660300002)(122000001)(38100700002)(33656002)(83380400001)(478600001)(110136005)(316002)(54906003)(71200400001)(76116006)(55016003)(52536014)(41300700001)(6506007)(7696005)(26005)(186003)(9686003)(107886003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?srABKQjTzZS8ONsuMLqLBE4Bs3GH?= =?utf-8?q?uQ5xJ5FOuojv/PtB+s8gYNb+873Yc8IBA1IjN1cGKpR70VnZhq15GtJ5dUn/lmwmc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?q?+Ac+GcZPKq9gHWXzdNMQdu51AnOiWbS2grOUaChyvpvkWjoADCgoxFRcJjTq8a3X+?= =?utf-8?q?JgbfhFQWgK6gARKxLSWUszBBK9e1aaPMrdTW7sGrqIC0elt6kTFF4bwETM79mXzH7?= =?utf-8?q?ZqQxFkQSfISesslPDFMLQ09TrrhjHoxDRaZzt80FN7dWQjiPE3UPi8VvBXhK/pGpp?= =?utf-8?q?/g+/Mucid1st4ydSvprwylnPacZ4CHAPvIoD/m1Y/64uDI8I12y4RprbtbS3CR+xJ?= =?utf-8?q?Lw/yB4GWDlFPgoQt9gDIu2OPyPfpB33cMNDo45Cea6LF9dYFsnYsAhTqLo51tlXeE?= =?utf-8?q?lYc5jiNKDQ9E46Q8jSUjSYZrDK3DS5h9nxkQZXag7rXsdM9lsvHCCQJJzNTDNFau8?= =?utf-8?q?gU+3ygUEJE4fA1WIrFX89htJrUaV+qyNmCq4h160IzDGYcNYjGunWgLS6wvMDszOX?= =?utf-8?q?kNJwwdiDfrBC4s2Jk/tgTH/uBwzoK2p/xrdQphinjbMEsM9LXgJnt00TCmntzyit7?= =?utf-8?q?LgqvWcPmW79vzGxxRTfAl2kvBoCAov+y5ikish5IyFFXVxZ0ARVv5ax0wSz0lwP3P?= =?utf-8?q?4VmQ4LXVsVZn?= MIME-Version: 1.0 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: 2408866f-47d5-4102-4eab-08dadcb2eac5 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Dec 2022 02:37:02.7122 (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: gHRNTYpJdDH+9fkWmBUCTC8Rm9bQ8G2F/ZAY7BcBEIf9aMGMUgLCGZRWKpYitNjsS9NC9EWq+99fJ/j9IHdX2A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR04MB6948 X-Proofpoint-ORIG-GUID: m-RLNV8RFcG8iwxBttdTVFp9PRA1253z X-Proofpoint-GUID: m-RLNV8RFcG8iwxBttdTVFp9PRA1253z X-Sony-Outbound-GUID: m-RLNV8RFcG8iwxBttdTVFp9PRA1253z 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-12_02,2022-12-12_02,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 Tue Dec 13 02:37: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: 13071670 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 9E99CC4332F for ; Tue, 13 Dec 2022 02:39:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234326AbiLMCjO (ORCPT ); Mon, 12 Dec 2022 21:39:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234278AbiLMCiE (ORCPT ); Mon, 12 Dec 2022 21:38:04 -0500 Received: from mx08-001d1705.pphosted.com (mx08-001d1705.pphosted.com [185.183.30.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 680371E735; Mon, 12 Dec 2022 18:37:20 -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 2BCMKDkr027794; Tue, 13 Dec 2022 02:37:11 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=Y1ebObPk+gwBPJ+nM78q4/8Oo4Q1s6THlTA1FIcB7qyc7MppMmrDC0E+pXS8Udsc+h5q WhvHVr9am5HB6MsLHMXMYd6yba6s4iAD2FeGgwEIfiAw34l74q7BZbSP2hu8sImXT8aq LuZ4lwGpHP7ZYGDuvuZXA5exOpR+SmzLRE3yuUE9pb14CMfXfFidz56xRD4pJa8KRTvJ +B3OVt5+mZKesE2ckg/Hs9/oAkvySdS3gLdqsWMBLwmKDF5qSpwhYjR5Qkl0SrbHIJoH ndzAcR/pF2wkfPn6T1dRGIEwE1eACsY71UnlsnxQZMgPWcJQt1yXOBExvj4NyNN1/lXU MA== Received: from apc01-tyz-obe.outbound.protection.outlook.com (mail-tyzapc01lp2041.outbound.protection.outlook.com [104.47.110.41]) by mx08-001d1705.pphosted.com (PPS) with ESMTPS id 3mcfh5jkrm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 13 Dec 2022 02:37:10 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JXWmK3hqarR7EZ9JTGLTWYQorv4lCTi07xttNomS0JMAsfGA/IHFqwbnPz3eLg+Cw0lXxPcuOBjijNu/59++5RloBfZbLtEI7Fet6Qnh3eG60oEikdxb3Rp4+irDpckLhGnKkwXd4Y4nSe+iiizxjA67JBbslkbW/Bcs0iWphPuNUBnVG/asq6J1I47/WtKnZAUthOgQszVoK9xduCUIwEgv7KnxozKTFJfcwU4fawGGq6+3JXzaXLPo0rHSYLHtUQMNEw2W+GT4KVkvnXtf3Y69h36jpagV28RVQ84ddMHR9OAkjpBb6ilHq8pzXaxAX+ZM95B4cS2G5PSbvdg08Q== 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=EgG2hTxiEHmF34OxshaKUFa7GXxZWdwNIoRO1zs/abwf4zaesFwsDJa+MfAvumsrNqSXY/d/Om2MYFpOIhVt8EhhLRaYEWRP7LbcrcPBtqFxJp88+nR8DUu6YO2/wzCGiwzlW+7ICUebbXhi76vGh0SOiSSXVcteh9BUlzM0kGwB8IgI6mIn0yaV9jrZhr3eAHUU49iri/eki3LpG05XSYLnCKa+Dt3dN8q0wC2EzNC5C8vypDhrakdDCycqxM/0W5mdha+U+Tisz3o0nMpcDfNLRRDbxSRGdkVE/z5nF5CGGuM4pfnsKyX6hmn0C7HWSWDKxXQ4a9XOGfohewUA9A== 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 SEZPR04MB6948.apcprd04.prod.outlook.com (2603:1096:101:e1::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.10; Tue, 13 Dec 2022 02:37: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%7]) with mapi id 15.20.5924.009; Tue, 13 Dec 2022 02:37:05 +0000 From: "Yuezhang.Mo@sony.com" To: "sj1557.seo@samsung.com" , "linkinjeon@kernel.org" CC: "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Andy.Wu@sony.com" , "Wataru.Aoyama@sony.com" Subject: [PATCH v2 5/7] exfat: remove i_size_write() from __exfat_truncate() Thread-Topic: [PATCH v2 5/7] exfat: remove i_size_write() from __exfat_truncate() Thread-Index: AdkOmkJ0uiTVDE8BQKmjN/VSAzn0eg== Date: Tue, 13 Dec 2022 02:37: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_|SEZPR04MB6948:EE_ x-ms-office365-filtering-correlation-id: feb30d9e-2b7d-4d92-4d7b-08dadcb2eca7 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 8hjfPxKoevsSQodnVEDgt0HXLl7Oo0rKXK47kYgoBGuGnImFOxs0v390aKHZGGz27kHNlmcBF2gZNetGhK41Z6HN/XcJ6EW4ZcwmqZyoy82bh/HZZQbgzBKU9Cw0+57aYV43zO+KYQPlR+MnfKAyxVigoAIfLeLh24/0tE0aqI0lwIl83p/JSbFtbIAO64E4E4000VueczBVotZ8QtvtX+2c6LEwi8l5t7CEsAzIlx+HPyv2T5XhvgHxbS+yVzshN531HnSDLpbJyE80Qrx14mvE/yxNjPW4+gXQa8P/zRA64kteuN84o+IPPj9bS4RDFoJ/YNSwMVwgq8CQSUfiadJMk15iLwiZ0kuBTqQECQ9u4sqvk6KU4nzLzwA5pysjp5WuxPj22x0SZ+vj/bGRJdn8n+IuHgCu1xIOGuGo4tLq0efrv6rwoEkuslGRmZ0G18jpfMe9SxOdNR0jrmL28IZWOluXR0+Fbsy02Y77SA+j0srKrmiLWyYcVDDuwvx4VwyFZfpnpkPXml3Iz7Y2DZYdCska0vDOTdXm9KvGmDJE7xlksvgnrI63wl3qyjLNz4rv2kQCIfRtzn5x2zsJSgWkWaCcj0NTyb2N3Wjho+qZvDrtJXQNK7EGHICgkl3uXujfElUU+9oLXw5vCNL9V3huYJziHxQ6AFGWsKKL2m3AY77HLcOrYl81yQ2e1AySbYSEYVCwwvXM4XFRwqpcNQ== 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)(366004)(346002)(396003)(451199015)(86362001)(82960400001)(38070700005)(2906002)(8936002)(4326008)(8676002)(66946007)(66476007)(66446008)(64756008)(66556008)(5660300002)(122000001)(38100700002)(33656002)(83380400001)(478600001)(110136005)(316002)(54906003)(71200400001)(76116006)(55016003)(52536014)(41300700001)(6506007)(7696005)(26005)(186003)(9686003)(107886003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?N5sWusW3M//GhKDVPWxN2bSpUAQf?= =?utf-8?q?UsWzoqSLsVBu03Rs9dMWbhevAkeP2O2qw+yY5jAbU02w1NY91+QTN7knvSfZ/EZ4s?= =?utf-8?q?QVD4Qesc3/zVgDNqvPOq1s43nZwGt/M3ZgaMTw1TX3/GKwko1vP2oDSNo2Ljd83CW?= =?utf-8?q?K5BcAIdpd2Kr8w8kdhmMKpt6HtyDgWdyCr9x0/VmPtMuRf0JOzpkouaSLi2Ml2Z6B?= =?utf-8?q?r/RQaWHemw3NyRJM238RmQsv8yryjuA0mldALD0on43U555TZtn4IP3oTeR5Vb9wo?= =?utf-8?q?55UpuxxBEEnzM3C/3Jj+lKTY9h4dXT+4CBIor/dScMIf0n3oqbl7nMN6DvE6AZCNW?= =?utf-8?q?OsQiaPM6rskV72lHBrgbf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iz1qt7jW4zrgl+MGcdPzyOnZ5hKDIVbcmfwebvXQVZlrkjlK9b?= =?utf-8?q?p0vgI1sAIN/aCF2JwC0OpOqF+j7T3QZcpnS/NC24YPUw4gKOVBuumL6ZDrPLKvEG7?= =?utf-8?q?desHLNEMrZFFonSWPdmKiQNNTwMGB7bBeiUWKDe5epmwKb0zKX9TqnOvETpcR/6u7?= =?utf-8?q?jIWmFRGU8NawDrRpxweNVp2AXo6nbg7/0IjXBgjHOTJfs6VSGAZbDKqQDYDcdGctZ?= =?utf-8?q?JIq4S/lUmzxHyzi4ZTi+rdj/eEcVFQ7VlIbVYKwNNNfDaI6d72nSKaqC+NHm3ukTT?= =?utf-8?q?sUv2AsLwQriX?= MIME-Version: 1.0 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: feb30d9e-2b7d-4d92-4d7b-08dadcb2eca7 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Dec 2022 02:37:05.8867 (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: CP5Ok2Qe22XZugFx3bz3PuPVjMM0/wPaJ10hBkMJEwn2nUkWRXZNDxMCZxduF2JdmHUJbsbkxEjonjFbrtaY5A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR04MB6948 X-Proofpoint-GUID: SvMlE44TsVIeAfjjT2GCEAm92TCn90ap X-Proofpoint-ORIG-GUID: SvMlE44TsVIeAfjjT2GCEAm92TCn90ap X-Sony-Outbound-GUID: SvMlE44TsVIeAfjjT2GCEAm92TCn90ap 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-12_02,2022-12-12_02,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 Tue Dec 13 02:37:08 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: 13071671 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 A60D0C00145 for ; Tue, 13 Dec 2022 02:39:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234283AbiLMCjP (ORCPT ); Mon, 12 Dec 2022 21:39:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234223AbiLMCiF (ORCPT ); Mon, 12 Dec 2022 21:38:05 -0500 Received: from mx08-001d1705.pphosted.com (mx08-001d1705.pphosted.com [185.183.30.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3B531E738; Mon, 12 Dec 2022 18:37:20 -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 2BCMKDks027794; Tue, 13 Dec 2022 02:37:11 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=dX7eKy0dTsE07ZhSSuBXld0RR7lJHMxB0ctZurNCFAU=; b=FbxsyL41N2R28HmqPGL20hoLYWAFJgqZ0z+jmtFAKSh53JTGOrmrZhlmpOs2IqCwEbq8 EBt/A3XvnynLuBiKmwaQN2T3qNvs1000nfR6Vc+bKtnXnWDhyypK//JKAgZXlOaNIzdn imAst3i42qNEXplqJBS8ebE375riUMOz/zQ3I6NdrnLZbEgTtnsVppkRM4sGO2QoAriu RlIB+WezlZZbKo+I/hpqZmtdkl9tvERZ8DHfH/SFkhvdolJA30QWvrHh6b9VtVX8S3oH WEwq9tE9YyLTWT52hlLPevZFYTNfzTcfosZqNVwsclVRkSNX6RGzVpVgjM9hMMdoQLX5 7A== Received: from apc01-tyz-obe.outbound.protection.outlook.com (mail-tyzapc01lp2041.outbound.protection.outlook.com [104.47.110.41]) by mx08-001d1705.pphosted.com (PPS) with ESMTPS id 3mcfh5jkrm-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 13 Dec 2022 02:37:11 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Z1wYk19odN+rFXemGy4gfT9L0pxIpCdYDdcF9lXuVCel4SjhEmwiEnsizeYL3ResUX6pFFe1xb0AQMDOdnAujosmIWd5woXuq5Gf61Q4XGeraIYHoiqAKAWiH2WkgzOrTYfXkodVH1UPfAqrOMmLUN96gKoJ8WcdA5oRs+Jnf5yinyhh/P+/EkXf99NF2dxZZJAp7Bmzy+g4yUgJntHMli0RHHcwWANHvAsCCcuka31T8lFIOktKiC6vpwNyByQm/FsHmR5nShFyHy5YrXbxhHZU1QGb2a+PHVvLFFdPMb54NbV7qUYMnS60HoHH6MZ5dOnIOU9uzERSulCEPmGRrw== 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=dX7eKy0dTsE07ZhSSuBXld0RR7lJHMxB0ctZurNCFAU=; b=ZkBfW1X+UwKJmag+wQb6Vi1Q4RQGtzyrYQChXb4bAA08Jpk19ZwgUenbs1sHZ7HxctTL6U9OgB/AHofA0qI5Np9pib5Vjrd4YrRUkgDhW4SYwMpMy7pKFFFEZ3Z3FP0VkiC1L0uUztckmrWubYsTjrK6ckGSTRstyn+ICLEkEw4A/QMDhcelr84+0bboKKe3GSYYJZnXGTl/6NYfWMqbN8QMrRadVzCaVihpGBormN+o6fFwWB0Q9hpIdaTslkbInWVLJkOmJ+qjEDqg9L0oS0LgF86Z5b5fTsDDLRd5KCLPd7dsAyJ2HkLNU2UoHVUkFWXZy9WboIbb9FZ4xw2z3Q== 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 SEZPR04MB6948.apcprd04.prod.outlook.com (2603:1096:101:e1::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.10; Tue, 13 Dec 2022 02:37:08 +0000 Received: from PUZPR04MB6316.apcprd04.prod.outlook.com ([fe80::c689:d665:b3a2:d4de]) by PUZPR04MB6316.apcprd04.prod.outlook.com ([fe80::c689:d665:b3a2:d4de%7]) with mapi id 15.20.5924.009; Tue, 13 Dec 2022 02:37:08 +0000 From: "Yuezhang.Mo@sony.com" To: "sj1557.seo@samsung.com" , "linkinjeon@kernel.org" CC: "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Andy.Wu@sony.com" , "Wataru.Aoyama@sony.com" Subject: [PATCH v2 6/7] exfat: fix overflow in sector and cluster conversion Thread-Topic: [PATCH v2 6/7] exfat: fix overflow in sector and cluster conversion Thread-Index: AdkOmq99zRXgAzKURlGtnFNFRSw9uw== Date: Tue, 13 Dec 2022 02:37:08 +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_|SEZPR04MB6948:EE_ x-ms-office365-filtering-correlation-id: 19179749-d7d1-4ee6-67fa-08dadcb2ee6d x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: xV0+uieF5v8PRmrYxBy0BQBlONZZQZSoaHnwCCLNt4akPTV/5snZDntH5tWg79CAJt67w6PycHVbXXlxEvy+bpf3idh87HKa0orS2YUAlINyjLSYK1Dl+PewEqpegpTpObcOsrhpYH9w7JypbFOhVNeB7j2BC+9Q0dCeCu3vl0j6cIXAyfrt+JwiRNCmP4q1fqjERtkQbfgwaXE9dn3uxpbHrKAl5T40ZydG8LiveyZoLesIWt6VIrhpu6Ke+HcDf6+qJlcCHrWAiUxahl18S1oXZqJi6z0EGUFqOpLZBHELa7HSS3bPqLu8UMjs6iu2el/WK/64n8KlaD4Bmlxz0OK6mi3Uzhe4EL8dmVy6ATjXow2aC51043AxS81JSgVpDWuBODE9liJyM0/yUGsqy88wbxUR155lTd2ETQEvdNUmugmps43k7XkQg+E10qUBvGyLycRhG9RwBTNrEbnGQVkGcRKx/aclFnH/CItYLjsYlcY2KgP5yDbGy2gnYrBMHbHf/yQrXGXdps/W11Yfrj3X/YgWCDnZSbI4TZi4gYheewo3LYFnzxkbhLFAdYwBvSgZ6J47cf1K7xTnXViMhPIF+LW+mXgeOtFhebTAHI6KiArlWCFaGJFVaB5uRsyTSsD/BhuXPPy4T1ct9r5I8p7lajYHmh80i3Jn6mFFOLE6Zx+n004FfRwAYIM28CdaaIM6gi8rWEZvpU4OnrQzXA== 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)(366004)(346002)(396003)(451199015)(86362001)(82960400001)(38070700005)(2906002)(8936002)(4326008)(8676002)(66946007)(66476007)(66446008)(64756008)(66556008)(4744005)(5660300002)(122000001)(38100700002)(33656002)(83380400001)(478600001)(110136005)(316002)(54906003)(71200400001)(76116006)(55016003)(52536014)(41300700001)(6506007)(7696005)(26005)(186003)(9686003)(107886003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?wUTcpPO7Tmmai1R25KUyi7noDV5Y?= =?utf-8?q?Dj+NbXawo/oIciXX8gyoonArbB9IMdlXNqZAokhP9Rcz96gKfoyDd4kOkK1PLjhfD?= =?utf-8?q?sWp5MDtuOMlYT9wFy3t+YCfad0glZ5nsY9yJw0lokLYNkD7dWcnnAGM1TSFYBKWcK?= =?utf-8?q?3Mda+EKZsRhyWeQzVybw09PnNH06VmNiPw396ZsxSXk4Lp+k91xo60lyxAcnG1V1F?= =?utf-8?q?EzK6DAz40ZF1ckUTEdysuRdHOni/twBN0ClkSVyAMV993YAcOT4L2a+qVgfnzQmvq?= =?utf-8?q?pU8HqmmvFIY4KZSHF5oxdi8KcQq3+DT/vuDJ1dxFDtZ0sQTmWmosEYsTL9z7vpeB6?= =?utf-8?q?I+lGmnI4NHMsU2gkgqVJJo//+jX7TLvFhFw6Fyn6gslu+VH6kWnLa29x6zoinS2rl?= =?utf-8?q?7ll+9JEbxfRP1Kh8mdxod5j6PQa0gN0UXj2IiID+DGrA/4q6k6PO0cNn0WXbeC2f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utbr1O?= =?utf-8?q?dnQgjcI9WYlX2fC2cbnTJ0HvmRLLucnamulDlvU+f4okDXj1y1CR262Je5XUn1Rft?= =?utf-8?q?Jz+XXvIKbgBJwt10ac2m42SAqIQGIT6B0mv001YtX9Q8W0YwasQlHIEmjcxK+7/0E?= =?utf-8?q?f7upO6/Hc8BgbvH7XUMxzJcHqPqSLhBPVDDBqrW2N12U2BipJAzsbBUfT9Qy00759?= =?utf-8?q?7EhNFA5PPTPh?= MIME-Version: 1.0 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: 19179749-d7d1-4ee6-67fa-08dadcb2ee6d X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Dec 2022 02:37:08.8314 (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: x8u5wvgYu+shyrJUsAajRF9hkbeGh6Dd3W1X59OQYRHrb73zvzwGRXQeVnJU6r6B3Xexs32PvO7eesRwi3hxhw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR04MB6948 X-Proofpoint-GUID: XtaIQHyZnd5pB90RAIzf9e0mPBAdMhpd X-Proofpoint-ORIG-GUID: XtaIQHyZnd5pB90RAIzf9e0mPBAdMhpd X-Sony-Outbound-GUID: XtaIQHyZnd5pB90RAIzf9e0mPBAdMhpd 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-12_02,2022-12-12_02,2022-06-22_01 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org According to the exFAT specification, there are at most 2^32-11 clusters in a volume. so using 'int' is not enough for cluster index, the return value type of exfat_sector_to_cluster() should be 'unsigned int'. Signed-off-by: Yuezhang Mo --- fs/exfat/exfat_fs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/exfat/exfat_fs.h b/fs/exfat/exfat_fs.h index a1e7feb22079..bc6d21d7c5ad 100644 --- a/fs/exfat/exfat_fs.h +++ b/fs/exfat/exfat_fs.h @@ -400,7 +400,7 @@ static inline sector_t exfat_cluster_to_sector(struct exfat_sb_info *sbi, sbi->data_start_sector; } -static inline int exfat_sector_to_cluster(struct exfat_sb_info *sbi, +static inline unsigned int exfat_sector_to_cluster(struct exfat_sb_info *sbi, sector_t sec) { return ((sec - sbi->data_start_sector) >> sbi->sect_per_clus_bits) + From patchwork Tue Dec 13 02:37:12 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: 13071672 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 7BACCC10F1D for ; Tue, 13 Dec 2022 02:39:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234291AbiLMCjR (ORCPT ); Mon, 12 Dec 2022 21:39:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234286AbiLMCiH (ORCPT ); Mon, 12 Dec 2022 21:38:07 -0500 Received: from mx08-001d1705.pphosted.com (mx08-001d1705.pphosted.com [185.183.30.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9866A1DF3C; Mon, 12 Dec 2022 18:37:30 -0800 (PST) Received: from pps.filterd (m0209320.ppops.net [127.0.0.1]) by mx08-001d1705.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2BCMfxV6023229; Tue, 13 Dec 2022 02:37:19 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=ltF9uTLyurlLxk/wr/RfDjvUK/5Qter81QMsfjKp15I=; b=ohkH+aWBI2GvkcAz6gUo24qmpRuz1Pwz0ntS/N99zsCktlutodEgqSGWi+XtWq9CgFAF xleFx3Gghuvq2imB42mofocgRODJKFx/cYnKSuJXx0TQ9WKPKhCxMDsq6zz0z6o7nZQv dcA1+KyKMT820xhEE/LJneiA9Qi75nnQwoIWXQy3c4ZtWSIHwzVaXXe4QS68FPiUw5Y6 RDysU9g1CPM6kP/4RaWsm2ejanrzBSeQmZgqpH4k3G+L4W8iKD7Gj+YxRMDkynX8GoPs FqdusU2onmVRYmqko6NYgAsCj/MFU2fZmEO7l9ugp8S1l2bMREVqj53TrQtfuuNK8BJ3 pQ== Received: from apc01-tyz-obe.outbound.protection.outlook.com (mail-tyzapc01lp2047.outbound.protection.outlook.com [104.47.110.47]) by mx08-001d1705.pphosted.com (PPS) with ESMTPS id 3mcg0majja-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 13 Dec 2022 02:37:17 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I7CK2nQ2tJgHigANthGgiEk7pHjiGlR0NvdFhbPYh+DioI8FhNVdJwatGuwU4fQG7y5Lhh0R1y5TNo8Ur+/dEOQGOm0yvUIll8txznTn49UJ/i6eqGVLZv9OsxndtyJqo9yw2DMwUyy5daryAjdpkpEuGU0oAmnQOtFPi1r1qAGj1Xl2xj9f//X6FsFudrMiHt14Pe3H5ba6HsBo/5GhcaMXgcpHvA823sLM6WLLqayvwNb73BxUjD/JJ+fvMegsq9bfPXMa6oxaKd7tm3ewWmbxREqoi/nYtpaicDaWbxuDXbdN5iUSOSJPx6uNJlQnDzn3Ze+ur6FbpHT/xZSWNg== 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=ltF9uTLyurlLxk/wr/RfDjvUK/5Qter81QMsfjKp15I=; b=VFeWVKj5746KGTOuxg39ByYOG0toPQZXOzt0DDzYPh4oECePTy6fwBFkzQ+skxNzXkJKHDxGLVdTfcVOOL6sRCkmxq5l4B3ZYIhim4tUYFJ6QaiDeOu37cuNpV6CqSlLy+cHFt8GkfouGGWetTFsL3gDiPIPY0ax0FrnKw+JJWvomH6/jXNDTWQNSP0X7u4JXr+ZtF5Kkl84BnEUg03VwNNnteRZVsT1R+0yQsImVVTzKp3W4zccnGk3wlqs7h9b9DoasxeNaQw+IVXuJZmAC5xSIEzGf60kYYXBHOggGG1WFG9R86TFPV7z9dZ+f7j6wMAWrg2Bg/FeHhCq/FR8Pw== 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 SEZPR04MB6948.apcprd04.prod.outlook.com (2603:1096:101:e1::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.10; Tue, 13 Dec 2022 02:37:12 +0000 Received: from PUZPR04MB6316.apcprd04.prod.outlook.com ([fe80::c689:d665:b3a2:d4de]) by PUZPR04MB6316.apcprd04.prod.outlook.com ([fe80::c689:d665:b3a2:d4de%7]) with mapi id 15.20.5924.009; Tue, 13 Dec 2022 02:37:12 +0000 From: "Yuezhang.Mo@sony.com" To: "sj1557.seo@samsung.com" , "linkinjeon@kernel.org" CC: "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Andy.Wu@sony.com" , "Wataru.Aoyama@sony.com" Subject: [PATCH v2 7/7] exfat: reuse exfat_find_location() to simplify exfat_get_dentry_set() Thread-Topic: [PATCH v2 7/7] exfat: reuse exfat_find_location() to simplify exfat_get_dentry_set() Thread-Index: AdkOmtAgzNiu6amqRB+LFDMxgmm87w== Date: Tue, 13 Dec 2022 02:37:12 +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_|SEZPR04MB6948:EE_ x-ms-office365-filtering-correlation-id: 427fdb53-7c89-479f-da5f-08dadcb2f096 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: xeG+1cplfLPI9/tNIYu9q/jV897rfBboPfcEDlkImtlfjC+yQ0LsdBgKiadY038yshp2WTzSnVMbqfMr2eGb65DpswipzTL1lYUcpuAJFZO/JIiXZofQ3FRzoGuD57H7FSXUehjg8f1pWukQDvy34DVZJvUyepP7dGcNEPype7EMsncJ8bm61W5Er6VdR/+JNDxfSYhh2BP9ZQaHQdqQlZWWQO8a+JT8U3d7O7I7n8I5hy2JWlpYNNc/i1LLM5QKp6wD05y0xW3tMZI/skMf0MRtWjIOc7+jC4hAvCb4fw3cv6Mb/XwI+PAoA3LWvy09d92GKnEWahKg/JcQjxQtHWa9PxQGzc8tw5KqrhF4oBIL3u3aBw3Hkw+xqLbkxYNmsgQ1UePRHGhmXQSxtv9ldUDYU+YjZgqSM3JGK6FxpwiqjJFqa24HJ+rWIgHb5BayJdC+q4csmvFnIIO5jRjYkFivoqw2IYKMdo2j7HHloSia005i1KFpBvtHUGlAry6wbE2upolBcq22aSUd65PeepFuDs1OjDQK6O744BwJo0GBBybAZzgKSJPMab1l2B+nHUeMyT+2exT5HGwOTubeub8O6awAWb+SK2Bs4P3W39Iz/yMKXJH85BxtG6F5RCjX0DB0HH/t9oSPGAU/MvAdYsuj2UxmFeFdbUG9S1sBDlHbCZILtTNNkzoPXZCRfnleD14VnrN3pdLB8yntoQ3u8w== 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)(366004)(346002)(396003)(451199015)(86362001)(82960400001)(38070700005)(2906002)(8936002)(4326008)(8676002)(66946007)(66476007)(66446008)(64756008)(66556008)(5660300002)(122000001)(38100700002)(33656002)(83380400001)(478600001)(110136005)(316002)(54906003)(71200400001)(76116006)(55016003)(52536014)(41300700001)(6506007)(7696005)(26005)(186003)(9686003)(107886003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?VzI0AkcNSZDJKDLRy5DqzeQOLT3R?= =?utf-8?q?UODrwu//63cqh+WeV5deJaHmU4DeMtQG0GXnf4JZTZuF+NDHsVOeGnbkHrqORHHCM?= =?utf-8?q?ByypcKnpYE7BHqITlSpVCvfG7dRw/0Xq6Bx+/bTc9CB+/zK35yr4jc7ZFTDF5HUyt?= =?utf-8?q?QM4VFMJjBEFfuwv2xOefMY4AdWUFFkVieaWE/c+X1IZdh5XJHo9wYi6TPHSVSEumH?= =?utf-8?q?b/JlBaZ+MMOWxdeYzSIz81sLL0hp0sB7Jma7qJmHVrJU6WzcG/OTv0b1iHaHWNGlB?= =?utf-8?q?mVwFEJBE9r85586oDFojrFEfjk8P+oGpK6OEceE5flxPDOFkEp4/VfziQnbIQYeMJ?= =?utf-8?q?TLFpZvXFXicp9BczwnJPemnGur68/Xv0SQviMe2Up490saqGxJC9iGvZt+wfctV4C?= =?utf-8?q?uJlr/VUDCw+iV06S1GJjZKYjgHL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Q00NcmqEeX9o+KcbcwR3Z62f2F2DGEcMe?= =?utf-8?q?CHZKxT1xXtT9As3rpUQfYBFwsdNbAATBiomd2QWBmSYYBoD8YQFK1IQvpkENsWf/h?= =?utf-8?q?gmhdLOr3T7+Vt+gFsT61eXe6INWxyD+mELmkCWwqHaaJmsrygw/4Leig5mmiep+S8?= =?utf-8?q?XAFJ2mK+8Vs4Cuz8oTDfbTDodofKByA5ob2mzpEzbQWaBIDGfJYPxPFh5CQA1xhQJ?= =?utf-8?q?XqsEp4NY7e8L?= MIME-Version: 1.0 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: 427fdb53-7c89-479f-da5f-08dadcb2f096 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Dec 2022 02:37:12.4897 (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: ZQVunxTc0T/emDD56OvA1A6H2TGpey9TBd1j1lucr31AmiD7Yf513JMvm1g/PMtkiMV7cPG6uik1Kd2GErJrVQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR04MB6948 X-Proofpoint-GUID: -hwfYQiqcOJKK0uDBA7JtewPG_HJGGiG X-Proofpoint-ORIG-GUID: -hwfYQiqcOJKK0uDBA7JtewPG_HJGGiG X-Sony-Outbound-GUID: -hwfYQiqcOJKK0uDBA7JtewPG_HJGGiG 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-12_02,2022-12-12_02,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..1dfa67f307f1 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)) { + unsigned 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))