fs/ocfs2/uptodate.c
Source file repositories/reference/linux-study-clean/fs/ocfs2/uptodate.c
File Facts
- System
- Linux kernel
- Corpus path
fs/ocfs2/uptodate.c- Extension
.c- Size
- 17294 bytes
- Lines
- 622
- 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/fs.hlinux/types.hlinux/slab.hlinux/highmem.hlinux/buffer_head.hlinux/rbtree.hcluster/masklog.hocfs2.hinode.huptodate.hocfs2_trace.h
Detected Declarations
struct ocfs2_meta_cache_itemfunction ocfs2_metadata_cache_ownerfunction ocfs2_metadata_cache_lockfunction ocfs2_metadata_cache_unlockfunction ocfs2_metadata_cache_io_lockfunction ocfs2_metadata_cache_io_unlockfunction ocfs2_metadata_cache_resetfunction ocfs2_metadata_cache_initfunction ocfs2_metadata_cache_exitfunction ocfs2_purge_copied_metadata_treefunction ocfs2_metadata_cache_purgefunction ocfs2_search_cache_arrayfunction ocfs2_search_cache_treefunction ocfs2_buffer_cachedfunction lock_bufferfunction ocfs2_buffer_read_aheadfunction ocfs2_append_cache_arrayfunction __ocfs2_insert_cache_treefunction ocfs2_insert_can_use_arrayfunction co_cache_lockfunction __ocfs2_set_buffer_uptodatefunction ocfs2_set_buffer_uptodatefunction ocfs2_set_new_buffer_uptodatefunction ocfs2_remove_metadata_arrayfunction ocfs2_remove_metadata_treefunction ocfs2_remove_block_from_cachefunction ocfs2_remove_from_cachefunction ocfs2_remove_xattr_clusters_from_cachefunction init_ocfs2_uptodate_cachefunction exit_ocfs2_uptodate_cache
Annotated Snippet
struct ocfs2_meta_cache_item {
struct rb_node c_node;
sector_t c_block;
};
static struct kmem_cache *ocfs2_uptodate_cachep;
u64 ocfs2_metadata_cache_owner(struct ocfs2_caching_info *ci)
{
BUG_ON(!ci || !ci->ci_ops);
return ci->ci_ops->co_owner(ci);
}
struct super_block *ocfs2_metadata_cache_get_super(struct ocfs2_caching_info *ci)
{
BUG_ON(!ci || !ci->ci_ops);
return ci->ci_ops->co_get_super(ci);
}
static void ocfs2_metadata_cache_lock(struct ocfs2_caching_info *ci)
{
BUG_ON(!ci || !ci->ci_ops);
ci->ci_ops->co_cache_lock(ci);
}
static void ocfs2_metadata_cache_unlock(struct ocfs2_caching_info *ci)
{
BUG_ON(!ci || !ci->ci_ops);
ci->ci_ops->co_cache_unlock(ci);
}
void ocfs2_metadata_cache_io_lock(struct ocfs2_caching_info *ci)
{
BUG_ON(!ci || !ci->ci_ops);
ci->ci_ops->co_io_lock(ci);
}
void ocfs2_metadata_cache_io_unlock(struct ocfs2_caching_info *ci)
{
BUG_ON(!ci || !ci->ci_ops);
ci->ci_ops->co_io_unlock(ci);
}
static void ocfs2_metadata_cache_reset(struct ocfs2_caching_info *ci,
int clear)
{
ci->ci_flags |= OCFS2_CACHE_FL_INLINE;
ci->ci_num_cached = 0;
if (clear) {
ci->ci_created_trans = 0;
ci->ci_last_trans = 0;
}
}
void ocfs2_metadata_cache_init(struct ocfs2_caching_info *ci,
const struct ocfs2_caching_operations *ops)
{
BUG_ON(!ops);
ci->ci_ops = ops;
ocfs2_metadata_cache_reset(ci, 1);
}
void ocfs2_metadata_cache_exit(struct ocfs2_caching_info *ci)
{
ocfs2_metadata_cache_purge(ci);
ocfs2_metadata_cache_reset(ci, 1);
}
/* No lock taken here as 'root' is not expected to be visible to other
* processes. */
static unsigned int ocfs2_purge_copied_metadata_tree(struct rb_root *root)
{
unsigned int purged = 0;
struct rb_node *node;
struct ocfs2_meta_cache_item *item;
while ((node = rb_last(root)) != NULL) {
item = rb_entry(node, struct ocfs2_meta_cache_item, c_node);
trace_ocfs2_purge_copied_metadata_tree(
Annotation
- Immediate include surface: `linux/fs.h`, `linux/types.h`, `linux/slab.h`, `linux/highmem.h`, `linux/buffer_head.h`, `linux/rbtree.h`, `cluster/masklog.h`, `ocfs2.h`.
- Detected declarations: `struct ocfs2_meta_cache_item`, `function ocfs2_metadata_cache_owner`, `function ocfs2_metadata_cache_lock`, `function ocfs2_metadata_cache_unlock`, `function ocfs2_metadata_cache_io_lock`, `function ocfs2_metadata_cache_io_unlock`, `function ocfs2_metadata_cache_reset`, `function ocfs2_metadata_cache_init`, `function ocfs2_metadata_cache_exit`, `function ocfs2_purge_copied_metadata_tree`.
- 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.