Thread (45 messages) 45 messages, 4 authors, 2025-08-07

Re: [PATCH 02/10] mount_setattr.2: move mount_attr struct to mount_attr.2type

From: Alejandro Colomar <alx@kernel.org>
Date: 2025-08-05 17:01:36

Hi Aleksa,

On Wed, Aug 06, 2025 at 02:25:47AM +1000, Aleksa Sarai wrote:
As with openat2(2type), it makes sense to move this to a separate man
I guess you meant open_how(2type) instead of openat2(2type).

	$ find man/man2type/
	man/man2type/
	man/man2type/open_how.2type
page. In addition, future man pages added in this patchset will want to
Please use two spaces after period in commit messages.  See:

$ cat CONTRIBUTING.d/patches/description | grep -A5 Style.guide
    Style guide
	URIs should always be enclosed in <>.

	The correct inter-sentence space amount is two.  See some
	history about this:
	<https://web.archive.org/web/20171217060354/http://www.heracliteanriver.com/?p=324>
quoted hunk ↗ jump to hunk
reference mount_attr(2type).

Signed-off-by: Aleksa Sarai <redacted>
---
 man/man2/mount_setattr.2      | 16 +++---------
 man/man2type/mount_attr.2type | 58 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 62 insertions(+), 12 deletions(-)
diff --git a/man/man2/mount_setattr.2 b/man/man2/mount_setattr.2
index b8ddc3e22aef..e863be64deb5 100644
--- a/man/man2/mount_setattr.2
+++ b/man/man2/mount_setattr.2
@@ -116,18 +116,10 @@ The
 .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 000000000000..733dbc3c8cdb
--- /dev/null
+++ b/man/man2type/mount_attr.2type
@@ -0,0 +1,58 @@
+
+.\" 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
Please use .member syntax.  This is the convention we're using for new
documentation.  I'll slowly add consistency to the existing docs.  So:

	.I .attr_set
+This field specifies which
+.B MOUNT_ATTR_*
Please use

	.BI MOUNT_ATTR_ *

The variable part should be in italics.
+attribute flags to set.
+.TP
+.I attr_clr
+This fields specifies which
+.B MOUNT_ATTR_*
Same here.
+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 fields specifies a file descriptor that indicates which user namespace to
+use as a reference for ID-mapped mounts with
+.BR MOUNT_ATTR_IDMAP .
+.SH VERSIONS
+Extra fields may be appended to the structure, with a zero value in a new field
Please use semantic newlines.  That is, break after the comma.  See
man-pages(7):

$ MANWIDTH=72 man man-pages | sed -n '/Use semantic newlines/,/^$/p'
   Use semantic newlines
       In the source of a manual page, new sentences should be  started
       on  new  lines,  long  sentences  should  be split into lines at
       clause breaks (commas, semicolons, colons, and so on), and  long
       clauses  should be split at phrase boundaries.  This convention,
       sometimes known as "semantic newlines", makes it easier  to  see
       the effect of patches, which often operate at the level of indi‐
       vidual sentences, clauses, or phrases.


Have a lovely day!
Alex
+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 STANDARDS
+Linux.
+.SH SEE ALSO
+.BR mount_setattr (2)

-- 
2.50.1
-- 
<https://www.alejandro-colomar.es/>

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help