Project

General

Profile

Submit #2767 ยป 0001-sys-vfs-hammer-make-description-on-low-level-storage.patch

tkusumi, 01/14/2015 08:38 AM

View differences:

sys/vfs/hammer/hammer_disk.h
63 63
 * 64K X-bufs are used for blocks >= a file's 1MB mark.
64 64
 *
65 65
 * Per-volume storage limit: 52 bits		4096 TB
66
 * Per-Zone storage limit: 59 bits		512 KTB (due to blockmap)
66
 * Per-Zone storage limit: 60 bits		1 MTB
67 67
 * Per-filesystem storage limit: 60 bits	1 MTB
68 68
 */
69 69
#define HAMMER_BUFSIZE		16384
......
104 104
 *
105 105
 * Hammer offsets are used for FIFO indexing and embed a cycle counter
106 106
 * and volume number in addition to the offset.  Most offsets are required
107
 * to be 64-byte aligned.
107
 * to be 16 KB aligned.
108 108
 */
109 109
typedef u_int64_t hammer_tid_t;
110 110
typedef u_int64_t hammer_off_t;
......
134 134
 * zone 8 (z,v,o):	B-Tree		- actually zone-2 address
135 135
 * zone 9 (z,v,o):	Record		- actually zone-2 address
136 136
 * zone 10 (z,v,o):	Large-data	- actually zone-2 address
137
 * zone 11 (z,v,o):	Small-data	- actually zone-2 address
137 138
 * zone 15:		reserved for sanity
138 139
 *
139 140
 * layer1/layer2 direct map:
......
201 202
 * Large-Block backing store
202 203
 *
203 204
 * A blockmap is a two-level map which translates a blockmap-backed zone
204
 * offset into a raw zone 2 offset.  Each layer handles 18 bits.  The 8M
205
 * large-block size is 23 bits so two layers gives us 23+18+18 = 59 bits
206
 * of address space.
205
 * offset into a raw zone 2 offset.  The layer 1 handles 18 bits and the
206
 * layer 2 handles 19 bits.  The 8M large-block size is 23 bits so two
207
 * layers gives us 18+19+23 = 60 bits of address space.
207 208
 *
208 209
 * When using hinting for a blockmap lookup, the hint is lost when the
209 210
 * scan leaves the HINTBLOCK, which is typically several LARGEBLOCK's.
......
273 274
 * thus any space allocated via the freemap can be directly translated
274 275
 * to a zone:2 (or zone:8-15) address.
275 276
 *
276
 * zone-X blockmap offset: [z:4][layer1:18][layer2:19][bigblock:23]
277
 * zone-X blockmap offset: [zone:4][layer1:18][layer2:19][bigblock:23]
277 278
 */
278 279
struct hammer_blockmap_layer1 {
279 280
	hammer_off_t	blocks_free;	/* big-blocks free */
......
324 325
#define HAMMER_BLOCKMAP_RADIX2_PERBUFFER	\
325 326
	(HAMMER_BLOCKMAP_RADIX2 / (HAMMER_LARGEBLOCK_SIZE / HAMMER_BUFSIZE))
326 327

  
327
#define HAMMER_BLOCKMAP_LAYER1	/* 18+19+23 */		\
328
#define HAMMER_BLOCKMAP_LAYER1	/* 18+19+23 - 1EB */		\
328 329
	(HAMMER_BLOCKMAP_RADIX1 * HAMMER_BLOCKMAP_LAYER2)
329 330
#define HAMMER_BLOCKMAP_LAYER2	/* 19+23 - 4TB */		\
330 331
	(HAMMER_BLOCKMAP_RADIX2 * HAMMER_LARGEBLOCK_SIZE64)
331
- 
    (1-1/1)