anonymous inode: move doc to readme

This commit is contained in:
Ciro Santilli
2018-07-01 16:10:29 +01:00
parent 662d4f25a1
commit 923f655811
6 changed files with 50 additions and 24 deletions

View File

@@ -3101,6 +3101,37 @@ Sources:
Bibliography: https://stackoverflow.com/questions/5970595/how-to-create-a-device-node-from-the-init-module-code-of-a-linux-kernel-module/45531867#45531867
==== Anonymous inode
In guest:
....
/anonymous_inode.sh
echo $?
....
Outcome: the test passes:
....
0
....
Sources:
* link:kernel_module/anonymous_inode.c[]
* link:kernel_module/anonymous_inode.h[]
* link:kernel_module/user/anonymous_inode.c[]
* link:rootfs_overlay/anonymous_inode.sh[]
This example:
* gets an anonymous inode via `ioctl` from a debugfs entry `anon_inode_getfd` from a debugfs file
* read jiffies from that inode
Anonymous inodes allow getting multiple file descriptors from a single filesystem entry, which reduces namespace pollution compared to creating multiple device files.
Bibliography: https://stackoverflow.com/questions/4508998/what-is-an-anonymous-inode-in-linux
=== Kernel panic and oops
To test out kernel panics and oops in controlled circumstances, try out the modules:
@@ -7734,7 +7765,7 @@ We are slowly automating testable guest tests with:
./run -F '/test_all.sh;/poweroff.out' | grep lkmc_test
....
which outputs to stdout `lkmc_test_pass` or `lkmc_test_fail` to stdout, which we can grep from host to automate testing.
which outputs `lkmc_test_pass` or `lkmc_test_fail`.
Source: link:rootfs_overlay/test_all.sh[].