6 #include "quota_types.h"
8 #include <linux/seqlock.h>
9 #include <linux/stat.h>
11 struct bch_inode_info {
14 struct mutex ei_update_lock;
16 unsigned long ei_last_dirtied;
17 struct bch_qid ei_qid;
19 struct bch_hash_info ei_str_hash;
21 /* copy of inode in btree: */
22 struct bch_inode_unpacked ei_inode;
25 #define to_bch_ei(_inode) \
26 container_of_or_null(_inode, struct bch_inode_info, v)
28 static inline struct bch_inode_info *file_bch_inode(struct file *file)
30 return to_bch_ei(file_inode(file));
33 static inline u8 mode_to_type(umode_t mode)
35 return (mode >> 12) & 15;
38 static inline unsigned nlink_bias(umode_t mode)
40 return S_ISDIR(mode) ? 2 : 1;
43 struct bch_inode_unpacked;
45 #ifndef NO_BCACHEFS_FS
47 /* returns 0 if we want to do the update, or error is passed up */
48 typedef int (*inode_set_fn)(struct bch_inode_info *,
49 struct bch_inode_unpacked *, void *);
51 int __must_check __bch2_write_inode(struct bch_fs *, struct bch_inode_info *,
52 inode_set_fn, void *);
53 int __must_check bch2_write_inode(struct bch_fs *,
54 struct bch_inode_info *);
56 void bch2_vfs_exit(void);
57 int bch2_vfs_init(void);
61 static inline void bch2_vfs_exit(void) {}
62 static inline int bch2_vfs_init(void) { return 0; }
64 #endif /* NO_BCACHEFS_FS */
66 #endif /* _BCACHEFS_FS_H */