Commit e77fc1d
committed
ch04: remove proc entry when unloading the module
/ # insmod share/rust_proc.ko
[ 7.874918] rust_proc: module verification failed: signature and/or required key missing - tainting kernel
[ 7.876615] rust_proc: rust_proc is loaded
[ 7.877263] rust_proc: succeeded to create a proc entry: 0xffff888005469300
/ # ls proc/
1 27 7 iomem pressure
10 28 8 ioports rust_demo
11 29 9 irq schedstat
111 3 bootconfig kallsyms self
12 30 buddyinfo kcore slabinfo
120 31 bus key-users softirqs
13 32 cgroups keys stat
14 33 cmdline kmsg swaps
15 34 consoles kpagecgroup sys
16 35 cpuinfo kpagecount sysrq-trigger
17 36 crypto kpageflags sysvipc
18 38 devices loadavg thread-self
19 4 diskstats locks timer_list
2 40 dma meminfo tty
20 41 driver misc uptime
21 42 dynamic_debug modules version
22 5 execdomains mounts vmallocinfo
23 53 fb mtrr vmstat
24 6 filesystems net zoneinfo
25 61 fs pagetypeinfo
26 62 interrupts partitions
/ # ls proc/rust_demo/
rust_proc_fs
/ # rmmod rust_proc
[ 14.860586] rust_proc: rust_proc is unloaded
/ # ls proc/rust_demo/
ls: proc/rust_demo/: No such file or directory1 parent f2eecb5 commit e77fc1d
2 files changed
Lines changed: 57 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
29 | 32 | | |
30 | 33 | | |
31 | 34 | | |
32 | 35 | | |
33 | 36 | | |
34 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
35 | 65 | | |
36 | 66 | | |
37 | 67 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
45 | 71 | | |
46 | 72 | | |
47 | 73 | | |
| |||
58 | 84 | | |
59 | 85 | | |
60 | 86 | | |
61 | | - | |
| 87 | + | |
62 | 88 | | |
63 | 89 | | |
64 | 90 | | |
65 | 91 | | |
66 | 92 | | |
67 | 93 | | |
68 | 94 | | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
69 | 104 | | |
70 | | - | |
71 | | - | |
72 | | - | |
| 105 | + | |
73 | 106 | | |
74 | | - | |
75 | | - | |
| 107 | + | |
| 108 | + | |
76 | 109 | | |
77 | | - | |
78 | | - | |
79 | 110 | | |
80 | 111 | | |
81 | 112 | | |
82 | 113 | | |
83 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
84 | 122 | | |
85 | 123 | | |
86 | 124 | | |
| 125 | + | |
| 126 | + | |
0 commit comments