mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
btrfs: raid56: use list_last_entry() at cache_rbio()
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>
This commit is contained in:
parent
d26d16a432
commit
c5d12d5b62
1 changed files with 3 additions and 3 deletions
|
@ -577,9 +577,9 @@ static void cache_rbio(struct btrfs_raid_bio *rbio)
|
|||
if (table->cache_size > RBIO_CACHE_SIZE) {
|
||||
struct btrfs_raid_bio *found;
|
||||
|
||||
found = list_entry(table->stripe_cache.prev,
|
||||
struct btrfs_raid_bio,
|
||||
stripe_cache);
|
||||
found = list_last_entry(&table->stripe_cache,
|
||||
struct btrfs_raid_bio,
|
||||
stripe_cache);
|
||||
|
||||
if (found != rbio)
|
||||
__remove_rbio_from_cache(found);
|
||||
|
|
Loading…
Add table
Reference in a new issue