44 lines · c
1/* SPDX-License-Identifier: GPL-2.0 */2#ifndef _BCACHEFS_QUOTA_TYPES_H3#define _BCACHEFS_QUOTA_TYPES_H4 5#include <linux/generic-radix-tree.h>6 7struct bch_qid {8 u32 q[QTYP_NR];9};10 11enum quota_acct_mode {12 KEY_TYPE_QUOTA_PREALLOC,13 KEY_TYPE_QUOTA_WARN,14 KEY_TYPE_QUOTA_NOCHECK,15};16 17struct memquota_counter {18 u64 v;19 u64 hardlimit;20 u64 softlimit;21 s64 timer;22 int warns;23 int warning_issued;24};25 26struct bch_memquota {27 struct memquota_counter c[Q_COUNTERS];28};29 30typedef GENRADIX(struct bch_memquota) bch_memquota_table;31 32struct quota_limit {33 u32 timelimit;34 u32 warnlimit;35};36 37struct bch_memquota_type {38 struct quota_limit limits[Q_COUNTERS];39 bch_memquota_table table;40 struct mutex lock;41};42 43#endif /* _BCACHEFS_QUOTA_TYPES_H */44