]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blame - src/patches/suse-2.6.27.31/patches.suse/dm-mpath-add-start-io
Reenabled linux-xen, added patches for Xen Kernel Version 2.6.27.31,
[people/teissler/ipfire-2.x.git] / src / patches / suse-2.6.27.31 / patches.suse / dm-mpath-add-start-io
CommitLineData
2cb7cef9
BS
1From: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
2Subject: dm-mpath: add a path selector interface
3References: FATE#303862,FATE#302108
4
5This patch adds a new hook for dm path selector: start_io.
6Target drivers should call this hook before submitting I/O to
7the selected path.
8Path selectors can use it to start accounting of the I/O.
9(e.g. counting the number of in-flight I/Os.)
10
11The code is based on the patch posted by Stefan Bader:
12https://www.redhat.com/archives/dm-devel/2005-October/msg00050.html
13
14
15Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
16Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
17Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
18Signed-off-by: Hannes Reinecke <hare@suse.de>
19
20Index: linux-2.6.27/drivers/md/dm-mpath.c
21===================================================================
22--- linux-2.6.27.orig/drivers/md/dm-mpath.c
23+++ linux-2.6.27/drivers/md/dm-mpath.c
24@@ -359,6 +359,9 @@ static int map_io(struct multipath *m, s
25
26 mpio->pgpath = pgpath;
27
28+ if (r == DM_MAPIO_REMAPPED && pgpath->pg->ps.type->start_io)
29+ pgpath->pg->ps.type->start_io(&pgpath->pg->ps, &pgpath->path);
30+
31 spin_unlock_irqrestore(&m->lock, flags);
32
33 return r;
34Index: linux-2.6.27/drivers/md/dm-path-selector.h
35===================================================================
36--- linux-2.6.27.orig/drivers/md/dm-path-selector.h
37+++ linux-2.6.27/drivers/md/dm-path-selector.h
38@@ -75,6 +75,7 @@ struct path_selector_type {
39 int (*status) (struct path_selector *ps, struct dm_path *path,
40 status_type_t type, char *result, unsigned int maxlen);
41
42+ int (*start_io) (struct path_selector *ps, struct dm_path *path);
43 int (*end_io) (struct path_selector *ps, struct dm_path *path);
44 };
45