From: Russell Haley <yumpusamongus@gmail.com>
To: Mateusz Guzik <mjguzik@gmail.com>, brauner@kernel.org
Cc: viro@zeniv.linux.org.uk, jack@suse.cz,
linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
josef@toxicpanda.com, kernel-team@fb.com, amir73il@gmail.com,
linux-btrfs@vger.kernel.org, linux-ext4@vger.kernel.org,
linux-xfs@vger.kernel.org, ceph-devel@vger.kernel.org,
linux-unionfs@vger.kernel.org
Subject: Re: [PATCH v5 0/4] hide ->i_state behind accessors
Date: Fri, 19 Sep 2025 23:31:22 -0500 [thread overview]
Message-ID: <73885a08-f255-4638-8a53-f136537f4b4c@gmail.com> (raw)
In-Reply-To: <20250919154905.2592318-1-mjguzik@gmail.com>
On 9/19/25 10:49 AM, Mateusz Guzik wrote:
> This is generated against:
> https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git/commit/?h=vfs-6.18.inode.refcount.preliminaries
>
> First commit message quoted verbatim with rationable + API:
>
> [quote]
> Open-coded accesses prevent asserting they are done correctly. One
> obvious aspect is locking, but significantly more can checked. For
> example it can be detected when the code is clearing flags which are
> already missing, or is setting flags when it is illegal (e.g., I_FREEING
> when ->i_count > 0).
>
> Given the late stage of the release cycle this patchset only aims to
> hide access, it does not provide any of the checks.
>
> Consumers can be trivially converted. Suppose flags I_A and I_B are to
> be handled, then:
>
> state = inode->i_state => state = inode_state_read(inode)
> inode->i_state |= (I_A | I_B) => inode_state_add(inode, I_A | I_B)
> inode->i_state &= ~(I_A | I_B) => inode_state_del(inode, I_A | I_B)
> inode->i_state = I_A | I_B => inode_state_set(inode, I_A | I_B)
> [/quote]
Drive-by bikeshedding: s/set/replace/g
"replace" removes ambiguity with the concept of setting a bit ( |= ). An
alternative would be "set_only".
next prev parent reply other threads:[~2025-09-20 4:31 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-19 15:49 [PATCH v5 0/4] hide ->i_state behind accessors Mateusz Guzik
2025-09-19 15:49 ` [PATCH v5 1/4] fs: provide accessors for ->i_state Mateusz Guzik
2025-09-19 15:49 ` [PATCH v5 2/4] Convert the kernel to use ->i_state accessors Mateusz Guzik
2025-09-19 15:49 ` [PATCH v5 3/4] Manual conversion of ->i_state uses Mateusz Guzik
2025-09-22 11:31 ` Jan Kara
2025-09-22 11:41 ` Mateusz Guzik
2025-09-19 15:49 ` [PATCH v5 4/4] fs: make plain ->i_state access fail to compile Mateusz Guzik
2025-09-20 4:31 ` Russell Haley [this message]
2025-09-20 5:47 ` [PATCH v5 0/4] hide ->i_state behind accessors Mateusz Guzik
2025-09-22 11:36 ` Jan Kara
2025-09-22 11:40 ` Mateusz Guzik
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=73885a08-f255-4638-8a53-f136537f4b4c@gmail.com \
--to=yumpusamongus@gmail.com \
--cc=amir73il@gmail.com \
--cc=brauner@kernel.org \
--cc=ceph-devel@vger.kernel.org \
--cc=jack@suse.cz \
--cc=josef@toxicpanda.com \
--cc=kernel-team@fb.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-unionfs@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=mjguzik@gmail.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;
as well as URLs for NNTP newsgroup(s).