fs/pnode.c
Source file repositories/reference/linux-study-clean/fs/pnode.c
File Facts
- System
- Linux kernel
- Corpus path
fs/pnode.c- Extension
.c- Size
- 17383 bytes
- Lines
- 688
- 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/mnt_namespace.hlinux/mount.hlinux/fs.hlinux/nsproxy.huapi/linux/mount.hinternal.hpnode.h
Detected Declarations
function get_dominating_idfunction will_be_unmountedfunction transfer_propagationfunction hlist_for_each_entry_safefunction change_mnt_propagationfunction set_destinationsfunction bulk_make_privatefunction list_for_each_entryfunction get_sourcefunction need_secondaryfunction propagate_mntfunction hlist_for_each_entryfunction do_refcount_checkfunction propagation_would_overmountfunction propagate_mount_busyfunction propagate_mount_unlockfunction is_candidatefunction umount_onefunction remove_from_candidate_listfunction gather_candidatesfunction list_for_each_entryfunction trim_ancestorsfunction trim_ancestorsfunction list_for_each_entryfunction handle_lockedfunction propagate_umountfunction mount_lock
Annotated Snippet
if (list_empty(&mnt->mnt_share)) {
mnt_release_group_id(mnt);
} else {
m = next_peer(mnt);
list_del_init(&mnt->mnt_share);
mnt->mnt_group_id = 0;
}
CLEAR_MNT_SHARED(mnt);
transfer_propagation(mnt, m);
}
hlist_del_init(&mnt->mnt_slave);
if (type == MS_SLAVE) {
mnt->mnt_master = m;
if (m)
hlist_add_head(&mnt->mnt_slave, &m->mnt_slave_list);
} else {
mnt->mnt_master = NULL;
if (type == MS_UNBINDABLE)
mnt->mnt_t_flags |= T_UNBINDABLE;
else
mnt->mnt_t_flags &= ~T_UNBINDABLE;
}
}
static struct mount *trace_transfers(struct mount *m)
{
while (1) {
struct mount *next = next_peer(m);
if (next != m) {
list_del_init(&m->mnt_share);
m->mnt_group_id = 0;
m->mnt_master = next;
} else {
if (IS_MNT_SHARED(m))
mnt_release_group_id(m);
next = m->mnt_master;
}
hlist_del_init(&m->mnt_slave);
CLEAR_MNT_SHARED(m);
SET_MNT_MARK(m);
if (!next || !will_be_unmounted(next))
return next;
if (IS_MNT_MARKED(next))
return next->mnt_master;
m = next;
}
}
static void set_destinations(struct mount *m, struct mount *master)
{
struct mount *next;
while ((next = m->mnt_master) != master) {
m->mnt_master = master;
m = next;
}
}
void bulk_make_private(struct list_head *set)
{
struct mount *m;
list_for_each_entry(m, set, mnt_list)
if (!IS_MNT_MARKED(m))
set_destinations(m, trace_transfers(m));
list_for_each_entry(m, set, mnt_list) {
transfer_propagation(m, m->mnt_master);
m->mnt_master = NULL;
CLEAR_MNT_MARK(m);
}
}
static struct mount *__propagation_next(struct mount *m,
struct mount *origin)
{
while (1) {
struct mount *master = m->mnt_master;
if (master == origin->mnt_master) {
struct mount *next = next_peer(m);
return (next == origin) ? NULL : next;
} else if (m->mnt_slave.next)
return next_slave(m);
/* back at master */
m = master;
}
Annotation
- Immediate include surface: `linux/mnt_namespace.h`, `linux/mount.h`, `linux/fs.h`, `linux/nsproxy.h`, `uapi/linux/mount.h`, `internal.h`, `pnode.h`.
- Detected declarations: `function get_dominating_id`, `function will_be_unmounted`, `function transfer_propagation`, `function hlist_for_each_entry_safe`, `function change_mnt_propagation`, `function set_destinations`, `function bulk_make_private`, `function list_for_each_entry`, `function get_source`, `function need_secondary`.
- 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.