Skip to contentSkip to conversation

fs/9p: Remove INET dependency

PATCH Superseded Jason Andryuk 2 participants 5 messages May 1, 2023 – May 3, 2023 9P file system

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs/9p: Remove INET dependency

9pfs can run over assorted transports, so it doesn't have an INET dependency. Drop it and remove the includes of linux/inet.h.

This allows configuring 9pfs over Xen with INET disabled.

---
 fs/9p/Kconfig          | 2 +-
 fs/9p/vfs_addr.c       | 1 -
 fs/9p/vfs_dentry.c     | 1 -
 fs/9p/vfs_dir.c        | 1 -
 fs/9p/vfs_file.c       | 1 -
 fs/9p/vfs_inode.c      | 1 -
 fs/9p/vfs_inode_dotl.c | 1 -
 fs/9p/vfs_super.c      | 1 -
 8 files changed, 1 insertion(+), 8 deletions(-)
fs/9p/Kconfig +1 -1
index d7bc93447c85..0c63df574ee7 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0-only
 config 9P_FS
 	tristate "Plan 9 Resource Sharing Support (9P2000)"
-	depends on INET && NET_9P
+	depends on NET_9P
 	select NETFS_SUPPORT
 	help
 	  If you say Y here, you will get experimental support for
fs/9p/vfs_addr.c +0 -1
index 6f46d7e4c750..425956eb9fde 100644
@@ -12,7 +12,6 @@
 #include <linux/file.h>
 #include <linux/stat.h>
 #include <linux/string.h>
-#include <linux/inet.h>
 #include <linux/pagemap.h>
 #include <linux/sched.h>
 #include <linux/swap.h>
fs/9p/vfs_dentry.c +0 -1
index 65fa2df5e49b..f16f73581634 100644
@@ -13,7 +13,6 @@
 #include <linux/pagemap.h>
 #include <linux/stat.h>
 #include <linux/string.h>
-#include <linux/inet.h>
 #include <linux/namei.h>
 #include <linux/sched.h>
 #include <linux/slab.h>
fs/9p/vfs_dir.c +0 -1
index 3d74b04fe0de..52bf87934650 100644
@@ -13,7 +13,6 @@
 #include <linux/stat.h>
 #include <linux/string.h>
 #include <linux/sched.h>
-#include <linux/inet.h>
 #include <linux/slab.h>
 #include <linux/uio.h>
 #include <linux/fscache.h>
fs/9p/vfs_file.c +0 -1
index 44c15eb2b908..367a851eaa82 100644
@@ -14,7 +14,6 @@
 #include <linux/file.h>
 #include <linux/stat.h>
 #include <linux/string.h>
-#include <linux/inet.h>
 #include <linux/list.h>
 #include <linux/pagemap.h>
 #include <linux/utsname.h>
fs/9p/vfs_inode.c +0 -1
index 1d523bec0a94..502ac74e4959 100644
@@ -15,7 +15,6 @@
 #include <linux/pagemap.h>
 #include <linux/stat.h>
 #include <linux/string.h>
-#include <linux/inet.h>
 #include <linux/namei.h>
 #include <linux/sched.h>
 #include <linux/slab.h>
fs/9p/vfs_inode_dotl.c +0 -1
index 331ed60d8fcb..a7da49906d99 100644
@@ -13,7 +13,6 @@
 #include <linux/pagemap.h>
 #include <linux/stat.h>
 #include <linux/string.h>
-#include <linux/inet.h>
 #include <linux/namei.h>
 #include <linux/sched.h>
 #include <linux/slab.h>
fs/9p/vfs_super.c +0 -1
index 266c4693e20c..10449994a972 100644
@@ -12,7 +12,6 @@
 #include <linux/file.h>
 #include <linux/stat.h>
 #include <linux/string.h>
-#include <linux/inet.h>
 #include <linux/pagemap.h>
 #include <linux/mount.h>
 #include <linux/sched.h>
