6 #include <linux/seqlock.h>
7 #include <linux/stat.h>
9 struct bch_inode_info {
10 struct inode vfs_inode;
12 struct mutex update_lock;
15 atomic_long_t i_size_dirty_count;
18 * these are updated whenever we update the inode in the btree - for
24 atomic_long_t i_sectors_dirty_count;
27 struct bch_hash_info str_hash;
29 unsigned long last_dirtied;
32 #define to_bch_ei(_inode) \
33 container_of(_inode, struct bch_inode_info, vfs_inode)
35 static inline u8 mode_to_type(umode_t mode)
37 return (mode >> 12) & 15;
40 static inline unsigned nlink_bias(umode_t mode)
42 return S_ISDIR(mode) ? 2 : 1;
45 struct bch_inode_unpacked;
47 #ifndef NO_BCACHEFS_FS
49 /* returns 0 if we want to do the update, or error is passed up */
50 typedef int (*inode_set_fn)(struct bch_inode_info *,
51 struct bch_inode_unpacked *, void *);
53 int __must_check __bch2_write_inode(struct bch_fs *, struct bch_inode_info *,
54 inode_set_fn, void *);
55 int __must_check bch2_write_inode(struct bch_fs *,
56 struct bch_inode_info *);
58 void bch2_vfs_exit(void);
59 int bch2_vfs_init(void);
63 static inline void bch2_vfs_exit(void) {}
64 static inline int bch2_vfs_init(void) { return 0; }
66 #endif /* NO_BCACHEFS_FS */
68 #endif /* _BCACHEFS_FS_H */