Re: [PATCH 4/8] FOLD: block: change the defer in task context interface to be procedural

From: Matthew Wilcox

Date: Fri Apr 10 2026 - 09:31:11 EST


On Fri, Apr 10, 2026 at 08:17:25AM +0200, Christoph Hellwig wrote:
> On Thu, Apr 09, 2026 at 09:18:50PM +0100, Matthew Wilcox wrote:
> > On Thu, Apr 09, 2026 at 06:02:17PM +0200, Christoph Hellwig wrote:
> > > @@ -1836,9 +1837,7 @@ void bio_endio(struct bio *bio)
> > > }
> > > #endif
> > >
> > > - if (!in_task() && bio_flagged(bio, BIO_COMPLETE_IN_TASK))
> > > - bio_queue_completion(bio);
> > > - else if (bio->bi_end_io)
> > > + if (bio->bi_end_io)
> > > bio->bi_end_io(bio);
> >
> > What I liked about this before is that we had one central place that
> > needed to be changed. This change means that every bi_end_io now needs
> > to check whether the BIO can be completed in its context.
>
> Yes. On the other hand we can actually use it when we don't know if
> we need to offload beforehand, which enabls the two later conversions
> and probably more.

I don't understand why we need to remove _this_ way to defer completions
to take context in order to _add_ the ability to defer completions
inside the bi_end_io handler.