Commit d7d75c0
drgn.helpers.linux.kernfs: add kernfs_children() helper
Add a helper, kernfs_children(), that returns an iterator over the
children of a directory in kernfs.
The implementation of this must check kn.flags to ensure it is a
KERNFS_DIR. struct kernfs_node unions dir and attr and without this
check, calling kernfs_children() on a KERNFS_FILE kernfs node may return
corrupt data or trigger a page fault that is confusing to the user.
Signed-off-by: Joanne Koong <[email protected]>1 parent 9936a49 commit d7d75c0
1 file changed
+21
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| 24 | + | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
| |||
110 | 112 | | |
111 | 113 | | |
112 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
0 commit comments