Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp804498pxb; Wed, 3 Nov 2021 12:41:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyM01Lpc5FzUs70p8RALq9ahUDAh5hmkSjMH8QX6z8/elpEF/NMVQ7h+boNBqn6McQO/nNH X-Received: by 2002:a17:907:94c4:: with SMTP id dn4mr31412018ejc.512.1635968471258; Wed, 03 Nov 2021 12:41:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635968471; cv=none; d=google.com; s=arc-20160816; b=eqVkqIHLEMYg1SiP/zQ2/AbMekxFyzKm16U4h2y7iVPP1xb1yGeK1OeMlafO4Yev2B Bqacg6QlL6tDNYRh+Ma93Q184MMeKtZU3ShRm5jLYYvbJ7x8laf1EB/0QW7f/1fSMkcx JRObUEx+P9hSeU7JCeeIfbEvaxQjGaYkNAl49E537jpRaW5x3Vh9yythWfmBHG3nmQgd 3UJRfWKDtUTw8bTXYAAM+zvGbtqxE/++V7zWs7HfrN6wc2udegf4J+MDGoaiFX50DtDM f4cxQWmOA1qo9iLYWo5M+gOr5aXLJepEBnveBeGt00bJNVDxtcL8bmNNzI+wsFJbvEU9 PQQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:dkim-signature :from; bh=BpQOhb2cZBGd7u8g7wwhelyv2avMnIDNd9OpbcIsOfg=; b=lyIUPM/r119bQGUlKNqCZBrNP9x3No+8JQiJZ9okwQhnbAR2WFicjXx/RnXP5408dK 5g3+t5/hoAU3TIl1Ew3wR1w+iyX5l2KrSSnvaJHiIaJxUluyh3jOn/zDni6epf6ryu7e u7e1omEI1T1HUPWfP1A1tLOfDmtPfC0ViBJAreMw4NOlL1DFzSmOX6ZsOwhbJzLKRFkm rGRChPvMyW7AhLxXYQ1CIvmT1uElxXdS0iUA2bGGocnPP4zWlkZYSoOX2+y2266GYByq CvNqnAUJnECwQb/z2apGVBaKqZfFx1Z7TZO/lBL7aLRJSZXCRfrprR2nRfC5bmHlfvxz ezTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@weissschuh.net header.s=mail header.b=V0vse0iZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dd18si5381462ejc.512.2021.11.03.12.40.47; Wed, 03 Nov 2021 12:41:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@weissschuh.net header.s=mail header.b=V0vse0iZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231543AbhKCTlS (ORCPT + 99 others); Wed, 3 Nov 2021 15:41:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229918AbhKCTlI (ORCPT ); Wed, 3 Nov 2021 15:41:08 -0400 Received: from todd.t-8ch.de (todd.t-8ch.de [IPv6:2a01:4f8:c010:41de::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51BA6C061714; Wed, 3 Nov 2021 12:38:31 -0700 (PDT) From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=weissschuh.net; s=mail; t=1635968309; bh=1lvpZBMnAiuoh4ysYuD5bGBkS7W06lh/Tvn7af7xom4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V0vse0iZPtrez5azQFc4VRg+v50Qjlu533fDW9EO24pn6RadYpzudPv2eBVRKdhBv Ldmwe1uopJf2M5qCpN5zOFHyqBvRTBZIC06gXi0mrxvak4Nsq+tf5C6DqwETqbFWL9 0+JoW1z7UT/7goMsweC24PQaCICTYUDx7BHpP5IA= To: v9fs-developer@lists.sourceforge.net, netdev@vger.kernel.org Cc: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , Dominique Martinet , Eric Van Hensbergen , Latchesar Ionkov , "David S. Miller" , Jakub Kicinski , Stefano Stabellini , linux-kernel@vger.kernel.org Subject: [PATCH v2 2/4] 9p/trans_fd: split into dedicated module Date: Wed, 3 Nov 2021 20:38:21 +0100 Message-Id: <20211103193823.111007-3-linux@weissschuh.net> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211103193823.111007-1-linux@weissschuh.net> References: <20211103193823.111007-1-linux@weissschuh.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This allows these transports only to be used when needed. Signed-off-by: Thomas Weißschuh --- include/net/9p/9p.h | 2 -- net/9p/Kconfig | 7 +++++++ net/9p/Makefile | 5 ++++- net/9p/mod.c | 2 -- net/9p/trans_fd.c | 14 ++++++++++++-- 5 files changed, 23 insertions(+), 7 deletions(-) diff --git a/include/net/9p/9p.h b/include/net/9p/9p.h index 03614de86942..f420f8cb378d 100644 --- a/include/net/9p/9p.h +++ b/include/net/9p/9p.h @@ -553,6 +553,4 @@ struct p9_fcall { int p9_errstr2errno(char *errstr, int len); int p9_error_init(void); -int p9_trans_fd_init(void); -void p9_trans_fd_exit(void); #endif /* NET_9P_H */ diff --git a/net/9p/Kconfig b/net/9p/Kconfig index 64468c49791f..af601129f1bb 100644 --- a/net/9p/Kconfig +++ b/net/9p/Kconfig @@ -15,6 +15,13 @@ menuconfig NET_9P if NET_9P +config NET_9P_FD + depends on VIRTIO + tristate "9P FD Transport" + help + This builds support for transports over TCP, Unix sockets and + filedescriptors. + config NET_9P_VIRTIO depends on VIRTIO tristate "9P Virtio Transport" diff --git a/net/9p/Makefile b/net/9p/Makefile index aa0a5641e5d0..1df9b344c30b 100644 --- a/net/9p/Makefile +++ b/net/9p/Makefile @@ -1,5 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 obj-$(CONFIG_NET_9P) := 9pnet.o +obj-$(CONFIG_NET_9P_FD) += 9pnet_fd.o obj-$(CONFIG_NET_9P_XEN) += 9pnet_xen.o obj-$(CONFIG_NET_9P_VIRTIO) += 9pnet_virtio.o obj-$(CONFIG_NET_9P_RDMA) += 9pnet_rdma.o @@ -9,9 +10,11 @@ obj-$(CONFIG_NET_9P_RDMA) += 9pnet_rdma.o client.o \ error.o \ protocol.o \ - trans_fd.o \ trans_common.o \ +9pnet_fd-objs := \ + trans_fd.o \ + 9pnet_virtio-objs := \ trans_virtio.o \ diff --git a/net/9p/mod.c b/net/9p/mod.c index c95416c1d1a2..8f1d067b272e 100644 --- a/net/9p/mod.c +++ b/net/9p/mod.c @@ -182,7 +182,6 @@ static int __init init_p9(void) p9_error_init(); pr_info("Installing 9P2000 support\n"); - p9_trans_fd_init(); return ret; } @@ -196,7 +195,6 @@ static void __exit exit_p9(void) { pr_info("Unloading 9P2000 support\n"); - p9_trans_fd_exit(); p9_client_exit(); } diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c index 007bbcc68010..e3f4a7a5c845 100644 --- a/net/9p/trans_fd.c +++ b/net/9p/trans_fd.c @@ -1092,6 +1092,7 @@ static struct p9_trans_module p9_tcp_trans = { .show_options = p9_fd_show_options, .owner = THIS_MODULE, }; +MODULE_ALIAS_9P("tcp"); static struct p9_trans_module p9_unix_trans = { .name = "unix", @@ -1105,6 +1106,7 @@ static struct p9_trans_module p9_unix_trans = { .show_options = p9_fd_show_options, .owner = THIS_MODULE, }; +MODULE_ALIAS_9P("unix"); static struct p9_trans_module p9_fd_trans = { .name = "fd", @@ -1118,6 +1120,7 @@ static struct p9_trans_module p9_fd_trans = { .show_options = p9_fd_show_options, .owner = THIS_MODULE, }; +MODULE_ALIAS_9P("fd"); /** * p9_poll_workfn - poll worker thread @@ -1151,7 +1154,7 @@ static void p9_poll_workfn(struct work_struct *work) p9_debug(P9_DEBUG_TRANS, "finish\n"); } -int p9_trans_fd_init(void) +static int __init p9_trans_fd_init(void) { v9fs_register_trans(&p9_tcp_trans); v9fs_register_trans(&p9_unix_trans); @@ -1160,10 +1163,17 @@ int p9_trans_fd_init(void) return 0; } -void p9_trans_fd_exit(void) +static void __exit p9_trans_fd_exit(void) { flush_work(&p9_poll_work); v9fs_unregister_trans(&p9_tcp_trans); v9fs_unregister_trans(&p9_unix_trans); v9fs_unregister_trans(&p9_fd_trans); } + +module_init(p9_trans_fd_init); +module_exit(p9_trans_fd_exit); + +MODULE_AUTHOR("Eric Van Hensbergen "); +MODULE_DESCRIPTION("Filedescriptor Transport for 9P"); +MODULE_LICENSE("GPL"); -- 2.33.1