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;
44 /* returns 0 if we want to do the update, or error is passed up */
45 typedef int (*inode_set_fn)(struct bch_inode_info *,
46 struct bch_inode_unpacked *, void *);
48 int __must_check __bch_write_inode(struct cache_set *, struct bch_inode_info *,
49 inode_set_fn, void *);
50 int __must_check bch_write_inode(struct cache_set *,
51 struct bch_inode_info *);
53 void bch_fs_exit(void);
54 int bch_fs_init(void);
56 #endif /* _BCACHE_FS_H */