fs/nfs/iostat.h
Source file repositories/reference/linux-study-clean/fs/nfs/iostat.h
File Facts
- System
- Linux kernel
- Corpus path
fs/nfs/iostat.h- Extension
.h- Size
- 1477 bytes
- Lines
- 62
- 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/percpu.hlinux/cache.hlinux/nfs_iostat.h
Detected Declarations
struct nfs_iostatsfunction nfs_inc_server_statsfunction nfs_inc_statsfunction nfs_add_server_statsfunction nfs_add_statsfunction separately
Annotated Snippet
struct nfs_iostats {
unsigned long long bytes[__NFSIOS_BYTESMAX];
unsigned long events[__NFSIOS_COUNTSMAX];
} ____cacheline_aligned;
static inline void nfs_inc_server_stats(const struct nfs_server *server,
enum nfs_stat_eventcounters stat)
{
this_cpu_inc(server->io_stats->events[stat]);
}
static inline void nfs_inc_stats(const struct inode *inode,
enum nfs_stat_eventcounters stat)
{
nfs_inc_server_stats(NFS_SERVER(inode), stat);
}
static inline void nfs_add_server_stats(const struct nfs_server *server,
enum nfs_stat_bytecounters stat,
long addend)
{
this_cpu_add(server->io_stats->bytes[stat], addend);
}
static inline void nfs_add_stats(const struct inode *inode,
enum nfs_stat_bytecounters stat,
long addend)
{
nfs_add_server_stats(NFS_SERVER(inode), stat, addend);
}
/*
* This specialized allocator has to be a macro for its allocations to be
* accounted separately (to have a separate alloc_tag).
*/
#define nfs_alloc_iostats() alloc_percpu(struct nfs_iostats)
static inline void nfs_free_iostats(struct nfs_iostats __percpu *stats)
{
if (stats != NULL)
free_percpu(stats);
}
#endif /* _NFS_IOSTAT */
Annotation
- Immediate include surface: `linux/percpu.h`, `linux/cache.h`, `linux/nfs_iostat.h`.
- Detected declarations: `struct nfs_iostats`, `function nfs_inc_server_stats`, `function nfs_inc_stats`, `function nfs_add_server_stats`, `function nfs_add_stats`, `function separately`.
- 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.