On 11/10/2021 16:52, David Sterba wrote:
quoted
+static int reclaim_bgs_cmp(void *unused, const struct list_head *a,
+ const struct list_head *b)
+{
+ const struct btrfs_block_group *bg1, *bg2;
+
+ bg1 = list_entry(a, struct btrfs_block_group, bg_list);
+ bg2 = list_entry(b, struct btrfs_block_group, bg_list);
+
+ return bg1->used - bg2->used;
It returns int but compares two u64, this should be either a if chaing
comparing all the possibilities or properly cast to s64.
Looking at the documentation of list_sort() this can also be used
as a boolean, I'll do that then.