diff options
author | David Sterba <dsterba@suse.com> | 2025-04-22 19:21:51 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2025-05-15 15:30:47 +0300 |
commit | 2d44a15afd4c6f80dd8ac10e710a28e54e5e15c2 (patch) | |
tree | 05a077b70a1cdfbbc370132e84566a48c87072fc /fs/btrfs/volumes.c | |
parent | 9e0a739a9e83eb28ceb0b1e97861c88f177a7f18 (diff) | |
download | linux-2d44a15afd4c6f80dd8ac10e710a28e54e5e15c2.tar.xz |
btrfs: use list_first_entry() everywhere
Using the helper makes it a bit more clear that we're accessing the
first list entry.
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r-- | fs/btrfs/volumes.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 97a3831a3f9a..34d605b2faea 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -415,8 +415,8 @@ static void free_fs_devices(struct btrfs_fs_devices *fs_devices) WARN_ON(fs_devices->opened); while (!list_empty(&fs_devices->devices)) { - device = list_entry(fs_devices->devices.next, - struct btrfs_device, dev_list); + device = list_first_entry(&fs_devices->devices, + struct btrfs_device, dev_list); list_del(&device->dev_list); btrfs_free_device(device); } @@ -428,8 +428,8 @@ void __exit btrfs_cleanup_fs_uuids(void) struct btrfs_fs_devices *fs_devices; while (!list_empty(&fs_uuids)) { - fs_devices = list_entry(fs_uuids.next, - struct btrfs_fs_devices, fs_list); + fs_devices = list_first_entry(&fs_uuids, struct btrfs_fs_devices, + fs_list); list_del(&fs_devices->fs_list); free_fs_devices(fs_devices); } |