diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2021-07-30 17:59:37 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2022-03-12 20:13:10 -0500 |
commit | fb7abb9f9ef5c9fb8cc1320741cce7f78495dec1 (patch) | |
tree | 12da25168eabc97a4e90162d6d3ad5f8b7483047 | |
parent | ecf2963e71ec82d06d127355b103a98fdd928962 (diff) |
bcachefs: Add flags field to bch2_inode_to_text()
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
-rw-r--r-- | fs/bcachefs/inode.c | 23 | ||||
-rw-r--r-- | fs/bcachefs/inode.h | 2 |
2 files changed, 19 insertions, 6 deletions
diff --git a/fs/bcachefs/inode.c b/fs/bcachefs/inode.c index 25607b5848be..3b671082cd1e 100644 --- a/fs/bcachefs/inode.c +++ b/fs/bcachefs/inode.c @@ -371,6 +371,22 @@ const char *bch2_inode_invalid(const struct bch_fs *c, struct bkey_s_c k) return NULL; } +static void __bch2_inode_unpacked_to_text(struct printbuf *out, struct bch_inode_unpacked *inode) +{ + pr_buf(out, "mode %o flags %x ", inode->bi_mode, inode->bi_flags); + +#define x(_name, _bits) \ + pr_buf(out, #_name " %llu ", (u64) inode->_name); + BCH_INODE_FIELDS() +#undef x +} + +void bch2_inode_unpacked_to_text(struct printbuf *out, struct bch_inode_unpacked *inode) +{ + pr_buf(out, "inum: %llu ", inode->bi_inum); + __bch2_inode_unpacked_to_text(out, inode); +} + void bch2_inode_to_text(struct printbuf *out, struct bch_fs *c, struct bkey_s_c k) { @@ -382,12 +398,7 @@ void bch2_inode_to_text(struct printbuf *out, struct bch_fs *c, return; } - pr_buf(out, "mode: %o ", unpacked.bi_mode); - -#define x(_name, _bits) \ - pr_buf(out, #_name ": %llu ", (u64) unpacked._name); - BCH_INODE_FIELDS() -#undef x + __bch2_inode_unpacked_to_text(out, &unpacked); } const char *bch2_inode_generation_invalid(const struct bch_fs *c, diff --git a/fs/bcachefs/inode.h b/fs/bcachefs/inode.h index 2cb081ae44d9..d67af4f56f05 100644 --- a/fs/bcachefs/inode.h +++ b/fs/bcachefs/inode.h @@ -55,6 +55,8 @@ void bch2_inode_pack(struct bch_fs *, struct bkey_inode_buf *, const struct bch_inode_unpacked *); int bch2_inode_unpack(struct bkey_s_c_inode, struct bch_inode_unpacked *); +void bch2_inode_unpacked_to_text(struct printbuf *, struct bch_inode_unpacked *); + struct btree_iter *bch2_inode_peek(struct btree_trans *, struct bch_inode_unpacked *, u64, unsigned); int bch2_inode_write(struct btree_trans *, struct btree_iter *, |