From: Hannes Reinecke Date: Tue, 3 May 2011 11:47:13 +0000 (+0200) Subject: Make status variable local X-Git-Tag: upstream/0.5.0~106^2~69 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=44f79b5ba75300afd8c86efa2c7170813c4288d1;p=platform%2Fupstream%2Fmultipath-tools.git Make status variable local The 'status' structure field in struct multipath can also be made local. Signed-off-by: Hannes Reinecke --- diff --git a/libmultipath/devmapper.c b/libmultipath/devmapper.c index 5624bb0..131930c 100644 --- a/libmultipath/devmapper.c +++ b/libmultipath/devmapper.c @@ -831,9 +831,6 @@ dm_get_maps (vector mp) if (dm_get_map(names->name, &mpp->size, NULL)) goto out1; - if (dm_get_status(names->name, mpp->status)) - goto out1; - dm_get_uuid(names->name, mpp->wwid); dm_get_info(names->name, &mpp->dmi); } diff --git a/libmultipath/structs.h b/libmultipath/structs.h index 02fed46..e793028 100644 --- a/libmultipath/structs.h +++ b/libmultipath/structs.h @@ -191,7 +191,6 @@ struct multipath { unsigned long long size; vector paths; vector pg; - char status[PARAMS_SIZE]; struct dm_info * dmi; /* configlet pointers */ diff --git a/libmultipath/structs_vec.c b/libmultipath/structs_vec.c index 9bcc8bb..8349c17 100644 --- a/libmultipath/structs_vec.c +++ b/libmultipath/structs_vec.c @@ -259,13 +259,15 @@ update_multipath_table (struct multipath *mpp, vector pathvec) static int update_multipath_status (struct multipath *mpp) { + char status[PARAMS_SIZE] = {0}; + if (!mpp) return 1; - if(dm_get_status(mpp->alias, mpp->status)) + if(dm_get_status(mpp->alias, status)) return 1; - if (disassemble_status(mpp->status, mpp)) + if (disassemble_status(status, mpp)) return 1; return 0; diff --git a/multipath/main.c b/multipath/main.c index fc676dc..5d718e7 100644 --- a/multipath/main.c +++ b/multipath/main.c @@ -160,7 +160,7 @@ get_dm_mpvec (vector curmp, vector pathvec, char * refwwid) { int i; struct multipath * mpp; - char params[PARAMS_SIZE]; + char params[PARAMS_SIZE], status[PARAMS_SIZE]; if (dm_get_maps(curmp)) return 1; @@ -180,7 +180,8 @@ get_dm_mpvec (vector curmp, vector pathvec, char * refwwid) dm_get_map(mpp->alias, &mpp->size, params); condlog(3, "params = %s", params); - condlog(3, "status = %s", mpp->status); + dm_get_status(mpp->alias, status); + condlog(3, "status = %s", status); disassemble_map(pathvec, params, mpp); @@ -195,7 +196,7 @@ get_dm_mpvec (vector curmp, vector pathvec, char * refwwid) if (conf->list > 1) mpp->bestpg = select_path_group(mpp); - disassemble_status(mpp->status, mpp); + disassemble_status(status, mpp); if (conf->list) print_multipath_topology(mpp, conf->verbosity);