fs/freevxfs/vxfs_subr.c
Source file repositories/reference/linux-study-clean/fs/freevxfs/vxfs_subr.c
File Facts
- System
- Linux kernel
- Corpus path
fs/freevxfs/vxfs_subr.c- Extension
.c- Size
- 3240 bytes
- Lines
- 153
- 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/buffer_head.hlinux/kernel.hlinux/pagemap.hvxfs_extern.h
Detected Declarations
function vxfs_put_pagefunction vxfs_get_pagefunction vxfs_breadfunction vxfs_getblkfunction vxfs_read_foliofunction vxfs_bmap
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2000-2001 Christoph Hellwig.
*/
/*
* Veritas filesystem driver - shared subroutines.
*/
#include <linux/fs.h>
#include <linux/buffer_head.h>
#include <linux/kernel.h>
#include <linux/pagemap.h>
#include "vxfs_extern.h"
static int vxfs_read_folio(struct file *, struct folio *);
static sector_t vxfs_bmap(struct address_space *, sector_t);
const struct address_space_operations vxfs_aops = {
.read_folio = vxfs_read_folio,
.bmap = vxfs_bmap,
};
inline void
vxfs_put_page(struct page *pp)
{
kunmap(pp);
put_page(pp);
}
/**
* vxfs_get_page - read a page into memory.
* @mapping: mapping to read from
* @n: page number
*
* Description:
* vxfs_get_page reads the @n th page of @ip into the pagecache.
*
* Returns:
* The wanted page on success, else a NULL pointer.
*/
struct page *
vxfs_get_page(struct address_space *mapping, u_long n)
{
struct page * pp;
pp = read_mapping_page(mapping, n, NULL);
if (!IS_ERR(pp)) {
kmap(pp);
/** if (!PageChecked(pp)) **/
/** vxfs_check_page(pp); **/
}
return (pp);
}
/**
* vxfs_bread - read buffer for a give inode,block tuple
* @ip: inode
* @block: logical block
*
* Description:
* The vxfs_bread function reads block no @block of
* @ip into the buffercache.
*
* Returns:
* The resulting &struct buffer_head.
*/
struct buffer_head *
vxfs_bread(struct inode *ip, int block)
{
struct buffer_head *bp;
daddr_t pblock;
pblock = vxfs_bmap1(ip, block);
bp = sb_bread(ip->i_sb, pblock);
return (bp);
}
/**
* vxfs_getblk - locate buffer for given inode,block tuple
* @ip: inode
* @iblock: logical block
* @bp: buffer skeleton
* @create: %TRUE if blocks may be newly allocated.
*
* Description:
Annotation
- Immediate include surface: `linux/fs.h`, `linux/buffer_head.h`, `linux/kernel.h`, `linux/pagemap.h`, `vxfs_extern.h`.
- Detected declarations: `function vxfs_put_page`, `function vxfs_get_page`, `function vxfs_bread`, `function vxfs_getblk`, `function vxfs_read_folio`, `function vxfs_bmap`.
- 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.