7 #include <linux/seqlock.h>
8 #include <linux/stat.h>
10 struct bch_inode_info {
13 struct mutex ei_update_lock;
15 unsigned long ei_last_dirtied;
17 struct bch_hash_info ei_str_hash;
19 /* copy of inode in btree: */
20 struct bch_inode_unpacked ei_inode;
23 #define to_bch_ei(_inode) \
24 container_of_or_null(_inode, struct bch_inode_info, v)
26 static inline struct bch_inode_info *file_bch_inode(struct file *file)
28 return to_bch_ei(file_inode(file));
31 static inline u8 mode_to_type(umode_t mode)
33 return (mode >> 12) & 15;
36 static inline unsigned nlink_bias(umode_t mode)
38 return S_ISDIR(mode) ? 2 : 1;
41 struct bch_inode_unpacked;
43 #ifndef NO_BCACHEFS_FS
45 /* returns 0 if we want to do the update, or error is passed up */
46 typedef int (*inode_set_fn)(struct bch_inode_info *,
47 struct bch_inode_unpacked *, void *);
49 int __must_check __bch2_write_inode(struct bch_fs *, struct bch_inode_info *,
50 inode_set_fn, void *);
51 int __must_check bch2_write_inode(struct bch_fs *,
52 struct bch_inode_info *);
54 void bch2_vfs_exit(void);
55 int bch2_vfs_init(void);
59 static inline void bch2_vfs_exit(void) {}
60 static inline int bch2_vfs_init(void) { return 0; }
62 #endif /* NO_BCACHEFS_FS */
64 #endif /* _BCACHEFS_FS_H */