Thread (3 messages) 3 messages, 2 authors, 2021-10-11

Re: [PATCH] btrfs: zoned: use greedy gc for auto reclaim

flat view

From: Johannes Thumshirn <hidden>
Date: 2021-10-11 15:36:06

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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help