diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2021-10-12 12:06:02 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:14 -0400 |
commit | 4db650277d42c0c80cde8fa3571ff1fb2fded8d9 (patch) | |
tree | 69697c049166bd3211c3b7266702ca8ee0d8b909 /fs/bcachefs/bcachefs_format.h | |
parent | e5fa91d7ac88ac6a8385c14dbc8dcbe1a053e62f (diff) |
bcachefs: Subvol dirents are now only visible in parent subvol
This changes the on disk format for dirents that point to subvols so
that they also record the subvolid of the parent subvol, so that we can
filter them out in other subvolumes.
This also updates the dirent code to do that filtering, and in
particular tweaks the rename code - we need to ensure that there's only
ever one dirent (counting multiplicities in different snapshots) that
point to a subvolume.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/bcachefs_format.h')
-rw-r--r-- | fs/bcachefs/bcachefs_format.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/bcachefs/bcachefs_format.h b/fs/bcachefs/bcachefs_format.h index 6ed3ca075ba0..481bf643bd6f 100644 --- a/fs/bcachefs/bcachefs_format.h +++ b/fs/bcachefs/bcachefs_format.h @@ -793,7 +793,13 @@ struct bch_dirent { struct bch_val v; /* Target inode number: */ + union { __le64 d_inum; + struct { /* DT_SUBVOL */ + __le32 d_child_subvol; + __le32 d_parent_subvol; + }; + }; /* * Copy of mode bits 12-15 from the target inode - so userspace can get @@ -1268,7 +1274,8 @@ enum bcachefs_metadata_version { bcachefs_metadata_version_btree_ptr_sectors_written = 14, bcachefs_metadata_version_snapshot_2 = 15, bcachefs_metadata_version_reflink_p_fix = 16, - bcachefs_metadata_version_max = 17, + bcachefs_metadata_version_subvol_dirent = 17, + bcachefs_metadata_version_max = 18, }; #define bcachefs_metadata_version_current (bcachefs_metadata_version_max - 1) |