Commit 64304aaf authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: bch_subvolume::parent -> creation_parent

bit of renaming, prep for adding a fs path parent
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 45b4ed52
...@@ -143,8 +143,8 @@ void bch2_subvolume_to_text(struct printbuf *out, struct bch_fs *c, ...@@ -143,8 +143,8 @@ void bch2_subvolume_to_text(struct printbuf *out, struct bch_fs *c,
le64_to_cpu(s.v->inode), le64_to_cpu(s.v->inode),
le32_to_cpu(s.v->snapshot)); le32_to_cpu(s.v->snapshot));
if (bkey_val_bytes(s.k) > offsetof(struct bch_subvolume, parent)) if (bkey_val_bytes(s.k) > offsetof(struct bch_subvolume, creation_parent))
prt_printf(out, " parent %u", le32_to_cpu(s.v->parent)); prt_printf(out, " creation_parent %u", le32_to_cpu(s.v->creation_parent));
} }
static __always_inline int static __always_inline int
...@@ -228,8 +228,8 @@ static int bch2_subvolume_reparent(struct btree_trans *trans, ...@@ -228,8 +228,8 @@ static int bch2_subvolume_reparent(struct btree_trans *trans,
if (k.k->type != KEY_TYPE_subvolume) if (k.k->type != KEY_TYPE_subvolume)
return 0; return 0;
if (bkey_val_bytes(k.k) > offsetof(struct bch_subvolume, parent) && if (bkey_val_bytes(k.k) > offsetof(struct bch_subvolume, creation_parent) &&
le32_to_cpu(bkey_s_c_to_subvolume(k).v->parent) != old_parent) le32_to_cpu(bkey_s_c_to_subvolume(k).v->creation_parent) != old_parent)
return 0; return 0;
s = bch2_bkey_make_mut_typed(trans, iter, &k, 0, subvolume); s = bch2_bkey_make_mut_typed(trans, iter, &k, 0, subvolume);
...@@ -237,7 +237,7 @@ static int bch2_subvolume_reparent(struct btree_trans *trans, ...@@ -237,7 +237,7 @@ static int bch2_subvolume_reparent(struct btree_trans *trans,
if (ret) if (ret)
return ret; return ret;
s->v.parent = cpu_to_le32(new_parent); s->v.creation_parent = cpu_to_le32(new_parent);
return 0; return 0;
} }
...@@ -260,7 +260,7 @@ static int bch2_subvolumes_reparent(struct btree_trans *trans, u32 subvolid_to_d ...@@ -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, BTREE_ID_subvolumes, POS_MIN, BTREE_ITER_PREFETCH, k,
NULL, NULL, BCH_TRANS_COMMIT_no_enospc, NULL, NULL, BCH_TRANS_COMMIT_no_enospc,
bch2_subvolume_reparent(trans, &iter, k, bch2_subvolume_reparent(trans, &iter, k,
subvolid_to_delete, le32_to_cpu(s.parent))); subvolid_to_delete, le32_to_cpu(s.creation_parent)));
} }
/* /*
...@@ -450,7 +450,7 @@ int bch2_subvolume_create(struct btree_trans *trans, u64 inode, ...@@ -450,7 +450,7 @@ int bch2_subvolume_create(struct btree_trans *trans, u64 inode,
new_subvol->v.flags = 0; new_subvol->v.flags = 0;
new_subvol->v.snapshot = cpu_to_le32(new_nodes[0]); new_subvol->v.snapshot = cpu_to_le32(new_nodes[0]);
new_subvol->v.inode = cpu_to_le64(inode); new_subvol->v.inode = cpu_to_le64(inode);
new_subvol->v.parent = cpu_to_le32(src_subvolid); 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.lo = cpu_to_le64(bch2_current_time(c));
new_subvol->v.otime.hi = 0; new_subvol->v.otime.hi = 0;
......
...@@ -19,7 +19,7 @@ struct bch_subvolume { ...@@ -19,7 +19,7 @@ struct bch_subvolume {
* This is _not_ necessarily the subvolume of the directory containing * This is _not_ necessarily the subvolume of the directory containing
* this subvolume: * this subvolume:
*/ */
__le32 parent; __le32 creation_parent;
__le32 pad; __le32 pad;
bch_le128 otime; bch_le128 otime;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment