Message ID | TYCP286MB2323D37F4F6400FD07D7C7F7CA319@TYCP286MB2323.JPNP286.PROD.OUTLOOK.COM |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1045470wru; Tue, 25 Oct 2022 07:40:33 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5p2PADc+KF5mddZtSc/SnDc5vQnugFjmD4wtThqiBFGE3mLdbSjRk3cFkuW5R4fHVQZvhI X-Received: by 2002:a17:907:8a24:b0:795:bb7d:643b with SMTP id sc36-20020a1709078a2400b00795bb7d643bmr27264627ejc.115.1666708833532; Tue, 25 Oct 2022 07:40:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1666708833; cv=pass; d=google.com; s=arc-20160816; b=Hi8YsHiHuWpn3EA8mzGhC8G+mPAgK6KBgufQtR3Q0mNBKBz6xwaqVb1shk0B8AZ7CC YQfKS9JS4Nvl8Ua4OkuZvfpBhp10AEhyEik3QflxwkZLtZXjAjou0pvl98/cP7mUM7Az j94e7jbQDppoEX4cuiZNOhBcGdrVBq+AkOyqPC75pQ/0EuOkj97HRbGWK0LZL0A1nVpf NZwj/j+zwjAI+cusehw+Rug4XtPNU20Z7LHMZm2yw0TxVhm6QZBjiivWvbgcQpZxYDiz OJG1hJSzWEVY3Es8WhiFxn0IWHIeZ36SZUY7BKrhYMENiNhuug2/gqvC15pv8H0k9rNs npFw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=6zcJljTMGPXUFkxnYOBBsjcF6wkPBV/qn1j1NedUcSI=; b=sF1004FJfrwQbS+tOUkXkREncy20y2MTP439pnrfCqen21jSfVQPiQ0Q3Pf29UVSK0 EW/oo9E72cdBnQmp1n8zpRScO4BteAQZNa1bdNqoYA3Ka1DjO/Pw29i4S/CTQTpI0+wv ok4sbBCrR4v6l15CzRDj3hh1WNDkFsgypTo3pKwBgmvFnfBDXKkEA4JekIqo5iOJ6xeh dC4udDPYSHNW/mHRR34eSycWoofgqUxKQZqiAQb1fOwtl64Lu+pWsRYF5pSK3Tk+bSDy OAwYH4XXav/+J8kviSymikVGSJ6l/C3sPYr8h5l26cHpCmGXZQzqWzFisRePwIHQMt5q 2Uag== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@outlook.com header.s=selector1 header.b=cEUQ9JzE; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n8-20020a05640205c800b004612220a97fsi3469273edx.100.2022.10.25.07.40.08; Tue, 25 Oct 2022 07:40:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@outlook.com header.s=selector1 header.b=cEUQ9JzE; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233175AbiJYOYY (ORCPT <rfc822;pwkd43@gmail.com> + 99 others); Tue, 25 Oct 2022 10:24:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232641AbiJYOYR (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 25 Oct 2022 10:24:17 -0400 Received: from JPN01-TYC-obe.outbound.protection.outlook.com (mail-tycjpn01olkn2091.outbound.protection.outlook.com [40.92.99.91]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DBBAA120EF7; Tue, 25 Oct 2022 07:24:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k8d6gisf9EYZWZknpcb8sl3/mtE/W2PveCD8RJRrW/UH1FJfcIATboE81s/0rHzX8d8WqcjhA02S2AEyP5O6yH/RnY4Zf11G771aNwhW6pK2/+Xwa6CIkwz9CLy6KBW3Y2YLVEw1oexnsTObU762N5tf5q1xWKIG8D5u3+UeF7WNTVPrUfRnhqmU8vPzUA6trm6xpKlRqZGzKWrHA+Rpn/Q84kBJ1nGPx3hcf2vN1v0ms+FrwClFQximXvBncqFfqCXQ+TuiI2Do6JnIRM5RyxdkZlT7j4IJlJw3vzPkmrvxtmIMGaEuGBXnJVhPjJUxeH2AtJLRK27hDlCyx5pl6Q== 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=6zcJljTMGPXUFkxnYOBBsjcF6wkPBV/qn1j1NedUcSI=; b=Jyr83BI3D3myJ9vDjS9H1n+UUlRNDoKi+WKs2aKPQUlICGZiSSYPxiDY5FcW0zWmo3imeiZpsra30CKu7fHWL2CLsYr7IlreDfh7n26UIujLrGvgLSWYVNC0l4MSfWyqy9FUwV8//wC3zn4zd9coDahXHqwCXbXk4XnHzLEB3E2z+W9Vm6vWmwKnde0fDAJPSEYy2e9ZWdsqWiK6jrt6PLvtHVmw3u6PgGb7n0tLw6oHb7nYhKlABaXYTekIeByTiNqmq99NOZcJxRlHmJeaLB88sFT7thgt27Z9RrRz91p5UMQ4t5jwb5Zht1JbMgF0XN9lSxhfpZcBpQCCZVItbA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6zcJljTMGPXUFkxnYOBBsjcF6wkPBV/qn1j1NedUcSI=; b=cEUQ9JzE0jzvXYRZ7EbfiiGLfCJxG3TaBQo7qN6Jj0osfQx43DeI1/rKk2eA5B+5rh8DHht6foI1BZeVw/EUZqLIRn2N0aHRqAKbHYPc6iV0Zz32STINXVguL6cAxAFxk2v1vTZfTFc//y97OHdXd/TzkVw7q6p1FKtlsHhVfb6xE1eqcsm6le605Z9cZmN3zgs20M1pcDroE8gV6oE+LUX+SUJiwZEV56TRGJnfmdjzNd0chJehfIRFLUePl9R7TN8FlG2qQrv3psCBi5fGKLRahFtJFo9676x+UhrQUFClOhPywM1M1kRMQE9wLPJN/vsH9X8fiVXabCzqLpxegQ== Received: from TYCP286MB2323.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:152::9) by OSZP286MB2109.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:16f::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.35; Tue, 25 Oct 2022 14:24:14 +0000 Received: from TYCP286MB2323.JPNP286.PROD.OUTLOOK.COM ([fe80::4722:62da:4861:9d73]) by TYCP286MB2323.JPNP286.PROD.OUTLOOK.COM ([fe80::4722:62da:4861:9d73%3]) with mapi id 15.20.5746.028; Tue, 25 Oct 2022 14:24:14 +0000 From: Dawei Li <set_pte_at@outlook.com> To: viro@zeniv.linux.org.uk Cc: neilb@suse.de, brauner@kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Dawei Li <set_pte_at@outlook.com> Subject: [PATCH] vfs: Make vfs_get_super() internal Date: Tue, 25 Oct 2022 22:24:01 +0800 Message-ID: <TYCP286MB2323D37F4F6400FD07D7C7F7CA319@TYCP286MB2323.JPNP286.PROD.OUTLOOK.COM> X-Mailer: git-send-email 2.25.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-TMN: [diWMgxRunJzNYx0/olHyjYUUZzsymLO9v1JWIG5E8so=] X-ClientProxiedBy: TY2PR0101CA0033.apcprd01.prod.exchangelabs.com (2603:1096:404:8000::19) To TYCP286MB2323.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:152::9) X-Microsoft-Original-Message-ID: <20221025142401.2876-1-set_pte_at@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCP286MB2323:EE_|OSZP286MB2109:EE_ X-MS-Office365-Filtering-Correlation-Id: 6761b73a-cd58-4902-bd7d-08dab6949773 X-MS-Exchange-SLBlob-MailProps: rYPt1fhvLTUdhmixpIsBU+VLc8pOS1tvP2p9uIgy0kcKaxLLgM267BQnJS/ufmk+bhqsMyizz4Z6HsQrdJdzZa/xW25s5a/45HbBfvSiaokIuTLemcV4Ll/jufPqkxytVD665XJxq8APS8B23KLB2erCzqm4WhM14ozavrMP6aSua932fyYepD+tS4bMlbpmhppkCdiM5XK76BueRbpHzByiPUN2gtHuMxJbdP7mZfsipZBRa9cxk+LU5g5w5ktsZJHGzEY8eYZmcK9O3G8cFLMpvYCOGhThhTJCg6Tl8uzOcFcmuTQ/UrUYCbsnk435Sp+jA4lHQB0e/yEQg9yzOHqHEf7lPddvmyVztyupMqnk+j7MxMcphZjLJCCqsvV0vbz6aV+kilTe3lI5H7ns7AaqjSX0idqZvPCfN0Bq2HliUq+BfqdRITjeDelOYr9Fu+x+i4hmElMWcAuM4y8fz8eHq8OPQGyfnLRqsABqtjUds8aDoGGx/9mFKaqx4SN/e5jkvOt3wP7P3YHwPZ69Qs5nqG03fNsOkdugJb77q8buf6QT4K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qDKblDydayPiV3pkPMpdGOs6RxjdAg9bsBxJnXWQWO9zpFYbpEFKYyJC2lbqpEYzAyR7gdygiOoJdmgJ6QZ3Y7Cqm5gWrzXSnheJq8SV5HkX3LKg== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6761b73a-cd58-4902-bd7d-08dab6949773 X-MS-Exchange-CrossTenant-AuthSource: TYCP286MB2323.JPNP286.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Oct 2022 14:24:14.0894 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSZP286MB2109 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747670881996806585?= X-GMAIL-MSGID: =?utf-8?q?1747670881996806585?= |
Series |
vfs: Make vfs_get_super() internal
|
|
Commit Message
Dawei Li
Oct. 25, 2022, 2:24 p.m. UTC
For now there are no external callers of vfs_get_super(),
so just make it an internal API.
base-commit: 3aca47127a646165965ff52803e2b269eed91afc
Signed-off-by: Dawei Li <set_pte_at@outlook.com>
---
fs/super.c | 3 +--
include/linux/fs_context.h | 4 ----
2 files changed, 1 insertion(+), 6 deletions(-)
Comments
On Tue, Oct 25, 2022 at 10:24:01PM +0800, Dawei Li wrote: > For now there are no external callers of vfs_get_super(), > so just make it an internal API. > > base-commit: 3aca47127a646165965ff52803e2b269eed91afc > > Signed-off-by: Dawei Li <set_pte_at@outlook.com> > --- > fs/super.c | 3 +-- > include/linux/fs_context.h | 4 ---- > 2 files changed, 1 insertion(+), 6 deletions(-) > > diff --git a/fs/super.c b/fs/super.c > index 6a82660e1adb..cde412f900c7 100644 > --- a/fs/super.c > +++ b/fs/super.c > @@ -1136,7 +1136,7 @@ static int test_single_super(struct super_block *s, struct fs_context *fc) > * A permissions check is made by sget_fc() unless we're getting a superblock > * for a kernel-internal mount or a submount. > */ > -int vfs_get_super(struct fs_context *fc, > +static int vfs_get_super(struct fs_context *fc, > enum vfs_get_super_keying keying, > int (*fill_super)(struct super_block *sb, > struct fs_context *fc)) If you want to make it static that you should probably also make enum vfs_get_super_keying static by moving it into super.c. It's not used anywhere but for vfs_get_super() afaict.
On Tue, Oct 25, 2022 at 04:36:07PM +0200, Christian Brauner wrote: > If you want to make it static that you should probably also make enum > vfs_get_super_keying static by moving it into super.c. It's not used > anywhere but for vfs_get_super() afaict. I'd just remove the enum entirely, as it really obsfucates the code: diff --git a/Documentation/filesystems/mount_api.rst b/Documentation/filesystems/mount_api.rst index eb358a00be279..b0f7fd4f64bc8 100644 --- a/Documentation/filesystems/mount_api.rst +++ b/Documentation/filesystems/mount_api.rst @@ -560,37 +560,6 @@ or looking up of superblocks. to sb->s_fs_info - and fc->s_fs_info will be cleared if set returns success (ie. 0). -The following helpers all wrap sget_fc(): - - * :: - - int vfs_get_super(struct fs_context *fc, - enum vfs_get_super_keying keying, - int (*fill_super)(struct super_block *sb, - struct fs_context *fc)) - - This creates/looks up a deviceless superblock. The keying indicates how - many superblocks of this type may exist and in what manner they may be - shared: - - (1) vfs_get_single_super - - Only one such superblock may exist in the system. Any further - attempt to get a new superblock gets this one (and any parameter - differences are ignored). - - (2) vfs_get_keyed_super - - Multiple superblocks of this type may exist and they're keyed on - their s_fs_info pointer (for example this may refer to a - namespace). - - (3) vfs_get_independent_super - - Multiple independent superblocks of this type may exist. This - function never matches an existing one and always creates a new - one. - Parameter Description ===================== diff --git a/fs/super.c b/fs/super.c index 6a82660e1adba..76f477c24c3d5 100644 --- a/fs/super.c +++ b/fs/super.c @@ -1111,55 +1111,14 @@ static int test_single_super(struct super_block *s, struct fs_context *fc) return 1; } -/** - * vfs_get_super - Get a superblock with a search key set in s_fs_info. - * @fc: The filesystem context holding the parameters - * @keying: How to distinguish superblocks - * @fill_super: Helper to initialise a new superblock - * - * Search for a superblock and create a new one if not found. The search - * criterion is controlled by @keying. If the search fails, a new superblock - * is created and @fill_super() is called to initialise it. - * - * @keying can take one of a number of values: - * - * (1) vfs_get_single_super - Only one superblock of this type may exist on the - * system. This is typically used for special system filesystems. - * - * (2) vfs_get_keyed_super - Multiple superblocks may exist, but they must have - * distinct keys (where the key is in s_fs_info). Searching for the same - * key again will turn up the superblock for that key. - * - * (3) vfs_get_independent_super - Multiple superblocks may exist and are - * unkeyed. Each call will get a new superblock. - * - * A permissions check is made by sget_fc() unless we're getting a superblock - * for a kernel-internal mount or a submount. - */ -int vfs_get_super(struct fs_context *fc, - enum vfs_get_super_keying keying, - int (*fill_super)(struct super_block *sb, - struct fs_context *fc)) +static int vfs_get_super(struct fs_context *fc, bool reconf, + int (*test)(struct super_block *, struct fs_context *), + int (*fill_super)(struct super_block *sb, + struct fs_context *fc)) { - int (*test)(struct super_block *, struct fs_context *); struct super_block *sb; int err; - switch (keying) { - case vfs_get_single_super: - case vfs_get_single_reconf_super: - test = test_single_super; - break; - case vfs_get_keyed_super: - test = test_keyed_super; - break; - case vfs_get_independent_super: - test = NULL; - break; - default: - BUG(); - } - sb = sget_fc(fc, test, set_anon_super_fc); if (IS_ERR(sb)) return PTR_ERR(sb); @@ -1173,7 +1132,7 @@ int vfs_get_super(struct fs_context *fc, fc->root = dget(sb->s_root); } else { fc->root = dget(sb->s_root); - if (keying == vfs_get_single_reconf_super) { + if (reconf) { err = reconfigure_super(fc); if (err < 0) { dput(fc->root); @@ -1189,13 +1148,12 @@ int vfs_get_super(struct fs_context *fc, deactivate_locked_super(sb); return err; } -EXPORT_SYMBOL(vfs_get_super); int get_tree_nodev(struct fs_context *fc, int (*fill_super)(struct super_block *sb, struct fs_context *fc)) { - return vfs_get_super(fc, vfs_get_independent_super, fill_super); + return vfs_get_super(fc, false, NULL, fill_super); } EXPORT_SYMBOL(get_tree_nodev); @@ -1203,7 +1161,7 @@ int get_tree_single(struct fs_context *fc, int (*fill_super)(struct super_block *sb, struct fs_context *fc)) { - return vfs_get_super(fc, vfs_get_single_super, fill_super); + return vfs_get_super(fc, false, test_single_super, fill_super); } EXPORT_SYMBOL(get_tree_single); @@ -1211,7 +1169,7 @@ int get_tree_single_reconf(struct fs_context *fc, int (*fill_super)(struct super_block *sb, struct fs_context *fc)) { - return vfs_get_super(fc, vfs_get_single_reconf_super, fill_super); + return vfs_get_super(fc, true, test_single_super, fill_super); } EXPORT_SYMBOL(get_tree_single_reconf); @@ -1221,7 +1179,7 @@ int get_tree_keyed(struct fs_context *fc, void *key) { fc->s_fs_info = key; - return vfs_get_super(fc, vfs_get_keyed_super, fill_super); + return vfs_get_super(fc, false, test_keyed_super, fill_super); } EXPORT_SYMBOL(get_tree_keyed); diff --git a/include/linux/fs_context.h b/include/linux/fs_context.h index 13fa6f3df8e46..87a34f2fa68de 100644 --- a/include/linux/fs_context.h +++ b/include/linux/fs_context.h @@ -145,20 +145,6 @@ extern void fc_drop_locked(struct fs_context *fc); int reconfigure_single(struct super_block *s, int flags, void *data); -/* - * sget() wrappers to be called from the ->get_tree() op. - */ -enum vfs_get_super_keying { - vfs_get_single_super, /* Only one such superblock may exist */ - vfs_get_single_reconf_super, /* As above, but reconfigure if it exists */ - vfs_get_keyed_super, /* Superblocks with different s_fs_info keys may exist */ - vfs_get_independent_super, /* Multiple independent superblocks may exist */ -}; -extern int vfs_get_super(struct fs_context *fc, - enum vfs_get_super_keying keying, - int (*fill_super)(struct super_block *sb, - struct fs_context *fc)); - extern int get_tree_nodev(struct fs_context *fc, int (*fill_super)(struct super_block *sb, struct fs_context *fc));
diff --git a/fs/super.c b/fs/super.c index 6a82660e1adb..cde412f900c7 100644 --- a/fs/super.c +++ b/fs/super.c @@ -1136,7 +1136,7 @@ static int test_single_super(struct super_block *s, struct fs_context *fc) * A permissions check is made by sget_fc() unless we're getting a superblock * for a kernel-internal mount or a submount. */ -int vfs_get_super(struct fs_context *fc, +static int vfs_get_super(struct fs_context *fc, enum vfs_get_super_keying keying, int (*fill_super)(struct super_block *sb, struct fs_context *fc)) @@ -1189,7 +1189,6 @@ int vfs_get_super(struct fs_context *fc, deactivate_locked_super(sb); return err; } -EXPORT_SYMBOL(vfs_get_super); int get_tree_nodev(struct fs_context *fc, int (*fill_super)(struct super_block *sb, diff --git a/include/linux/fs_context.h b/include/linux/fs_context.h index 13fa6f3df8e4..8b3df5ca8f33 100644 --- a/include/linux/fs_context.h +++ b/include/linux/fs_context.h @@ -154,10 +154,6 @@ enum vfs_get_super_keying { vfs_get_keyed_super, /* Superblocks with different s_fs_info keys may exist */ vfs_get_independent_super, /* Multiple independent superblocks may exist */ }; -extern int vfs_get_super(struct fs_context *fc, - enum vfs_get_super_keying keying, - int (*fill_super)(struct super_block *sb, - struct fs_context *fc)); extern int get_tree_nodev(struct fs_context *fc, int (*fill_super)(struct super_block *sb,