[dm-devel] [PATCH 5/17] bottom-layer barrier support

Mikulas Patocka mpatocka at redhat.com
Mon Apr 20 07:55:08 UTC 2009


dm-target-flush-option.patch

Two variables for targets.

Target driver can change num_flush_requests and signal that it wants
to receive flushes. It receives num_flush_requests flushes, individual
flushes are differentiated by map_info->flush_request (which goes from
0 to num_flush_requests - 1).

Old targets without flush support won't receive any flush requests.

Signed-off-by: Mikulas Patocka <mpatocka at redhat.com>

---
 include/linux/device-mapper.h |   11 +++++++++++
 1 file changed, 11 insertions(+)

Index: linux-2.6.30-rc1-devel/include/linux/device-mapper.h
===================================================================
--- linux-2.6.30-rc1-devel.orig/include/linux/device-mapper.h	2009-04-10 06:32:54.000000000 +0200
+++ linux-2.6.30-rc1-devel/include/linux/device-mapper.h	2009-04-10 06:33:26.000000000 +0200
@@ -21,6 +21,7 @@ typedef enum { STATUSTYPE_INFO, STATUSTY
 union map_info {
 	void *ptr;
 	unsigned long long ll;
+	unsigned flush_request;
 };
 
 /*
@@ -168,6 +169,16 @@ struct dm_target {
 	sector_t split_io;
 
 	/*
+	 * A number of zero-length barrier requests that will be submitted
+	 * to the target for the purpose of flushing cache.
+	 *
+	 * The request number will be placed in union map_info->flush_request.
+	 * It is a responsibility of the target driver to remap these requests
+	 * to the real underlying devices.
+	 */
+	unsigned num_flush_requests;
+
+	/*
 	 * These are automatically filled in by
 	 * dm_table_get_device.
 	 */




More information about the dm-devel mailing list