Re: [PATCH v4 7/7] docs: add fileattr API documentation
From: koraynilay
Date: Thu Dec 03 2026 - 18:07:26 EST
On Thu Dec 3, 2026 at 11:59 PM CET, koraynilay wrote:
> On Thu Dec 3, 2026 at 11:52 PM CET, Amir Goldstein wrote:
>> On Thu, Dec 3, 2026 at 11:20 PM koraynilay <koray.fra@xxxxxxxxx> wrote:
>>>
>>> On Thu Dec 3, 2026 at 6:45 PM CET, Amir Goldstein wrote:
>>> > On Wed, Dec 2, 2026 at 10:54 PM koraynilay <koray.fra@xxxxxxxxx> wrote:
...
>>> >> +| | ``FS_XFLAG_FILESTREAM`` |
>>> >> ++------------------------+--------------------------------+
>>> >> +| | ``FS_XFLAG_COWEXTSIZE`` |
>>> >> ++------------------------+--------------------------------+
>>> >> +| | ``FS_XFLAG_CASENONPRESERVING`` |
>>> >> ++------------------------+--------------------------------+
>>> >> +| | ``FS_XFLAG_PROJID`` |
>>> >> ++------------------------+--------------------------------+
>>> >> +| | ``FS_XFLAG_HASATTR`` |
>>> >> ++------------------------+--------------------------------+
>>> >
>>> > Still very much not happy about this section.
>>> > How about merging only some of it with with XFLAGS table above
>>> > For example:
>>> >
>>> >> +| Flag Macro | Hex Value | Xflags mode | Flags mode | Description and Constraints |
>>> > ...
>>> >> +| ``FS_XFLAG_CASEFOLD`` | 0x00040000 | RO | RW | Case-insensitive lookups. |
>>> >> ++--------------------------------+------------+--------+-------------------------------------------------------+
>>> >> +| ``FS_XFLAG_CASENONPRESERVING`` | 0x00080000 | RO | - | Case not preserved in directory lookups. |
>>> >> ++--------------------------------+------------+--------+-------------------------------------------------------+
>>> >> +| ``FS_XFLAG_PROJID`` | 0x00100000 | RW | - | Project ID value flag (VER1). |
>>> >> +| | | | Updates require ``init_user_ns``. |
>>> >> ++--------------------------------+------------+--------+-------------------------------------------------------+
>>> >> +| ``FS_XFLAG_COMPR`` | 0x00200000 | RO | RW | Compressed file flag. |
>>> >> ++--------------------------------+------------+--------+-------------------------------------------------------+
>>> >> +| ``FS_XFLAG_ENCRYPT`` | 0x00400000 | RO | RO | Encrypted file flag (fscrypt). Read-only. |
>>> >> ++--------------------------------+------------+--------+-------------------------------------------------------+
>>>
>>> Oh, yeah, the 2 columns for RO/RW are nicer and I can add a column so we
>>
>> Yes.
>>
>>> have "Flag Macro" "XFlag Macro" ((I really don't like "Xflag")) and have
>>> only 1 table instead of 2?
>>
>> One table, yes.
>> Writing all the flags there like this and their hex values:
>>
>> FS_XFLAG_ENCRYPT | FS_XFLAG_ENCRYPT
> (Assuming you meant FS_XFLAG_ENCRYPT | FS_ENCRYPT_FL)
>>
>> I think it's just silly and has no place in this doc.
>
> Hmm, can you check how it looks? https://koraynilay.neocities.org/vfs-masks/fileattr
> (don't mind the unclear writing in the note above it, I haven't read it
> manually yet)
Ok sorry updated the html at the link to not include the hex values,
that is indeed pretty useless since it's just a matter of reading
fs/uapi/linux/fs.h.
Thanks,
koraynilay
>> If you want you can tell the story about file attributes, some can be
>> access by one API, some by another and some by both the story can
>> tell about the template of the FS_*_FL and FS_XFLAG_* constants etc
>> and the table could be keyed by the attr name (e.g. ENCRYPT)
>> and the table will say for each what it is and which API can access it
>> with which mode, hence:
>>
>> | Attribute | xflags | flags | Description and
>> Constraints |
>> ...
>> | ``NOCOMP`` | - | RW | ....
>> +------------------------+-----+-------+-------------------------------------------------------+
>> | ``COMPR`` | RO | RW | Compressed file flag.
>> |
>> +-------------------------+-----+------+-------------------------------------------------------+
>> | ``ENCRYPT`` | RO | RO | Encrypted file flag (fscrypt).
>> Read-only. |
>> +-------------------------+-----+-----+-------------------------------------------------------+
>
> So you mean only saying the attribute name and not the flag/xflags
> macros?
>
> In that case, I would still keep the flag|xflag table as it is in this
> patch series (so devs have a visual way to know which flags have a xflag
> counterpart and which don't)
>
>> And then somehow also represent masked only xflags, maybe:
>>
>> | ``MAYSHAREEXT`` | MRO | - | Maye sharing data extends with other
>> files. |
>> | ``BTIME`` | MRW | - | Birth time (modifiable on
>> some filesystems). |
>
> Yes, but IMO this could be done in the same table as in the link above,
> just like all other FS_XFLAG_*.
>
> Thanks,
> koraynilay
>
>> Thanks,
>> Amir.
Attachment:
signature.asc
Description: PGP signature