aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/send.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2025-04-22 18:21:51 +0200
committerDavid Sterba <dsterba@suse.com>2025-05-15 14:30:47 +0200
commit2d44a15afd4c6f80dd8ac10e710a28e54e5e15c2 (patch)
tree05a077b70a1cdfbbc370132e84566a48c87072fc /fs/btrfs/send.c
parentbtrfs: convert ASSERT(0) with handled errors to DEBUG_WARN() (diff)
downloadlinux-rng-2d44a15afd4c6f80dd8ac10e710a28e54e5e15c2.tar.xz
linux-rng-2d44a15afd4c6f80dd8ac10e710a28e54e5e15c2.zip
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/send.c')
-rw-r--r--fs/btrfs/send.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c
index 095bdd11398d..36ad01e34577 100644
--- a/fs/btrfs/send.c
+++ b/fs/btrfs/send.c
@@ -3098,7 +3098,7 @@ static void __free_recorded_refs(struct list_head *head)
struct recorded_ref *cur;
while (!list_empty(head)) {
- cur = list_entry(head->next, struct recorded_ref, list);
+ cur = list_first_entry(head, struct recorded_ref, list);
recorded_ref_free(cur);
}
}
@@ -4560,8 +4560,7 @@ static int process_recorded_refs(struct send_ctx *sctx, int *pending_move)
/*
* We have a moved dir. Add the old parent to check_dirs
*/
- cur = list_entry(sctx->deleted_refs.next, struct recorded_ref,
- list);
+ cur = list_first_entry(&sctx->deleted_refs, struct recorded_ref, list);
ret = dup_ref(cur, &check_dirs);
if (ret < 0)
goto out;