virtiofs: export filesystem tags through sysfs
From: | Stefan Hajnoczi <stefanha-AT-redhat.com> | |
To: | linux-fsdevel-AT-vger.kernel.org | |
Subject: | [PATCH v2 0/3] virtiofs: export filesystem tags through sysfs | |
Date: | Thu, 08 Feb 2024 14:32:08 -0500 | |
Message-ID: | <20240208193212.731978-1-stefanha@redhat.com> | |
Cc: | Alyssa Ross <hi-AT-alyssa.is>, gmaglione-AT-redhat.com, virtio-fs-AT-lists.linux.dev, vgoyal-AT-redhat.com, mzxreary-AT-0pointer.de, Greg KH <gregkh-AT-linuxfoundation.org>, miklos-AT-szeredi.hu, Stefan Hajnoczi <stefanha-AT-redhat.com> | |
Archive-link: | Article |
v2: - Vivek mentioned that he didn't have time to work on this patch series recently so I gave it a shot. - Information is now exposed in /sys/fs/virtiofs/ whereas before it was part of the generic virtio device kobject, which didn't really fit. Userspace needs a way to enumerate available virtiofs filesystems and detect when they are hotplugged or unplugged. This would allow systemd to wait for a virtiofs filesystem during boot, for example. This patch series adds the following in sysfs: /sys/fs/virtiofs/<n>/tag - unique identifier for mount(8) /sys/fs/virtiofs/<n>/device - symlink to virtio device A uevent is emitted when virtiofs devices are hotplugged or unplugged: KERNEL[111.113221] add /fs/virtiofs/2 (virtiofs) ACTION=add DEVPATH=/fs/virtiofs/2 SUBSYSTEM=virtiofs TAG=test KERNEL[165.527167] remove /fs/virtiofs/2 (virtiofs) ACTION=remove DEVPATH=/fs/virtiofs/2 SUBSYSTEM=virtiofs TAG=test Stefan Hajnoczi (3): virtiofs: forbid newlines in tags virtiofs: export filesystem tags through sysfs virtiofs: emit uevents on filesystem events fs/fuse/virtio_fs.c | 138 +++++++++++++++++--- Documentation/ABI/testing/sysfs-fs-virtiofs | 11 ++ 2 files changed, 128 insertions(+), 21 deletions(-) create mode 100644 Documentation/ABI/testing/sysfs-fs-virtiofs -- 2.43.0