[dm-devel] [PATCH 4/5] block: turn bio_kmalloc into a simple kmalloc wrapper
Martin K. Petersen
martin.petersen at oracle.com
Wed Mar 9 03:06:52 UTC 2022
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 at oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
More information about the dm-devel
mailing list