From: Mateusz Guzik <mjguzik@gmail.com>
To: Andreas Gruenbacher <agruenba@redhat.com>
Cc: brauner@kernel.org, viro@zeniv.linux.org.uk, jack@suse.cz,
linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] fs: rework I_NEW handling to operate without fences
Date: Mon, 24 Nov 2025 20:25:04 +0100 [thread overview]
Message-ID: <CAGudoHF4PNbJpc5uUDA02d=TD8gL2J4epn-+hhKhreou1dVX5g@mail.gmail.com> (raw)
In-Reply-To: <20251124174742.2939610-1-agruenba@redhat.com>
On Mon, Nov 24, 2025 at 6:47 PM Andreas Gruenbacher <agruenba@redhat.com> wrote:
>
> On Sat, Oct 11, 2025 at 12:17 AM Mateusz Guzik <mjguzik@gmail.com> wrote:
> > + *isnew = !!(inode_state_read(inode) & I_NEW);
>
> Nit: the not-nots here and in the other two places in this patch are not
> doing anything. Please avoid that kind of thing.
>
Huh, it appears you are right. So happens I_NEW has the value of 0x1,
so I tried out another flag:
bool flagvar_de(struct inode *inode);
bool flagvar_de(struct inode *inode)
{
return !!(inode_state_read(inode) & I_CREATING);
}
EXPORT_SYMBOL(flagvar_de);
bool flagvar(struct inode *inode);
bool flagvar(struct inode *inode)
{
return inode_state_read(inode) & I_CREATING;
}
EXPORT_SYMBOL(flagvar);
endbr64
call 22c9 <flagvar+0x9>
movzbl 0x91(%rdi),%eax
shr $0x7,%al
jmp 22d8 <flagvar+0x18>
endbr64
call 699 <flagvar_de+0x9>
movzbl 0x91(%rdi),%eax
shr $0x7,%al
jmp 6a8 <flagvar_de+0x18>
Was that always a thing? My grep for '!!' shows plenty of hits in the
kernel tree and I'm pretty sure this was an established pratice.
next prev parent reply other threads:[~2025-11-24 19:25 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-10 22:17 [PATCH] fs: rework I_NEW handling to operate without fences Mateusz Guzik
2025-10-15 11:50 ` Mateusz Guzik
2025-10-21 12:48 ` Christian Brauner
2025-10-21 12:54 ` Mateusz Guzik
2025-10-21 12:49 ` Christian Brauner
2025-10-22 9:41 ` Jan Kara
2025-11-24 17:47 ` Andreas Gruenbacher
2025-11-24 19:25 ` Mateusz Guzik [this message]
2025-11-24 23:04 ` Andreas Gruenbacher
2025-11-25 3:00 ` Mateusz Guzik
2025-11-25 10:39 ` Andreas Gruenbacher
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='CAGudoHF4PNbJpc5uUDA02d=TD8gL2J4epn-+hhKhreou1dVX5g@mail.gmail.com' \
--to=mjguzik@gmail.com \
--cc=agruenba@redhat.com \
--cc=brauner@kernel.org \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--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).