@@ -546,7 +546,12 @@ static int multipath_clone_and_map(struct dm_target *ti, struct request *rq,
clone->cmd_flags |= REQ_FAILFAST_TRANSPORT;
*__clone = clone;
- if (pgpath->pg->ps.type->start_io)
+ if (pgpath->pg->ps.type->start_io_rq)
+ pgpath->pg->ps.type->start_io_rq(&pgpath->pg->ps,
+ &pgpath->path,
+ clone ?: rq,
+ nr_bytes);
+ else if (pgpath->pg->ps.type->start_io)
pgpath->pg->ps.type->start_io(&pgpath->pg->ps,
&pgpath->path,
nr_bytes);
@@ -1614,7 +1619,10 @@ static int multipath_end_io(struct dm_target *ti, struct request *clone,
if (pgpath) {
struct path_selector *ps = &pgpath->pg->ps;
- if (ps->type->end_io)
+ if (ps->type->end_io_rq)
+ ps->type->end_io_rq(ps, &pgpath->path,
+ clone, mpio->nr_bytes);
+ else if (ps->type->end_io)
ps->type->end_io(ps, &pgpath->path, mpio->nr_bytes);
}
@@ -12,6 +12,7 @@
#ifndef DM_PATH_SELECTOR_H
#define DM_PATH_SELECTOR_H
+#include <linux/blkdev.h>
#include <linux/device-mapper.h>
#include "dm-mpath.h"
@@ -75,6 +76,11 @@ struct path_selector_type {
size_t nr_bytes);
int (*end_io) (struct path_selector *ps, struct dm_path *path,
size_t nr_bytes);
+
+ int (*start_io_rq)(struct path_selector *ps, struct dm_path *path,
+ const struct request *rq, size_t nr_bytes);
+ int (*end_io_rq)(struct path_selector *ps, struct dm_path *path,
+ const struct request *rq, size_t nr_bytes);
};
/* Register a path selector */