@@ -119,22 +119,57 @@ enum disk_accounting_type {
119
119
BCH_DISK_ACCOUNTING_TYPE_NR ,
120
120
};
121
121
122
+ /*
123
+ * No subtypes - number of inodes in the entire filesystem
124
+ *
125
+ * XXX: perhaps we could add a per-subvolume counter?
126
+ */
122
127
struct bch_acct_nr_inodes {
123
128
};
124
129
130
+ /*
131
+ * Tracks KEY_TYPE_reservation sectors, broken out by number of replicas for the
132
+ * reservation:
133
+ */
125
134
struct bch_acct_persistent_reserved {
126
135
__u8 nr_replicas ;
127
136
};
128
137
138
+ /*
139
+ * device, data type counter fields:
140
+ * [
141
+ * nr_buckets
142
+ * live sectors (in buckets of that data type)
143
+ * sectors of internal fragmentation
144
+ * ]
145
+ *
146
+ * XXX: live sectors should've been done differently, you can have multiple data
147
+ * types in the same bucket (user, stripe, cached) and this collapses them to
148
+ * the bucket data type, and makes the internal fragmentation counter redundant
149
+ */
129
150
struct bch_acct_dev_data_type {
130
151
__u8 dev ;
131
152
__u8 data_type ;
132
153
};
133
154
155
+ /*
156
+ * Compression type fields:
157
+ * [
158
+ * number of extents
159
+ * uncompressed size
160
+ * compressed size
161
+ * ]
162
+ *
163
+ * Compression ratio, average extent size (fragmentation).
164
+ */
134
165
struct bch_acct_compression {
135
166
__u8 type ;
136
167
};
137
168
169
+ /*
170
+ * On disk usage by snapshot id; counts same values as replicas counter, but
171
+ * aggregated differently
172
+ */
138
173
struct bch_acct_snapshot {
139
174
__u32 id ;
140
175
} __packed ;
@@ -143,10 +178,27 @@ struct bch_acct_btree {
143
178
__u32 id ;
144
179
} __packed ;
145
180
181
+ /*
182
+ * inum counter fields:
183
+ * [
184
+ * number of extents
185
+ * sum of extent sizes - bkey size
186
+ * this field is similar to inode.bi_sectors, except here extents in
187
+ * different snapshots but the same inode number are all collapsed to the
188
+ * same counter
189
+ * sum of on disk size - same values tracked by replicas counters
190
+ * ]
191
+ *
192
+ * This tracks on disk fragmentation.
193
+ */
146
194
struct bch_acct_inum {
147
195
__u64 inum ;
148
196
} __packed ;
149
197
198
+ /*
199
+ * Simple counter of the amount of data (on disk sectors) rebalance needs to
200
+ * move, extents counted here are also in the rebalance_work btree.
201
+ */
150
202
struct bch_acct_rebalance_work {
151
203
};
152
204
@@ -155,7 +207,7 @@ struct disk_accounting_pos {
155
207
struct {
156
208
__u8 type ;
157
209
union {
158
- struct bch_acct_nr_inodes nr_inodes ;
210
+ struct bch_acct_nr_inodes nr_inodes ;
159
211
struct bch_acct_persistent_reserved persistent_reserved ;
160
212
struct bch_replicas_entry_v1 replicas ;
161
213
struct bch_acct_dev_data_type dev_data_type ;
0 commit comments