From 62bc60473ad202aa414edf304a78ddd7bc10ac49 Mon Sep 17 00:00:00 2001 From: David Sterba Date: Thu, 25 May 2023 01:04:37 +0200 Subject: btrfs: pass NOWAIT for set/clear extent bits as another bit The only flags we now pass to set_extent_bit/__clear_extent_bit are GFP_NOFS and GFP_NOWAIT (a few functions handling mappings). This requires an extra parameter to be passed everywhere but is almost always the same. Encode the GFP_NOWAIT as an artificial extent bit and extract the real bits and gfp mask in the lowest level helpers. Now the passed gfp mask is not actually used and can be removed. Signed-off-by: David Sterba --- fs/btrfs/extent_map.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'fs/btrfs/extent_map.c') diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c index 918ce12ea412..4c8c87524d62 100644 --- a/fs/btrfs/extent_map.c +++ b/fs/btrfs/extent_map.c @@ -365,8 +365,8 @@ static void extent_map_device_set_bits(struct extent_map *em, unsigned bits) struct btrfs_device *device = stripe->dev; set_extent_bit(&device->alloc_state, stripe->physical, - stripe->physical + stripe_size - 1, bits, NULL, - GFP_NOWAIT); + stripe->physical + stripe_size - 1, + bits | EXTENT_NOWAIT, NULL, GFP_NOWAIT); } } @@ -381,7 +381,8 @@ static void extent_map_device_clear_bits(struct extent_map *em, unsigned bits) struct btrfs_device *device = stripe->dev; __clear_extent_bit(&device->alloc_state, stripe->physical, - stripe->physical + stripe_size - 1, bits, + stripe->physical + stripe_size - 1, + bits | EXTENT_NOWAIT, NULL, GFP_NOWAIT, NULL); } } -- cgit v1.2.3