Skip to content

Commit d32088f

Browse files
author
Kent Overstreet
committed
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: Kent Overstreet <kent.overstreet@linux.dev>
1 parent 7be0208 commit d32088f

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

fs/bcachefs/bcachefs_format.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1149,6 +1149,7 @@ struct bch_snapshot {
11491149
__le32 tree;
11501150
__le32 depth;
11511151
__le32 skip[3];
1152+
bch_le128 btime;
11521153
};
11531154

11541155
LE32_BITMASK(BCH_SNAPSHOT_DELETED, struct bch_snapshot, flags, 0, 1)

fs/bcachefs/snapshot.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,6 +1053,8 @@ static int create_snapids(struct btree_trans *trans, u32 parent, u32 tree,
10531053
n->v.subvol = cpu_to_le32(snapshot_subvols[i]);
10541054
n->v.tree = cpu_to_le32(tree);
10551055
n->v.depth = cpu_to_le32(depth);
1056+
n->v.btime.lo = cpu_to_le64(bch2_current_time(c));
1057+
n->v.btime.hi = 0;
10561058

10571059
for (j = 0; j < ARRAY_SIZE(n->v.skip); j++)
10581060
n->v.skip[j] = cpu_to_le32(bch2_snapshot_skiplist_get(c, parent));

0 commit comments

Comments
 (0)