diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2021-03-16 00:42:25 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:12 -0400 |
commit | 14b393ee768e8339b9c64f82df24e8c081bdbff9 (patch) | |
tree | b13103661ffcc09863d14e1c33b951d21d1941a3 /fs/bcachefs/dirent.c | |
parent | 8948fc8f1521702d87a21b9c43c1228e53e3fc29 (diff) | |
download | linux-14b393ee768e8339b9c64f82df24e8c081bdbff9.tar.gz linux-14b393ee768e8339b9c64f82df24e8c081bdbff9.tar.bz2 linux-14b393ee768e8339b9c64f82df24e8c081bdbff9.zip |
bcachefs: Subvolumes, snapshots
This patch adds subvolume.c - support for the subvolumes and snapshots
btrees and related data types and on disk data structures. The next
patches will start hooking up this new code to existing code.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/dirent.c')
-rw-r--r-- | fs/bcachefs/dirent.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/bcachefs/dirent.c b/fs/bcachefs/dirent.c index 1d510f7728b6..53c7687a9ca8 100644 --- a/fs/bcachefs/dirent.c +++ b/fs/bcachefs/dirent.c @@ -99,7 +99,8 @@ const char *bch2_dirent_invalid(const struct bch_fs *c, struct bkey_s_c k) if (memchr(d.v->d_name, '/', len)) return "invalid name"; - if (le64_to_cpu(d.v->d_inum) == d.k->p.inode) + if (d.v->d_type != DT_SUBVOL && + le64_to_cpu(d.v->d_inum) == d.k->p.inode) return "dirent points to own directory"; return NULL; @@ -113,7 +114,7 @@ void bch2_dirent_to_text(struct printbuf *out, struct bch_fs *c, bch_scnmemcpy(out, d.v->d_name, bch2_dirent_name_bytes(d)); pr_buf(out, " -> %llu type %s", d.v->d_inum, - d.v->d_type < DT_MAX + d.v->d_type < BCH_DT_MAX ? bch2_d_types[d.v->d_type] : "(bad d_type)"); } |