/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ /* * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved. * * This copyrighted material is made available to anyone wishing to use, * modify, copy, or redistribute it subject to the terms and conditions * of the GNU General Public License v.2.
*/
struct gfs2_meta_header {
__be32 mh_magic;
__be32 mh_type;
__be64 __pad0; /* Was generation number in gfs1 */
__be32 mh_format; /* This union is to keep userspace happy */ union {
__be32 mh_jid; /* Was incarnation number in gfs1 */
__be32 __pad1;
};
};
/* * super-block structure * * It's probably good if SIZEOF_SB <= GFS2_BASIC_BLOCK (512 bytes) * * Order is important, need to be able to read old superblocks to do on-disk * version upgrades.
*/
/* Address of superblock in GFS2 basic blocks */ #define GFS2_SB_ADDR 128
/* The lock number for the superblock (must be zero) */ #define GFS2_SB_LOCK 0
/* Requirement: GFS2_LOCKNAME_LEN % 8 == 0
Includes: the fencing zero at the end */ #define GFS2_LOCKNAME_LEN 64
__be32 rg_flags;
__be32 rg_free;
__be32 rg_dinodes; union {
__be32 __pad;
__be32 rg_skip; /* Distance to the next rgrp in fs blocks */
};
__be64 rg_igeneration; /* The following 3 fields are duplicated from gfs2_rindex to reduce
reliance on the rindex */
__be64 rg_data0; /* First data location */
__be32 rg_data; /* Number of data blocks in rgrp */
__be32 rg_bitbytes; /* Number of bytes in data bitmaps */
__be32 rg_crc; /* crc32 of the structure with this field 0 */
__u8 rg_reserved[60]; /* Several fields from gfs1 now reserved */
};
__be32 di_mode; /* mode of file */
__be32 di_uid; /* owner's user id */
__be32 di_gid; /* owner's group id */
__be32 di_nlink; /* number of links to this file */
__be64 di_size; /* number of bytes in file */
__be64 di_blocks; /* number of blocks in file */
__be64 di_atime; /* time last accessed */
__be64 di_mtime; /* time last modified */
__be64 di_ctime; /* time last changed */
__be32 di_major; /* device major number */
__be32 di_minor; /* device minor number */
/* This section varies from gfs1. Padding added to align with * remainder of dinode
*/
__be64 di_goal_meta; /* rgrp to alloc from next */
__be64 di_goal_data; /* data block goal */
__be64 di_generation; /* generation number for NFS */
__be32 di_flags; /* GFS2_DIF_... */
__be32 di_payload_format; /* GFS2_FORMAT_... */
__u16 __pad1; /* Was ditype in gfs1 */
__be16 di_height; /* height of metadata */
__u32 __pad2; /* Unused incarnation number from gfs1 */
/* These only apply to directories */
__u16 __pad3; /* Padding */
__be16 di_depth; /* Number of bits in the table */
__be32 di_entries; /* The number of entries in the directory */
struct gfs2_inum __pad4; /* Unused even in current gfs1 */
__be64 di_eattr; /* extended attribute block number */
__be32 di_atime_nsec; /* nsec portion of atime */
__be32 di_mtime_nsec; /* nsec portion of mtime */
__be32 di_ctime_nsec; /* nsec portion of ctime */
__u8 di_reserved[44];
};
/* * directory structure - many of these per directory file
*/
__be16 lf_depth; /* Depth of leaf */
__be16 lf_entries; /* Number of dirents in leaf */
__be32 lf_dirent_format; /* Format of the dirents */
__be64 lf_next; /* Next leaf, if overflow */
union {
__u8 lf_reserved[64]; struct {
__be64 lf_inode; /* Dir inode number */
__be32 lf_dist; /* Dist from inode on chain */
__be32 lf_nsec; /* Last ins/del usecs */
__be64 lf_sec; /* Last ins/del in secs */
__u8 lf_reserved2[40];
};
};
};
/* * Extended attribute header format * * This works in a similar way to dirents. There is a fixed size header * followed by a variable length section made up of the name and the * associated data. In the case of a "stuffed" entry, the value is * inline directly after the name, the ea_num_ptrs entry will be * zero in that case. For non-"stuffed" entries, there will be * a set of pointers (aligned to 8 byte boundary) to the block(s) * containing the value. * * The blocks containing the values and the blocks containing the * extended attribute headers themselves all start with the common * metadata header. Each inode, if it has extended attributes, will * have either a single block containing the extended attribute headers * or a single indirect block pointing to blocks containing the * extended attribute headers. * * The maximum size of the data part of an extended attribute is 64k * so the number of blocks required depends upon block size. Since the * block size also determines the number of pointers in an indirect * block, its a fairly complicated calculation to work out the maximum * number of blocks that an inode may have relating to extended attributes. *
*/
__be64 lh_sequence; /* Sequence number of this transaction */
__be32 lh_flags; /* GFS2_LOG_HEAD_... */
__be32 lh_tail; /* Block number of log tail */
__be32 lh_blkno;
__be32 lh_hash; /* crc up to here with this field 0 */
/* Version 2 additional fields start here */
__be32 lh_crc; /* crc32c from lh_nsec to end of block */
__be32 lh_nsec; /* Nanoseconds of timestamp */
__be64 lh_sec; /* Seconds of timestamp */
__be64 lh_addr; /* Block addr of this log header (absolute) */
__be64 lh_jinode; /* Journal inode number */
__be64 lh_statfs_addr; /* Local statfs inode number */
__be64 lh_quota_addr; /* Local quota change inode number */
/* Statfs local changes (i.e. diff from global statfs) */
__be64 lh_local_total;
__be64 lh_local_free;
__be64 lh_local_dinodes;
};
/* * Log type descriptor
*/
#define GFS2_LOG_DESC_METADATA 300 /* ld_data1 is the number of metadata blocks in the descriptor.
ld_data2 is unused. */
#define GFS2_LOG_DESC_REVOKE 301 /* ld_data1 is the number of revoke blocks in the descriptor.
ld_data2 is unused. */
#define GFS2_LOG_DESC_JDATA 302 /* ld_data1 is the number of data blocks in the descriptor.
ld_data2 is unused. */
__be32 ld_type; /* GFS2_LOG_DESC_... */
__be32 ld_length; /* Number of buffers in this chunk */
__be32 ld_data1; /* descriptor-specific field */
__be32 ld_data2; /* descriptor-specific field */
__u8 ld_reserved[32];
};
/* * Inum Range * Describe a range of formal inode numbers allocated to * one machine to assign to inodes.
*/
struct gfs2_quota_lvb {
__be32 qb_magic;
__u32 __pad;
__be64 qb_limit; /* Hard limit of # blocks to alloc */
__be64 qb_warn; /* Warn user when alloc is above this # */
__be64 qb_value; /* Current # blocks allocated */
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.