From: Al Viro <viro@zeniv.linux.org.uk>
To: Christian Brauner <brauner@kernel.org>
Cc: linux-fsdevel@vger.kernel.org, Jan Kara <jack@suse.cz>,
Christoph Hellwig <hch@lst.de>, Jens Axboe <axboe@kernel.dk>,
Dave Chinner <david@fromorbit.com>,
io-uring@vger.kernel.org
Subject: Re: [PATCH v2] fs: claw back a few FMODE_* bits
Date: Sat, 6 Apr 2024 07:16:04 +0100 [thread overview]
Message-ID: <20240406061604.GA538574@ZenIV> (raw)
In-Reply-To: <20240406061002.GZ538574@ZenIV>
On Sat, Apr 06, 2024 at 07:10:02AM +0100, Al Viro wrote:
> On Thu, Mar 28, 2024 at 01:27:24PM +0100, Christian Brauner wrote:
> > There's a bunch of flags that are purely based on what the file
> > operations support while also never being conditionally set or unset.
> > IOW, they're not subject to change for individual files. Imho, such
> > flags don't need to live in f_mode they might as well live in the fops
> > structs itself. And the fops struct already has that lonely
> > mmap_supported_flags member. We might as well turn that into a generic
> > fop_flags member and move a few flags from FMODE_* space into FOP_*
> > space. That gets us four FMODE_* bits back and the ability for new
> > static flags that are about file ops to not have to live in FMODE_*
> > space but in their own FOP_* space. It's not the most beautiful thing
> > ever but it gets the job done. Yes, there'll be an additional pointer
> > chase but hopefully that won't matter for these flags.
> >
> > I suspect there's a few more we can move into there and that we can also
> > redirect a bunch of new flag suggestions that follow this pattern into
> > the fop_flags field instead of f_mode.
>
> Looks sane; one suggestion, though - if we are going to try and free
> bits, etc., it might be a good idea to use e.g.
> #define FMODE_NOACCOUNT ((__force fmode_t)BIT(29))
> instead of hex constants. IME it's easier to keep track of, especially
> if we have comments between the definitions.
... or (1u << 29), for that matter; the point is that counting zeroes
visually is error-prone, so seeing the binary logarithm of the value
somewhere would be a good idea.
next prev parent reply other threads:[~2024-04-06 6:16 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-28 12:27 [PATCH v2] fs: claw back a few FMODE_* bits Christian Brauner
2024-03-28 13:08 ` Christoph Hellwig
2024-04-02 10:51 ` Jan Kara
2024-04-02 12:59 ` Jens Axboe
2024-04-03 21:12 ` Mark Brown
2024-04-04 9:12 ` Jan Kara
2024-04-04 11:43 ` Mark Brown
2024-04-05 10:27 ` Christian Brauner
2024-04-05 11:12 ` Mark Brown
2024-04-04 0:18 ` Al Viro
2024-04-05 10:06 ` Christian Brauner
2024-04-06 6:10 ` Al Viro
2024-04-06 6:16 ` Al Viro [this message]
2024-04-09 9:12 ` Christian Brauner
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=20240406061604.GA538574@ZenIV \
--to=viro@zeniv.linux.org.uk \
--cc=axboe@kernel.dk \
--cc=brauner@kernel.org \
--cc=david@fromorbit.com \
--cc=hch@lst.de \
--cc=io-uring@vger.kernel.org \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.