diff mbox

[RFC,2/2] dm: only initialize full request_queue for request-based device

Message ID 4BED049C.5040409@ct.jp.nec.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Kiyoshi Ueda May 14, 2010, 8:06 a.m. UTC
None
diff mbox

Patch

Index: 2.6.34-rc7/drivers/md/dm.c
===================================================================
--- 2.6.34-rc7.orig/drivers/md/dm.c
+++ 2.6.34-rc7/drivers/md/dm.c
@@ -2410,6 +2410,14 @@  struct dm_table *dm_swap_table(struct ma
 		goto out;
 	}
 
+	/* drop elevator when the device type is decided as bio-based */
+	if (!md->map && dm_table_get_type(table) == DM_TYPE_BIO_BASED) {
+		elv_unregister_queue(md->queue);
+		elevator_exit(md->queue->elevator);
+		md->queue->request_fn = NULL;
+		md->queue->elevator = NULL;
+	}
+
 	map = __bind(md, table, &limits);
 
 out: