diff options
author | David S. Miller <davem@davemloft.net> | 2008-06-10 05:22:26 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-06-10 05:22:26 -0400 |
commit | 65b53e4cc90e59936733b3b95b9451d2ca47528d (patch) | |
tree | 29932718192962671c48c3fd1ea017a6112459e8 /block/blktrace.c | |
parent | 788c0a53164c05c5ccdb1472474372b72ba74644 (diff) | |
parent | 2e761e0532a784816e7e822dbaaece8c5d4be14d (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
drivers/net/tg3.c
drivers/net/wireless/rt2x00/rt2x00dev.c
net/mac80211/ieee80211_i.h
Diffstat (limited to 'block/blktrace.c')
-rw-r--r-- | block/blktrace.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/block/blktrace.c b/block/blktrace.c index b2cbb4e5d767..7ae87cc4a163 100644 --- a/block/blktrace.c +++ b/block/blktrace.c | |||
@@ -75,6 +75,23 @@ static void trace_note_time(struct blk_trace *bt) | |||
75 | local_irq_restore(flags); | 75 | local_irq_restore(flags); |
76 | } | 76 | } |
77 | 77 | ||
78 | void __trace_note_message(struct blk_trace *bt, const char *fmt, ...) | ||
79 | { | ||
80 | int n; | ||
81 | va_list args; | ||
82 | char *buf; | ||
83 | |||
84 | preempt_disable(); | ||
85 | buf = per_cpu_ptr(bt->msg_data, smp_processor_id()); | ||
86 | va_start(args, fmt); | ||
87 | n = vscnprintf(buf, BLK_TN_MAX_MSG, fmt, args); | ||
88 | va_end(args); | ||
89 | |||
90 | trace_note(bt, 0, BLK_TN_MESSAGE, buf, n); | ||
91 | preempt_enable(); | ||
92 | } | ||
93 | EXPORT_SYMBOL_GPL(__trace_note_message); | ||
94 | |||
78 | static int act_log_check(struct blk_trace *bt, u32 what, sector_t sector, | 95 | static int act_log_check(struct blk_trace *bt, u32 what, sector_t sector, |
79 | pid_t pid) | 96 | pid_t pid) |
80 | { | 97 | { |
@@ -232,6 +249,7 @@ static void blk_trace_cleanup(struct blk_trace *bt) | |||
232 | debugfs_remove(bt->dropped_file); | 249 | debugfs_remove(bt->dropped_file); |
233 | blk_remove_tree(bt->dir); | 250 | blk_remove_tree(bt->dir); |
234 | free_percpu(bt->sequence); | 251 | free_percpu(bt->sequence); |
252 | free_percpu(bt->msg_data); | ||
235 | kfree(bt); | 253 | kfree(bt); |
236 | } | 254 | } |
237 | 255 | ||
@@ -346,6 +364,10 @@ int do_blk_trace_setup(struct request_queue *q, char *name, dev_t dev, | |||
346 | if (!bt->sequence) | 364 | if (!bt->sequence) |
347 | goto err; | 365 | goto err; |
348 | 366 | ||
367 | bt->msg_data = __alloc_percpu(BLK_TN_MAX_MSG); | ||
368 | if (!bt->msg_data) | ||
369 | goto err; | ||
370 | |||
349 | ret = -ENOENT; | 371 | ret = -ENOENT; |
350 | dir = blk_create_tree(buts->name); | 372 | dir = blk_create_tree(buts->name); |
351 | if (!dir) | 373 | if (!dir) |
@@ -392,6 +414,7 @@ err: | |||
392 | if (bt->dropped_file) | 414 | if (bt->dropped_file) |
393 | debugfs_remove(bt->dropped_file); | 415 | debugfs_remove(bt->dropped_file); |
394 | free_percpu(bt->sequence); | 416 | free_percpu(bt->sequence); |
417 | free_percpu(bt->msg_data); | ||
395 | if (bt->rchan) | 418 | if (bt->rchan) |
396 | relay_close(bt->rchan); | 419 | relay_close(bt->rchan); |
397 | kfree(bt); | 420 | kfree(bt); |