]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
bcachefs: bch2_subvolume_wait_for_pagecache_and_delete() cleanup
authorKent Overstreet <kent.overstreet@linux.dev>
Sat, 29 Mar 2025 21:59:30 +0000 (17:59 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Thu, 22 May 2025 00:13:15 +0000 (20:13 -0400)
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/subvolume.c

index d0209f7658bb8798aba32ffa8fcb844a1d19d292..239ea783698c17a64eeb3d4e1dfdcbdff2b99cd3 100644 (file)
@@ -479,13 +479,11 @@ static void bch2_subvolume_wait_for_pagecache_and_delete(struct work_struct *wor
 {
        struct bch_fs *c = container_of(work, struct bch_fs,
                                snapshot_wait_for_pagecache_and_delete_work);
-       snapshot_id_list s;
-       u32 *id;
        int ret = 0;
 
        while (!ret) {
                mutex_lock(&c->snapshots_unlinked_lock);
-               s = c->snapshots_unlinked;
+               snapshot_id_list s = c->snapshots_unlinked;
                darray_init(&c->snapshots_unlinked);
                mutex_unlock(&c->snapshots_unlinked_lock);
 
@@ -494,7 +492,7 @@ static void bch2_subvolume_wait_for_pagecache_and_delete(struct work_struct *wor
 
                bch2_evict_subvolume_inodes(c, &s);
 
-               for (id = s.data; id < s.data + s.nr; id++) {
+               darray_for_each(s, id) {
                        ret = bch2_trans_run(c, bch2_subvolume_delete(trans, *id));
                        bch_err_msg(c, ret, "deleting subvolume %u", *id);
                        if (ret)