]> www.infradead.org Git - users/jedix/linux-maple.git/commit
btrfs: simplify extracting delayed node at btrfs_first_delayed_node()
authorFilipe Manana <fdmanana@suse.com>
Thu, 1 May 2025 12:05:10 +0000 (13:05 +0100)
committerDavid Sterba <dsterba@suse.com>
Thu, 15 May 2025 12:30:55 +0000 (14:30 +0200)
commit32bc875cbc159dc18ac588b64717a70b444e4656
tree8374a28104cd9eb976b469b6a4eae5556ec9c5a6
parentc5d12d5b621258eb07f4106dc9196affed1c22d0
btrfs: simplify extracting delayed node at btrfs_first_delayed_node()

Instead of grabbing the next pointer from the list and then doing a
list_entry() call, we can simply use list_first_entry(), removing the need
for list_head variable.

Also there's no need to check if the list is empty before attempting to
extract the first element, we can use list_first_entry_or_null(), removing
the need for a special if statement and the 'out' label.

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/delayed-inode.c