staticstruct ocfs2_system_inode_info ocfs2_system_inodes[NUM_SYSTEM_INODES] = { /* Global system inodes (single copy) */ /* The first two are only used from userspace mfks/tunefs */
[BAD_BLOCK_SYSTEM_INODE] = { "bad_blocks", 0, S_IFREG | 0644 },
[GLOBAL_INODE_ALLOC_SYSTEM_INODE] = { "global_inode_alloc", OCFS2_BITMAP_FL | OCFS2_CHAIN_FL, S_IFREG | 0644 },
/* *Blockcheckingstructure.Thisisusedinmetadatatovalidatethe *contents.IfOCFS2_FEATURE_INCOMPAT_META_ECCisnotset,itisall *zeros.
*/ struct ocfs2_block_check { /*00*/ __le32 bc_crc32e; /* 802.3 Ethernet II CRC32 */
__le16 bc_ecc; /* Single-error-correction parity vector. ThisisasimpleHammingcodedependent ontheblocksize.OCFS2'smaximum blocksize,4K,requires16paritybits,
so we fit in __le16. */
__le16 bc_reserved1; /*08*/
};
/* *OndiskextentrecordforOCFS2 *Itdescribesarangeofclustersondisk. * *Lengthfieldsaredividedintointeriorandleafnodeversions. *Thisleavesroomforaflagsfield(OCFS2_EXT_*)intheleafnodes.
*/ struct ocfs2_extent_rec { /*00*/ __le32 e_cpos; /* Offset into the file, in clusters */ union {
__le32 e_int_clusters; /* Clusters covered by all children */ struct {
__le16 e_leaf_clusters; /* Clusters covered by this
extent */
__u8 e_reserved1;
__u8 e_flags; /* Extent flags */
};
};
__le64 e_blkno; /* Physical disk offset, in blocks */ /*10*/
};
struct ocfs2_chain_rec {
__le32 c_free; /* Number of free bits in this chain. */
__le32 c_total; /* Number of total bits in this chain */
__le64 c_blkno; /* Physical disk offset (blocks) of 1st group */
};
struct ocfs2_truncate_rec {
__le32 t_start; /* 1st cluster in this log */
__le32 t_clusters; /* Number of total clusters covered */
};
/* *OndiskextentlistforOCFS2(nodeinthetree).Notethatthis *iscontainedinsideocfs2_dinodeorocfs2_extent_block,sothe *offsetsarerelativetoocfs2_dinode.id2.i_listor *ocfs2_extent_block.h_list,respectively.
*/ struct ocfs2_extent_list { /*00*/ __le16 l_tree_depth; /* Extent tree depth from this
point. 0 means data extents
hang directly off this
header (a leaf)
NOTE: The high 8 bits cannot be
used - tree_depth is never that big.
*/
__le16 l_count; /* Number of extent records */
__le16 l_next_free_rec; /* Next unused extent slot */
__le16 l_reserved1;
__le64 l_reserved2; /* Pad to
sizeof(ocfs2_extent_rec) */ /*10*/ struct ocfs2_extent_rec l_recs[]; /* Extent records */
};
/* *OndiskallocationchainlistforOCFS2.Notethatthisis *containedinsideocfs2_dinode,sotheoffsetsarerelativeto *ocfs2_dinode.id2.i_chain.
*/ struct ocfs2_chain_list { /*00*/ __le16 cl_cpg; /* Clusters per Block Group */
__le16 cl_bpc; /* Bits per cluster */
__le16 cl_count; /* Total chains in this list */
__le16 cl_next_free_rec; /* Next unused chain slot */
__le64 cl_reserved1; /*10*/ struct ocfs2_chain_rec cl_recs[]; /* Chain records */
};
/* *OndiskdeallocationlogforOCFS2.Notethatthisis *containedinsideocfs2_dinode,sotheoffsetsarerelativeto *ocfs2_dinode.id2.i_dealloc.
*/ struct ocfs2_truncate_log { /*00*/ __le16 tl_count; /* Total records in this log */
__le16 tl_used; /* Number of records in use */
__le32 tl_reserved1; /*08*/ struct ocfs2_truncate_rec tl_recs[]; /* Truncate records */
};
/* *Ondiskextentblock(indirectblock)forOCFS2
*/ struct ocfs2_extent_block
{ /*00*/ __u8 h_signature[8]; /* Signature for verification */ struct ocfs2_block_check h_check; /* Error checking */ /*10*/ __le16 h_suballoc_slot; /* Slot suballocator this
extent_header belongs to */
__le16 h_suballoc_bit; /* Bit offset in suballocator
block group */
__le32 h_fs_generation; /* Must match super block */
__le64 h_blkno; /* Offset on disk, in blocks */ /*20*/ __le64 h_suballoc_loc; /* Suballocator block group this
eb belongs to. Only valid if allocated from a
discontiguous block group */
__le64 h_next_leaf_blk; /* Offset on disk, in blocks, ofnextleafheaderpointing
to data */ /*30*/ struct ocfs2_extent_list h_list; /* Extent record list */ /* Actual on-disk size is one block */
};
/* *LocalallocationbitmapforOCFS2slots *Notethatitexistsinsideanocfs2_dinode,soalloffsetsare *relativetothestartofocfs2_dinode.id2.
*/ struct ocfs2_local_alloc
{ /*00*/ __le32 la_bm_off; /* Starting bit offset in main bitmap */
__le16 la_size; /* Size of included bitmap, in bytes */
__le16 la_reserved1;
__le64 la_reserved2; /*10*/ __u8 la_bitmap[];
};
/* *Data-in-inodeheader.Thisisonlyusedifi_dyn_featureshas *OCFS2_INLINE_DATA_FLset.
*/ struct ocfs2_inline_data
{ /*00*/ __le16 id_count; /* Number of bytes that can be used
* for data, starting at id_data */
__le16 id_reserved0;
__le32 id_reserved1;
__u8 id_data[]; /* Start of user data */
};
/* *OndiskinodeforOCFS2
*/ struct ocfs2_dinode { /*00*/ __u8 i_signature[8]; /* Signature for validation */
__le32 i_generation; /* Generation number */
__le16 i_suballoc_slot; /* Slot suballocator this inode
belongs to */
__le16 i_suballoc_bit; /* Bit offset in suballocator
block group */ /*10*/ __le16 i_links_count_hi; /* High 16 bits of links count */
__le16 i_xattr_inline_size;
__le32 i_clusters; /* Cluster count */
__le32 i_uid; /* Owner UID */
__le32 i_gid; /* Owning GID */ /*20*/ __le64 i_size; /* Size in bytes */
__le16 i_mode; /* File mode */
__le16 i_links_count; /* Links count */
__le32 i_flags; /* File flags */ /*30*/ __le64 i_atime; /* Access time */
__le64 i_ctime; /* Creation time */ /*40*/ __le64 i_mtime; /* Modification time */
__le64 i_dtime; /* Deletion time */ /*50*/ __le64 i_blkno; /* Offset on disk, in blocks */
__le64 i_last_eb_blk; /* Pointer to last extent
block */ /*60*/ __le32 i_fs_generation; /* Generation per fs-instance */
__le32 i_atime_nsec;
__le32 i_ctime_nsec;
__le32 i_mtime_nsec; /*70*/ __le32 i_attr;
__le16 i_orphaned_slot; /* Only valid when OCFS2_ORPHANED_FL
was set in i_flags */
__le16 i_dyn_features;
__le64 i_xattr_loc; /*80*/ struct ocfs2_block_check i_check; /* Error checking */ /*88*/ __le64 i_dx_root; /* Pointer to dir index root block */ /*90*/ __le64 i_refcount_loc;
__le64 i_suballoc_loc; /* Suballocator block group this inodebelongsto.Onlyvalid ifallocatedfroma
discontiguous block group */ /*A0*/ __le16 i_dio_orphaned_slot; /* only used for append dio write */
__le16 i_reserved1[3];
__le64 i_reserved2[2]; /*B8*/ union {
__le64 i_pad1; /* Generic way to refer to this
64bit union */ struct {
__le64 i_rdev; /* Device number */
} dev1; struct { /* Info for bitmap system
inodes */
__le32 i_used; /* Bits (ie, clusters) used */
__le32 i_total; /* Total bits (clusters)
available */
} bitmap1; struct { /* Info for journal system
inodes */
__le32 ij_flags; /* Mounted, version, etc. */
__le32 ij_recovery_generation; /* Incremented when the journalisrecovered afteranunclean
shutdown */
} journal1;
} id1; /* Inode type dependent 1 */ /*C0*/ union { struct ocfs2_super_block i_super; struct ocfs2_local_alloc i_lab; struct ocfs2_chain_list i_chain; struct ocfs2_extent_list i_list; struct ocfs2_truncate_log i_dealloc; struct ocfs2_inline_data i_data;
DECLARE_FLEX_ARRAY(__u8, i_symlink);
} id2; /* Actual on-disk size is one block */
};
/* *On-diskdirectoryentrystructureforOCFS2 * *Packedasthisstructurecouldbeaccessedunalignedon64-bitplatforms
*/ struct ocfs2_dir_entry { /*00*/ __le64 inode; /* Inode number */
__le16 rec_len; /* Directory entry length */
__u8 name_len; /* Name length */
__u8 file_type; /*0C*/ char name[OCFS2_MAX_FILENAME_LEN]; /* File name */ /* Actual on-disk length specified by rec_len */
} __attribute__ ((packed));
__le16 db_compat_rec_len; /* Backwards compatible with
* ocfs2_dir_entry. */
__u8 db_compat_name_len; /* Always zero. Was name_len */
__u8 db_reserved0;
__le16 db_reserved1;
__le16 db_free_rec_len; /* Size of largest empty hole
* in this block. (unused) */ /*10*/ __u8 db_signature[8]; /* Signature for verification */
__le64 db_reserved2; /*20*/ __le64 db_free_next; /* Next block in list (unused) */
__le64 db_blkno; /* Offset on disk, in blocks */ /*30*/ __le64 db_parent_dinode; /* dinode which owns me, in
blocks */ struct ocfs2_block_check db_check; /* Error checking */ /*40*/
};
/* *Adirectoryentryintheindexedtree.Wedon'tstorethefullnamehere, *butinsteadprovideapointertothefulldirentintheunindexedtree. * *Wealsostorename_lenheresoastoreducethenumberofleafblockswe *needtosearchincaseofcollisions.
*/ struct ocfs2_dx_entry {
__le32 dx_major_hash; /* Used to find logical
* cluster in index */
__le32 dx_minor_hash; /* Lower bits used to find
* block in cluster */
__le64 dx_dirent_blk; /* Physical block in unindexed
* tree holding this dirent. */
};
struct ocfs2_dx_entry_list {
__le32 de_reserved;
__le16 de_count; /* Maximum number of entries
* possible in de_entries */
__le16 de_num_used; /* Current number of
* de_entries entries */ struct ocfs2_dx_entry de_entries[]; /* Indexed dir entries *inapackedarrayof
* length de_num_used */
};
#define OCFS2_DX_FLAG_INLINE 0x01
/* *Adirectoryindexingblock.Eachindexeddirectoryhasoneofthese, *pointedtobyocfs2_dinode. * *Thisblockstoresanindexedbtreeroot,andasetoffreespace *start-of-listpointers.
*/ struct ocfs2_dx_root_block {
__u8 dr_signature[8]; /* Signature for verification */ struct ocfs2_block_check dr_check; /* Error checking */
__le16 dr_suballoc_slot; /* Slot suballocator this
* block belongs to. */
__le16 dr_suballoc_bit; /* Bit offset in suballocator
* block group */
__le32 dr_fs_generation; /* Must match super block */
__le64 dr_blkno; /* Offset on disk, in blocks */
__le64 dr_last_eb_blk; /* Pointer to last
* extent block */
__le32 dr_clusters; /* Clusters allocated
* to the indexed tree. */
__u8 dr_flags; /* OCFS2_DX_FLAG_* flags */
__u8 dr_reserved0;
__le16 dr_reserved1;
__le64 dr_dir_blkno; /* Pointer to parent inode */
__le32 dr_num_entries; /* Total number of *namesstoredin
* this directory.*/
__le32 dr_reserved2;
__le64 dr_free_blk; /* Pointer to head of free
* unindexed block list. */
__le64 dr_suballoc_loc; /* Suballocator block group thisrootbelongsto. Onlyvalidifallocated fromadiscontiguous
block group */
__le64 dr_reserved3[14]; union { struct ocfs2_extent_list dr_list; /* Keep this aligned to 128 *bitsformaximumspace
* efficiency. */ struct ocfs2_dx_entry_list dr_entries; /* In-root-block list of *entries.Wegrowout *toextentsifthis
* gets too big. */
};
};
/* *Theheaderofaleafblockintheindexedtree.
*/ struct ocfs2_dx_leaf {
__u8 dl_signature[8];/* Signature for verification */ struct ocfs2_block_check dl_check; /* Error checking */
__le64 dl_blkno; /* Offset on disk, in blocks */
__le32 dl_fs_generation;/* Must match super block */
__le32 dl_reserved0;
__le64 dl_reserved1; struct ocfs2_dx_entry_list dl_list;
};
struct ocfs2_refcount_list { /*00*/ __le16 rl_count; /* Maximum number of entries possible
in rl_records */
__le16 rl_used; /* Current number of used records */
__le32 rl_reserved2;
__le64 rl_reserved1; /* Pad to sizeof(ocfs2_refcount_record) */ /*10*/ struct ocfs2_refcount_rec rl_recs[]; /* Refcount records */
};
struct ocfs2_refcount_block { /*00*/ __u8 rf_signature[8]; /* Signature for verification */
__le16 rf_suballoc_slot; /* Slot suballocator this block
belongs to */
__le16 rf_suballoc_bit; /* Bit offset in suballocator
block group */
__le32 rf_fs_generation; /* Must match superblock */ /*10*/ __le64 rf_blkno; /* Offset on disk, in blocks */
__le64 rf_parent; /* Parent block, only valid if OCFS2_REFCOUNT_LEAF_FLissetin
rf_flags */ /*20*/ struct ocfs2_block_check rf_check; /* Error checking */
__le64 rf_last_eb_blk; /* Pointer to last extent block */ /*30*/ __le32 rf_count; /* Number of inodes sharing this
refcount tree */
__le32 rf_flags; /* See the flags above */
__le32 rf_clusters; /* clusters covered by refcount tree. */
__le32 rf_cpos; /* cluster offset in refcount tree.*/ /*40*/ __le32 rf_generation; /* generation number. all be the same
* for the same refcount tree. */
__le32 rf_reserved0;
__le64 rf_suballoc_loc; /* Suballocator block group this refcountblockbelongsto.Only validifallocatedfroma
discontiguous block group */ /*50*/ __le64 rf_reserved1[6]; /*80*/ union { struct ocfs2_refcount_list rf_records; /* List of refcount
records */ struct ocfs2_extent_list rf_list; /* Extent record list, onlyvalidif OCFS2_REFCOUNT_TREE_FL
is set in rf_flags */
}; /* Actual on-disk size is one block */
};
/* *OndiskextendedattributestructureforOCFS2.
*/
/* *ocfs2_xattr_entryindicatesoneextendattribute. * *Notethatitcanbestoredininode,oneblockoronexattrbucket.
*/ struct ocfs2_xattr_entry {
__le32 xe_name_hash; /* hash value of xattr prefix+suffix. */
__le16 xe_name_offset; /* byte offset from the 1st entry in the localxattrstorage(inode,xattrblockor
xattr bucket). */
__u8 xe_name_len; /* xattr name len, doesn't include prefix. */
__u8 xe_type; /* the low 7 bits indicate the name prefix *typeandthehighestbitindicateswhether
* the EA is stored in the local storage. */
__le64 xe_value_size; /* real xattr value length. */
};
/* *Ondiskstructureforxattrheader. * *Oneocfs2_xattr_headerdescribeshowmanyocfs2_xattr_entryrecordsin *thelocalxattrstorage.
*/ struct ocfs2_xattr_header {
__le16 xh_count; /* contains the count of how manyrecordsareinthe
local xattr storage. */
__le16 xh_free_start; /* current offset for storing
xattr. */
__le16 xh_name_value_len; /* total length of name/value
length in this bucket. */
__le16 xh_num_buckets; /* Number of xattr buckets inthisextentrecord, onlyvalidinthefirst
bucket. */ struct ocfs2_block_check xh_check; /* Error checking (Note,thisisonly usedforxattr buckets.Ablockuses xb_checkandsets
this field to zero.) */ struct ocfs2_xattr_entry xh_entries[]; /* xattr entry list. */
};
/* *Ondiskstructureforxattrvalueroot. * *Whenanxattr'svalueislargeenough,itisstoredinanexternal *b-treelikefiledata.Thexattrvaluerootpointstothisstructure.
*/ struct ocfs2_xattr_value_root { /*00*/ __le32 xr_clusters; /* clusters covered by xattr value. */
__le32 xr_reserved0;
__le64 xr_last_eb_blk; /* Pointer to last extent block */ /*10*/ struct ocfs2_extent_list xr_list; /* Extent record list */
};
/* *Ondiskstructureforxattrtreeroot. * *Itisusedwhentherearetoomanyextendedattributesforonefile.These *attributeswillbeorganizedandstoredinanindexed-btree.
*/ struct ocfs2_xattr_tree_root { /*00*/ __le32 xt_clusters; /* clusters covered by xattr. */
__le32 xt_reserved0;
__le64 xt_last_eb_blk; /* Pointer to last extent block */ /*10*/ struct ocfs2_extent_list xt_list; /* Extent record list */
};
/* Magic numbers and known versions for global quota files */ #define OCFS2_GLOBAL_QMAGICS {\ 0x0cf52470, /* USRQUOTA */ \ 0x0cf52471 /* GRPQUOTA */ \
}
#define OCFS2_GLOBAL_QVERSIONS {\ 0, \ 0, \
}
/* Each block of each quota file has a certain fixed number of bytes reserved *forOCFS2internaluseatitsend.OCFS2canuseitforthingslike
* checksums, etc. */ #define OCFS2_QBLK_RESERVED_SPACE 8
/* Generic header of all quota files */ struct ocfs2_disk_dqheader {
__le32 dqh_magic; /* Magic number identifying file */
__le32 dqh_version; /* Quota format version */
};
/* Information header of global quota file (immediately follows the generic
* header) */ struct ocfs2_global_disk_dqinfo { /*00*/ __le32 dqi_bgrace; /* Grace time for space softlimit excess */
__le32 dqi_igrace; /* Grace time for inode softlimit excess */
__le32 dqi_syncms; /* Time after which we sync local changes to
* global quota file */
__le32 dqi_blocks; /* Number of blocks in quota file */ /*10*/ __le32 dqi_free_blk; /* First free block in quota file */
__le32 dqi_free_entry; /* First block with free dquot entry in quota
* file */
};
/* Structure with global user / group information. We reserve some space
* for future use. */ struct ocfs2_global_disk_dqblk { /*00*/ __le32 dqb_id; /* ID the structure belongs to */
__le32 dqb_use_count; /* Number of nodes having reference to this structure */
__le64 dqb_ihardlimit; /* absolute limit on allocated inodes */ /*10*/ __le64 dqb_isoftlimit; /* preferred inode limit */
__le64 dqb_curinodes; /* current # allocated inodes */ /*20*/ __le64 dqb_bhardlimit; /* absolute limit on disk space */
__le64 dqb_bsoftlimit; /* preferred limit on disk space */ /*30*/ __le64 dqb_curspace; /* current space occupied */
__le64 dqb_btime; /* time limit for excessive disk use */ /*40*/ __le64 dqb_itime; /* time limit for excessive inode use */
__le64 dqb_pad1; /*50*/ __le64 dqb_pad2;
};
/* *On-diskstructuresforlocalquotafile
*/
/* Magic numbers and known versions for local quota files */ #define OCFS2_LOCAL_QMAGICS {\ 0x0cf524c0, /* USRQUOTA */ \ 0x0cf524c1 /* GRPQUOTA */ \
}
#define OCFS2_LOCAL_QVERSIONS {\ 0, \ 0, \
}
/* Quota flags in dqinfo header */ #define OLQF_CLEAN 0x0001 /* Quota file is empty (this should be after\
* quota has been cleanly turned off) */
/* Information header of local quota file (immediately follows the generic
* header) */ struct ocfs2_local_disk_dqinfo {
__le32 dqi_flags; /* Flags for quota file */
__le32 dqi_chunks; /* Number of chunks of quota structures
* with a bitmap */
__le32 dqi_blocks; /* Number of blocks allocated for quota file */
};
/* Header of one chunk of a quota file */ struct ocfs2_local_disk_chunk {
__le32 dqc_free; /* Number of free entries in the bitmap */
__u8 dqc_bitmap[]; /* Bitmap of entries in the corresponding
* chunk of quota file */
};
/* One entry in local quota file */ struct ocfs2_local_disk_dqblk { /*00*/ __le64 dqb_id; /* id this quota applies to */
__le64 dqb_spacemod; /* Change in the amount of used space */ /*10*/ __le64 dqb_inodemod; /* Change in the amount of used inodes */
};
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 und die Messung sind noch experimentell.