aboutsummaryrefslogtreecommitdiff
path: root/fs/bcachefs/super.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2019-04-06 14:32:06 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:08:20 -0400
commitd1170ce53c5b332caf647f658c6f2a483c3608a7 (patch)
tree5632ff5356378744bdd71117dc0c7718d320d88a /fs/bcachefs/super.c
parent478259b749d442baaccbe18b02a7352ca1e012ae (diff)
bcachefs: allocate sb_read_scratch with __get_free_page
kmalloc allocations aren't guranteed alignment for io Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/super.c')
-rw-r--r--fs/bcachefs/super.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/bcachefs/super.c b/fs/bcachefs/super.c
index 85a9400a47fc..18576538613c 100644
--- a/fs/bcachefs/super.c
+++ b/fs/bcachefs/super.c
@@ -919,7 +919,7 @@ static void bch2_dev_free(struct bch_dev *ca)
free_percpu(ca->io_done);
bioset_exit(&ca->replica_set);
bch2_dev_buckets_free(ca);
- kfree(ca->sb_read_scratch);
+ free_page((unsigned long) ca->sb_read_scratch);
bch2_time_stats_exit(&ca->io_latency[WRITE]);
bch2_time_stats_exit(&ca->io_latency[READ]);
@@ -1030,7 +1030,7 @@ static struct bch_dev *__bch2_dev_alloc(struct bch_fs *c,
0, GFP_KERNEL) ||
percpu_ref_init(&ca->io_ref, bch2_dev_io_ref_complete,
PERCPU_REF_INIT_DEAD, GFP_KERNEL) ||
- !(ca->sb_read_scratch = kmalloc(4096, GFP_KERNEL)) ||
+ !(ca->sb_read_scratch = (void *) __get_free_page(GFP_KERNEL)) ||
bch2_dev_buckets_alloc(c, ca) ||
bioset_init(&ca->replica_set, 4,
offsetof(struct bch_write_bio, bio), 0) ||