9p: add support for root file systems
Subsystems (3)
v2 cover 9p: add support for root file systems
Just like cifs and nfs, this short series enables rootfs support for 9p. Bellow is an example which mounts v9fs with tag 'r' as rootfs in qemu guest via virtio transport.
$ qemu-system-x86_64 -enable-kvm -cpu host -m 1024 \
-virtfs local,path=$rootfs_dir,mount_tag=r,security_model=passthrough,id=r \
-kernel /path/to/linux/arch/x86/boot/bzImage -nographic \
-append "root=/dev/v9fs v9fsroot=r,trans=virtio rw console=ttyS0 3"v2:
o use pr_err instead of printk.
o ROOT_DEV is only set after checking.
o cleanup DEFAULT_MNT_OPTS.
o do not retry mount for fd and virtio transport.
Changbin Du (3):
9p: add support for root file systems
9p: doc: move to a new dedicated folder
9p: doc: add v9fsroot description
Documentation/filesystems/index.rst | 2 +-
Documentation/filesystems/{ => v9fs}/9p.rst | 0
Documentation/filesystems/v9fs/index.rst | 12 ++++
Documentation/filesystems/v9fs/v9fsroot.rst | 52 +++++++++++++++++
MAINTAINERS | 8 ++-
fs/9p/Kconfig | 6 ++
fs/9p/Makefile | 1 +
fs/9p/v9fsroot.c | 64 +++++++++++++++++++++
include/linux/root_dev.h | 1 +
init/do_mounts.c | 54 +++++++++++++++++
10 files changed, 198 insertions(+), 2 deletions(-)
rename Documentation/filesystems/{ => v9fs}/9p.rst (100%)
create mode 100644 Documentation/filesystems/v9fs/index.rst
create mode 100644 Documentation/filesystems/v9fs/v9fsroot.rst
create mode 100644 fs/9p/v9fsroot.cSignature · 1 line
2.30.2
PATCH v2 1/3 9p: add support for root file systems
This introduces a new kernel command-line option called 'v9fsroot=' which will tell the kernel to mount the root file system by utilizing the 9p protocol.
This allows us to mount host folder as rootfs for guest linux in qemu. Bellow is an example which mounts v9fs with tag 'r' as rootfs in qemu guest via virtio transport.
$ qemu-system-x86_64 -enable-kvm -cpu host -m 1024 \
-virtfs local,path=$rootfs_dir,mount_tag=r,security_model=passthrough,id=r \
-kernel /path/to/linux/arch/x86/boot/bzImage -nographic \
-append "root=/dev/v9fs v9fsroot=r,trans=virtio rw console=ttyS0 3"---
v2:
o use pr_err instead of printk.
o ROOT_DEV is only set after checking.
o cleanup DEFAULT_MNT_OPTS.
o do not retry mount for fd and virtio transport.
--- MAINTAINERS | 5 ++++ fs/9p/Kconfig | 6 ++++ fs/9p/Makefile | 1 + fs/9p/v9fsroot.c | 64 ++++++++++++++++++++++++++++++++++++++++ include/linux/root_dev.h | 1 + init/do_mounts.c | 54 +++++++++++++++++++++++++++++++++ 6 files changed, 131 insertions(+) create mode 100644 fs/9p/v9fsroot.c
MAINTAINERS +5 -0
@@ -239,6 +239,11 @@ F: include/trace/events/9p.h F: include/uapi/linux/virtio_9p.h F: net/9p/ +9P FILE SYSTEM ROOTFS SUPPORT +R: Changbin Du <[email protected]> +S: Supported +F: fs/9p/v9fsroot.c + A8293 MEDIA DRIVER M: Antti Palosaari <[email protected]> L: [email protected]
fs/9p/Kconfig +6 -0
@@ -42,3 +42,9 @@ config 9P_FS_SECURITY If you are not using a security module that requires using extended attributes for file security labels, say N. + +config 9P_FS_ROOT + bool "9p root file system" + depends on 9P_FS=y + help + Enables root file system support over 9p protocol.
fs/9p/Makefile +1 -0
@@ -15,3 +15,4 @@ obj-$(CONFIG_9P_FS) := 9p.o 9p-$(CONFIG_9P_FSCACHE) += cache.o 9p-$(CONFIG_9P_FS_POSIX_ACL) += acl.o +9p-$(CONFIG_9P_FS_ROOT) += v9fsroot.o
fs/9p/v9fsroot.c new file +64 -0
64 lines not on this page · raw message
include/linux/root_dev.h +1 -0
@@ -9,6 +9,7 @@enum { Root_NFS =MKDEV (UNNAMED_MAJOR ,255 ), Root_CIFS =MKDEV (UNNAMED_MAJOR ,254 ), + Root_V9FS =MKDEV (UNNAMED_MAJOR ,253 ), Root_RAM0 =MKDEV (RAMDISK_MAJOR ,0 ), Root_RAM1 =MKDEV (RAMDISK_MAJOR ,1 ), Root_FD0 =MKDEV (FLOPPY_MAJOR ,0 ),
init/do_mounts.c +54 -0
72 lines not on this page · raw message
Signature · 1 line
2.30.2
PATCH v2 2/3 9p: doc: move to a new dedicated folder
In reply to Changbin DuLater we will add another documentation for v9fs.
---
Documentation/filesystems/index.rst | 2 +-
Documentation/filesystems/{ => v9fs}/9p.rst | 0
Documentation/filesystems/v9fs/index.rst | 11 +++++++++++
MAINTAINERS | 2 +-
4 files changed, 13 insertions(+), 2 deletions(-)
rename Documentation/filesystems/{ => v9fs}/9p.rst (100%)
create mode 100644 Documentation/filesystems/v9fs/index.rstDocumentation/filesystems/index.rst +1 -1
@@ -63,7 +63,7 @@ Documentation for filesystem implementations. .. toctree:: :maxdepth: 2 - 9p + v9fs/index adfs affs afs
Documentation/filesystems/v9fs/9p.rst renamed from Documentation/filesystems/9p.rst +0 -0
Documentation/filesystems/v9fs/index.rst new file +11 -0
@@ -0,0 +1,11 @@ +.. SPDX-License-Identifier: GPL-2.0 + +==== +v9fs +==== + +.. toctree:: + :maxdepth: 6 + :numbered: + + 9p
MAINTAINERS +1 -1
@@ -232,7 +232,7 @@ W: http://swik.net/v9fs Q: http://patchwork.kernel.org/project/v9fs-devel/list/ T: git git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs.git T: git git://github.com/martinetd/linux.git -F: Documentation/filesystems/9p.rst +F: Documentation/filesystems/v9fs/ F: fs/9p/ F: include/net/9p/ F: include/trace/events/9p.h
Signature · 1 line
2.30.2
PATCH v2 3/3 9p: doc: add v9fsroot description
In reply to Changbin DuThis documentation is modified from cifs/cifsroot.rst.
--- Documentation/filesystems/v9fs/index.rst | 1 + Documentation/filesystems/v9fs/v9fsroot.rst | 52 +++++++++++++++++++++ MAINTAINERS | 1 + 3 files changed, 54 insertions(+) create mode 100644 Documentation/filesystems/v9fs/v9fsroot.rst
Documentation/filesystems/v9fs/index.rst +1 -0
@@ -9,3 +9,4 @@ v9fs :numbered: 9p + v9fsroot
Documentation/filesystems/v9fs/v9fsroot.rst new file +52 -0
52 lines not on this page · raw message
MAINTAINERS +1 -0
@@ -243,6 +243,7 @@ F: net/9p/ R: Changbin Du <[email protected]> S: Supported F: fs/9p/v9fsroot.c +F: Documentation/filesystems/v9fs/v9fsroot.rst A8293 MEDIA DRIVER M: Antti Palosaari <[email protected]>
Signature · 1 line
2.30.2