1 #ifndef _BCACHEFS_QUOTA_H
2 #define _BCACHEFS_QUOTA_H
4 #include "quota_types.h"
6 extern const struct bkey_ops bch2_bkey_quota_ops;
14 static inline struct bch_qid bch_qid(struct bch_inode_unpacked *u)
16 return (struct bch_qid) {
17 .q[QTYP_USR] = u->bi_uid,
18 .q[QTYP_GRP] = u->bi_gid,
19 .q[QTYP_PRJ] = u->bi_project,
23 #ifdef CONFIG_BCACHEFS_QUOTA
25 int bch2_quota_acct(struct bch_fs *, struct bch_qid, enum quota_counters,
26 s64, enum quota_acct_mode);
28 int bch2_quota_transfer(struct bch_fs *, unsigned, struct bch_qid,
31 void bch2_fs_quota_exit(struct bch_fs *);
32 void bch2_fs_quota_init(struct bch_fs *);
33 int bch2_fs_quota_read(struct bch_fs *);
35 extern const struct quotactl_ops bch2_quotactl_operations;
39 static inline int bch2_quota_acct(struct bch_fs *c, struct bch_qid qid,
40 enum quota_counters counter, s64 v,
41 enum quota_acct_mode mode)
46 static inline int bch2_quota_transfer(struct bch_fs *c, unsigned qtypes,
48 struct bch_qid src, u64 space)
53 static inline void bch2_fs_quota_exit(struct bch_fs *c) {}
54 static inline void bch2_fs_quota_init(struct bch_fs *c) {}
55 static inline int bch2_fs_quota_read(struct bch_fs *c) { return 0; }
59 #endif /* _BCACHEFS_QUOTA_H */