Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

bcachefs: Use kvzalloc() when dynamically allocating btree paths

THis silences a mm/page_alloc.c warning about allocating more than a
page with GFP_NOFAIL - and there's no reason for this to not have a
vmalloc fallback anyways.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>

+2 -2
+2 -2
fs/bcachefs/btree_iter.c
··· 1520 1520 { 1521 1521 unsigned nr = trans->nr_paths * 2; 1522 1522 1523 - void *p = kzalloc(BITS_TO_LONGS(nr) * sizeof(unsigned long) + 1523 + void *p = kvzalloc(BITS_TO_LONGS(nr) * sizeof(unsigned long) + 1524 1524 sizeof(struct btree_trans_paths) + 1525 1525 nr * sizeof(struct btree_path) + 1526 1526 nr * sizeof(btree_path_idx_t) + 8 + ··· 3091 3091 trans->paths = NULL; 3092 3092 3093 3093 if (paths_allocated != trans->_paths_allocated) 3094 - kfree_rcu_mightsleep(paths_allocated); 3094 + kvfree_rcu_mightsleep(paths_allocated); 3095 3095 3096 3096 if (trans->mem_bytes == BTREE_TRANS_MEM_MAX) 3097 3097 mempool_free(trans->mem, &c->btree_trans_mem_pool);