Lines Matching +full:1 +full:- +full:of +full:- +full:4

1 /* SPDX-License-Identifier: GPL-2.0 */
6 * In extent bkeys, the value is a list of pointers (bch_extent_ptr), optionally
10 * One major determining factor in the format of extents is how we handle and
15 * merely adjust ptr->offset to point to the start of the data that is currently
16 * live. The size field in struct bkey records the current (live) size of the
17 * extent, and is also used to mean "size of region on disk that we point to" in
20 * Thus an extent that is not checksummed or compressed will consist only of a
21 * list of bch_extent_ptrs, with none of the fields in
26 * originally written, and then return only the part of the extent that is
29 * Thus, in addition to the current size of the extent in struct bkey, we need
30 * to store the size of the originally allocated space - this is the
32 * when the extent is trimmed, instead of modifying the offset field of the
33 * pointer, we keep a second smaller offset field - "offset into the original
34 * extent of the currently live region".
40 * same checksum type and compression format - however, when copygc runs later (or
42 * going to rewrite all the pointers at once - one of the replicas may be in a
47 * Thus it will only move a subset of the pointers (or in the case of
51 * fragmentation!) - which necessitates a different bch_extent_crc format for
54 * But in the interests of space efficiency, we don't want to store one
57 * Thus, a bch_extent consists of bch_extent_crc32s, bch_extent_crc64s, and
59 * type of a given entry with a scheme similar to utf8 (except we're encoding a
60 * type, not a size), encoding the type in the position of the first set bit:
62 * bch_extent_crc32 - 0b1
63 * bch_extent_ptr - 0b10
64 * bch_extent_crc64 - 0b100
78 x(crc32, 1) \
81 x(stripe_ptr, 4) \
91 /* Compressed/uncompressed size are stored biased by 1: */
98 _unused:1,
99 csum_type:4,
100 compression_type:4;
104 __u32 compression_type:4,
105 csum_type:4,
106 _unused:1,
114 #define CRC32_SIZE_MAX (1U << 7)
124 csum_type:4,
125 compression_type:4,
129 compression_type:4,
130 csum_type:4,
140 #define CRC64_SIZE_MAX (1U << 9)
141 #define CRC64_NONCE_MAX ((1U << 10) - 1)
145 __u64 type:4,
150 csum_type:4,
151 compression_type:4;
153 __u64 compression_type:4,
154 csum_type:4,
159 type:4;
164 #define CRC128_SIZE_MAX (1U << 13)
165 #define CRC128_NONCE_MAX ((1U << 13) - 1)
168 * @reservation - pointer hasn't been written to, just reserved
172 __u64 type:1,
173 cached:1,
174 unused:1,
175 unwritten:1,
183 unwritten:1,
184 unused:1,
185 cached:1,
186 type:1;
194 redundancy:4,
198 redundancy:4,
254 LE16_BITMASK(BTREE_PTR_RANGE_UPDATED, struct bch_btree_ptr_v2, flags, 0, 1);
268 /* Maximum possible size of an entire extent value: */
270 (1 + BKEY_EXTENT_PTR_U64s_MAX * (BCH_REPLICAS_MAX + 1))
272 /* * Maximum possible size of an entire extent, key + value: */