[PATCH] block: unmap and free user mapped integrity via submitter
Anuj gupta
anuj1072538 at gmail.com
Sat May 11 04:22:23 PDT 2024
On Sat, May 11, 2024 at 12:31 AM Keith Busch <kbusch at kernel.org> wrote:
>
> On Fri, May 10, 2024 at 03:14:29PM +0530, Anuj Gupta wrote:
> > The user mapped intergity is copied back and unpinned by
> > bio_integrity_free which is a low-level routine. Do it via the submitter
> > rather than doing it in the low-level block layer code, to split the
> > submitter side from the consumer side of the bio.
>
> Thanks, this looks pretty good.
>
> > out_unmap:
> > - if (bio)
> > + if (bio) {
> > + if (bio_integrity(bio))
> > + bio_integrity_unmap_free_user(bio);
> > blk_rq_unmap_user(bio);
> > + }
>
> Since we're adding more cleanup responsibilities on the caller, and this
> pattern is repeated 4 times, I think a little helper function is
> warranted: 'nvme_unmap_bio(struct bio *bio)', or something like that.
Makes sense, I will add this in the next version.
Thanks,
Anuj Gupta
More information about the Linux-nvme
mailing list