fs/squashfs/file_cache.c
Source file repositories/reference/linux-study-clean/fs/squashfs/file_cache.c
File Facts
- System
- Linux kernel
- Corpus path
fs/squashfs/file_cache.c- Extension
.c- Size
- 891 bytes
- Lines
- 37
- 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/vfs.hlinux/kernel.hlinux/slab.hlinux/string.hlinux/pagemap.hlinux/mutex.hsquashfs_fs.hsquashfs_fs_sb.hsquashfs_fs_i.hsquashfs.h
Detected Declarations
function Copyright
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2013
* Phillip Lougher <phillip@squashfs.org.uk>
*/
#include <linux/fs.h>
#include <linux/vfs.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/string.h>
#include <linux/pagemap.h>
#include <linux/mutex.h>
#include "squashfs_fs.h"
#include "squashfs_fs_sb.h"
#include "squashfs_fs_i.h"
#include "squashfs.h"
/* Read separately compressed datablock and memcopy into page cache */
int squashfs_readpage_block(struct folio *folio, u64 block, int bsize, int expected)
{
struct inode *i = folio->mapping->host;
struct squashfs_cache_entry *buffer = squashfs_get_datablock(i->i_sb,
block, bsize);
int res = buffer->error;
if (res)
ERROR("Unable to read page, block %llx, size %x\n", block,
bsize);
else
squashfs_copy_cache(folio, buffer, expected, 0);
squashfs_cache_put(buffer);
return res;
}
Annotation
- Immediate include surface: `linux/fs.h`, `linux/vfs.h`, `linux/kernel.h`, `linux/slab.h`, `linux/string.h`, `linux/pagemap.h`, `linux/mutex.h`, `squashfs_fs.h`.
- Detected declarations: `function Copyright`.
- 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.