diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-03-29 22:09:24 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-03-30 22:05:40 -0400 |
commit | 8e02744a90673d9e4ea06cfa0ff123e7bada962f (patch) | |
tree | cebbceedbc59465e73783e0cea126432d2532a9f /linux/bio.c | |
parent | 89b322abb3450bd689ed50d7f55178887941ddfe (diff) |
Update bcachefs sources to 794723fc10c4 bcachefs: Topology repair now uses nodes found by scanning to fill holes
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'linux/bio.c')
-rw-r--r-- | linux/bio.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/linux/bio.c b/linux/bio.c index 93a791c4..08dcd584 100644 --- a/linux/bio.c +++ b/linux/bio.c @@ -306,6 +306,20 @@ struct bio *bio_kmalloc(unsigned int nr_iovecs, gfp_t gfp_mask) return bio; } +struct bio *bio_alloc(struct block_device *bdev, unsigned nr_iovecs, + blk_opf_t opf, gfp_t gfp_mask) +{ + struct bio *bio; + + bio = kmalloc(sizeof(struct bio) + + sizeof(struct bio_vec) * nr_iovecs, gfp_mask); + if (unlikely(!bio)) + return NULL; + bio_init(bio, bdev, nr_iovecs ? bio->bi_inline_vecs : NULL, nr_iovecs, opf); + bio->bi_pool = NULL; + return bio; +} + static struct bio_vec *bvec_alloc(mempool_t *pool, int *nr_vecs, gfp_t gfp_mask) { |