Re: [PATCH 4/5] block: turn bio_kmalloc into a simple kmalloc wrapper

From: Martin K. Petersen
Date: Tue Mar 08 2022 - 22:07:20 EST



Christoph,

> Remove the magic autofree semantics and require the callers to explicitly
> call bio_init to initialize the bio.
>
> This allows bio_free to catch accidental bio_put calls on bio_init()ed
> bios as well.

> -struct bio *bio_kmalloc(gfp_t gfp_mask, unsigned short nr_iovecs);
> +struct bio *bio_kmalloc(unsigned short nr_vecs, gfp_t gfp_mask);

I understand why you did it but this parameter reversal is a bit
scary. Hopefully gfp_t will cause any mistakes to be flagged.

Reviewed-by: Martin K. Petersen <martin.petersen@xxxxxxxxxx>

--
Martin K. Petersen Oracle Linux Engineering