Re: [PATCH RFC v5 10/10] iomap: Rename ATOMIC flags again
From: Christoph Hellwig
Date: Thu Mar 13 2025 - 03:07:56 EST
On Thu, Mar 13, 2025 at 06:28:03AM +0000, John Garry wrote:
> > > I'd rather have a
> > >
> > > blk_opf_t extra_flags;
> > >
> > > in the caller that gets REQ_FUA and REQ_ATOMIC assigned as needed,
> > > and then just clear
> > Yep, that is cleaner..
>
> This suggestion is not clear to me.
>
> Is it that iomap_dio_bio_iter() [the only caller of iomap_dio_bio_opflags()]
> sets REQ_FUA and REQ_ATOMIC in extra_flags, and then we extra_flags |
> bio_opf?
Yes.
> Note that iomap_dio_bio_opflags() does still use use_fua for clearing
> IOMAP_DIO_WRITE_THROUGH.
You can check for REQ_FUA in extra_flags (or the entire op).
> And to me it seems nicer to set all the REQ_ flags in one place.
Passing multiple bool arguments just loses way too much context. But
if you really want everything in one place you could probably build
the entire blk_opf_t in iomap_dio_bio_iter, and avoid having to
recalculate it for every bio.