fs/lockd/svcshare.c
Source file repositories/reference/linux-study-clean/fs/lockd/svcshare.c
File Facts
- System
- Linux kernel
- Corpus path
fs/lockd/svcshare.c- Extension
.c- Size
- 2854 bytes
- Lines
- 126
- 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.
- 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/time.hlinux/unistd.hlinux/string.hlinux/slab.hlinux/sunrpc/clnt.hlinux/sunrpc/svc.hlockd.hshare.h
Detected Declarations
function Copyrightfunction nlmsvc_share_filefunction nlmsvc_unshare_filefunction given
Annotated Snippet
if (share->s_host == host && nlm_cmp_owner(share, oh)) {
*shpp = share->s_next;
kfree(share);
return nlm_granted;
}
}
/* X/Open spec says return success even if there was no
* corresponding share. */
return nlm_granted;
}
/*
* Traverse all shares for a given file, and delete
* those owned by the given (type of) host
*/
void nlmsvc_traverse_shares(struct nlm_host *host, struct nlm_file *file,
nlm_host_match_fn_t match)
{
struct lockd_share *share, **shpp;
shpp = &file->f_shares;
while ((share = *shpp) != NULL) {
if (match(share->s_host, host)) {
*shpp = share->s_next;
kfree(share);
continue;
}
shpp = &share->s_next;
}
}
Annotation
- Immediate include surface: `linux/time.h`, `linux/unistd.h`, `linux/string.h`, `linux/slab.h`, `linux/sunrpc/clnt.h`, `linux/sunrpc/svc.h`, `lockd.h`, `share.h`.
- Detected declarations: `function Copyright`, `function nlmsvc_share_file`, `function nlmsvc_unshare_file`, `function given`.
- 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.