6 #include <linux/seqlock.h>
8 struct bch_inode_info {
9 struct inode vfs_inode;
11 struct mutex update_lock;
14 atomic_long_t i_size_dirty_count;
17 * these are updated whenever we update the inode in the btree - for
23 atomic_long_t i_sectors_dirty_count;
26 struct bch_hash_info str_hash;
29 #define to_bch_ei(_inode) \
30 container_of(_inode, struct bch_inode_info, vfs_inode)
32 static inline u8 mode_to_type(umode_t mode)
34 return (mode >> 12) & 15;
37 static inline unsigned nlink_bias(umode_t mode)
39 return S_ISDIR(mode) ? 2 : 1;
42 struct bch_inode_unpacked;
46 /* returns 0 if we want to do the update, or error is passed up */
47 typedef int (*inode_set_fn)(struct bch_inode_info *,
48 struct bch_inode_unpacked *, void *);
50 int __must_check __bch2_write_inode(struct bch_fs *, struct bch_inode_info *,
51 inode_set_fn, void *);
52 int __must_check bch2_write_inode(struct bch_fs *,
53 struct bch_inode_info *);
55 void bch2_vfs_exit(void);
56 int bch2_vfs_init(void);
60 static inline void bch2_vfs_exit(void) {}
61 static inline int bch2_vfs_init(void) { return 0; }
65 #endif /* _BCACHE_FS_H */