fs/ocfs2/ocfs2.h
Source file repositories/reference/linux-study-clean/fs/ocfs2/ocfs2.h
File Facts
- System
- Linux kernel
- Corpus path
fs/ocfs2/ocfs2.h- Extension
.h- Size
- 26285 bytes
- Lines
- 992
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/spinlock.hlinux/sched.hlinux/wait.hlinux/list.hlinux/llist.hlinux/rbtree.hlinux/workqueue.hlinux/kref.hlinux/mutex.hlinux/lockdep.hlinux/jbd2.hstackglue.hocfs2_fs.hocfs2_lockid.hocfs2_ioctl.hblockcheck.hreservations.hfilecheck.h
Detected Declarations
struct ocfs2_caching_operationsstruct ocfs2_caching_infostruct ocfs2_node_mapstruct ocfs2_lock_res_opsstruct ocfs2_lock_statsstruct ocfs2_lock_resstruct ocfs2_orphan_scanstruct ocfs2_dlm_debugstruct ocfs2_alloc_statsstruct ocfs2_triggersstruct ocfs2_journalstruct ocfs2_slot_infostruct ocfs2_recovery_mapstruct ocfs2_replay_mapstruct ocfs2_quota_recoverystruct ocfs2_superenum ocfs2_caching_info_flagsenum ocfs2_ast_actionenum ocfs2_unlock_actionenum ocfs2_orphan_reco_typeenum ocfs2_orphan_scan_stateenum ocfs2_vol_stateenum ocfs2_local_alloc_stateenum ocfs2_mount_optionsenum ocfs2_journal_trigger_typeenum ocfs2_recovery_statefunction ocfs2_should_order_datafunction ocfs2_sparse_allocfunction ocfs2_writes_unwritten_extentsfunction ocfs2_supports_append_diofunction ocfs2_supports_inline_datafunction ocfs2_supports_xattrfunction ocfs2_meta_eccfunction ocfs2_supports_indexed_dirsfunction ocfs2_supports_discontig_bgfunction ocfs2_link_maxfunction ocfs2_read_links_countfunction ocfs2_set_links_countfunction ocfs2_add_links_countfunction ocfs2_refcount_treefunction ocfs2_set_osb_flagfunction ocfs2_set_ro_flagfunction ocfs2_is_hard_readonlyfunction ocfs2_is_soft_readonlyfunction ocfs2_is_readonlyfunction ocfs2_emergency_statefunction ocfs2_clusterinfo_validfunction ocfs2_userspace_stack
Annotated Snippet
struct ocfs2_caching_info {
/*
* The parent structure provides the locks, but because the
* parent structure can differ, it provides locking operations
* to struct ocfs2_caching_info.
*/
const struct ocfs2_caching_operations *ci_ops;
/* next two are protected by trans_inc_lock */
/* which transaction were we created on? Zero if none. */
unsigned long ci_created_trans;
/* last transaction we were a part of. */
unsigned long ci_last_trans;
/* Cache structures */
unsigned int ci_flags;
unsigned int ci_num_cached;
union {
sector_t ci_array[OCFS2_CACHE_INFO_MAX_ARRAY];
struct rb_root ci_tree;
} ci_cache;
};
/*
* Need this prototype here instead of in uptodate.h because journal.h
* uses it.
*/
struct super_block *ocfs2_metadata_cache_get_super(struct ocfs2_caching_info *ci);
/* this limits us to 256 nodes
* if we need more, we can do a kmalloc for the map */
#define OCFS2_NODE_MAP_MAX_NODES 256
struct ocfs2_node_map {
u16 num_nodes;
unsigned long map[BITS_TO_LONGS(OCFS2_NODE_MAP_MAX_NODES)];
};
enum ocfs2_ast_action {
OCFS2_AST_INVALID = 0,
OCFS2_AST_ATTACH,
OCFS2_AST_CONVERT,
OCFS2_AST_DOWNCONVERT,
};
/* actions for an unlockast function to take. */
enum ocfs2_unlock_action {
OCFS2_UNLOCK_INVALID = 0,
OCFS2_UNLOCK_CANCEL_CONVERT,
OCFS2_UNLOCK_DROP_LOCK,
};
/* ocfs2_lock_res->l_flags flags. */
#define OCFS2_LOCK_ATTACHED (0x00000001) /* we have initialized
* the lvb */
#define OCFS2_LOCK_BUSY (0x00000002) /* we are currently in
* dlm_lock */
#define OCFS2_LOCK_BLOCKED (0x00000004) /* blocked waiting to
* downconvert*/
#define OCFS2_LOCK_LOCAL (0x00000008) /* newly created inode */
#define OCFS2_LOCK_NEEDS_REFRESH (0x00000010)
#define OCFS2_LOCK_REFRESHING (0x00000020)
#define OCFS2_LOCK_INITIALIZED (0x00000040) /* track initialization
* for shutdown paths */
#define OCFS2_LOCK_FREEING (0x00000080) /* help dlmglue track
* when to skip queueing
* a lock because it's
* about to be
* dropped. */
#define OCFS2_LOCK_QUEUED (0x00000100) /* queued for downconvert */
#define OCFS2_LOCK_NOCACHE (0x00000200) /* don't use a holder count */
#define OCFS2_LOCK_PENDING (0x00000400) /* This lockres is pending a
call to dlm_lock. Only
exists with BUSY set. */
#define OCFS2_LOCK_UPCONVERT_FINISHING (0x00000800) /* blocks the dc thread
* from downconverting
* before the upconvert
* has completed */
#define OCFS2_LOCK_NONBLOCK_FINISHED (0x00001000) /* NONBLOCK cluster
* lock has already
* returned, do not block
* dc thread from
* downconverting */
struct ocfs2_lock_res_ops;
typedef void (*ocfs2_lock_callback)(int status, unsigned long data);
#ifdef CONFIG_OCFS2_FS_STATS
struct ocfs2_lock_stats {
u64 ls_total; /* Total wait in NSEC */
Annotation
- Immediate include surface: `linux/spinlock.h`, `linux/sched.h`, `linux/wait.h`, `linux/list.h`, `linux/llist.h`, `linux/rbtree.h`, `linux/workqueue.h`, `linux/kref.h`.
- Detected declarations: `struct ocfs2_caching_operations`, `struct ocfs2_caching_info`, `struct ocfs2_node_map`, `struct ocfs2_lock_res_ops`, `struct ocfs2_lock_stats`, `struct ocfs2_lock_res`, `struct ocfs2_orphan_scan`, `struct ocfs2_dlm_debug`, `struct ocfs2_alloc_stats`, `struct ocfs2_triggers`.
- Atlas domain: Core OS / VFS And Filesystem Core.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.