aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2014-03-13 11:01:10 +0100
committerJiri Slaby <jslaby@suse.cz>2014-04-22 15:23:00 +0200
commitb92c32d6144042eddc3c64ae85a5c626d9d9b886 (patch)
treeb91e0033fd714699fa1292c895200041b3838c38
parent57aa0e493741098c16aa3996855a7c9c60b76fc6 (diff)
downloadkgraft-ftrace_cleanup.tar.gz
fentry: Remember module for fentry_pageftrace_cleanup
This is needed for kgraft. Signed-off-by: Jiri Slaby <jslaby@suse.cz>
-rw-r--r--include/linux/fentry.h1
-rw-r--r--lib/fentry.c6
2 files changed, 5 insertions, 2 deletions
diff --git a/include/linux/fentry.h b/include/linux/fentry.h
index d994b9ffc4f850..fa1e38b8099932 100644
--- a/include/linux/fentry.h
+++ b/include/linux/fentry.h
@@ -43,6 +43,7 @@ struct fentry {
struct fentry_page {
struct fentry_page *next;
struct fentry *records;
+ struct module *mod;
int index;
int size;
};
diff --git a/lib/fentry.c b/lib/fentry.c
index 226f4356ce1afe..d8ea5d6e847e5b 100644
--- a/lib/fentry.c
+++ b/lib/fentry.c
@@ -71,7 +71,7 @@ static int fentry_allocate_records(struct fentry_page *pg, int count)
}
static struct fentry_page *
-fentry_allocate_pages(unsigned long num_to_init)
+fentry_allocate_pages(struct module *mod, unsigned long num_to_init)
{
struct fentry_page *start_pg;
struct fentry_page *pg;
@@ -91,6 +91,8 @@ fentry_allocate_pages(unsigned long num_to_init)
* waste as little space as possible.
*/
for (;;) {
+ pg->mod = mod;
+
cnt = fentry_allocate_records(pg, num_to_init);
if (cnt < 0)
goto free_pages;
@@ -217,7 +219,7 @@ static int fentry_process_locs(struct module *mod,
sort(start, count, sizeof(*start),
fentry_cmp_ips, fentry_swap_ips);
- start_pg = fentry_allocate_pages(count);
+ start_pg = fentry_allocate_pages(mod, count);
if (!start_pg)
return -ENOMEM;