From: Aleksa Sarai <cyphar@cyphar.com>
To: Alejandro Colomar <alx@kernel.org>
Cc: "Michael T. Kerrisk" <mtk.manpages@gmail.com>,
Alexander Viro <viro@zeniv.linux.org.uk>,
Jan Kara <jack@suse.cz>, Askar Safin <safinaskar@zohomail.com>,
"G. Branden Robinson" <g.branden.robinson@gmail.com>,
linux-man@vger.kernel.org, linux-api@vger.kernel.org,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
David Howells <dhowells@redhat.com>,
Christian Brauner <brauner@kernel.org>,
Aleksa Sarai <cyphar@cyphar.com>
Subject: [PATCH v4 01/10] man/man2/mount_setattr.2: move mount_attr struct to mount_attr(2type)
Date: Fri, 19 Sep 2025 11:59:42 +1000 [thread overview]
Message-ID: <20250919-new-mount-api-v4-1-1261201ab562@cyphar.com> (raw)
In-Reply-To: <20250919-new-mount-api-v4-0-1261201ab562@cyphar.com>
As with open_how(2type), it makes sense to move this to a separate man
page. In addition, future man pages added in this patchset will want to
reference mount_attr(2type).
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
---
man/man2/mount_setattr.2 | 17 ++++--------
man/man2type/mount_attr.2type | 61 +++++++++++++++++++++++++++++++++++++++++++
2 files changed, 66 insertions(+), 12 deletions(-)
diff --git a/man/man2/mount_setattr.2 b/man/man2/mount_setattr.2
index 586633f48e894bf8f2823aa7755c96adcddea6a6..4b55f6d2e09d00d9bc4b3a085f310b1b459f34e8 100644
--- a/man/man2/mount_setattr.2
+++ b/man/man2/mount_setattr.2
@@ -114,18 +114,11 @@ .SH DESCRIPTION
.I attr
argument of
.BR mount_setattr ()
-is a structure of the following form:
-.P
-.in +4n
-.EX
-struct mount_attr {
- __u64 attr_set; /* Mount properties to set */
- __u64 attr_clr; /* Mount properties to clear */
- __u64 propagation; /* Mount propagation type */
- __u64 userns_fd; /* User namespace file descriptor */
-};
-.EE
-.in
+is a pointer to a
+.I mount_attr
+structure,
+described in
+.BR mount_attr (2type).
.P
The
.I attr_set
diff --git a/man/man2type/mount_attr.2type b/man/man2type/mount_attr.2type
new file mode 100644
index 0000000000000000000000000000000000000000..f5c4f48be46ec1e6c0d3a211b6724a1e95311a41
--- /dev/null
+++ b/man/man2type/mount_attr.2type
@@ -0,0 +1,61 @@
+.\" Copyright, the authors of the Linux man-pages project
+.\"
+.\" SPDX-License-Identifier: Linux-man-pages-copyleft
+.\"
+.TH mount_attr 2type (date) "Linux man-pages (unreleased)"
+.SH NAME
+mount_attr \- what mount properties to set and clear
+.SH LIBRARY
+Linux kernel headers
+.SH SYNOPSIS
+.EX
+.B #include <sys/mount.h>
+.P
+.B struct mount_attr {
+.BR " u64 attr_set;" " /* Mount properties to set */"
+.BR " u64 attr_clr;" " /* Mount properties to clear */"
+.BR " u64 propagation;" " /* Mount propagation type */"
+.BR " u64 userns_fd;" " /* User namespace file descriptor */"
+ /* ... */
+.B };
+.EE
+.SH DESCRIPTION
+Specifies which mount properties should be changed with
+.BR mount_setattr (2).
+.P
+The fields are as follows:
+.TP
+.I .attr_set
+This field specifies which
+.BI MOUNT_ATTR_ *
+attribute flags to set.
+.TP
+.I .attr_clr
+This field specifies which
+.BI MOUNT_ATTR_ *
+attribute flags to clear.
+.TP
+.I .propagation
+This field specifies what mount propagation will be applied.
+The valid values of this field are the same propagation types described in
+.BR mount_namespaces (7).
+.TP
+.I .userns_fd
+This field specifies a file descriptor that indicates which user namespace to
+use as a reference for ID-mapped mounts with
+.BR MOUNT_ATTR_IDMAP .
+.SH STANDARDS
+Linux.
+.SH HISTORY
+Linux 5.12.
+.\" commit 2a1867219c7b27f928e2545782b86daaf9ad50bd
+glibc 2.36.
+.P
+Extra fields may be appended to the structure,
+with a zero value in a new field resulting in
+the kernel behaving as though that extension field was not present.
+Therefore, a user
+.I must
+zero-fill this structure on initialization.
+.SH SEE ALSO
+.BR mount_setattr (2)
--
2.51.0
next prev parent reply other threads:[~2025-09-19 2:00 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-19 1:59 [PATCH v4 00/10] man2: document "new" mount API Aleksa Sarai
2025-09-19 1:59 ` Aleksa Sarai [this message]
2025-09-19 16:04 ` [PATCH v4 01/10] man/man2/mount_setattr.2: move mount_attr struct to mount_attr(2type) Alejandro Colomar
2025-09-19 1:59 ` [PATCH v4 02/10] man/man2/fsopen.2: document "new" mount API Aleksa Sarai
2025-09-19 16:24 ` Alejandro Colomar
2025-09-19 21:19 ` Aleksa Sarai
2025-09-21 1:33 ` Aleksa Sarai
2025-09-21 8:39 ` Alejandro Colomar
2025-09-19 1:59 ` [PATCH v4 03/10] man/man2/fspick.2: " Aleksa Sarai
2025-09-21 8:53 ` Alejandro Colomar
2025-09-21 14:55 ` Aleksa Sarai
2025-09-21 15:17 ` Alejandro Colomar
2025-09-22 0:25 ` Askar Safin
2025-09-19 1:59 ` [PATCH v4 04/10] man/man2/fsconfig.2: " Aleksa Sarai
2025-09-21 9:26 ` Alejandro Colomar
2025-09-24 6:41 ` Aleksa Sarai
2025-09-24 8:52 ` Alejandro Colomar
2025-09-19 1:59 ` [PATCH v4 05/10] man/man2/fsmount.2: " Aleksa Sarai
2025-09-21 23:08 ` Askar Safin
2025-09-22 1:10 ` Askar Safin
2025-09-19 1:59 ` [PATCH v4 06/10] man/man2/move_mount.2: " Aleksa Sarai
2025-09-19 1:59 ` [PATCH v4 07/10] man/man2/open_tree.2: " Aleksa Sarai
2025-09-21 9:47 ` Alejandro Colomar
2025-09-22 10:09 ` Aleksa Sarai
2025-09-22 13:22 ` Alejandro Colomar
2025-09-24 1:34 ` Aleksa Sarai
2025-09-30 12:32 ` G. Branden Robinson
2025-10-02 22:20 ` Alejandro Colomar
2025-09-19 1:59 ` [PATCH v4 08/10] man/man2/mount_setattr.2: mirror opening sentence from fsopen(2) Aleksa Sarai
2025-09-21 9:50 ` Alejandro Colomar
2025-09-21 10:03 ` Aleksa Sarai
2025-09-21 10:19 ` Alejandro Colomar
2025-09-19 1:59 ` [PATCH v4 09/10] man/man2/open_tree{,_attr}.2: document new open_tree_attr() API Aleksa Sarai
2025-09-21 9:55 ` Alejandro Colomar
2025-09-24 6:31 ` Aleksa Sarai
2025-09-24 8:51 ` Alejandro Colomar
2025-09-19 1:59 ` [PATCH v4 10/10] man/man2/{fsconfig,mount_setattr}.2: add note about attribute-parameter distinction Aleksa Sarai
2025-09-19 12:23 ` Aleksa Sarai
2025-09-21 9:59 ` Alejandro Colomar
2025-09-22 1:06 ` Askar Safin
2025-09-21 2:43 ` [PATCH v4 00/10] man2: document "new" mount API Askar Safin
2025-09-21 9:58 ` Aleksa Sarai
2025-09-24 11:11 ` Aleksa Sarai
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=20250919-new-mount-api-v4-1-1261201ab562@cyphar.com \
--to=cyphar@cyphar.com \
--cc=alx@kernel.org \
--cc=brauner@kernel.org \
--cc=dhowells@redhat.com \
--cc=g.branden.robinson@gmail.com \
--cc=jack@suse.cz \
--cc=linux-api@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-man@vger.kernel.org \
--cc=mtk.manpages@gmail.com \
--cc=safinaskar@zohomail.com \
--cc=viro@zeniv.linux.org.uk \
/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