kernel/bpf/dispatcher.c

Source file repositories/reference/linux-study-clean/kernel/bpf/dispatcher.c

File Facts

System
Linux kernel
Corpus path
kernel/bpf/dispatcher.c
Extension
.c
Size
4318 bytes
Lines
172
Domain
Core OS
Bucket
Scheduler, Processes, Timers, Sync, And Syscalls
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.

Dependency Surface

Detected Declarations

Annotated Snippet

if (!d->rw_image) {
			bpf_prog_pack_free(d->image, PAGE_SIZE);
			d->image = NULL;
			goto out;
		}
		bpf_image_ksym_init(d->image, PAGE_SIZE, &d->ksym);
		bpf_image_ksym_add(&d->ksym);
	}

	prev_num_progs = d->num_progs;
	changed |= bpf_dispatcher_remove_prog(d, from);
	changed |= bpf_dispatcher_add_prog(d, to);

	if (!changed)
		goto out;

	bpf_dispatcher_update(d, prev_num_progs);
out:
	mutex_unlock(&d->mutex);
}

Annotation

Implementation Notes