bcachefs: bch_subvolume::parent -> creation_parent
authorKent Overstreet <kent.overstreet@linux.dev>
Mon, 22 Jan 2024 20:12:28 +0000 (15:12 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Thu, 14 Mar 2024 01:22:24 +0000 (21:22 -0400)
bit of renaming, prep for adding a fs path parent

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/subvolume.c
fs/bcachefs/subvolume_format.h

index e7ee52c39990cc8dff2dafbd928a0da51f0f6d50..a0be103b48fe03f2bf9d627e417f33b61922dc10 100644 (file)
@@ -143,8 +143,8 @@ void bch2_subvolume_to_text(struct printbuf *out, struct bch_fs *c,
                   le64_to_cpu(s.v->inode),
                   le32_to_cpu(s.v->snapshot));
 
-       if (bkey_val_bytes(s.k) > offsetof(struct bch_subvolume, parent))
-               prt_printf(out, " parent %u", le32_to_cpu(s.v->parent));
+       if (bkey_val_bytes(s.k) > offsetof(struct bch_subvolume, creation_parent))
+               prt_printf(out, " creation_parent %u", le32_to_cpu(s.v->creation_parent));
 }
 
 static __always_inline int
@@ -228,8 +228,8 @@ static int bch2_subvolume_reparent(struct btree_trans *trans,
        if (k.k->type != KEY_TYPE_subvolume)
                return 0;
 
-       if (bkey_val_bytes(k.k) > offsetof(struct bch_subvolume, parent) &&
-           le32_to_cpu(bkey_s_c_to_subvolume(k).v->parent) != old_parent)
+       if (bkey_val_bytes(k.k) > offsetof(struct bch_subvolume, creation_parent) &&
+           le32_to_cpu(bkey_s_c_to_subvolume(k).v->creation_parent) != old_parent)
                return 0;
 
        s = bch2_bkey_make_mut_typed(trans, iter, &k, 0, subvolume);
@@ -237,7 +237,7 @@ static int bch2_subvolume_reparent(struct btree_trans *trans,
        if (ret)
                return ret;
 
-       s->v.parent = cpu_to_le32(new_parent);
+       s->v.creation_parent = cpu_to_le32(new_parent);
        return 0;
 }
 
@@ -260,7 +260,7 @@ static int bch2_subvolumes_reparent(struct btree_trans *trans, u32 subvolid_to_d
                                BTREE_ID_subvolumes, POS_MIN, BTREE_ITER_PREFETCH, k,
                                NULL, NULL, BCH_TRANS_COMMIT_no_enospc,
                        bch2_subvolume_reparent(trans, &iter, k,
-                                       subvolid_to_delete, le32_to_cpu(s.parent)));
+                                       subvolid_to_delete, le32_to_cpu(s.creation_parent)));
 }
 
 /*
@@ -447,12 +447,12 @@ int bch2_subvolume_create(struct btree_trans *trans, u64 inode,
        if (ret)
                goto err;
 
-       new_subvol->v.flags     = 0;
-       new_subvol->v.snapshot  = cpu_to_le32(new_nodes[0]);
-       new_subvol->v.inode     = cpu_to_le64(inode);
-       new_subvol->v.parent    = cpu_to_le32(src_subvolid);
-       new_subvol->v.otime.lo  = cpu_to_le64(bch2_current_time(c));
-       new_subvol->v.otime.hi  = 0;
+       new_subvol->v.flags             = 0;
+       new_subvol->v.snapshot          = cpu_to_le32(new_nodes[0]);
+       new_subvol->v.inode             = cpu_to_le64(inode);
+       new_subvol->v.creation_parent   = cpu_to_le32(src_subvolid);
+       new_subvol->v.otime.lo          = cpu_to_le64(bch2_current_time(c));
+       new_subvol->v.otime.hi          = 0;
 
        SET_BCH_SUBVOLUME_RO(&new_subvol->v, ro);
        SET_BCH_SUBVOLUME_SNAP(&new_subvol->v, src_subvolid != 0);
index af79134b07d6ad304e7af22b838d9709e777a41b..b81cf0c6119d87b3fa0bd96eeb40f6a096aa38e1 100644 (file)
@@ -19,7 +19,7 @@ struct bch_subvolume {
         * This is _not_ necessarily the subvolume of the directory containing
         * this subvolume:
         */
-       __le32                  parent;
+       __le32                  creation_parent;
        __le32                  pad;
        bch_le128               otime;
 };