public inbox for [email protected]
 help / color / mirror / Atom feed
From: Christian Brauner <[email protected]>
To: Christoph Hellwig <[email protected]>
Cc: [email protected], Jan Kara <[email protected]>,
	 Jens Axboe <[email protected]>,
	Alexander Viro <[email protected]>,
	 [email protected]
Subject: Re: [PATCH] [RFC]: fs: claw back a few FMODE_* bits
Date: Thu, 28 Mar 2024 10:29:06 +0100	[thread overview]
Message-ID: <20240328-begriffen-entgleisen-2e89b8d52667@brauner> (raw)
In-Reply-To: <[email protected]>

On Thu, Mar 28, 2024 at 06:35:33AM +0100, Christoph Hellwig wrote:
> On Wed, Mar 27, 2024 at 05:45:09PM +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 file opens. Imho, such
> > flags don't need to live in f_mode they might as well live in the fops
> > structs itself.
> 
> Yes.  I actually have a half-finished patch doing the same lying around,
> which I've not found time to rabse.
> 
> > (Fwiw, FMODE_NOACCOUNT and FMODE_BACKING could live in fops_flags as
> >  well because they're also completely static but they aren't really
> >  about file operations so they're better suited for FMODE_* imho.)
> 
> I'd still move them there.  I've also simply called fops_flags flags
> so maybe it didn't bother me too much :)

Possible that we can do that as well but I'd keep calling it fop_flags
for the sake of grepping. If you git grep \\.fop_flags you get a nice
unique match and you get an overview who uses what. I'm not married to
this but I'll keep it for now.

> 
> > +/* File ops support async buffered reads */
> > +#define FOP_BUF_RASYNC		BIT(0)
> > +/* File ops support async nowait buffered writes */
> > +#define FOP_BUF_WASYNC		BIT(1)
> 
> Can we spell out BUFFERED here when changing things?  BUF always confuses
> me as it let's me thing of the buffer cache.

Ok.

> 
> And can be please avoid this silly BIT() junk?  1u << N is shorter
> and a lot more obvious than this random macro.

Everyone and their grandmother has an opinion on this hex, <<, BIT(). :)
Fine, I don't care enough and my grandmothers aren't around anymore.

> 
> > +#define FOP_MMAP_SYNC		BIT(2)
> 
> Please throw in a comment for this one while you're at it.

Ok.

> 
> > +/* File ops support non-exclusive O_DIRECT writes from multiple threads */
> > +#define FOP_DIO_PARALLEL_WRITE	BIT(3)
> > +
> > +#define __fops_supported(f_op, flag) ((f_op)->fops_flags & (flag))
> > +#define fops_buf_rasync(file) __fops_supported((file)->f_op, FOP_BUF_RASYNC)
> > +#define fops_buf_wasync(file) __fops_supported((file)->f_op, FOP_BUF_WASYNC)
> > +#define fops_mmap_sync(file) __fops_supported((file)->f_op, FOP_MMAP_SYNC)
> > +#define fops_dio_parallel_write(file) __fops_supported((file)->f_op, FOP_DIO_PARALLEL_WRITE)
> 
> And please drop these helpers.  They just make grepping for the flags
> a complete pain.

Ok.

      reply	other threads:[~2024-03-28  9:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-27 16:45 [PATCH] [RFC]: fs: claw back a few FMODE_* bits Christian Brauner
2024-03-27 17:19 ` Jens Axboe
2024-03-28  9:40   ` Christian Brauner
2024-03-28  1:18 ` Dave Chinner
2024-03-28  5:36   ` Christoph Hellwig
2024-03-28  8:06   ` Christian Brauner
2024-03-28  8:13     ` Christoph Hellwig
2024-03-28  9:41       ` Christian Brauner
2024-04-01 23:16     ` Dave Chinner
2024-03-28  5:35 ` Christoph Hellwig
2024-03-28  9:29   ` Christian Brauner [this message]

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=20240328-begriffen-entgleisen-2e89b8d52667@brauner \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /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