]> www.infradead.org Git - users/jedix/linux-maple.git/commit
btrfs: defrag: use list_last_entry() at defrag_collect_targets()
authorFilipe Manana <fdmanana@suse.com>
Fri, 2 May 2025 10:23:02 +0000 (11:23 +0100)
committerDavid Sterba <dsterba@suse.com>
Thu, 15 May 2025 12:30:55 +0000 (14:30 +0200)
commit5bc3b7e2b5f840a4131093b66fd3c1ab604ba9a9
treeaa25af0fc00be83c6d31d600c00f34d06b78c75f
parent58fe389a2a2497bbb4e6be3afeaa20c5d5640102
btrfs: defrag: use list_last_entry() at defrag_collect_targets()

Instead of using list_entry() against the list's prev entry, use
list_last_entry(), which removes the need to know the last member is
accessed through the prev list pointer and the naming makes it easier
to reason about what we are doing.

Reviewed-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/defrag.c