diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2022-08-10 20:28:55 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2022-08-11 17:34:34 -0400 |
commit | ddac1641ee1e2686c2211a8d671ea723634dfc89 (patch) | |
tree | 0596db2376fb5cbdcd83bf1642efdc7868ade480 /libbcachefs/super-io.c | |
parent | a6128b5335a79cd68b9dbb6b083a835d94539d04 (diff) |
Update bcachefs sources to 90a9c61e2b bcachefs: Switch bch2_btree_delete_range() to bch2_trans_run()
Diffstat (limited to 'libbcachefs/super-io.c')
-rw-r--r-- | libbcachefs/super-io.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/libbcachefs/super-io.c b/libbcachefs/super-io.c index 8b813099..55f8c65a 100644 --- a/libbcachefs/super-io.c +++ b/libbcachefs/super-io.c @@ -101,7 +101,7 @@ void bch2_sb_field_delete(struct bch_sb_handle *sb, void bch2_free_super(struct bch_sb_handle *sb) { if (sb->bio) - bio_put(sb->bio); + kfree(sb->bio); if (!IS_ERR_OR_NULL(sb->bdev)) blkdev_put(sb->bdev, sb->mode); @@ -143,13 +143,16 @@ int bch2_sb_realloc(struct bch_sb_handle *sb, unsigned u64s) return -ENOMEM; if (sb->have_bio) { - bio = bio_kmalloc(GFP_KERNEL, - DIV_ROUND_UP(new_buffer_size, PAGE_SIZE)); + unsigned nr_bvecs = DIV_ROUND_UP(new_buffer_size, PAGE_SIZE); + + bio = bio_kmalloc(nr_bvecs, GFP_KERNEL); if (!bio) return -ENOMEM; + bio_init(bio, NULL, bio->bi_inline_vecs, nr_bvecs, 0); + if (sb->bio) - bio_put(sb->bio); + kfree(sb->bio); sb->bio = bio; } |