Signature · 1 line
2.40.0
#1 lore raw

Jason Andryuk wrote on Mon, May 01, 2023 at 03:06:00PM -0400:

Quoted 4 lines

9pfs can run over assorted transports, so it doesn't have an INET dependency. Drop it and remove the includes of linux/inet.h.

This allows configuring 9pfs over Xen with INET disabled.

Good catch.
Could you add depends on INET to NET_9P_FD in net/9p/Kconfig?

That aside looks good to me; we probably ought to cleanup the includes a bit more aggressively...

Signature · 1 line
Dominique
#2 lore raw

Hi, Dominique

Quoted 9 lines · Dominique Martinet

Jason Andryuk wrote on Mon, May 01, 2023 at 03:06:00PM -0400:

Quoted 4 lines

9pfs can run over assorted transports, so it doesn't have an INET dependency. Drop it and remove the includes of linux/inet.h.

This allows configuring 9pfs over Xen with INET disabled.

Good catch.
Could you add depends on INET to NET_9P_FD in net/9p/Kconfig?

trans_fd.o builds without INET and without UNIX. Looks like trying to use either TCP or UNIX sockets would lead to runtime errors, but it also supports generic file descriptors. That could be useful for
someone. Since it builds, would it be okay to leave this patch
unchanged, or do you still want the depends added? Leaving the patch unchanged provides more flexibility, though the runtime errors may surprise users. While I built a Xen kernel without INET or UNIX, that is an unusual scenario. Typically INET and UNIX sockets will be built in anyway even without a depends.

Thanks,
Jason

#3 lore raw

Jason Andryuk wrote on Tue, May 02, 2023 at 08:03:15AM -0400:

Quoted 12 lines
Quoted 2 lines

Good catch.
Could you add depends on INET to NET_9P_FD in net/9p/Kconfig?

trans_fd.o builds without INET and without UNIX. Looks like trying to use either TCP or UNIX sockets would lead to runtime errors, but it also supports generic file descriptors. That could be useful for
someone. Since it builds, would it be okay to leave this patch
unchanged, or do you still want the depends added? Leaving the patch unchanged provides more flexibility, though the runtime errors may surprise users. While I built a Xen kernel without INET or UNIX, that is an unusual scenario. Typically INET and UNIX sockets will be built in anyway even without a depends.

Hmm, good point; the socket interface is common between INET and UNIX.. And you're right about the ability to use plain fd as well.

How about 'imply INET'? That will automatically select INET when enabled, but allow someone to disable it explicitly.

It's rare enough that I didn't know about it though, just found it in Documentation/kbuild/kconfig-language.rst ...
I guess this version is fine as is if you think it's too minor, I agree kernels without INET ought to be rare enough and if it builds for randconfig tests I'm fine with this.

Signature · 1 line
Dominique Martinet | Asmadeus
#4 lore raw
Quoted 15 lines · Dominique Martinet

Jason Andryuk wrote on Tue, May 02, 2023 at 08:03:15AM -0400:

Quoted 12 lines
Quoted 2 lines

Good catch.
Could you add depends on INET to NET_9P_FD in net/9p/Kconfig?

trans_fd.o builds without INET and without UNIX. Looks like trying to use either TCP or UNIX sockets would lead to runtime errors, but it also supports generic file descriptors. That could be useful for
someone. Since it builds, would it be okay to leave this patch
unchanged, or do you still want the depends added? Leaving the patch unchanged provides more flexibility, though the runtime errors may surprise users. While I built a Xen kernel without INET or UNIX, that is an unusual scenario. Typically INET and UNIX sockets will be built in anyway even without a depends.

Quoted 5 lines

Hmm, good point; the socket interface is common between INET and UNIX.. And you're right about the ability to use plain fd as well.

How about 'imply INET'? That will automatically select INET when enabled, but allow someone to disable it explicitly.

This sounds good.

Thanks,
Jason