Skip to content

Commit 75e849f

Browse files
visitorckwakpm00
authored andcommitted
bcachefs: update min_heap_callbacks to use default builtin swap
Replace the swp function pointer in the min_heap_callbacks of bcachefs with NULL, allowing direct usage of the default builtin swap implementation. This modification simplifies the code and improves performance by removing unnecessary function indirection. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Kuan-Wei Chiu <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Ching-Chun (Jim) Huang <[email protected]> Cc: Coly Li <[email protected]> Cc: Ian Rogers <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Jonathan Corbet <[email protected]> Cc: Kent Overstreet <[email protected]> Cc: "Liang, Kan" <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Matthew Sakai <[email protected]> Cc: Matthew Wilcox (Oracle) <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 06ce251 commit 75e849f

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

fs/bcachefs/clock.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,9 @@ static inline bool io_timer_cmp(const void *l, const void *r, void __always_unus
1414
return (*_l)->expire < (*_r)->expire;
1515
}
1616

17-
static inline void io_timer_swp(void *l, void *r, void __always_unused *args)
18-
{
19-
struct io_timer **_l = (struct io_timer **)l;
20-
struct io_timer **_r = (struct io_timer **)r;
21-
22-
swap(*_l, *_r);
23-
}
24-
2517
static const struct min_heap_callbacks callbacks = {
2618
.less = io_timer_cmp,
27-
.swp = io_timer_swp,
19+
.swp = NULL,
2820
};
2921

3022
void bch2_io_timer_add(struct io_clock *clock, struct io_timer *timer)

0 commit comments

Comments
 (0)