aboutsummaryrefslogtreecommitdiff
path: root/fs/bcachefs/inode.h
diff options
context:
space:
mode:
authorGravatar Kent Overstreet <kent.overstreet@linux.dev> 2024-02-08 22:52:40 -0500
committerGravatar Kent Overstreet <kent.overstreet@linux.dev> 2024-03-13 21:22:24 -0400
commit688a7694097653ca9bd6b7febdf7c88763bbbb92 (patch)
treec83fe80af7fc508eb0c7634e42d6c035d49d6816 /fs/bcachefs/inode.h
parentbcachefs: Fix path where dirent -> subvol missing and we don't fix (diff)
downloadlinux-688a7694097653ca9bd6b7febdf7c88763bbbb92.tar.gz
linux-688a7694097653ca9bd6b7febdf7c88763bbbb92.tar.bz2
linux-688a7694097653ca9bd6b7febdf7c88763bbbb92.zip
bcachefs: Pass inode bkey to check_path()
prep work for improving logging/error messages Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/inode.h')
-rw-r--r--fs/bcachefs/inode.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/fs/bcachefs/inode.h b/fs/bcachefs/inode.h
index 9a9353c001c2..056298050550 100644
--- a/fs/bcachefs/inode.h
+++ b/fs/bcachefs/inode.h
@@ -177,6 +177,20 @@ static inline u8 inode_d_type(struct bch_inode_unpacked *inode)
return inode->bi_subvol ? DT_SUBVOL : mode_to_type(inode->bi_mode);
}
+static inline u32 bch2_inode_flags(struct bkey_s_c k)
+{
+ switch (k.k->type) {
+ case KEY_TYPE_inode:
+ return le32_to_cpu(bkey_s_c_to_inode(k).v->bi_flags);
+ case KEY_TYPE_inode_v2:
+ return le64_to_cpu(bkey_s_c_to_inode_v2(k).v->bi_flags);
+ case KEY_TYPE_inode_v3:
+ return le64_to_cpu(bkey_s_c_to_inode_v3(k).v->bi_flags);
+ default:
+ return 0;
+ }
+}
+
/* i_nlink: */
static inline unsigned nlink_bias(umode_t mode)