diff options
Diffstat (limited to 'fs/f2fs/trace.c')
-rw-r--r-- | fs/f2fs/trace.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/fs/f2fs/trace.c b/fs/f2fs/trace.c index 19f5216b9b9c..92fa38a47e63 100644 --- a/fs/f2fs/trace.c +++ b/fs/f2fs/trace.c | |||
@@ -15,7 +15,8 @@ | |||
15 | #include "f2fs.h" | 15 | #include "f2fs.h" |
16 | #include "trace.h" | 16 | #include "trace.h" |
17 | 17 | ||
18 | RADIX_TREE(pids, GFP_NOIO); | 18 | RADIX_TREE(pids, GFP_ATOMIC); |
19 | spinlock_t pids_lock; | ||
19 | struct last_io_info last_io; | 20 | struct last_io_info last_io; |
20 | 21 | ||
21 | static inline void __print_last_io(void) | 22 | static inline void __print_last_io(void) |
@@ -58,9 +59,13 @@ void f2fs_trace_pid(struct page *page) | |||
58 | 59 | ||
59 | page->private = pid; | 60 | page->private = pid; |
60 | 61 | ||
62 | if (radix_tree_preload(GFP_NOFS)) | ||
63 | return; | ||
64 | |||
65 | spin_lock(&pids_lock); | ||
61 | p = radix_tree_lookup(&pids, pid); | 66 | p = radix_tree_lookup(&pids, pid); |
62 | if (p == current) | 67 | if (p == current) |
63 | return; | 68 | goto out; |
64 | if (p) | 69 | if (p) |
65 | radix_tree_delete(&pids, pid); | 70 | radix_tree_delete(&pids, pid); |
66 | 71 | ||
@@ -69,7 +74,9 @@ void f2fs_trace_pid(struct page *page) | |||
69 | trace_printk("%3x:%3x %4x %-16s\n", | 74 | trace_printk("%3x:%3x %4x %-16s\n", |
70 | MAJOR(inode->i_sb->s_dev), MINOR(inode->i_sb->s_dev), | 75 | MAJOR(inode->i_sb->s_dev), MINOR(inode->i_sb->s_dev), |
71 | pid, current->comm); | 76 | pid, current->comm); |
72 | 77 | out: | |
78 | spin_unlock(&pids_lock); | ||
79 | radix_tree_preload_end(); | ||
73 | } | 80 | } |
74 | 81 | ||
75 | void f2fs_trace_ios(struct page *page, struct f2fs_io_info *fio, int flush) | 82 | void f2fs_trace_ios(struct page *page, struct f2fs_io_info *fio, int flush) |
@@ -108,3 +115,8 @@ void f2fs_trace_ios(struct page *page, struct f2fs_io_info *fio, int flush) | |||
108 | last_io.len = 1; | 115 | last_io.len = 1; |
109 | return; | 116 | return; |
110 | } | 117 | } |
118 | |||
119 | void f2fs_build_trace_ios(void) | ||
120 | { | ||
121 | spin_lock_init(&pids_lock); | ||
122 | } | ||