From patchwork Mon Dec 5 05:10:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuezhang.Mo@sony.com" X-Patchwork-Id: 13064130 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E2204C47089 for ; Mon, 5 Dec 2022 05:10:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231500AbiLEFKg (ORCPT ); Mon, 5 Dec 2022 00:10:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231463AbiLEFKe (ORCPT ); Mon, 5 Dec 2022 00:10:34 -0500 Received: from mx08-001d1705.pphosted.com (mx08-001d1705.pphosted.com [185.183.30.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2894FDEA2; Sun, 4 Dec 2022 21:10:32 -0800 (PST) Received: from pps.filterd (m0209319.ppops.net [127.0.0.1]) by mx08-001d1705.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2B5445uA006120; Mon, 5 Dec 2022 05:10:15 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sony.com; h=from : to : cc : subject : date : message-id : content-type : content-transfer-encoding : mime-version; s=S1; bh=QhH9VyPGdNTGqWkZmSmt0Hm58Ex/kwEIfhsELooyTIE=; b=S91fQx3+IBD5ElcY5WOHeBtm+TE1VnE0GNOoYrvd++2PeGpHNHY1SQAQqTmuW3bimwTo I+DmTGZYrQ3cr4XvJobquhiEu3DY9PDvMVSN7+xmC+Vyj+tQgkywxtz0kPM8nhhUFqLe 14nw6IkUM92t7FWiaRoM48UFY4AQcNteWex/K2TIM6Eju0kbVdzOLV4pcGY5Ob8UHTtF HAu9W6LczccKFKBOkt63AFw5R8l022Zc9FDcw86bKiRi54DiOg040JvATa+7cFtamxA4 GE1FOkKhI+Z4zG8TQ5b7x8Jmm+Es2AQQY+XPKOKdgg/gdB0xdBohMVYps/qIFuE0aJ8X ZQ== Received: from apc01-tyz-obe.outbound.protection.outlook.com (mail-tyzapc01lp2040.outbound.protection.outlook.com [104.47.110.40]) by mx08-001d1705.pphosted.com (PPS) with ESMTPS id 3m7yfghadc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 05 Dec 2022 05:10:15 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WoAS7B1vg3XKg85ff5lYLxBayoujEYxA/WSbj4XZBSSCijPXQYy8nFcEwWnXPrApyhxCLyeYC57LM7yYYICQZSRAHx6Ja8Q9f6iUrG4JH/ZpAbYLRSz/4YViAKECjvLldSOAt80CMFfVW5feHfzExlWqTdU1kPpErHHUF2zNFdQJQW/TSvwuFbcP4PenVZCTJiQY7ZAh1i+oqpkp4yMNqv406IrBAOsEMBoGfIQ7hsTjoLI/WFG0rlBEL/1I7/6pKln9S0ox1/h9GM4T5utcNaldRPnTJNozg7xQQO+50pu8fMbpNc3JMVEJwI3SCggk8eoLgC+U08V1ezFN4nqTOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=QhH9VyPGdNTGqWkZmSmt0Hm58Ex/kwEIfhsELooyTIE=; b=S4GTRvgFICEuJRhPyZ9xcpxIKmiI0JbTY0JU7CaLHmOY2FE7lL0Myvo5PFAuFEDjuQph56qfBjFVBzxdWMtZ9tPDQSp4CYDOu26aE/gbWAJ9vHTrouGYgaEdixvNzPAvs7IBO9yK5nVltjKt9FN7WWkdmMAzCu/Ihv0pO/tTryUYn/D7HOVsKh/3Z7JtwPNcgIvEmM9IUp8yaDM3+PHCjQ/a6y8nOAnrmsYWnDKDUlOT4BNvkKpWPNWp3mtcx381tE1m28QkN13w+jFwjARbJ7P7lzVwwpH6xU8ZJMbIkqaF8hSi4iKobbD1XyVMisCKI41/5d+FyAldm9e4MKFi4w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=sony.com; dmarc=pass action=none header.from=sony.com; dkim=pass header.d=sony.com; arc=none Received: from PUZPR04MB6316.apcprd04.prod.outlook.com (2603:1096:301:fc::7) by PSBPR04MB3909.apcprd04.prod.outlook.com (2603:1096:301:2::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.14; Mon, 5 Dec 2022 05:10:10 +0000 Received: from PUZPR04MB6316.apcprd04.prod.outlook.com ([fe80::c689:d665:b3a2:d4de]) by PUZPR04MB6316.apcprd04.prod.outlook.com ([fe80::c689:d665:b3a2:d4de%6]) with mapi id 15.20.5880.008; Mon, 5 Dec 2022 05:10:10 +0000 From: "Yuezhang.Mo@sony.com" To: "linkinjeon@kernel.org" , "sj1557.seo@samsung.com" CC: "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Andy.Wu@sony.com" , "Wataru.Aoyama@sony.com" Subject: [PATCH v1 3/6] exfat: remove unnecessary arguments from exfat_find_dir_entry() Thread-Topic: [PATCH v1 3/6] exfat: remove unnecessary arguments from exfat_find_dir_entry() Thread-Index: AdkIZj3HTv953xMKQy2/a3f6bPetrQ== Date: Mon, 5 Dec 2022 05:10:09 +0000 Message-ID: Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PUZPR04MB6316:EE_|PSBPR04MB3909:EE_ x-ms-office365-filtering-correlation-id: a3c5e62f-2e23-4360-a968-08dad67efb83 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: GIF/UtOfx2FewT3uqEKEtTERSABuFl/p7mVkNcepqm442VXM2SONxnt/vlFMtXryX/LKrnSAercIoG6k55ftqcddYEH4DlLsXeFZB2uuoSmE5sZ4VF5BcJdfUGpIGFtp+tcX8EOMLzWDVQQFZkiX6DeP04XG8e8xnA/omp9ExieGRIsMTmCmaAtuZDeMtrZPDG3w2Uiqp67syPyOCD0FNp7uQTSAK3OTlTTISFKP4mKp/cX0iYQc7Rc/BQ9t7jDjaZI5YVhilzogF40hYsOd6zxBvbs6wPNoedVHsIPHMo/G4KErrhVUQAPA0uKBV63atX6K7AtOeCAlueX3Ahd31UB/Sm7NNxdzGBj5w4NTrnFn+pokFMzbGWnbK16H/sGnJkmFa7Gp9yr6Y42wog9BU2IjODkjsnuoN3D+1feO8dTQ4TD+Rqm5JlcIjp+AJZEwLTUyX+mAVcbh9zcMiLeDPV+2e68XjxHswf0PN+C596ZT+lQoeRX8jrZxlhnGAYG8D1RsYGW2AZREMd2SwwsRgsy6TGTUMvy+ggkdapYXP0o8By6OmFoDauLXdGx9HemdCz3PHlqUp6spfWs4hZ8I8xJR/mtU5KqPbx1oVGujpWsKa5hFKJDlVBUxWcKggBtJGIwbnaRODfAXQPqqX/xnc2Hck2s8OkElcRGEl+scMhpjLv4QuNtmMLp/IQrsJFzJtWgtW/Db1JKIBbUxd15i2w== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PUZPR04MB6316.apcprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(39860400002)(366004)(396003)(136003)(346002)(376002)(451199015)(26005)(316002)(107886003)(478600001)(6506007)(7696005)(54906003)(110136005)(9686003)(71200400001)(76116006)(66556008)(66476007)(8676002)(66946007)(4326008)(64756008)(66446008)(8936002)(52536014)(5660300002)(186003)(83380400001)(41300700001)(2906002)(122000001)(38100700002)(82960400001)(38070700005)(55016003)(86362001)(33656002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?Ax9vyVHt5hj017zB/jU36jBKe226?= =?utf-8?q?H7s+elrLT7ODSPe7EhRidUv7w0uicE7JuiOUYmmxLm9A4qdw51Ibi+CYOdFBS8YV0?= =?utf-8?q?ademNUt9szanX/VTZE6+tLb9B8RFIGMv95Gun1r77gKJtI1OmyHk6RR0XQwha6QNo?= =?utf-8?q?7WVGatC4jM6YBxXyMPfnPdnMfjmuVjF1joHFlSq3+asFsXRFHASmR70slOkyDJKQm?= =?utf-8?q?wJIczN3kBQdQ6TPIhQjC/j8fAWC6yOZ+HxKCtU4L8wdAI/diMY8WgzQqk7CerUlea?= =?utf-8?q?BXzmjv15xc65hhtM608+bPy3HTi0vB5Ys3ekwlZeTHRGjXu+OqJeNmQOCvoJCKtnt?= =?utf-8?q?S1vc0WH3/hARMNvDvKm4Z158Wg5aWM01run4kKfCpjQpvwYtBvvcufIZcIil72efh?= =?utf-8?q?uowU9/HW8SWpWbukbIMjLUx+Dt398PpQnxnF8u4yus4VRCXmCslKlJTvmP4FZFWc9?= =?utf-8?q?zqS0zx2jhS1fTniITqiU46PZ/a16s1kLbi1yJgtwV8lcQlFQ1gULkoWBrxxVJsGPK?= =?utf-8?q?GnEU2dtd34MnwP1zNB0Ji/labCCd4F1tM/PmUp+U2mlHRzMUQDCMOor/VNqQmKMnc?= =?utf-8?q?C7XCdH1d7jgeBdIR1mZwo2cFgMvpCyWQA8820kr3PQSPAH+zgFRWGMFgx2uvueInX?= =?utf-8?q?SpqcW9wjFKSsCn4LOySdck7HPNi/XS303wpXlrzYx5gLvWT0wUCRsc09QXht1tgF4?= =?utf-8?q?zq/PsGYvHNBfj39xdW/bVQ3gvHJWTBET1JUKLVcGtZcuCU5u/1uoFPq37RNpytvQN?= =?utf-8?q?w0z/nxRwS7fQgqDeBTapVgmCeKdaP60h9lc+kAQYenknYzaVSoNdvRxhXrPwkguXp?= =?utf-8?q?3k7ExHlui9KUhZww9D08tFX+pJmBtwpdcGSsgIaj7rnfIRdGlU5TiKVPgeJLK3cWH?= =?utf-8?q?zoe152rHs3v/9H/CBpWDVZbwL31cTv13v2gCoi/BhuwxBUbaEVu9oT0xVKdTKucdU?= =?utf-8?q?2WM0gJdwGlobX2vbrCqWRaTmeR1zcrXuRBpy8PcXKqbnbeaBYM9OlKUfjQzlwaed/?= =?utf-8?q?lGgETTlKYQQIpcKoVaDZZ+zDd4INaIw4lvLQa1jiW3jKBKThPsNlvWd2XKBk8byS9?= =?utf-8?q?Li2kgMoQV9BNYVIgy/9S5uIBPbZO15/O9nHGVNUu/BK+zFJUCwUK52FB+Qp+wlQb1?= =?utf-8?q?2dj65Kj/n9GB5g9Sh39ZzL1SIGeF4DCCNwzkhbTdKx7kFLAtRvI+eHgxpFsPXTP7e?= =?utf-8?q?x5TlPuGuYTXpzLK+fXIO5La4uyTzsikZUNaPNwZ+8zkEiHrKkkfz1A+cRqHLuv0U5?= =?utf-8?q?7AG+bn4kLuwFrh4nUPmRVnFZB+GvmrRxruIchLgbw5VGrzKEP5JgTHFCfLH1+hOA+?= =?utf-8?q?AGUc7iwZvVyDdnMIDOy4k8i3ifS5zrjz4rc8ZbVWhAVbSA08AvV0KViqvQbfIr7YR?= =?utf-8?q?gtkgevbtzs0nA+aOOeB6OorK0VYVnmekgwVmE6CHEDs66DenDWRO2Cc0pP6okOWK0?= =?utf-8?q?1TQuLUJmYMF2qr//tXDyzp2oXVpQyjRO1OjtJlmB6ty/oHHiqz/Nge66li7gBA/+4?= =?utf-8?q?BEkZZvSXx9nY?= MIME-Version: 1.0 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: AupgN5D95/UfZA9hs42AWpHeP/wy7ozjAqq8437uYa7iK1ux0OumeN8JbPTxKW0Cl32c3h2SIVIbJD+E2HJI613KCBl309OyR6RWkCkhzcxqzq+HhhLmflPqez3XBaKJ5oiJ5l1DwxVROPDvJMVeHPO8S41j72hDRhHOJOBrBYFBkqwwoTzlhkKylRUHeyFoMIhdzaiYMPu2Qasq5sCM1DNAOsn+sqmZlj9gzfuhc1iW9nyW5D4Jpf21HSapkcTYJHd4Y7/YzuBP9lGGWnnP4yATDjlD/lNIM/bCiI1XBSxMcIqx0EKLM4cxTpd4IUl2o2uawalnD6T0Ueef/4HtJgBUUMOsnutdBL9U2YHvC5+EIa+DPa4UyPu+r+6Ncg+y+zflN4LTQh2OBxZUu6DyQiEUURiCTUOtQtfhfo9jkBYLYVs0gtkh4kSAmJGMjbP/gDLvQRmEbXmvdQUc0hVPD4UkuT75DGfA0zNjztZuRDAOi1btfJ2U1QTmjMSBQAPs4zzAgYsJ+itTHAN0B3TSjntM6+qta3/sYfBP7tUZaIW8Jh8v+yVbLmMh5KJ/VqSM7j3Nv4A+okpQyHQsag4pAGOyknrY3WMB7bdbRcLSfM4Df+qZ1Dmd4vwdu2WUuGR507FP0cZl5XdoRT454BhFluw++GY3sLnto7DXHZttSYF3JVV2BXtTMuZ6WyyFTASGSrVMXIFvfZAzyw/lAQna+R+Glx/PvzgVJLKXzu7OXqJlHk4vr/+BuAzUZAQQUm94do+ShztLScvR0jne1Kvykn0KljurDU2mcyOEPTSajC5wmOFkMBdIhOsgr2/5sreJFnUQgPsrmV82q5U+iM5mN2pPoKBbMlViCoKdMC0moriRJ1yWzKcSIEVmoz8af7ND X-OriginatorOrg: sony.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PUZPR04MB6316.apcprd04.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a3c5e62f-2e23-4360-a968-08dad67efb83 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Dec 2022 05:10:09.9654 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 66c65d8a-9158-4521-a2d8-664963db48e4 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Sk5VaZwQmJFJw13bycR41tEbvpyXHHoC8rzKGgcwo30pB0v1kjxW3zy+iin0gb22rxqjlXxEO+J1nQHxXX8HPA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PSBPR04MB3909 X-Proofpoint-GUID: H4u1S6m0n4qdrO1IqV--v2ATmot5yZ2L X-Proofpoint-ORIG-GUID: H4u1S6m0n4qdrO1IqV--v2ATmot5yZ2L X-Sony-Outbound-GUID: H4u1S6m0n4qdrO1IqV--v2ATmot5yZ2L X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-05_01,2022-12-01_01,2022-06-22_01 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org This commit removes argument 'num_entries' and 'type' from exfat_find_dir_entry(). Code refinement, no functional changes. Signed-off-by: Yuezhang Mo Reviewed-by: Andy Wu Reviewed-by: Aoyama Wataru --- fs/exfat/dir.c | 12 +++++++----- fs/exfat/exfat_fs.h | 3 +-- fs/exfat/namei.c | 10 ++-------- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/fs/exfat/dir.c b/fs/exfat/dir.c index 397ea2d98848..8121a7e073bc 100644 --- a/fs/exfat/dir.c +++ b/fs/exfat/dir.c @@ -956,7 +956,7 @@ enum { */ int exfat_find_dir_entry(struct super_block *sb, struct exfat_inode_info *ei, struct exfat_chain *p_dir, struct exfat_uni_name *p_uniname, - int num_entries, unsigned int type, struct exfat_hint *hint_opt) + struct exfat_hint *hint_opt) { int i, rewind = 0, dentry = 0, end_eidx = 0, num_ext = 0, len; int order, step, name_len = 0; @@ -967,6 +967,10 @@ int exfat_find_dir_entry(struct super_block *sb, struct exfat_inode_info *ei, struct exfat_hint *hint_stat = &ei->hint_stat; struct exfat_hint_femp candi_empty; struct exfat_sb_info *sbi = EXFAT_SB(sb); + int num_entries = exfat_calc_num_entries(p_uniname); + + if (num_entries < 0) + return num_entries; dentries_per_clu = sbi->dentries_per_clu; @@ -1020,10 +1024,8 @@ int exfat_find_dir_entry(struct super_block *sb, struct exfat_inode_info *ei, step = DIRENT_STEP_FILE; hint_opt->clu = clu.dir; hint_opt->eidx = i; - if (type == TYPE_ALL || type == entry_type) { - num_ext = ep->dentry.file.num_ext; - step = DIRENT_STEP_STRM; - } + num_ext = ep->dentry.file.num_ext; + step = DIRENT_STEP_STRM; brelse(bh); continue; } diff --git a/fs/exfat/exfat_fs.h b/fs/exfat/exfat_fs.h index 37e8af8042aa..21fec01d68ff 100644 --- a/fs/exfat/exfat_fs.h +++ b/fs/exfat/exfat_fs.h @@ -71,7 +71,6 @@ enum { #define TYPE_PADDING 0x0402 #define TYPE_ACLTAB 0x0403 #define TYPE_BENIGN_SEC 0x0800 -#define TYPE_ALL 0x0FFF #define MAX_CHARSET_SIZE 6 /* max size of multi-byte character */ #define MAX_NAME_LENGTH 255 /* max len of file name excluding NULL */ @@ -490,7 +489,7 @@ void exfat_update_dir_chksum_with_entry_set(struct exfat_entry_set_cache *es); int exfat_calc_num_entries(struct exfat_uni_name *p_uniname); int exfat_find_dir_entry(struct super_block *sb, struct exfat_inode_info *ei, struct exfat_chain *p_dir, struct exfat_uni_name *p_uniname, - int num_entries, unsigned int type, struct exfat_hint *hint_opt); + struct exfat_hint *hint_opt); int exfat_alloc_new_dir(struct inode *inode, struct exfat_chain *clu); struct exfat_dentry *exfat_get_dentry(struct super_block *sb, struct exfat_chain *p_dir, int entry, struct buffer_head **bh); diff --git a/fs/exfat/namei.c b/fs/exfat/namei.c index 347c8df45bd0..5f995eba5dbb 100644 --- a/fs/exfat/namei.c +++ b/fs/exfat/namei.c @@ -597,7 +597,7 @@ static int exfat_create(struct user_namespace *mnt_userns, struct inode *dir, static int exfat_find(struct inode *dir, struct qstr *qname, struct exfat_dir_entry *info) { - int ret, dentry, num_entries, count; + int ret, dentry, count; struct exfat_chain cdir; struct exfat_uni_name uni_name; struct super_block *sb = dir->i_sb; @@ -616,10 +616,6 @@ static int exfat_find(struct inode *dir, struct qstr *qname, if (ret) return ret; - num_entries = exfat_calc_num_entries(&uni_name); - if (num_entries < 0) - return num_entries; - /* check the validation of hint_stat and initialize it if required */ if (ei->version != (inode_peek_iversion_raw(dir) & 0xffffffff)) { ei->hint_stat.clu = cdir.dir; @@ -629,9 +625,7 @@ static int exfat_find(struct inode *dir, struct qstr *qname, } /* search the file name for directories */ - dentry = exfat_find_dir_entry(sb, ei, &cdir, &uni_name, - num_entries, TYPE_ALL, &hint_opt); - + dentry = exfat_find_dir_entry(sb, ei, &cdir, &uni_name, &hint_opt); if (dentry < 0) return dentry; /* -error value */