Lines Matching +full:set +full:- +full:aces

1 /*-
7 * McAfee, Inc. under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as
74 #define AVL_ISIGN(a) (((a) > 0) - ((a) < 0))
75 #define AVL_CMP(a, b) (((a) > (b)) - ((a) < (b)))
77 (((uintptr_t)(a) > (uintptr_t)(b)) - ((uintptr_t)(a) < (uintptr_t)(b)))
84 #define ZFS_CRC64_POLY 0xC96C5795D7870F42ULL /* ECMA-182, reflected form */
90 #define P2ALIGN(x, align) ((x) & -(align))
91 #define P2PHASE(x, align) ((x) & ((align) - 1))
92 #define P2NPHASE(x, align) (-(x) & ((align) - 1))
93 #define P2ROUNDUP(x, align) (-(-(x) & -(align)))
94 #define P2END(x, align) (-(~(x) & -(align)))
95 #define P2PHASEUP(x, align, phase) ((phase) - (((phase) - (x)) & -(align)))
96 #define P2BOUNDARY(off, len, align) (((off) ^ ((off) + (len) - 1)) > (align) - 1)
97 #define IS_P2ALIGNED(v, a) ((((uintptr_t)(v)) & ((uintptr_t)(a) - 1)) == 0)
100 * General-purpose 32-bit and 64-bit bitfield encodings.
121 BF32_SET(x, low, len, ((val) >> (shift)) - (bias))
123 BF64_SET(x, low, len, ((val) >> (shift)) - (bias))
143 * to support up to 4-way RAID-Z mirror mode with worst-case gang block
152 * All SPA data is represented by 128-bit data virtual addresses (DVAs).
160 * Each block has a 256-bit checksum -- strong enough for cryptographic hashes.
167 * Some checksums/hashes need a 256-bit initialization salt. This salt is kept
176 * The word-by-word, bit-by-bit layout of the blkptr is as follows:
179 * +-------+-------+-------+-------+-------+-------+-------+-------+
181 * +-------+-------+-------+-------+-------+-------+-------+-------+
183 * +-------+-------+-------+-------+-------+-------+-------+-------+
185 * +-------+-------+-------+-------+-------+-------+-------+-------+
187 * +-------+-------+-------+-------+-------+-------+-------+-------+
189 * +-------+-------+-------+-------+-------+-------+-------+-------+
191 * +-------+-------+-------+-------+-------+-------+-------+-------+
193 * +-------+-------+-------+-------+-------+-------+-------+-------+
195 * +-------+-------+-------+-------+-------+-------+-------+-------+
197 * +-------+-------+-------+-------+-------+-------+-------+-------+
199 * +-------+-------+-------+-------+-------+-------+-------+-------+
201 * +-------+-------+-------+-------+-------+-------+-------+-------+
203 * +-------+-------+-------+-------+-------+-------+-------+-------+
205 * +-------+-------+-------+-------+-------+-------+-------+-------+
207 * +-------+-------+-------+-------+-------+-------+-------+-------+
209 * +-------+-------+-------+-------+-------+-------+-------+-------+
211 * +-------+-------+-------+-------+-------+-------+-------+-------+
219 * ASIZE allocated size (including RAID-Z parity and gang block headers)
220 * GRID RAID-Z layout information (reserved for future use)
232 * fill count number of non-zero blocks under this bp
233 * checksum[4] 256-bit checksum of the data this bp describes
244 * +-------+-------+-------+-------+-------+-------+-------+-------+
251 * +-------+-------+-------+-------+-------+-------+-------+-------+
253 * +-------+-------+-------+-------+-------+-------+-------+-------+
257 * +-------+-------+-------+-------+-------+-------+-------+-------+
259 * +-------+-------+-------+-------+-------+-------+-------+-------+
265 * +-------+-------+-------+-------+-------+-------+-------+-------+
271 * D (dedup) padding (set to zero)
272 * X encryption (set to zero; see above)
273 * E (embedded) set to one
284 * Note that LSIZE and PSIZE are stored in bytes, whereas for non-embedded
289 * be set with the BPE_SET_* macros. BP_SET_EMBEDDED() should be called before
291 * "embedded-ness".
296 BF64_GET((bp)->blk_prop, 40, 8))
299 BF64_SET((bp)->blk_prop, 40, 8, t); \
304 BF64_GET_SB((bp)->blk_prop, 0, 25, 0, 1))
307 BF64_SET_SB((bp)->blk_prop, 0, 25, 0, 1, x); \
312 BF64_GET_SB((bp)->blk_prop, 25, 7, 0, 1))
315 BF64_SET_SB((bp)->blk_prop, 25, 7, 0, 1, x); \
327 ((wp) != &(bp)->blk_prop && (wp) != &(bp)->blk_birth)
339 zio_cksum_t blk_cksum; /* 256-bit checksum */
343 * Macros to get and set fields in a bp or DVA.
346 BF64_GET_SB((dva)->dva_word[0], 0, SPA_ASIZEBITS, SPA_MINBLOCKSHIFT, 0)
348 BF64_SET_SB((dva)->dva_word[0], 0, SPA_ASIZEBITS, \
351 #define DVA_GET_GRID(dva) BF64_GET((dva)->dva_word[0], 24, 8)
352 #define DVA_SET_GRID(dva, x) BF64_SET((dva)->dva_word[0], 24, 8, x)
354 #define DVA_GET_VDEV(dva) BF64_GET((dva)->dva_word[0], 32, 32)
355 #define DVA_SET_VDEV(dva, x) BF64_SET((dva)->dva_word[0], 32, 32, x)
358 BF64_GET_SB((dva)->dva_word[1], 0, 63, SPA_MINBLOCKSHIFT, 0)
360 BF64_SET_SB((dva)->dva_word[1], 0, 63, SPA_MINBLOCKSHIFT, 0, x)
362 #define DVA_GET_GANG(dva) BF64_GET((dva)->dva_word[1], 63, 1)
363 #define DVA_SET_GANG(dva, x) BF64_SET((dva)->dva_word[1], 63, 1, x)
368 BF64_GET_SB((bp)->blk_prop, 0, SPA_LSIZEBITS, SPA_MINBLOCKSHIFT, 1))
371 BF64_SET_SB((bp)->blk_prop, \
376 BF64_GET_SB((bp)->blk_prop, 16, SPA_LSIZEBITS, SPA_MINBLOCKSHIFT, 1)
378 BF64_SET_SB((bp)->blk_prop, 16, SPA_LSIZEBITS, SPA_MINBLOCKSHIFT, 1, x)
380 #define BP_GET_COMPRESS(bp) BF64_GET((bp)->blk_prop, 32, 7)
381 #define BP_SET_COMPRESS(bp, x) BF64_SET((bp)->blk_prop, 32, 7, x)
383 #define BP_GET_CHECKSUM(bp) BF64_GET((bp)->blk_prop, 40, 8)
384 #define BP_SET_CHECKSUM(bp, x) BF64_SET((bp)->blk_prop, 40, 8, x)
386 #define BP_GET_TYPE(bp) BF64_GET((bp)->blk_prop, 48, 8)
387 #define BP_SET_TYPE(bp, x) BF64_SET((bp)->blk_prop, 48, 8, x)
389 #define BP_GET_LEVEL(bp) BF64_GET((bp)->blk_prop, 56, 5)
390 #define BP_SET_LEVEL(bp, x) BF64_SET((bp)->blk_prop, 56, 5, x)
392 #define BP_IS_EMBEDDED(bp) BF64_GET((bp)->blk_prop, 39, 1)
394 #define BP_GET_DEDUP(bp) BF64_GET((bp)->blk_prop, 62, 1)
395 #define BP_SET_DEDUP(bp, x) BF64_SET((bp)->blk_prop, 62, 1, x)
397 #define BP_GET_BYTEORDER(bp) BF64_GET((bp)->blk_prop, 63, 1)
398 #define BP_SET_BYTEORDER(bp, x) BF64_SET((bp)->blk_prop, 63, 1, x)
401 ((bp)->blk_phys_birth ? (bp)->blk_phys_birth : (bp)->blk_birth)
406 (bp)->blk_birth = (logical); \
407 (bp)->blk_phys_birth = ((logical) == (physical) ? 0 : (physical)); \
411 ((BP_IS_EMBEDDED(bp)) ? 1 : (bp)->blk_fill)
415 (bp)->blk_fill = fill; \
419 (DVA_GET_ASIZE(&(bp)->blk_dva[0]) + DVA_GET_ASIZE(&(bp)->blk_dva[1]) + \
420 DVA_GET_ASIZE(&(bp)->blk_dva[2]))
427 (!!DVA_GET_ASIZE(&(bp)->blk_dva[0]) + \
428 !!DVA_GET_ASIZE(&(bp)->blk_dva[1]) + \
429 !!DVA_GET_ASIZE(&(bp)->blk_dva[2]))
432 ((dva1)->dva_word[1] == (dva2)->dva_word[1] && \
433 (dva1)->dva_word[0] == (dva2)->dva_word[0])
436 (0 == (((zc1).zc_word[0] - (zc2).zc_word[0]) | \
437 ((zc1).zc_word[1] - (zc2).zc_word[1]) | \
438 ((zc1).zc_word[2] - (zc2).zc_word[2]) | \
439 ((zc1).zc_word[3] - (zc2).zc_word[3])))
446 (zcp)->zc_word[0] = w0; \
447 (zcp)->zc_word[1] = w1; \
448 (zcp)->zc_word[2] = w2; \
449 (zcp)->zc_word[3] = w3; \
452 #define BP_IDENTITY(bp) (&(bp)->blk_dva[0])
454 #define DVA_IS_EMPTY(dva) ((dva)->dva_word[0] == 0ULL && \
455 (dva)->dva_word[1] == 0ULL)
457 #define BP_IS_OLDER(bp, txg) (!BP_IS_HOLE(bp) && (bp)->blk_birth < (txg))
461 (bp)->blk_dva[0].dva_word[0] = 0; \
462 (bp)->blk_dva[0].dva_word[1] = 0; \
463 (bp)->blk_dva[1].dva_word[0] = 0; \
464 (bp)->blk_dva[1].dva_word[1] = 0; \
465 (bp)->blk_dva[2].dva_word[0] = 0; \
466 (bp)->blk_dva[2].dva_word[1] = 0; \
467 (bp)->blk_prop = 0; \
468 (bp)->blk_pad[0] = 0; \
469 (bp)->blk_pad[1] = 0; \
470 (bp)->blk_phys_birth = 0; \
471 (bp)->blk_birth = 0; \
472 (bp)->blk_fill = 0; \
473 ZIO_SET_CHECKSUM(&(bp)->blk_cksum, 0, 0, 0, 0); \
486 ((wp) != &(bp)->blk_prop && (wp) != &(bp)->blk_birth)
495 zio_cksum_t zec_cksum; /* 256-bit checksum */
499 * Gang block headers are self-checksumming and contain an array
521 MIN(MAX((vd)->v_top->v_ashift, UBERBLOCK_SHIFT), MAX_UBERBLOCK_SHIFT)
535 char vp_nvlist[VDEV_PHYS_SIZE - sizeof (zio_eck_t)];
552 char vbe_bootenv[VDEV_PAD_SIZE - sizeof (uint64_t) -
687 * On-disk version number.
720 * When bumping up SPA_VERSION, make sure GRUB ZFS understands the on-disk
721 * format change. Go to usr/src/grub/grub-0.97/stage2/{zfs-include/, fsys_zfs*},
732 * were multiple changes to on-disk structures during that version.
736 * last synced uberblock. Checking the in-flight version can
887 VDEV_AUX_VERSION_NEWER, /* on-disk version is too new */
888 VDEV_AUX_VERSION_OLDER, /* on-disk version is too old */
908 * The uberblock version is incremented whenever an incompatible on-disk
917 #define UBERBLOCK_MAGIC 0x00bab10c /* oo-ba-bloc! */
920 #define MMP_MAGIC 0xa11cea11 /* all-see-all */
926 #define MMP_VALID(ubp) (ubp->ub_magic == UBERBLOCK_MAGIC && \
927 ubp->ub_mmp_magic == MMP_MAGIC)
928 #define MMP_INTERVAL_VALID(ubp) (MMP_VALID(ubp) && (ubp->ub_mmp_config & \
930 #define MMP_SEQ_VALID(ubp) (MMP_VALID(ubp) && (ubp->ub_mmp_config & \
932 #define MMP_FAIL_INT_VALID(ubp) (MMP_VALID(ubp) && (ubp->ub_mmp_config & \
935 #define MMP_INTERVAL(ubp) ((ubp->ub_mmp_config & 0x00000000FFFFFF00) \
937 #define MMP_SEQ(ubp) ((ubp->ub_mmp_config & 0x0000FFFF00000000) \
939 #define MMP_FAIL_INT(ubp) ((ubp->ub_mmp_config & 0xFFFF000000000000) \
961 * fail intervals, sequence number for sub-second granularity, and
965 * +-------+-------+-------+-------+-------+-------+-------+-------+
967 * +-------+-------+-------+-------+-------+-------+-------+-------+
972 * - 0x01 - Write Interval (ms)
973 * - 0x02 - Sequence number exists
974 * - 0x04 - Fail Intervals
975 * - 0xf8 - Reserved
989 * The field is set when we checkpoint the uberblock and continues to
1028 #define DN_BONUS_SIZE(dnsize) ((dnsize) - DNODE_CORE_SIZE - \
1032 #define DN_MAX_NBLKPTR ((DNODE_MIN_SIZE - DNODE_CORE_SIZE) >> \
1037 #define DNODES_PER_BLOCK_SHIFT (DNODE_BLOCK_SHIFT - DNODE_SHIFT)
1039 #define DNODES_PER_LEVEL_SHIFT (DN_MAX_INDBLKSHIFT - SPA_BLKPTRSHIFT)
1042 #define DN_MAX_LEVELS (2 + ((DN_MAX_OFFSET_SHIFT - SPA_MINBLOCKSHIFT) / \
1043 (DN_MIN_INDBLKSHIFT - SPA_BLKPTRSHIFT)))
1045 #define DN_BONUS(dnp) ((void*)((dnp)->dn_bonus + \
1046 (((dnp)->dn_nblkptr - 1) * sizeof (blkptr_t))))
1048 #define DN_USED_BYTES(dnp) (((dnp)->dn_flags & DNODE_FLAG_USED_BYTES) ? \
1049 (dnp)->dn_used : (dnp)->dn_used << SPA_MINBLOCKSHIFT)
1051 #define EPB(blkshift, typeshift) (1 << (blkshift - typeshift))
1063 uint8_t dn_nlevels; /* 1=dn_blkptr->data blocks */
1088 * +---------------+---------------+---------------+-------+
1090 * +---------------+---------------+---------------+-------+
1092 * +---------------+-----------------------+---------------+
1094 * +---------------+-----------------------+---------------+
1104 uint8_t __dn_ignore3[DN_OLD_MAX_BONUSLEN -
1112 (((dnp)->dn_extra_slots + 1) << DNODE_SHIFT) - (1 << SPA_BLKPTRSHIFT))
1126 * Allocating a new byteswap type number makes the on-disk format
1258 * sa_hdr_phys -> sa_layout_info
1261 * +--------+-------+
1263 * +--------+-------+
1265 * Bits 0-10 are the layout number
1266 * Bits 11-16 are the size of the header.
1275 #define SA_HDR_LAYOUT_NUM(hdr) BF32_GET(hdr->sa_layout_info, 0, 10)
1276 #define SA_HDR_SIZE(hdr) BF32_GET_SB(hdr->sa_layout_info, 10, 16, 3, 0)
1317 * Intent log header - this on disk structure holds fields to manage
1338 char os_pad0[OBJSET_PHYS_SIZE_V2 - sizeof (dnode_phys_t)*3 -
1339 sizeof (zil_header_t) - sizeof (uint64_t)*2 -
1344 char os_pad1[OBJSET_PHYS_SIZE_V3 - OBJSET_PHYS_SIZE_V2 -
1364 /* one-word entry constants */
1369 /* two-word entry constants */
1389 #define SM_RUN_ENCODE(x) BF64_ENCODE((x) - 1, 0, SM_RUN_BITS)
1394 #define SM2_RUN_ENCODE(x) BF64_ENCODE((x) - 1, 24, SM2_RUN_BITS)
1455 * The ds_fsid_guid is a 56-bit ID that can change to avoid
1456 * collisions. The ds_guid is a 64-bit ID that will never
1516 #define FZAP_BLOCK_SHIFT(zap) ((zap)->zap_block_shift)
1518 #define ZAP_MAXCD (uint32_t)(-1)
1522 ((MZAP_MAX_BLKSZ - sizeof(mzap_phys_t)) / sizeof(mzap_ent_phys_t) + 1)
1523 #define MZAP_NAME_LEN (MZAP_ENT_LEN - 8 - 4 - 2)
1563 #define ZAP_EMBEDDED_PTRTBL_SHIFT(zap) (FZAP_BLOCK_SHIFT(zap) - 3 - 1)
1566 * The embedded pointer table starts half-way through the block. Since
1567 * the pointer table itself is half the block, it starts at (64-bit)
1571 ((uint64_t *)(zap)->zap_phys) \
1574 #define ZAP_HASH_IDX(hash, n) (((n) == 0) ? 0 : ((hash) >> (64 - (n))))
1623 * block size (1<<l->l_bs) - hash entry size (2) * number of hash
1624 * entries - header space (2*chunksize)
1627 (((1<<(l)->l_bs) - 2*ZAP_LEAF_HASH_NUMENTRIES(l)) / \
1628 ZAP_LEAF_CHUNKSIZE - 2)
1632 * chunk size - space for type (1) - space for next pointer (2)
1634 #define ZAP_LEAF_ARRAY_BYTES (ZAP_LEAF_CHUNKSIZE - 3)
1637 (((bytes)+ZAP_LEAF_ARRAY_BYTES-1)/ZAP_LEAF_ARRAY_BYTES)
1642 * "reasonably-sized" entry. 20 chunks is more than enough for the
1643 * largest directory entry (MAXNAMELEN (256) byte name, 8-byte value),
1654 #define ZAP_LEAF_HASH_SHIFT(l) ((l)->l_bs - 5)
1664 ((l)->l_phys->l_hash + ZAP_LEAF_HASH_NUMENTRIES(l)))[idx]
1668 ((ZAP_LEAF_HASH_NUMENTRIES(l)-1) & \
1670 (64 - ZAP_LEAF_HASH_SHIFT(l) - (l)->l_phys->l_hdr.lh_prefix_len)))
1671 #define ZAP_LEAF_HASH_ENTPTR(l, h) (&(l)->l_phys->l_hash[ZAP_LEAF_HASH(l, h)])
1698 } l_hdr; /* 2 24-byte chunks */
1789 #define ZFS_INHERIT_ACE 0x2 /* ace has inheritable ACEs */
1831 * ZPL version - rev'd whenever an incompatible on-disk format change
1857 uint32_t z_acl_count; /* Number of ACEs */
1860 ace_t z_ace_data[ACE_SLOT_CNT]; /* 6 standard ACEs */
1869 uint64_t zp_atime[2]; /* 0 - last file access time */
1870 uint64_t zp_mtime[2]; /* 16 - last file modification time */
1871 uint64_t zp_ctime[2]; /* 32 - last file change time */
1872 uint64_t zp_crtime[2]; /* 48 - creation time */
1873 uint64_t zp_gen; /* 64 - generation (txg of creation) */
1874 uint64_t zp_mode; /* 72 - file mode bits */
1875 uint64_t zp_size; /* 80 - size of file */
1876 uint64_t zp_parent; /* 88 - directory parent (`..') */
1877 uint64_t zp_links; /* 96 - number of links to file */
1878 uint64_t zp_xattr; /* 104 - DMU object for xattrs */
1879 uint64_t zp_rdev; /* 112 - dev_t for VBLK & VCHR files */
1880 uint64_t zp_flags; /* 120 - persistent flags */
1881 uint64_t zp_uid; /* 128 - file owner */
1882 uint64_t zp_gid; /* 136 - owning group */
1883 uint64_t zp_pad[4]; /* 144 - future */
1884 zfs_znode_acl_t zp_acl; /* 176 - 263 ACL */
1888 * |<---------------------- dnode_phys (512) ------------------------>|
1889 * |<-- dnode (192) --->|<----------- "bonus" buffer (320) ---------->|
1890 * |<---- znode (264) ---->|<---- data (56) ---->|
1897 * In-core vdev representation.
1912 * the one-bit "mark", used for garbage collection (by zdb)
1924 BF64_GET_SB((vimep)->vimep_src, 0, 63, SPA_MINBLOCKSHIFT, 0)
1926 BF64_SET_SB((vimep)->vimep_src, 0, 63, SPA_MINBLOCKSHIFT, 0, x)
1973 * On-disk indirect vdev state.
2039 * In-core pool representation.