From patchwork Thu Dec 28 06:59:57 2023 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: 13505644 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 78FDF63AE for ; Thu, 28 Dec 2023 07:00:14 +0000 (UTC) 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="A6fvfrHY" 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 3BS5tcBc026015; Thu, 28 Dec 2023 07:00:04 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sony.com; h=from : to : cc : subject : date : message-id : mime-version : content-type : content-transfer-encoding; s=S1; bh=OsiQNWbeqXP3B+9uexlb7CKFzPFIDzG5i4Lt1yY0oNw=; b=A6fvfrHYVhNHgSSMx7p3a+syW/YWw7WAnKsCj3Na+ggoPwk5KCJkbQBaFgltAt3uMfOJ cnLN3F0/oXSSlCXHSZ9afKCNQ06WAx+nwphbHECS5MyBmsvbKSXnI/mOu9vk7rRwoMjf mKi09FWQiZ1ts+c7V++aHvswXJni75axXGQSbqzCHs6Be8JJEE8WPTzc+/KZ6mWup0IV q3GUzerXsCaJHTFQpOABEqGtVx7Bb7vA3at3PfxvONZgifZItqKCaOECUh5WEjWHNBZT gJ7PWU7Ni7IHgmdcKwlTb1Yt/nwlNvHvyVpr+9XbRI4eeNhRxcHjopXxED2yX0eNqWcp bw== Received: from apc01-tyz-obe.outbound.protection.outlook.com (mail-tyzapc01lp2040.outbound.protection.outlook.com [104.47.110.40]) by mx08-001d1705.pphosted.com (PPS) with ESMTPS id 3v5pb73tuh-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 28 Dec 2023 07:00:04 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M0cMwrr2LyLI4Uc3zkT31gOWq8UnxxS5pVf0aU64QI8JkYzpdZZ5npqDlErxcTihEZfNEjyPe5nVpZlCNtdax8eoH5tETbkB9vCPPjPrBZQj3G5Qt7tJE3GD7tTeKzByhlFRP7yCuZLvEN4DbOUoOj7Mfzm5j97H94KxFZIq9umY0wdiUDm6Wf+svCZq7UbLsAqJBmZg7iGzdz0G8ixoNAGiBUExyl3HJ0E31laCGSgGuOECgjXo3aZpkiB+PL/qit66otcii+Bc/HyG8GzPkVtjbGIUINucoND0sxdRYRyIS9ZoC9t/mB/yVyJjPbrOuz5iQSV/niv2CEfDG6Hu1A== 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=OsiQNWbeqXP3B+9uexlb7CKFzPFIDzG5i4Lt1yY0oNw=; b=FruOlw3XteMO8b+ArCMHyqfh3jfJJbRnRL98trJxZMbWU30mNJRa3bwQaRlj4/pGKEbVam03OymLULHL1FBFIP7Lk5SfDoAP9kRivJBv2vEwdzVwIp3gyttJ89HHsQE40gKDVomKHcal+SqeyV2TIpIcqETz+S3fJtnBZK0V9JUYEM87nMZ5VYNPTu+Kr0juuU2Ukfv82DNTpAvpeUafKczwu90bg+6oH53N91uIduZ+L9bWVhP0yfhuvXrn9uEs7vF1IGzTTXexnbr8nngmmq5w3HQKNJqIGRELDl3PrkLjD/q1+8o5eXFYYpcnNv/J/84XdFVH8lRzb7Ysn8RtDA== 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 SEYPR04MB7223.apcprd04.prod.outlook.com (2603:1096:101:167::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.27; Thu, 28 Dec 2023 06:59:57 +0000 Received: from PUZPR04MB6316.apcprd04.prod.outlook.com ([fe80::5914:6fc7:b79d:7e34]) by PUZPR04MB6316.apcprd04.prod.outlook.com ([fe80::5914:6fc7:b79d:7e34%7]) with mapi id 15.20.7113.026; Thu, 28 Dec 2023 06:59:57 +0000 From: "Yuezhang.Mo@sony.com" To: "linkinjeon@kernel.org" , "sj1557.seo@samsung.com" CC: "linux-fsdevel@vger.kernel.org" , "Andy.Wu@sony.com" , "Wataru.Aoyama@sony.com" Subject: [PATCH v2 08/10] exfat: remove unused functions Thread-Topic: [PATCH v2 08/10] exfat: remove unused functions Thread-Index: Ado5WrnLuTRtybDYRCqx8qBlEMgWyg== Date: Thu, 28 Dec 2023 06:59:57 +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_|SEYPR04MB7223:EE_ x-ms-office365-filtering-correlation-id: 94043ca0-ea91-43f3-56fe-08dc07729a5e x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: WnOqVhq2+JOQzuc3qq/mjQhVker01WHsCRgORSpnIE8zfSAmifIwpcMmRGitrhRt+p8Zxx9un9mBZCd6gHWeFu250Lj+mmDE3mRWqcBUgjgHELjZKH6hXvqP9dxK6beGuxeFQ/TShnKXDm1hdQakSEzPf/MYnASFCJU7mpbLHxJFckw0hQBKXwgCSTsZAcvKADSrwEFT+V4nxrWmDmilQigc6Tv5PidPRQg1EDUxBm3f78XhTulzyzvQD0I361GFulOFP2hIq+fL76jw1hnNF0Yr0zsFeKq3SlsEwDDpYGTNCwNzN/JGMJZGjzy1IbwN+o8ujIISnRvUcAJQXAFiHs828tefOlhIkYmKMswMwlS/W6S+j4ICcnQT4bAZmA4k6q5D7sCmy/aeJgbSqmK4R6g+g8/Vva6hQd95bk7If7JxSp+MBx0PK0H4VldJ4tb48zJnlAD5+phq0os08EhIx8YzwACJY9fmJFbZ8TzyRB+20SYDXonXIn4lanOYY6TzwgO2yR8WF7O6OPILsqdfIxDCKHT3gks4ApQjDQuma6UjhcMe2l3BXL/GlXiBcaLWC1YI/nnI6GjPlNjcrdWkU0C+Rlwh7PQ7kxESHuq4b08LHL4fy0X5DHyaSarw8t5f 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:(13230031)(346002)(366004)(136003)(376002)(396003)(39860400002)(230922051799003)(186009)(451199024)(64100799003)(1800799012)(2906002)(66556008)(66446008)(66476007)(76116006)(5660300002)(64756008)(66946007)(55016003)(4326008)(52536014)(8676002)(8936002)(316002)(54906003)(110136005)(38070700009)(9686003)(107886003)(7696005)(478600001)(71200400001)(26005)(86362001)(6506007)(33656002)(122000001)(41300700001)(83380400001)(38100700002)(82960400001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?WdpZeVYyS6l3QDNbyFpsBA6hhlrl?= =?utf-8?q?N8Ms5h0tVcjA2bd+E7eKtrKW0P7/mPuGbkDrqafj5kKYyYMWNZEQM9Lfi0qg/uu+w?= =?utf-8?q?6b8Urqp2Gw86Y7tM5ap25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+C+opDf0dyuIjnGYaMu?= =?utf-8?q?TqfpiPVagi303hrevYPWCJbURaGjbQ2vsQJ6JI+XCQ8V0aMAFzdE6qnUwKgDYg1YK?= =?utf-8?q?se1AiAcrzAWRpDSucIlY2EHS1ZEYL+0SmGU/pVko8QXe5cqKU6LZVDQKmy8nKTKGo?= =?utf-8?q?1qTHJS642Gs3iWfQRwu9xR0FHnv1OcBcsDNnuVt2DFKXatQxP59dcS+0vyc9BRNJB?= =?utf-8?q?uxTd/lOdo87cN+lz/4MjPcZTb4RXJdI8oySK8sU/zhPkpDguJ0Lxf1FPH9+PO+YkZ?= =?utf-8?q?Smbw0ZKs/JlawlYo6KaWKJSKkVTwyocDCr0E2+HxngFWpZeEl+nmz8rZF4fFHVzFv?= =?utf-8?q?gYeGdXXE0aIviPdxdntL2Kvyt7sBen7ABgBrWhPQe2XNDXbAhhb6K7aFMz8HQnwlA?= =?utf-8?q?QM8Vf02yAMsaug/1iifm8ANS1qNO5sU6VRQCBFYtCzh2q5eYEYEMc+WpSjWKUMGAW?= =?utf-8?q?UDKySl2c02FPp6abu/2H39rFZPiD2klgWAKaouQ2n6FBBhb9m3ZSx0nGqB5YaeY6C?= =?utf-8?q?J64E6FzViMs/?= 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: 21Y1zOcoNMIGfAR+SS/yr3FShelxXg4b/sxwfWaFYKGqKFWyAGyP3oZKuchFH970VnjcTAcHGDgs5BY07sw4V3yzf9I0ucuVOycYus1KAS8SKov/J8504N8b6qjzJPlgg/lBcOiuE3G/hUgefJ+Q8VqHPgKO3nN+vyR9No/T3IUS/ABnWIUNjS18n1BBqRCVrh5KAO5Ooeum6MOxgiNKPzp4F/UrBAB4gjnN8igbzeXBRsm9ywH+Rq7Ql+PL6HNL6pp2WeuU7PUwDE1zXdqnC4sZY8/OKhYoNTl6cxRZnUzimskWIiDi7hIuqIQJfma07wcyc3dzMvX5bnO9nhW950uUGKmauzBisIn+WiDJZhUL/C6HhZvnKaWMTmeTtp+ucMV4mwe9wkcXwGUiC3VztnZ7/i8cNLgetNb5bRFwFgr0zL7McULpOLibDDjFL/3uCvooABRwmCleqn+iQ842m1eHasDcQLMWHf1T6ssG2s70HRnH/h+d5eoDQf3rG76W1PE6pVFJcqPnSZ1s/R5Y7djzFwLkz1mf6RXLpf/8kFI2hRMDkD7dgmCc+m4qUGWMS5/HhjqcBOAeC2o7ZUEkGDWApvC7NSz92nBjK3gSBGEAbyHWhxR3bIaI7ii1H9Lv 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: 94043ca0-ea91-43f3-56fe-08dc07729a5e X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Dec 2023 06:59:57.7121 (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: M88SN/opLymPftqBbm7SVVQgU0xSPOovZTljNQ6bl2qVLWRjPvd/jossCSWbC2eQ0Em6IN6w0OTZ/LGR/SieqQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR04MB7223 X-Proofpoint-GUID: eRXtKkVheJdveC2UArHaxQeKkQTT-uVJ X-Proofpoint-ORIG-GUID: eRXtKkVheJdveC2UArHaxQeKkQTT-uVJ X-Sony-Outbound-GUID: eRXtKkVheJdveC2UArHaxQeKkQTT-uVJ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-28_02,2023-12-27_01,2023-05-22_02 exfat_count_ext_entries() is no longer called, remove it. exfat_update_dir_chksum() is no longer called, remove it and rename exfat_update_dir_chksum_with_entry_set() to it. Signed-off-by: Yuezhang Mo Reviewed-by: Andy Wu Reviewed-by: Aoyama Wataru --- fs/exfat/dir.c | 60 ++------------------------------------------- fs/exfat/exfat_fs.h | 6 +---- fs/exfat/inode.c | 2 +- 3 files changed, 4 insertions(+), 64 deletions(-) diff --git a/fs/exfat/dir.c b/fs/exfat/dir.c index f123c1c2a4a2..88a8c2a60988 100644 --- a/fs/exfat/dir.c +++ b/fs/exfat/dir.c @@ -478,41 +478,6 @@ void exfat_init_dir_entry(struct exfat_entry_set_cache *es, exfat_init_stream_entry(ep, start_clu, size); } -int exfat_update_dir_chksum(struct inode *inode, struct exfat_chain *p_dir, - int entry) -{ - struct super_block *sb = inode->i_sb; - int ret = 0; - int i, num_entries; - u16 chksum; - struct exfat_dentry *ep, *fep; - struct buffer_head *fbh, *bh; - - fep = exfat_get_dentry(sb, p_dir, entry, &fbh); - if (!fep) - return -EIO; - - num_entries = fep->dentry.file.num_ext + 1; - chksum = exfat_calc_chksum16(fep, DENTRY_SIZE, 0, CS_DIR_ENTRY); - - for (i = 1; i < num_entries; i++) { - ep = exfat_get_dentry(sb, p_dir, entry + i, &bh); - if (!ep) { - ret = -EIO; - goto release_fbh; - } - chksum = exfat_calc_chksum16(ep, DENTRY_SIZE, chksum, - CS_DEFAULT); - brelse(bh); - } - - fep->dentry.file.checksum = cpu_to_le16(chksum); - exfat_update_bh(fbh, IS_DIRSYNC(inode)); -release_fbh: - brelse(fbh); - return ret; -} - static void exfat_free_benign_secondary_clusters(struct inode *inode, struct exfat_dentry *ep) { @@ -552,7 +517,7 @@ void exfat_init_ext_entry(struct exfat_entry_set_cache *es, int num_entries, uniname += EXFAT_FILE_NAME_LEN; } - exfat_update_dir_chksum_with_entry_set(es); + exfat_update_dir_chksum(es); } void exfat_remove_entries(struct inode *inode, struct exfat_entry_set_cache *es, @@ -574,7 +539,7 @@ void exfat_remove_entries(struct inode *inode, struct exfat_entry_set_cache *es, es->modified = true; } -void exfat_update_dir_chksum_with_entry_set(struct exfat_entry_set_cache *es) +void exfat_update_dir_chksum(struct exfat_entry_set_cache *es) { int chksum_type = CS_DIR_ENTRY, i; unsigned short chksum = 0; @@ -1237,27 +1202,6 @@ int exfat_find_dir_entry(struct super_block *sb, struct exfat_inode_info *ei, return dentry - num_ext; } -int exfat_count_ext_entries(struct super_block *sb, struct exfat_chain *p_dir, - int entry, struct exfat_dentry *ep) -{ - int i, count = 0; - unsigned int type; - struct exfat_dentry *ext_ep; - struct buffer_head *bh; - - for (i = 0, entry++; i < ep->dentry.file.num_ext; i++, entry++) { - ext_ep = exfat_get_dentry(sb, p_dir, entry, &bh); - if (!ext_ep) - return -EIO; - - type = exfat_get_entry_type(ext_ep); - brelse(bh); - if (type & TYPE_CRITICAL_SEC || type & TYPE_BENIGN_SEC) - count++; - } - return count; -} - int exfat_count_dir_entries(struct super_block *sb, struct exfat_chain *p_dir) { int i, count = 0; diff --git a/fs/exfat/exfat_fs.h b/fs/exfat/exfat_fs.h index b1c85f6ec90b..77fe410c11fb 100644 --- a/fs/exfat/exfat_fs.h +++ b/fs/exfat/exfat_fs.h @@ -431,8 +431,6 @@ int exfat_ent_get(struct super_block *sb, unsigned int loc, unsigned int *content); int exfat_ent_set(struct super_block *sb, unsigned int loc, unsigned int content); -int exfat_count_ext_entries(struct super_block *sb, struct exfat_chain *p_dir, - int entry, struct exfat_dentry *p_entry); int exfat_chain_cont_cluster(struct super_block *sb, unsigned int chain, unsigned int len); int exfat_zeroed_cluster(struct inode *dir, unsigned int clu); @@ -487,9 +485,7 @@ void exfat_init_ext_entry(struct exfat_entry_set_cache *es, int num_entries, struct exfat_uni_name *p_uniname); void exfat_remove_entries(struct inode *inode, struct exfat_entry_set_cache *es, int order); -int exfat_update_dir_chksum(struct inode *inode, struct exfat_chain *p_dir, - int entry); -void exfat_update_dir_chksum_with_entry_set(struct exfat_entry_set_cache *es); +void exfat_update_dir_chksum(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, diff --git a/fs/exfat/inode.c b/fs/exfat/inode.c index 522edcbb2ce4..0614bccfbe76 100644 --- a/fs/exfat/inode.c +++ b/fs/exfat/inode.c @@ -94,7 +94,7 @@ int __exfat_write_inode(struct inode *inode, int sync) ep2->dentry.stream.start_clu = EXFAT_FREE_CLUSTER; } - exfat_update_dir_chksum_with_entry_set(&es); + exfat_update_dir_chksum(&es); return exfat_put_dentry_set(&es, sync); }