xref: /linux/fs/bcachefs/quota_format.h (revision 06d07429858317ded2db7986113a9e0129cd599b)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _BCACHEFS_QUOTA_FORMAT_H
3 #define _BCACHEFS_QUOTA_FORMAT_H
4 
5 /* KEY_TYPE_quota: */
6 
7 enum quota_types {
8 	QTYP_USR		= 0,
9 	QTYP_GRP		= 1,
10 	QTYP_PRJ		= 2,
11 	QTYP_NR			= 3,
12 };
13 
14 enum quota_counters {
15 	Q_SPC			= 0,
16 	Q_INO			= 1,
17 	Q_COUNTERS		= 2,
18 };
19 
20 struct bch_quota_counter {
21 	__le64			hardlimit;
22 	__le64			softlimit;
23 };
24 
25 struct bch_quota {
26 	struct bch_val		v;
27 	struct bch_quota_counter c[Q_COUNTERS];
28 } __packed __aligned(8);
29 
30 /* BCH_SB_FIELD_quota: */
31 
32 struct bch_sb_quota_counter {
33 	__le32				timelimit;
34 	__le32				warnlimit;
35 };
36 
37 struct bch_sb_quota_type {
38 	__le64				flags;
39 	struct bch_sb_quota_counter	c[Q_COUNTERS];
40 };
41 
42 struct bch_sb_field_quota {
43 	struct bch_sb_field		field;
44 	struct bch_sb_quota_type	q[QTYP_NR];
45 } __packed __aligned(8);
46 
47 #endif /* _BCACHEFS_QUOTA_FORMAT_H */
48