]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - libbcachefs/quota.h
Disable pristine-tar option in gbp.conf, since there is no pristine-tar branch.
[bcachefs-tools-debian] / libbcachefs / quota.h
index eabb94c143a8457e04af7de6bd9583018a6bf412..884f601f41c425b711f14ea05be3c8fc26f12158 100644 (file)
@@ -1,25 +1,29 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 #ifndef _BCACHEFS_QUOTA_H
 #define _BCACHEFS_QUOTA_H
 
 #include "inode.h"
 #include "quota_types.h"
 
+enum bkey_invalid_flags;
 extern const struct bch_sb_field_ops bch_sb_field_ops_quota;
 
-const char *bch2_quota_invalid(const struct bch_fs *, struct bkey_s_c);
+int bch2_quota_invalid(struct bch_fs *, struct bkey_s_c,
+                      enum bkey_invalid_flags, struct printbuf *);
 void bch2_quota_to_text(struct printbuf *, struct bch_fs *, struct bkey_s_c);
 
-#define bch2_bkey_ops_quota (struct bkey_ops) {                \
+#define bch2_bkey_ops_quota ((struct bkey_ops) {       \
        .key_invalid    = bch2_quota_invalid,           \
        .val_to_text    = bch2_quota_to_text,           \
-}
+       .min_val_size   = 32,                           \
+})
 
 static inline struct bch_qid bch_qid(struct bch_inode_unpacked *u)
 {
        return (struct bch_qid) {
                .q[QTYP_USR] = u->bi_uid,
                .q[QTYP_GRP] = u->bi_gid,
-               .q[QTYP_PRJ] = u->bi_project,
+               .q[QTYP_PRJ] = u->bi_project ? u->bi_project - 1 : 0,
        };
 }
 
@@ -55,7 +59,8 @@ static inline int bch2_quota_acct(struct bch_fs *c, struct bch_qid qid,
 
 static inline int bch2_quota_transfer(struct bch_fs *c, unsigned qtypes,
                                      struct bch_qid dst,
-                                     struct bch_qid src, u64 space)
+                                     struct bch_qid src, u64 space,
+                                     enum quota_acct_mode mode)
 {
        return 0;
 }