aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
Diffstat (limited to 'block')
-rw-r--r--block/blktrace.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/block/blktrace.c b/block/blktrace.c
index 7ae87cc4a163..8d3a27780260 100644
--- a/block/blktrace.c
+++ b/block/blktrace.c
@@ -79,16 +79,17 @@ void __trace_note_message(struct blk_trace *bt, const char *fmt, ...)
79{ 79{
80 int n; 80 int n;
81 va_list args; 81 va_list args;
82 unsigned long flags;
82 char *buf; 83 char *buf;
83 84
84 preempt_disable(); 85 local_irq_save(flags);
85 buf = per_cpu_ptr(bt->msg_data, smp_processor_id()); 86 buf = per_cpu_ptr(bt->msg_data, smp_processor_id());
86 va_start(args, fmt); 87 va_start(args, fmt);
87 n = vscnprintf(buf, BLK_TN_MAX_MSG, fmt, args); 88 n = vscnprintf(buf, BLK_TN_MAX_MSG, fmt, args);
88 va_end(args); 89 va_end(args);
89 90
90 trace_note(bt, 0, BLK_TN_MESSAGE, buf, n); 91 trace_note(bt, 0, BLK_TN_MESSAGE, buf, n);
91 preempt_enable(); 92 local_irq_restore(flags);
92} 93}
93EXPORT_SYMBOL_GPL(__trace_note_message); 94EXPORT_SYMBOL_GPL(__trace_note_message);
94 95
@@ -158,10 +159,7 @@ void __blk_add_trace(struct blk_trace *bt, sector_t sector, int bytes,
158 /* 159 /*
159 * A word about the locking here - we disable interrupts to reserve 160 * A word about the locking here - we disable interrupts to reserve
160 * some space in the relay per-cpu buffer, to prevent an irq 161 * some space in the relay per-cpu buffer, to prevent an irq
161 * from coming in and stepping on our toes. Once reserved, it's 162 * from coming in and stepping on our toes.
162 * enough to get preemption disabled to prevent read of this data
163 * before we are through filling it. get_cpu()/put_cpu() does this
164 * for us
165 */ 163 */
166 local_irq_save(flags); 164 local_irq_save(flags);
167 165