Skip to content

Commit 8fed323

Browse files
author
Kent Overstreet
committed
bcachefs: snapshot_format.h
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
1 parent d455179 commit 8fed323

File tree

2 files changed

+37
-33
lines changed

2 files changed

+37
-33
lines changed

fs/bcachefs/bcachefs_format.h

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -805,39 +805,6 @@ LE32_BITMASK(BCH_SUBVOLUME_RO, struct bch_subvolume, flags, 0, 1)
805805
LE32_BITMASK(BCH_SUBVOLUME_SNAP, struct bch_subvolume, flags, 1, 2)
806806
LE32_BITMASK(BCH_SUBVOLUME_UNLINKED, struct bch_subvolume, flags, 2, 3)
807807

808-
/* Snapshots */
809-
810-
struct bch_snapshot {
811-
struct bch_val v;
812-
__le32 flags;
813-
__le32 parent;
814-
__le32 children[2];
815-
__le32 subvol;
816-
/* corresponds to a bch_snapshot_tree in BTREE_ID_snapshot_trees */
817-
__le32 tree;
818-
__le32 depth;
819-
__le32 skip[3];
820-
bch_le128 btime;
821-
};
822-
823-
LE32_BITMASK(BCH_SNAPSHOT_DELETED, struct bch_snapshot, flags, 0, 1)
824-
825-
/* True if a subvolume points to this snapshot node: */
826-
LE32_BITMASK(BCH_SNAPSHOT_SUBVOL, struct bch_snapshot, flags, 1, 2)
827-
828-
/*
829-
* Snapshot trees:
830-
*
831-
* The snapshot_trees btree gives us persistent indentifier for each tree of
832-
* bch_snapshot nodes, and allow us to record and easily find the root/master
833-
* subvolume that other snapshots were created from:
834-
*/
835-
struct bch_snapshot_tree {
836-
struct bch_val v;
837-
__le32 master_subvol;
838-
__le32 root_snapshot;
839-
};
840-
841808
/* LRU btree: */
842809

843810
struct bch_lru {
@@ -904,6 +871,7 @@ struct bch_sb_field {
904871
#include "dirent_format.h"
905872
#include "xattr_format.h"
906873
#include "quota_format.h"
874+
#include "snapshot_format.h"
907875
#include "sb-counters_format.h"
908876

909877
enum bch_sb_field_type {

fs/bcachefs/snapshot_format.h

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
#ifndef _BCACHEFS_SNAPSHOT_FORMAT_H
3+
#define _BCACHEFS_SNAPSHOT_FORMAT_H
4+
5+
struct bch_snapshot {
6+
struct bch_val v;
7+
__le32 flags;
8+
__le32 parent;
9+
__le32 children[2];
10+
__le32 subvol;
11+
/* corresponds to a bch_snapshot_tree in BTREE_ID_snapshot_trees */
12+
__le32 tree;
13+
__le32 depth;
14+
__le32 skip[3];
15+
bch_le128 btime;
16+
};
17+
18+
LE32_BITMASK(BCH_SNAPSHOT_DELETED, struct bch_snapshot, flags, 0, 1)
19+
20+
/* True if a subvolume points to this snapshot node: */
21+
LE32_BITMASK(BCH_SNAPSHOT_SUBVOL, struct bch_snapshot, flags, 1, 2)
22+
23+
/*
24+
* Snapshot trees:
25+
*
26+
* The snapshot_trees btree gives us persistent indentifier for each tree of
27+
* bch_snapshot nodes, and allow us to record and easily find the root/master
28+
* subvolume that other snapshots were created from:
29+
*/
30+
struct bch_snapshot_tree {
31+
struct bch_val v;
32+
__le32 master_subvol;
33+
__le32 root_snapshot;
34+
};
35+
36+
#endif /* _BCACHEFS_SNAPSHOT_FORMAT_H */

0 commit comments

Comments
 (0)