summaryrefslogtreecommitdiff
path: root/fs/bcachefs/quota.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2018-12-17 13:43:00 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:08:13 +0300
commit0f5254aa98befa5187cc4d02584ab0f19d18ff68 (patch)
treef216065b3dd82d6f1f0d84d61e2a02b95dd5ebd8 /fs/bcachefs/quota.c
parentd42dd4ad6d7e15a7742ed008d1be3c37247547c9 (diff)
downloadlinux-0f5254aa98befa5187cc4d02584ab0f19d18ff68.tar.xz
bcachefs: bch2_fs_quota_transfer
improve quota transfer locking & make ei_qid usage more consistent Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/quota.c')
-rw-r--r--fs/bcachefs/quota.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/bcachefs/quota.c b/fs/bcachefs/quota.c
index 7c38daac1cac..113a2ca88ffc 100644
--- a/fs/bcachefs/quota.c
+++ b/fs/bcachefs/quota.c
@@ -270,7 +270,8 @@ static void __bch2_quota_transfer(struct bch_memquota *src_q,
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)
{
struct bch_memquota_type *q;
struct bch_memquota *src_q[3], *dst_q[3];
@@ -296,13 +297,13 @@ int bch2_quota_transfer(struct bch_fs *c, unsigned qtypes,
ret = bch2_quota_check_limit(c, i, dst_q[i], &msgs, Q_SPC,
dst_q[i]->c[Q_SPC].v + space,
- KEY_TYPE_QUOTA_PREALLOC);
+ mode);
if (ret)
goto err;
ret = bch2_quota_check_limit(c, i, dst_q[i], &msgs, Q_INO,
dst_q[i]->c[Q_INO].v + 1,
- KEY_TYPE_QUOTA_PREALLOC);
+ mode);
if (ret)
goto err;
}