From: Christian Brauner <brauner@kernel.org>
To: Miklos Szeredi <miklos@szeredi.hu>, Amir Goldstein <amir73il@gmail.com>
Cc: Josef Bacik <josef@toxicpanda.com>,
linux-fsdevel@vger.kernel.org, linux-unionfs@vger.kernel.org,
Christian Brauner <brauner@kernel.org>
Subject: [PATCH v3 3/5] Documentation,ovl: document new file descriptor based layers
Date: Mon, 14 Oct 2024 11:40:58 +0200 [thread overview]
Message-ID: <20241014-work-overlayfs-v3-3-32b3fed1286e@kernel.org> (raw)
In-Reply-To: <20241014-work-overlayfs-v3-0-32b3fed1286e@kernel.org>
Add a minimal example how to specify layers via file descriptors.
Signed-off-by: Christian Brauner <brauner@kernel.org>
---
Documentation/filesystems/overlayfs.rst | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/Documentation/filesystems/overlayfs.rst b/Documentation/filesystems/overlayfs.rst
index 3436447123409726cbd78badea2f8b4f002e0640..4c8387e1c88068fa10c640191fe3bcc20587f6b0 100644
--- a/Documentation/filesystems/overlayfs.rst
+++ b/Documentation/filesystems/overlayfs.rst
@@ -440,6 +440,23 @@ For example::
fsconfig(fs_fd, FSCONFIG_SET_STRING, "datadir+", "/do2", 0);
+Specifying layers via file descriptors
+--------------------------------------
+
+Since kernel v6.13, overlayfs supports specifying layers via file descriptors in
+addition to specifying them as paths. This feature is available for the
+"datadir+", "lowerdir+", "upperdir", and "workdir+" mount options with the
+fsconfig syscall from the new mount api::
+
+ fsconfig(fs_fd, FSCONFIG_SET_FD, "lowerdir+", NULL, fd_lower1);
+ fsconfig(fs_fd, FSCONFIG_SET_FD, "lowerdir+", NULL, fd_lower2);
+ fsconfig(fs_fd, FSCONFIG_SET_FD, "lowerdir+", NULL, fd_lower3);
+ fsconfig(fs_fd, FSCONFIG_SET_FD, "datadir+", NULL, fd_data1);
+ fsconfig(fs_fd, FSCONFIG_SET_FD, "datadir+", NULL, fd_data2);
+ fsconfig(fs_fd, FSCONFIG_SET_FD, "workdir", NULL, fd_work);
+ fsconfig(fs_fd, FSCONFIG_SET_FD, "upperdir", NULL, fd_upper);
+
+
fs-verity support
-----------------
--
2.45.2
next prev parent reply other threads:[~2024-10-14 9:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-14 9:40 [PATCH v3 0/5] ovl: file descriptors based layer setup Christian Brauner
2024-10-14 9:40 ` [PATCH v3 1/5] fs: add helper to use mount option as path or fd Christian Brauner
2024-10-14 9:40 ` [PATCH v3 2/5] ovl: specify layers via file descriptors Christian Brauner
2024-10-18 9:42 ` Miklos Szeredi
2024-10-18 10:34 ` Christian Brauner
2024-10-14 9:40 ` Christian Brauner [this message]
2024-10-14 9:40 ` [PATCH v3 4/5] selftests: use shared header Christian Brauner
2024-10-14 9:41 ` [PATCH v3 5/5] selftests: add overlayfs fd mounting selftests Christian Brauner
2024-10-14 14:16 ` [PATCH v3 0/5] ovl: file descriptors based layer setup Amir Goldstein
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241014-work-overlayfs-v3-3-32b3fed1286e@kernel.org \
--to=brauner@kernel.org \
--cc=amir73il@gmail.com \
--cc=josef@toxicpanda.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-unionfs@vger.kernel.org \
--cc=miklos@szeredi.hu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).