diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-02-23 22:43:24 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-03-13 21:22:25 -0400 |
commit | 69426613cdf0784e29e1a429c1a2f372a6267c43 (patch) | |
tree | 08d9402cd8f82ccb17731096d4bcd5640bd6fe0b /fs/bcachefs/util.h | |
parent | 95ffc7fb8c7831ee79ed8d2c0e53c7b4869c6338 (diff) | |
download | linux-69426613cdf0784e29e1a429c1a2f372a6267c43.tar.gz linux-69426613cdf0784e29e1a429c1a2f372a6267c43.tar.bz2 linux-69426613cdf0784e29e1a429c1a2f372a6267c43.zip |
bcachefs: improve move_gap()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/util.h')
-rw-r--r-- | fs/bcachefs/util.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/bcachefs/util.h b/fs/bcachefs/util.h index 7fed75c44cd5..b3d3a7349814 100644 --- a/fs/bcachefs/util.h +++ b/fs/bcachefs/util.h @@ -756,8 +756,12 @@ static inline void __move_gap(void *array, size_t element_size, } /* Move the gap in a gap buffer: */ -#define move_gap(_array, _nr, _size, _old_gap, _new_gap) \ - __move_gap(_array, sizeof(_array[0]), _nr, _size, _old_gap, _new_gap) +#define move_gap(_d, _new_gap) \ +do { \ + __move_gap((_d)->data, sizeof((_d)->data[0]), \ + (_d)->nr, (_d)->size, (_d)->gap, _new_gap); \ + (_d)->gap = _new_gap; \ +} while (0) #define bubble_sort(_base, _nr, _cmp) \ do { \ |