lib/test_kho.c

Source file repositories/reference/linux-study-clean/lib/test_kho.c

File Facts

System
Linux kernel
Corpus path
lib/test_kho.c
Extension
.c
Size
8246 bytes
Lines
366
Domain
Kernel Services
Bucket
lib
Inferred role
Kernel Services: exported/initcall integration point
Status
integration implementation candidate

Why This File Exists

Shared kernel service surface used by multiple subsystems, including helpers, cryptography, virtualization support, and async I/O infrastructure.

Dependency Surface

Detected Declarations

Annotated Snippet

module_init(kho_test_init);

static void kho_test_cleanup(void)
{
	/* unpreserve and free the data stored in folios */
	kho_test_unpreserve_data(&kho_test_state);
	for (int i = 0; i < kho_test_state.nr_folios; i++)
		folio_put(kho_test_state.folios[i]);

	kvfree(kho_test_state.folios);

	/* Unpreserve and release the FDT folio */
	kho_unpreserve_folio(kho_test_state.fdt);
	folio_put(kho_test_state.fdt);
}

static void __exit kho_test_exit(void)
{
	kho_remove_subtree(folio_address(kho_test_state.fdt));
	kho_test_cleanup();
}
module_exit(kho_test_exit);

MODULE_AUTHOR("Mike Rapoport <rppt@kernel.org>");
MODULE_DESCRIPTION("KHO test module");
MODULE_LICENSE("GPL");

Annotation

Implementation Notes