Sample ramfs file server that uses the in-kernel 9P file server support.
This code is for reference only.
Signed-off-by: Latchesar Ionkov <lucho@ionkov.net>
---
net/9p/Kconfig | 8 +-
net/9p/Makefile | 1 +
net/9p/ramfs/ramfs.c | 986 ++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 994 insertions(+), 1 deletions(-)
diff --git a/net/9p/Kconfig b/net/9p/Kconfig
index 5b0dc28..68f7496 100644
--- a/net/9p/Kconfig
+++ b/net/9p/Kconfig
@@ -23,11 +23,17 @@ config NET_9P_FD
file descriptors. TCP/IP is the default transport for 9p,
so if you are going to use 9p, you'll likely want this.
-config NET_9P_SRV
+menuconfig NET_9P_SRV
tristate "9P server support"
depends on NET_9P
help
Say Y if you want the 9P server support
+
+config NET_9P_RAMFS
+ tristate "9P ramfs sample file server"
+ depends on NET_9P_SRV && NET_9P_LOOP
+ help
+ Say Y if you want the 9P ramfs support
config NET_9P_VIRTIO
depends on NET_9P && EXPERIMENTAL && VIRTIO
tristate "9P Virtio Transport (Experimental)"
diff --git a/net/9p/Makefile b/net/9p/Makefile
index 6ee024e..3808c40 100644
--- a/net/9p/Makefile
+++ b/net/9p/Makefile
@@ -3,6 +3,7 @@ obj-$(CONFIG_NET_9P_FD) += 9pnet_fd.o
obj-$(CONFIG_NET_9P_LOOP) += 9pnet_loop.o
obj-$(CONFIG_NET_9P_SRV) += 9psrv.o
obj-$(CONFIG_NET_9P_VIRTIO) += 9pnet_virtio.o
+obj-$(CONFIG_NET_9P_RAMFS) += ramfs/
9pnet-objs := \
mod.o \
diff --git a/net/9p/ramfs/ramfs.c b/net/9p/ramfs/ramfs.c
new file mode 100644
index 0000000..3aff620
--- /dev/null
+++ b/net/9p/ramfs/ramfs.c
@@ -0,0 +1,986 @@
+/*
+ * net/9p/srv/ramfs.c
+ *
+ * Simple RAM filesystem
+ *
+ * Copyright (C) 2007 by Latchesar Ionkov <lucho@ionkov.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope ...