diff options
author | Jes Sorensen <Jes.Sorensen@gmail.com> | 2017-04-05 15:06:24 -0400 |
---|---|---|
committer | Jes Sorensen <Jes.Sorensen@gmail.com> | 2017-04-05 15:06:24 -0400 |
commit | 700483a22340f2f25a761acd08e6db87e92d90e9 (patch) | |
tree | 57f2028d937be51fdf9ebc42d04582614e75440c /util.c | |
parent | f5c924f441cedce2a13c48b12be35250560ee575 (diff) | |
download | mdadm-700483a22340f2f25a761acd08e6db87e92d90e9.tar.gz |
util/set_array_info: Simplify code since md_get_version returns a constant
md_get_version() always returns (0 * 1000) + (90 * 100) + 3, so no
point in calling it.
Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com>
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 19 |
1 files changed, 8 insertions, 11 deletions
@@ -1858,22 +1858,19 @@ int set_array_info(int mdfd, struct supertype *st, struct mdinfo *info) * This varies between externally managed arrays * and older kernels */ - int vers = md_get_version(mdfd); + mdu_array_info_t inf; int rv; #ifndef MDASSEMBLE if (st->ss->external) - rv = sysfs_set_array(info, vers); - else + return sysfs_set_array(info, 9003); #endif - if ((vers % 100) >= 1) { /* can use different versions */ - mdu_array_info_t inf; - memset(&inf, 0, sizeof(inf)); - inf.major_version = info->array.major_version; - inf.minor_version = info->array.minor_version; - rv = md_set_array_info(mdfd, &inf); - } else - rv = md_set_array_info(mdfd, NULL); + + memset(&inf, 0, sizeof(inf)); + inf.major_version = info->array.major_version; + inf.minor_version = info->array.minor_version; + rv = md_set_array_info(mdfd, &inf); + return rv; } |