diff options
author | Christoph Hellwig <hch@lst.de> | 2007-05-08 03:34:11 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-08 14:15:19 -0400 |
commit | b0bb501651b467096723dcfcf4565d910a2aadf8 (patch) | |
tree | ed7a6fef07dc5a942f04d403dbe0466301688306 /kernel | |
parent | 41ac8df9d5b731a4dd8f1f4e5a9de6ef8768383d (diff) |
kprobes: use hlist_for_each_entry
Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: Prasanna S Panchamukhi <prasanna@in.ibm.com>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/kprobes.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/kernel/kprobes.c b/kernel/kprobes.c index bee29bde6adf..993452324a1f 100644 --- a/kernel/kprobes.c +++ b/kernel/kprobes.c | |||
@@ -134,8 +134,7 @@ kprobe_opcode_t __kprobes *get_insn_slot(void) | |||
134 | struct hlist_node *pos; | 134 | struct hlist_node *pos; |
135 | 135 | ||
136 | retry: | 136 | retry: |
137 | hlist_for_each(pos, &kprobe_insn_pages) { | 137 | hlist_for_each_entry(kip, pos, &kprobe_insn_pages, hlist) { |
138 | kip = hlist_entry(pos, struct kprobe_insn_page, hlist); | ||
139 | if (kip->nused < INSNS_PER_PAGE) { | 138 | if (kip->nused < INSNS_PER_PAGE) { |
140 | int i; | 139 | int i; |
141 | for (i = 0; i < INSNS_PER_PAGE; i++) { | 140 | for (i = 0; i < INSNS_PER_PAGE; i++) { |
@@ -214,9 +213,8 @@ static int __kprobes collect_garbage_slots(void) | |||
214 | if (check_safety() != 0) | 213 | if (check_safety() != 0) |
215 | return -EAGAIN; | 214 | return -EAGAIN; |
216 | 215 | ||
217 | hlist_for_each_safe(pos, next, &kprobe_insn_pages) { | 216 | hlist_for_each_entry_safe(kip, pos, next, &kprobe_insn_pages, hlist) { |
218 | int i; | 217 | int i; |
219 | kip = hlist_entry(pos, struct kprobe_insn_page, hlist); | ||
220 | if (kip->ngarbage == 0) | 218 | if (kip->ngarbage == 0) |
221 | continue; | 219 | continue; |
222 | kip->ngarbage = 0; /* we will collect all garbages */ | 220 | kip->ngarbage = 0; /* we will collect all garbages */ |
@@ -235,8 +233,7 @@ void __kprobes free_insn_slot(kprobe_opcode_t * slot, int dirty) | |||
235 | struct kprobe_insn_page *kip; | 233 | struct kprobe_insn_page *kip; |
236 | struct hlist_node *pos; | 234 | struct hlist_node *pos; |
237 | 235 | ||
238 | hlist_for_each(pos, &kprobe_insn_pages) { | 236 | hlist_for_each_entry(kip, pos, &kprobe_insn_pages, hlist) { |
239 | kip = hlist_entry(pos, struct kprobe_insn_page, hlist); | ||
240 | if (kip->insns <= slot && | 237 | if (kip->insns <= slot && |
241 | slot < kip->insns + (INSNS_PER_PAGE * MAX_INSN_SIZE)) { | 238 | slot < kip->insns + (INSNS_PER_PAGE * MAX_INSN_SIZE)) { |
242 | int i = (slot - kip->insns) / MAX_INSN_SIZE; | 239 | int i = (slot - kip->insns) / MAX_INSN_SIZE; |