[dm-devel] [DM-MPATH] multipath_ctr() and friends - cleanup
Michał Mirosław
mirq-linux at rere.qmqm.pl
Mon Aug 7 14:14:06 UTC 2006
After initialising m->ti, there's no need to pass it in subsequent calls
to static functions used for parsing parameters.
This patch depends on my previous patch [DM-MPATH] BUG/OOPS fix.
Signed-off-by: Michał Mirosław <mirq-linux at rere.qmqm.pl>
diff -urN linux-2.6.17.8-routes-esfq/drivers/md/dm-mpath.c linux-2.6.17.8-routes-esfq-mq/drivers/md/dm-mpath.c
--- linux-2.6.17.8-routes-esfq/drivers/md/dm-mpath.c 2006-07-05 18:29:10.000000000 +0200
+++ linux-2.6.17.8-routes-esfq-mq/drivers/md/dm-mpath.c 2006-08-07 15:25:07.000000000 +0200
@@ -558,8 +558,7 @@
}
static struct priority_group *parse_priority_group(struct arg_set *as,
- struct multipath *m,
- struct dm_target *ti)
+ struct multipath *m)
{
static struct param _params[] = {
{1, 1024, ESTR("invalid number of paths")},
@@ -569,6 +568,7 @@
int r;
unsigned i, nr_selector_args, nr_params;
struct priority_group *pg;
+ struct dm_target *ti = m->ti;
if (as->argc < 2) {
as->argc = 0;
@@ -625,12 +625,12 @@
return NULL;
}
-static int parse_hw_handler(struct arg_set *as, struct multipath *m,
- struct dm_target *ti)
+static int parse_hw_handler(struct arg_set *as, struct multipath *m)
{
int r;
struct hw_handler_type *hwht;
unsigned hw_argc;
+ struct dm_target *ti = m->ti;
static struct param _params[] = {
{0, 1024, ESTR("invalid number of hardware handler args")},
@@ -662,11 +662,11 @@
return 0;
}
-static int parse_features(struct arg_set *as, struct multipath *m,
- struct dm_target *ti)
+static int parse_features(struct arg_set *as, struct multipath *m)
{
int r;
unsigned argc;
+ struct dm_target *ti = m->ti;
static struct param _params[] = {
{0, 1, ESTR("invalid number of feature args")},
@@ -713,11 +713,11 @@
m->ti = ti;
- r = parse_features(&as, m, ti);
+ r = parse_features(&as, m);
if (r)
goto bad;
- r = parse_hw_handler(&as, m, ti);
+ r = parse_hw_handler(&as, m);
if (r)
goto bad;
@@ -733,7 +733,7 @@
while (as.argc) {
struct priority_group *pg;
- pg = parse_priority_group(&as, m, ti);
+ pg = parse_priority_group(&as, m);
if (!pg) {
r = -EINVAL;
goto bad;
More information about the dm-devel
mailing list