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 u64 ei_quota_reserved;
17 unsigned long ei_last_dirtied;
18 struct bch_qid ei_qid;
20 struct bch_hash_info ei_str_hash;
22 /* copy of inode in btree: */
23 struct bch_inode_unpacked ei_inode;
26 #define to_bch_ei(_inode) \
27 container_of_or_null(_inode, struct bch_inode_info, v)
29 static inline struct bch_inode_info *file_bch_inode(struct file *file)
31 return to_bch_ei(file_inode(file));
34 static inline u8 mode_to_type(umode_t mode)
36 return (mode >> 12) & 15;
39 static inline unsigned nlink_bias(umode_t mode)
41 return S_ISDIR(mode) ? 2 : 1;
44 struct bch_inode_unpacked;
46 #ifndef NO_BCACHEFS_FS
48 /* returns 0 if we want to do the update, or error is passed up */
49 typedef int (*inode_set_fn)(struct bch_inode_info *,
50 struct bch_inode_unpacked *, void *);
52 int __must_check __bch2_write_inode(struct bch_fs *, struct bch_inode_info *,
53 inode_set_fn, void *);
54 int __must_check bch2_write_inode(struct bch_fs *,
55 struct bch_inode_info *);
57 void bch2_vfs_exit(void);
58 int bch2_vfs_init(void);
62 static inline void bch2_vfs_exit(void) {}
63 static inline int bch2_vfs_init(void) { return 0; }
65 #endif /* NO_BCACHEFS_FS */
67 #endif /* _BCACHEFS_FS_H */