Lines Matching +full:block +full:- +full:number
1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright (c) 2000-2001,2005 Silicon Graphics, Inc.
11 * This structure is common to both leaf nodes and non-leaf nodes in the Btree.
14 * level in the Btree, and to identify which type of block this is.
16 #define XFS_DA_NODE_MAGIC 0xfebe /* magic number: non-leaf blocks */
17 #define XFS_ATTR_LEAF_MAGIC 0xfbee /* magic number: attribute leaf blks */
18 #define XFS_DIR2_LEAF1_MAGIC 0xd2f1 /* magic number: v2 dirlf single blks */
19 #define XFS_DIR2_LEAFN_MAGIC 0xd2ff /* magic number: v2 dirlf multi blks */
22 __be32 forw; /* previous block in list */
23 __be32 back; /* following block in list */
24 __be16 magic; /* validity check on block */
36 #define XFS_DA3_NODE_MAGIC 0x3ebe /* magic number: non-leaf blocks */
37 #define XFS_ATTR3_LEAF_MAGIC 0x3bee /* magic number: attribute leaf blks */
38 #define XFS_DIR3_LEAF1_MAGIC 0x3df1 /* magic number: v3 dirlf single blks */
39 #define XFS_DIR3_LEAFN_MAGIC 0x3dff /* magic number: v3 dirlf multi blks */
48 __be32 crc; /* CRC of block */
49 __be64 blkno; /* first block of the buffer */
50 __be64 lsn; /* sequence number of last write */
52 __be64 owner; /* inode that owns the block */
62 * all match in the block, not just the first match found.
67 struct xfs_da_blkinfo info; /* block type, links, etc. */
73 struct xfs_da3_blkinfo info; /* block type, links, etc. */
83 __be32 before; /* Btree block before this key */
100 * - shortform - embedded into the inode
101 * - single block - data with embedded leaf at the end
102 * - multiple data blocks, single leaf+freeindex block
103 * - data blocks, node and leaf blocks (btree), freeindex blocks
109 #define XFS_DIR2_BLOCK_MAGIC 0x58443242 /* XD2B: single block dirs */
117 * is in the block header and dirent formats. In many cases the v3 structures
121 * Also, the xfs_dir3_*() functions handle both v2 and v3 formats - if the
135 * - a larger block header for CRC and identification purposes and so the
138 * - new magic numbers to be able to detect the v2/v3 types on the fly.
141 #define XFS_DIR3_BLOCK_MAGIC 0x58444233 /* XDB3: single block dirs */
147 * list are an on-disk format change, requiring feature bits. Valid values
167 { XFS_DIR3_FT_BLKDEV, "block" }, \
174 * Byte offset in data block and shortform entry.
193 * Directory block number (logical dirblk in file)
199 #define XFS_INO64_DIFF (XFS_INO64_SIZE - XFS_INO32_SIZE)
209 * structures. Due the different inode number storage size and the variable
216 uint8_t i8count; /* count of 8-byte inode #s */
217 uint8_t parent[8]; /* parent dir inode number */
226 * number for version 3 directory entries.
228 * A 64-bit or 32-bit inode number follows here, at a variable offset
235 return sizeof(struct xfs_dir2_sf_hdr) - in xfs_dir2_sf_hdr_size()
242 return get_unaligned_be16(sfep->offset); in xfs_dir2_sf_get_offset()
248 put_unaligned_be16(off, sfep->offset); in xfs_dir2_sf_put_offset()
255 ((char *)hdr + xfs_dir2_sf_hdr_size(hdr->i8count)); in xfs_dir2_sf_firstentry()
259 * Data block structures.
261 * A pure data block looks like the following drawing on disk:
263 * +-------------------------------------------------+
265 * +-------------------------------------------------+
270 * +-------------------------------------------------+
272 * +-------------------------------------------------+
278 * most structures are also used for the combined data/freespace "block"
297 * Describe a free area in the data block.
319 * directory block structures. This will be used in several structures.
320 * The magic number must be the first entry to align with all the dir2
321 * structures so we determine how to decode them just by the magic number.
324 __be32 magic; /* magic number */
325 __be32 crc; /* CRC of block */
326 __be64 blkno; /* first block of the buffer */
327 __be64 lsn; /* sequence number of last write */
329 __be64 owner; /* inode that owns the block */
341 * Active entry in a data block.
352 __be64 inumber; /* inode number */
360 * Unused entry in a data block.
379 be16_to_cpu(dup->length) - sizeof(__be16)); in xfs_dir2_data_unused_tag_p()
383 * Leaf block structures.
385 * A pure leaf block looks like the following drawing on disk:
387 * +---------------------------+
389 * +---------------------------+
395 * +---------------------------+
400 * +---------------------------+
402 * +---------------------------+
404 * The xfs_dir2_data_off_t members (bests) and tail are at the end of the block
405 * for single-leaf (magic = XFS_DIR2_LEAF1_MAGIC) blocks only, but not present
414 * Offset of the leaf/node space. First block in this space
421 * Leaf block header.
437 * Leaf block entry.
445 * Leaf block tail.
452 * Leaf block.
467 * Get address of the bests array in the single-leaf block.
472 return (__be16 *)ltp - be32_to_cpu(ltp->bestcount); in xfs_dir2_leaf_bests_p()
476 * Free space block definitions for the node format.
493 xfs_dir2_free_hdr_t hdr; /* block header */
495 /* unused entries are -1 */
509 /* unused entries are -1 */
515 * Single block format.
517 * The single block format looks like the following drawing on disk:
519 * +-------------------------------------------------+
521 * +-------------------------------------------------+
526 * +-------------------------------------------------+
528 * +-------------------------------------------------+
532 * +-------------------------------------------------+
534 * +-------------------------------------------------+
546 * Pointer to the leaf entries embedded in a data block (1-block format)
551 return ((struct xfs_dir2_leaf_entry *)btp) - be32_to_cpu(btp->count); in xfs_dir2_block_leaf_p()
562 * internal links in the Btree are logical block offsets into the file.
565 * bottom but are not packed. The freemap contains run-length-encoded entries
569 * still don't have enough space, then we have to split the block. The
574 * takes the first-in-the-block key match found, so we should only have
600 struct xfs_attr_sf_hdr { /* constant-structure header block */
618 typedef struct xfs_attr_leaf_hdr { /* constant-structure header block */
619 xfs_da_blkinfo_t info; /* block type, links, etc. */
637 __be16 valuelen; /* number of bytes in value */
648 __be32 valueblk; /* block number of value bytes */
649 __be32 valuelen; /* number of bytes in value */
660 xfs_attr_leaf_hdr_t hdr; /* constant-structure header block */
663 * The rest of the block contains the following structures after the
675 * version number of the directory and dablk structures for this feature, and
696 * The rest of the block contains the following structures after the
706 * Special value to represent fs block size in the leaf header firstused field.
707 * Only used when block size overflows the 2-bytes available on disk.
751 if (leafp->hdr.info.magic == cpu_to_be16(XFS_ATTR3_LEAF_MAGIC)) in xfs_attr3_leaf_hdr_size()
759 if (leafp->hdr.info.magic == cpu_to_be16(XFS_ATTR3_LEAF_MAGIC)) in xfs_attr3_leaf_entryp()
760 return &((struct xfs_attr3_leafblock *)leafp)->entries[0]; in xfs_attr3_leaf_entryp()
761 return &leafp->entries[0]; in xfs_attr3_leaf_entryp()
797 * is 9 bytes of fixed-length fields followed by a __u8 flex array at in xfs_attr_leaf_entsize_remote()
808 * to (the padded struct length - 1) and rounded that sum up to the in xfs_attr_leaf_entsize_remote()
826 * struct is 3 bytes of fixed-length fields followed by a __u8 flex in xfs_attr_leaf_entsize_local()
837 * value length) to (the padded struct length - 1) and rounded that sum in xfs_attr_leaf_entsize_local()
859 * Remote attribute block format definition
861 * There is one of these headers per filesystem block in a remote attribute.
863 * length and the number of blocks needed to store the attribute. This makes the
866 * the number of blocks needed to store the attribute data.
885 /* Number of bytes in a directory block. */
888 return 1 << (sbp->sb_blocklog + sbp->sb_dirblklog); in xfs_dir2_dirblock_bytes()
898 * The xattr value encodes the parent inode number and generation to ease