fs/ocfs2/ocfs2_fs.h
Source file repositories/reference/linux-study-clean/fs/ocfs2/ocfs2_fs.h
File Facts
- System
- Linux kernel
- Corpus path
fs/ocfs2/ocfs2_fs.h- Extension
.h- Size
- 51041 bytes
- Lines
- 1617
- Domain
- Core OS
- Bucket
- VFS And Filesystem Core
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/magic.h
Detected Declarations
struct ocfs2_system_inode_infostruct ocfs2_block_checkstruct ocfs2_extent_recstruct ocfs2_chain_recstruct ocfs2_truncate_recstruct ocfs2_extent_liststruct ocfs2_chain_liststruct ocfs2_truncate_logstruct ocfs2_extent_blockstruct ocfs2_slot_mapstruct ocfs2_extended_slotstruct ocfs2_slot_map_extendedstruct ocfs2_cluster_infostruct ocfs2_super_blockstruct ocfs2_local_allocstruct ocfs2_inline_datastruct ocfs2_dinodestruct ocfs2_dir_entrystruct ocfs2_dir_block_trailerstruct ocfs2_dx_entrystruct ocfs2_dx_entry_liststruct ocfs2_dx_root_blockstruct ocfs2_dx_leafstruct ocfs2_group_descstruct ocfs2_refcount_recstruct ocfs2_refcount_liststruct ocfs2_refcount_blockstruct ocfs2_xattr_entrystruct ocfs2_xattr_headerstruct ocfs2_xattr_value_rootstruct ocfs2_xattr_tree_rootstruct ocfs2_xattr_blockstruct ocfs2_disk_dqheaderstruct ocfs2_global_disk_dqinfostruct ocfs2_global_disk_dqblkstruct ocfs2_local_disk_dqinfostruct ocfs2_local_disk_chunkstruct ocfs2_local_disk_dqblkstruct ocfs2_disk_dqtrailerfunction ocfs2_xattr_set_localfunction ocfs2_xattr_is_localfunction ocfs2_xattr_set_typefunction ocfs2_xattr_get_typefunction ocfs2_fast_symlink_charsfunction ocfs2_max_inline_data_with_xattrfunction ocfs2_extent_recs_per_inodefunction ocfs2_extent_recs_per_inode_with_xattrfunction ocfs2_extent_recs_per_dx_root
Annotated Snippet
struct ocfs2_system_inode_info {
char *si_name;
int si_iflags;
int si_mode;
};
/* System file index */
enum {
BAD_BLOCK_SYSTEM_INODE = 0,
GLOBAL_INODE_ALLOC_SYSTEM_INODE,
#define OCFS2_FIRST_ONLINE_SYSTEM_INODE GLOBAL_INODE_ALLOC_SYSTEM_INODE
SLOT_MAP_SYSTEM_INODE,
HEARTBEAT_SYSTEM_INODE,
GLOBAL_BITMAP_SYSTEM_INODE,
USER_QUOTA_SYSTEM_INODE,
GROUP_QUOTA_SYSTEM_INODE,
#define OCFS2_LAST_GLOBAL_SYSTEM_INODE GROUP_QUOTA_SYSTEM_INODE
#define OCFS2_FIRST_LOCAL_SYSTEM_INODE ORPHAN_DIR_SYSTEM_INODE
ORPHAN_DIR_SYSTEM_INODE,
EXTENT_ALLOC_SYSTEM_INODE,
INODE_ALLOC_SYSTEM_INODE,
JOURNAL_SYSTEM_INODE,
LOCAL_ALLOC_SYSTEM_INODE,
TRUNCATE_LOG_SYSTEM_INODE,
LOCAL_USER_QUOTA_SYSTEM_INODE,
LOCAL_GROUP_QUOTA_SYSTEM_INODE,
#define OCFS2_LAST_LOCAL_SYSTEM_INODE LOCAL_GROUP_QUOTA_SYSTEM_INODE
NUM_SYSTEM_INODES
};
#define NUM_GLOBAL_SYSTEM_INODES OCFS2_FIRST_LOCAL_SYSTEM_INODE
#define NUM_LOCAL_SYSTEM_INODES \
(NUM_SYSTEM_INODES - OCFS2_FIRST_LOCAL_SYSTEM_INODE)
static struct 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 },
/* These are used by the running filesystem */
[SLOT_MAP_SYSTEM_INODE] = { "slot_map", 0, S_IFREG | 0644 },
[HEARTBEAT_SYSTEM_INODE] = { "heartbeat", OCFS2_HEARTBEAT_FL, S_IFREG | 0644 },
[GLOBAL_BITMAP_SYSTEM_INODE] = { "global_bitmap", 0, S_IFREG | 0644 },
[USER_QUOTA_SYSTEM_INODE] = { "aquota.user", OCFS2_QUOTA_FL, S_IFREG | 0644 },
[GROUP_QUOTA_SYSTEM_INODE] = { "aquota.group", OCFS2_QUOTA_FL, S_IFREG | 0644 },
/* Slot-specific system inodes (one copy per slot) */
[ORPHAN_DIR_SYSTEM_INODE] = { "orphan_dir:%04d", 0, S_IFDIR | 0755 },
[EXTENT_ALLOC_SYSTEM_INODE] = { "extent_alloc:%04d", OCFS2_BITMAP_FL | OCFS2_CHAIN_FL, S_IFREG | 0644 },
[INODE_ALLOC_SYSTEM_INODE] = { "inode_alloc:%04d", OCFS2_BITMAP_FL | OCFS2_CHAIN_FL, S_IFREG | 0644 },
[JOURNAL_SYSTEM_INODE] = { "journal:%04d", OCFS2_JOURNAL_FL, S_IFREG | 0644 },
[LOCAL_ALLOC_SYSTEM_INODE] = { "local_alloc:%04d", OCFS2_BITMAP_FL | OCFS2_LOCAL_ALLOC_FL, S_IFREG | 0644 },
[TRUNCATE_LOG_SYSTEM_INODE] = { "truncate_log:%04d", OCFS2_DEALLOC_FL, S_IFREG | 0644 },
[LOCAL_USER_QUOTA_SYSTEM_INODE] = { "aquota.user:%04d", OCFS2_QUOTA_FL, S_IFREG | 0644 },
[LOCAL_GROUP_QUOTA_SYSTEM_INODE] = { "aquota.group:%04d", OCFS2_QUOTA_FL, S_IFREG | 0644 },
};
/* Parameter passed from mount.ocfs2 to module */
#define OCFS2_HB_NONE "heartbeat=none"
#define OCFS2_HB_LOCAL "heartbeat=local"
#define OCFS2_HB_GLOBAL "heartbeat=global"
/*
* OCFS2_DIR_PAD defines the directory entries boundaries
*
* NOTE: It must be a multiple of 4
*/
#define OCFS2_DIR_PAD 4
#define OCFS2_DIR_ROUND (OCFS2_DIR_PAD - 1)
#define OCFS2_DIR_MEMBER_LEN offsetof(struct ocfs2_dir_entry, name)
#define OCFS2_DIR_REC_LEN(name_len) (((name_len) + OCFS2_DIR_MEMBER_LEN + \
OCFS2_DIR_ROUND) & \
~OCFS2_DIR_ROUND)
#define OCFS2_DIR_MIN_REC_LEN OCFS2_DIR_REC_LEN(1)
#define OCFS2_LINK_MAX 32000
#define OCFS2_DX_LINK_MAX ((1U << 31) - 1U)
#define OCFS2_LINKS_HI_SHIFT 16
#define OCFS2_DX_ENTRIES_MAX (0xffffffffU)
/*
* Convenience casts
*/
#define OCFS2_RAW_SB(dinode) (&((dinode)->id2.i_super))
/*
* Block checking structure. This is used in metadata to validate the
* contents. If OCFS2_FEATURE_INCOMPAT_META_ECC is not set, it is all
* zeros.
Annotation
- Immediate include surface: `linux/magic.h`.
- Detected declarations: `struct ocfs2_system_inode_info`, `struct ocfs2_block_check`, `struct ocfs2_extent_rec`, `struct ocfs2_chain_rec`, `struct ocfs2_truncate_rec`, `struct ocfs2_extent_list`, `struct ocfs2_chain_list`, `struct ocfs2_truncate_log`, `struct ocfs2_extent_block`, `struct ocfs2_slot_map`.
- Atlas domain: Core OS / VFS And Filesystem Core.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.