Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 164763
b: refs/heads/master
c: 2ef43ec
h: refs/heads/master
i:
  164761: f80afff
  164759: 09b7329
v: v3
  • Loading branch information
KAMEZAWA Hiroyuki authored and Linus Torvalds committed Sep 23, 2009
1 parent 10493ad commit bfa8c00
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d899bf7b55f503ba7d3d07ed27c3a37e270fa7db
refs/heads/master: 2ef43ec772551e975a6ea7cf22b59c84955aadf9
12 changes: 6 additions & 6 deletions trunk/fs/proc/kcore.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <linux/init.h>
#include <asm/uaccess.h>
#include <asm/io.h>
#include <linux/list.h>

#define CORE_STR "CORE"

Expand Down Expand Up @@ -57,7 +58,7 @@ struct memelfnote
void *data;
};

static struct kcore_list *kclist;
static LIST_HEAD(kclist_head);
static DEFINE_RWLOCK(kclist_lock);

void
Expand All @@ -67,8 +68,7 @@ kclist_add(struct kcore_list *new, void *addr, size_t size)
new->size = size;

write_lock(&kclist_lock);
new->next = kclist;
kclist = new;
list_add_tail(&new->list, &kclist_head);
write_unlock(&kclist_lock);
}

Expand All @@ -80,7 +80,7 @@ static size_t get_kcore_size(int *nphdr, size_t *elf_buflen)
*nphdr = 1; /* PT_NOTE */
size = 0;

for (m=kclist; m; m=m->next) {
list_for_each_entry(m, &kclist_head, list) {
try = kc_vaddr_to_offset((size_t)m->addr + m->size);
if (try > size)
size = try;
Expand Down Expand Up @@ -192,7 +192,7 @@ static void elf_kcore_store_hdr(char *bufp, int nphdr, int dataoff)
nhdr->p_align = 0;

/* setup ELF PT_LOAD program header for every area */
for (m=kclist; m; m=m->next) {
list_for_each_entry(m, &kclist_head, list) {
phdr = (struct elf_phdr *) bufp;
bufp += sizeof(struct elf_phdr);
offset += sizeof(struct elf_phdr);
Expand Down Expand Up @@ -317,7 +317,7 @@ read_kcore(struct file *file, char __user *buffer, size_t buflen, loff_t *fpos)
struct kcore_list *m;

read_lock(&kclist_lock);
for (m=kclist; m; m=m->next) {
list_for_each_entry(m, &kclist_head, list) {
if (start >= m->addr && start < (m->addr+m->size))
break;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/linux/proc_fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ struct proc_dir_entry {
};

struct kcore_list {
struct kcore_list *next;
struct list_head list;
unsigned long addr;
size_t size;
};
Expand Down

0 comments on commit bfa8c00

Please sign in to comment.