Re: [PATCH v3 5/5] docs: add fileattr API documentation
From: Amir Goldstein
Date: Mon Nov 30 2026 - 10:25:15 EST
On Mon, Nov 30, 2026 at 3:10 PM koraynilay <koray.fra@xxxxxxxxx> wrote:
>
> On Mon Nov 30, 2026 at 2:33 PM CET, Andrey Albershteyn wrote:
> > On 2026-11-29 03:42:33, koraynilay wrote:
> >> Add documentation for the fileattr API.
> >>
> >> Signed-off-by: koraynilay <koray.fra@xxxxxxxxx>
> >> ---
> >> Documentation/filesystems/fileattr.rst | 530 +++++++++++++++++++++++++
> >> Documentation/filesystems/index.rst | 1 +
> >> Documentation/filesystems/vfs.rst | 19 +-
> >> include/uapi/linux/fs.h | 28 +-
> >> 4 files changed, 568 insertions(+), 10 deletions(-)
> >> create mode 100644 Documentation/filesystems/fileattr.rst
> >>
> >> diff --git a/Documentation/filesystems/fileattr.rst b/Documentation/filesystems/fileattr.rst
> >> new file mode 100644
> >> index 000000000000..9e3515dc4517
> >> --- /dev/null
> >> +++ b/Documentation/filesystems/fileattr.rst
> >> @@ -0,0 +1,530 @@
> >> +.. SPDX-License-Identifier: GPL-2.0
> >> +
> >> +============
> >> +Fileattr API
> >> +============
> >> +
> >> +Overview
> >> +========
> >> +
> >> +The fileattr API provides a modern way (instead of the older
> >> +``FS_IOC_[GS]ETFLAGS`` and ``FS_IOC_FS[GS]ETXATTR`` ioctls) to query and modify inode
> >> +flags (like immutable and append-only).
> >
> > Note, there're man-pages for file_getattr()/file_setattr() merged
> > for a next release [1] and [2]. The `struct file_attr` man page is
> > already merged in 6.20 [3].
>
> Ah yes thanks, I was indeed modifying those files to add the masks.
> (But I'll probably finish those after having the actual code and doc
> finished)
>
> > I think it worth referencing these and maybe focus this doc more on
> > internals?
>
> Yes, I'll update the doc to reference these.
> Should I keep the doc with only stuff that isn't/won't be in the
> manpages or have *some* things duplicated?
>
You don't need to worry about duplication, only need to consider
who this doc you are writing is for and then use common sense to know
if this information is relevant (hint: all possible error codes are not).
It is NOT for userspace programmers, it is for the kernel and filesystem
developers. For fs developers wanting to convert an fs and for developers
wanting to add some new flag/value etc.
Thanks,
Amir.