summaryrefslogtreecommitdiff
path: root/fs/bcachefs/inode.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2021-07-31 00:59:37 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:09:10 +0300
commit0f120eac34f31e7e6c4904d9e92e2e95e2edfbaa (patch)
tree8e896c19bade2fc92f9f2f07695a69d3d3be502f /fs/bcachefs/inode.c
parent0423fb7185e3c0178b3a09f24afc3777c2ef9522 (diff)
downloadlinux-0f120eac34f31e7e6c4904d9e92e2e95e2edfbaa.tar.xz
bcachefs: Add flags field to bch2_inode_to_text()
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/inode.c')
-rw-r--r--fs/bcachefs/inode.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/fs/bcachefs/inode.c b/fs/bcachefs/inode.c
index 102bd3c9d30f..63f50891594c 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,