Skip to content

Commit 82de620

Browse files
author
Kent Overstreet
committed
bcachefs; quota_format.h
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
1 parent 4331480 commit 82de620

File tree

2 files changed

+48
-42
lines changed

2 files changed

+48
-42
lines changed

fs/bcachefs/bcachefs_format.h

Lines changed: 1 addition & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,31 +1030,6 @@ struct bch_bucket_gens {
10301030
u8 gens[KEY_TYPE_BUCKET_GENS_NR];
10311031
} __packed __aligned(8);
10321032

1033-
/* Quotas: */
1034-
1035-
enum quota_types {
1036-
QTYP_USR = 0,
1037-
QTYP_GRP = 1,
1038-
QTYP_PRJ = 2,
1039-
QTYP_NR = 3,
1040-
};
1041-
1042-
enum quota_counters {
1043-
Q_SPC = 0,
1044-
Q_INO = 1,
1045-
Q_COUNTERS = 2,
1046-
};
1047-
1048-
struct bch_quota_counter {
1049-
__le64 hardlimit;
1050-
__le64 softlimit;
1051-
};
1052-
1053-
struct bch_quota {
1054-
struct bch_val v;
1055-
struct bch_quota_counter c[Q_COUNTERS];
1056-
} __packed __aligned(8);
1057-
10581033
/* Erasure coding */
10591034

10601035
struct bch_stripe {
@@ -1234,6 +1209,7 @@ struct bch_sb_field {
12341209
x(ext, 13) \
12351210
x(downgrade, 14)
12361211

1212+
#include "quota_format.h"
12371213
#include "sb-counters_format.h"
12381214

12391215
enum bch_sb_field_type {
@@ -1471,23 +1447,6 @@ struct bch_sb_field_replicas {
14711447
struct bch_replicas_entry_v1 entries[];
14721448
} __packed __aligned(8);
14731449

1474-
/* BCH_SB_FIELD_quota: */
1475-
1476-
struct bch_sb_quota_counter {
1477-
__le32 timelimit;
1478-
__le32 warnlimit;
1479-
};
1480-
1481-
struct bch_sb_quota_type {
1482-
__le64 flags;
1483-
struct bch_sb_quota_counter c[Q_COUNTERS];
1484-
};
1485-
1486-
struct bch_sb_field_quota {
1487-
struct bch_sb_field field;
1488-
struct bch_sb_quota_type q[QTYP_NR];
1489-
} __packed __aligned(8);
1490-
14911450
/* BCH_SB_FIELD_disk_groups: */
14921451

14931452
#define BCH_SB_LABEL_SIZE 32

fs/bcachefs/quota_format.h

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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 */

0 commit comments

Comments
 (0)