diff options
Diffstat (limited to 'drivers/md/dm-ps-service-time.c')
| -rw-r--r-- | drivers/md/dm-ps-service-time.c | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/drivers/md/dm-ps-service-time.c b/drivers/md/dm-ps-service-time.c index 9cfda665e9eb..0543fe7969c4 100644 --- a/drivers/md/dm-ps-service-time.c +++ b/drivers/md/dm-ps-service-time.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2007-2009 NEC Corporation. All Rights Reserved. * @@ -30,8 +31,8 @@ struct selector { struct path_info { struct list_head list; struct dm_path *path; - unsigned repeat_count; - unsigned relative_throughput; + unsigned int repeat_count; + unsigned int relative_throughput; atomic_t in_flight_size; /* Total size of in-flight I/Os */ }; @@ -48,7 +49,7 @@ static struct selector *alloc_selector(void) return s; } -static int st_create(struct path_selector *ps, unsigned argc, char **argv) +static int st_create(struct path_selector *ps, unsigned int argc, char **argv) { struct selector *s = alloc_selector(); @@ -80,9 +81,9 @@ static void st_destroy(struct path_selector *ps) } static int st_status(struct path_selector *ps, struct dm_path *path, - status_type_t type, char *result, unsigned maxlen) + status_type_t type, char *result, unsigned int maxlen) { - unsigned sz = 0; + unsigned int sz = 0; struct path_info *pi; if (!path) @@ -99,6 +100,9 @@ static int st_status(struct path_selector *ps, struct dm_path *path, DMEMIT("%u %u ", pi->repeat_count, pi->relative_throughput); break; + case STATUSTYPE_IMA: + result[0] = '\0'; + break; } } @@ -110,22 +114,21 @@ static int st_add_path(struct path_selector *ps, struct dm_path *path, { struct selector *s = ps->context; struct path_info *pi; - unsigned repeat_count = ST_MIN_IO; - unsigned relative_throughput = 1; + unsigned int repeat_count = ST_MIN_IO; + unsigned int relative_throughput = 1; char dummy; unsigned long flags; /* * Arguments: [<repeat_count> [<relative_throughput>]] - * <repeat_count>: The number of I/Os before switching path. - * If not given, default (ST_MIN_IO) is used. - * <relative_throughput>: The relative throughput value of + * <repeat_count>: The number of I/Os before switching path. + * If not given, default (ST_MIN_IO) is used. + * <relative_throughput>: The relative throughput value of * the path among all paths in the path-group. - * The valid range: 0-<ST_MAX_RELATIVE_THROUGHPUT> + * The valid range: 0-<ST_MAX_RELATIVE_THROUGHPUT> * If not given, minimum value '1' is used. * If '0' is given, the path isn't selected while - * other paths having a positive value are - * available. + * other paths having a positive value are available. */ if (argc > 2) { *error = "service-time ps: incorrect number of arguments"; @@ -338,8 +341,10 @@ static int __init dm_st_init(void) { int r = dm_register_path_selector(&st_ps); - if (r < 0) + if (r < 0) { DMERR("register failed %d", r); + return r; + } DMINFO("version " ST_VERSION " loaded"); @@ -348,10 +353,7 @@ static int __init dm_st_init(void) static void __exit dm_st_exit(void) { - int r = dm_unregister_path_selector(&st_ps); - - if (r < 0) - DMERR("unregister failed %d", r); + dm_unregister_path_selector(&st_ps); } module_init(dm_st_init); |
