Skip to content

Commit b36f679

Browse files
author
Kent Overstreet
committed
bcachefs: Drop memalloc_nofs_save() in bch2_btree_node_mem_alloc()
It's really not needed: the only locks used here are the btree cache lock, which we drop for GFP_WAIT allocations, and btree node locks - but we also drop those for GFP_WAIT allocations. Signed-off-by: Kent Overstreet <[email protected]>
1 parent 42386fb commit b36f679

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

fs/bcachefs/btree_cache.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -671,9 +671,7 @@ struct btree *bch2_btree_node_mem_alloc(struct btree_trans *trans, bool pcpu_rea
671671
: &bc->freed_nonpcpu;
672672
struct btree *b, *b2;
673673
u64 start_time = local_clock();
674-
unsigned flags;
675674

676-
flags = memalloc_nofs_save();
677675
mutex_lock(&bc->lock);
678676

679677
/*
@@ -745,8 +743,6 @@ struct btree *bch2_btree_node_mem_alloc(struct btree_trans *trans, bool pcpu_rea
745743
bch2_time_stats_update(&c->times[BCH_TIME_btree_node_mem_alloc],
746744
start_time);
747745

748-
memalloc_nofs_restore(flags);
749-
750746
int ret = bch2_trans_relock(trans);
751747
if (unlikely(ret)) {
752748
bch2_btree_node_to_freelist(c, b);
@@ -781,7 +777,6 @@ struct btree *bch2_btree_node_mem_alloc(struct btree_trans *trans, bool pcpu_rea
781777
}
782778

783779
mutex_unlock(&bc->lock);
784-
memalloc_nofs_restore(flags);
785780
return ERR_PTR(-BCH_ERR_ENOMEM_btree_node_mem_alloc);
786781
}
787782

0 commit comments

Comments
 (0)