]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - libbcachefs/quota.c
Fix building on musl
[bcachefs-tools-debian] / libbcachefs / quota.c
index 5e7df0bb4ca213c16a2843edf1455f4fa6f9ef4e..e7787c5063ce3d7932fe5295702cae12b52ded9f 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include "bcachefs.h"
 #include "btree_update.h"
 #include "inode.h"
@@ -360,10 +361,10 @@ static int bch2_quota_init_type(struct bch_fs *c, enum quota_types type)
        struct bkey_s_c k;
        int ret = 0;
 
-       bch2_trans_init(&trans, c);
+       bch2_trans_init(&trans, c, 0, 0);
 
        for_each_btree_key(&trans, iter, BTREE_ID_QUOTAS, POS(type, 0),
-                          BTREE_ITER_PREFETCH, k) {
+                          BTREE_ITER_PREFETCH, k, ret) {
                if (k.k->p.inode != type)
                        break;
 
@@ -432,10 +433,10 @@ int bch2_fs_quota_read(struct bch_fs *c)
                        return ret;
        }
 
-       bch2_trans_init(&trans, c);
+       bch2_trans_init(&trans, c, 0, 0);
 
        for_each_btree_key(&trans, iter, BTREE_ID_INODES, POS_MIN,
-                          BTREE_ITER_PREFETCH, k) {
+                          BTREE_ITER_PREFETCH, k, ret) {
                switch (k.k->type) {
                case KEY_TYPE_inode:
                        ret = bch2_inode_unpack(bkey_s_c_to_inode(k), &u);
@@ -725,7 +726,7 @@ static int bch2_set_quota(struct super_block *sb, struct kqid qid,
        bkey_quota_init(&new_quota.k_i);
        new_quota.k.p = POS(qid.type, from_kqid(&init_user_ns, qid));
 
-       bch2_trans_init(&trans, c);
+       bch2_trans_init(&trans, c, 0, 0);
 
        iter = bch2_trans_get_iter(&trans, BTREE_ID_QUOTAS, new_quota.k.p,
                                   BTREE_ITER_SLOTS|BTREE_ITER_INTENT);
@@ -751,7 +752,7 @@ static int bch2_set_quota(struct super_block *sb, struct kqid qid,
        if (qdq->d_fieldmask & QC_INO_HARD)
                new_quota.v.c[Q_INO].hardlimit = cpu_to_le64(qdq->d_ino_hardlimit);
 
-       bch2_trans_update(&trans, BTREE_INSERT_ENTRY(iter, &new_quota.k_i));
+       bch2_trans_update(&trans, iter, &new_quota.k_i, 0);
 
        ret = bch2_trans_commit(&trans, NULL, NULL, 0);