fs/nfs/pnfs_dev.c
Source file repositories/reference/linux-study-clean/fs/nfs/pnfs_dev.c
File Facts
- System
- Linux kernel
- Corpus path
fs/nfs/pnfs_dev.c- Extension
.c- Size
- 10139 bytes
- Lines
- 382
- Domain
- Core OS
- Bucket
- VFS And Filesystem Core
- Inferred role
- Core OS: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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/export.hlinux/nfs_fs.hnfs4session.hinternal.hpnfs.hnfs4trace.h
Detected Declarations
function nfs4_print_deviceidfunction nfs4_deviceid_hashfunction _lookup_deviceidfunction hlist_for_each_entry_rcufunction nfs4_get_device_infofunction __nfs4_find_get_deviceidfunction nfs4_find_get_deviceidfunction nfs4_delete_deviceidfunction nfs4_init_deviceid_nodefunction nfs4_put_deviceid_nodefunction nfs4_mark_deviceid_availablefunction nfs4_mark_deviceid_unavailablefunction nfs4_test_deviceid_unavailablefunction _deviceid_purge_clientfunction nfs4_deviceid_purge_clientfunction nfs4_deviceid_mark_client_invalidexport nfs4_print_deviceidexport nfs4_find_get_deviceidexport nfs4_delete_deviceidexport nfs4_init_deviceid_nodeexport nfs4_put_deviceid_nodeexport nfs4_mark_deviceid_availableexport nfs4_mark_deviceid_unavailableexport nfs4_test_deviceid_unavailable
Annotated Snippet
if (d->nfs_client == clp && atomic_read(&d->ref)) {
hlist_del_init_rcu(&d->node);
hlist_add_head(&d->tmpnode, &tmp);
clear_bit(NFS_DEVICEID_NOCACHE, &d->flags);
}
rcu_read_unlock();
spin_unlock(&nfs4_deviceid_lock);
if (hlist_empty(&tmp))
return;
while (!hlist_empty(&tmp)) {
d = hlist_entry(tmp.first, struct nfs4_deviceid_node, tmpnode);
hlist_del(&d->tmpnode);
nfs4_put_deviceid_node(d);
}
}
void
nfs4_deviceid_purge_client(const struct nfs_client *clp)
{
long h;
if (!(clp->cl_exchange_flags & EXCHGID4_FLAG_USE_PNFS_MDS))
return;
for (h = 0; h < NFS4_DEVICE_ID_HASH_SIZE; h++)
_deviceid_purge_client(clp, h);
}
/*
* Stop use of all deviceids associated with an nfs_client
*/
void
nfs4_deviceid_mark_client_invalid(struct nfs_client *clp)
{
struct nfs4_deviceid_node *d;
int i;
rcu_read_lock();
for (i = 0; i < NFS4_DEVICE_ID_HASH_SIZE; i ++){
hlist_for_each_entry_rcu(d, &nfs4_deviceid_cache[i], node)
if (d->nfs_client == clp)
set_bit(NFS_DEVICEID_INVALID, &d->flags);
}
rcu_read_unlock();
}
Annotation
- Immediate include surface: `linux/export.h`, `linux/nfs_fs.h`, `nfs4session.h`, `internal.h`, `pnfs.h`, `nfs4trace.h`.
- Detected declarations: `function nfs4_print_deviceid`, `function nfs4_deviceid_hash`, `function _lookup_deviceid`, `function hlist_for_each_entry_rcu`, `function nfs4_get_device_info`, `function __nfs4_find_get_deviceid`, `function nfs4_find_get_deviceid`, `function nfs4_delete_deviceid`, `function nfs4_init_deviceid_node`, `function nfs4_put_deviceid_node`.
- Atlas domain: Core OS / VFS And Filesystem Core.
- Implementation status: integration 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.