14 #include <linux/slab.h>
15 #include <linux/module.h>
17 #define DM_MSG_PREFIX "multipath service-time"
19 #define ST_MAX_RELATIVE_THROUGHPUT 100
20 #define ST_MAX_RELATIVE_THROUGHPUT_SHIFT 7
21 #define ST_MAX_INFLIGHT_SIZE ((size_t)-1 >> ST_MAX_RELATIVE_THROUGHPUT_SHIFT)
22 #define ST_VERSION "0.2.0"
37 static struct selector *alloc_selector(
void)
60 static void free_paths(
struct list_head *paths)
107 int argc,
char **argv,
char **
error)
128 *error =
"service-time ps: incorrect number of arguments";
132 if (argc && (
sscanf(argv[0],
"%u%c", &repeat_count, &dummy) != 1)) {
133 *error =
"service-time ps: invalid repeat count";
138 (
sscanf(argv[1],
"%u%c", &relative_throughput, &dummy) != 1 ||
140 *error =
"service-time ps: invalid relative_throughput value";
147 *error =
"service-time ps: Error allocating path context";
199 size_t sz1, sz2, st1, st2;
259 unsigned *repeat_count,
size_t nr_bytes)
271 if (!best || (st_compare_load(pi, best, nr_bytes) < 0))
277 *repeat_count = best->repeat_count;
303 .name =
"service-time",
308 .destroy = st_destroy,
310 .add_path = st_add_path,
311 .fail_path = st_fail_path,
312 .reinstate_path = st_reinstate_path,
313 .select_path = st_select_path,
314 .start_io = st_start_io,
318 static int __init dm_st_init(
void)
323 DMERR(
"register failed %d", r);
330 static void __exit dm_st_exit(
void)
335 DMERR(
"unregister failed %d", r);