Эх сурвалжийг харах

[PATCH] ifdef blktrace debugging fields

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Acked-by: Jens Axboe <axboe@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Alexey Dobriyan 18 жил өмнө
parent
commit
6c5c934153

+ 4 - 2
block/blktrace.c

@@ -450,8 +450,10 @@ int blk_trace_ioctl(struct block_device *bdev, unsigned cmd, char __user *arg)
  **/
  **/
 void blk_trace_shutdown(request_queue_t *q)
 void blk_trace_shutdown(request_queue_t *q)
 {
 {
-	blk_trace_startstop(q, 0);
-	blk_trace_remove(q);
+	if (q->blk_trace) {
+		blk_trace_startstop(q, 0);
+		blk_trace_remove(q);
+	}
 }
 }
 
 
 /*
 /*

+ 1 - 2
block/ll_rw_blk.c

@@ -1847,8 +1847,7 @@ static void blk_release_queue(struct kobject *kobj)
 	if (q->queue_tags)
 	if (q->queue_tags)
 		__blk_queue_free_tags(q);
 		__blk_queue_free_tags(q);
 
 
-	if (q->blk_trace)
-		blk_trace_shutdown(q);
+	blk_trace_shutdown(q);
 
 
 	kmem_cache_free(requestq_cachep, q);
 	kmem_cache_free(requestq_cachep, q);
 }
 }

+ 2 - 2
include/linux/blkdev.h

@@ -417,9 +417,9 @@ struct request_queue
 	unsigned int		sg_timeout;
 	unsigned int		sg_timeout;
 	unsigned int		sg_reserved_size;
 	unsigned int		sg_reserved_size;
 	int			node;
 	int			node;
-
+#ifdef CONFIG_BLK_DEV_IO_TRACE
 	struct blk_trace	*blk_trace;
 	struct blk_trace	*blk_trace;
-
+#endif
 	/*
 	/*
 	 * reserved for flush operations
 	 * reserved for flush operations
 	 */
 	 */

+ 2 - 1
include/linux/sched.h

@@ -784,8 +784,9 @@ struct task_struct {
 	struct prio_array *array;
 	struct prio_array *array;
 
 
 	unsigned short ioprio;
 	unsigned short ioprio;
+#ifdef CONFIG_BLK_DEV_IO_TRACE
 	unsigned int btrace_seq;
 	unsigned int btrace_seq;
-
+#endif
 	unsigned long sleep_avg;
 	unsigned long sleep_avg;
 	unsigned long long timestamp, last_ran;
 	unsigned long long timestamp, last_ran;
 	unsigned long long sched_time; /* sched_clock time spent running */
 	unsigned long long sched_time; /* sched_clock time spent running */

+ 2 - 0
kernel/fork.c

@@ -183,7 +183,9 @@ static struct task_struct *dup_task_struct(struct task_struct *orig)
 	/* One for us, one for whoever does the "release_task()" (usually parent) */
 	/* One for us, one for whoever does the "release_task()" (usually parent) */
 	atomic_set(&tsk->usage,2);
 	atomic_set(&tsk->usage,2);
 	atomic_set(&tsk->fs_excl, 0);
 	atomic_set(&tsk->fs_excl, 0);
+#ifdef CONFIG_BLK_DEV_IO_TRACE
 	tsk->btrace_seq = 0;
 	tsk->btrace_seq = 0;
+#endif
 	tsk->splice_pipe = NULL;
 	tsk->splice_pipe = NULL;
 	return tsk;
 	return tsk;
 }
 }