Commit d32088f2 authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: bch_snapshot::btime

Add a field to bch_snapshot for creation time; this will be important
when we start exposing the snapshot tree to userspace.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 7be0208f
...@@ -1149,6 +1149,7 @@ struct bch_snapshot { ...@@ -1149,6 +1149,7 @@ struct bch_snapshot {
__le32 tree; __le32 tree;
__le32 depth; __le32 depth;
__le32 skip[3]; __le32 skip[3];
bch_le128 btime;
}; };
LE32_BITMASK(BCH_SNAPSHOT_DELETED, struct bch_snapshot, flags, 0, 1) LE32_BITMASK(BCH_SNAPSHOT_DELETED, struct bch_snapshot, flags, 0, 1)
......
...@@ -1053,6 +1053,8 @@ static int create_snapids(struct btree_trans *trans, u32 parent, u32 tree, ...@@ -1053,6 +1053,8 @@ static int create_snapids(struct btree_trans *trans, u32 parent, u32 tree,
n->v.subvol = cpu_to_le32(snapshot_subvols[i]); n->v.subvol = cpu_to_le32(snapshot_subvols[i]);
n->v.tree = cpu_to_le32(tree); n->v.tree = cpu_to_le32(tree);
n->v.depth = cpu_to_le32(depth); n->v.depth = cpu_to_le32(depth);
n->v.btime.lo = cpu_to_le64(bch2_current_time(c));
n->v.btime.hi = 0;
for (j = 0; j < ARRAY_SIZE(n->v.skip); j++) for (j = 0; j < ARRAY_SIZE(n->v.skip); j++)
n->v.skip[j] = cpu_to_le32(bch2_snapshot_skiplist_get(c, parent)); n->v.skip[j] = cpu_to_le32(bch2_snapshot_skiplist_get(c, parent));
......
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