#include "f2fs.h"
#include "trace.h"
-RADIX_TREE(pids, GFP_NOIO);
+RADIX_TREE(pids, GFP_ATOMIC);
+spinlock_t pids_lock;
struct last_io_info last_io;
static inline void __print_last_io(void)
page->private = pid;
+ if (radix_tree_preload(GFP_NOFS))
+ return;
+
+ spin_lock(&pids_lock);
p = radix_tree_lookup(&pids, pid);
if (p == current)
- return;
+ goto out;
if (p)
radix_tree_delete(&pids, pid);
trace_printk("%3x:%3x %4x %-16s\n",
MAJOR(inode->i_sb->s_dev), MINOR(inode->i_sb->s_dev),
pid, current->comm);
-
+out:
+ spin_unlock(&pids_lock);
+ radix_tree_preload_end();
}
void f2fs_trace_ios(struct page *page, struct f2fs_io_info *fio, int flush)
last_io.len = 1;
return;
}
+
+void f2fs_build_trace_ios(void)
+{
+ spin_lock_init(&pids_lock);
+}
extern void f2fs_trace_pid(struct page *);
extern void f2fs_trace_ios(struct page *, struct f2fs_io_info *, int);
+extern void f2fs_build_trace_ios(void);
#else
#define f2fs_trace_pid(p)
#define f2fs_trace_ios(p, i, n)
+#define f2fs_build_trace_ios()
#endif
#endif /* __F2FS_TRACE_H__ */