X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Futils%2Fobd.c;h=39bb35fbaf0a355237ddb58bd16cd158ffcbf2d6;hb=7524da20e134f6bbafb2a10aadc89852c6cd236d;hp=5331898fe1991bc88c5fed8cd5f74fdb562a2845;hpb=f4e95a4429e9f6a8aa8170984bc6f8cd14cd5db0;p=fs%2Flustre-release.git diff --git a/lustre/utils/obd.c b/lustre/utils/obd.c index 5331898..39bb35f 100644 --- a/lustre/utils/obd.c +++ b/lustre/utils/obd.c @@ -2656,14 +2656,13 @@ static int llog_cancel_parse_optional(int argc, char **argv, struct obd_ioctl_data *data) { int cOpt; - const char *const short_options = "c:l:i:h"; - const struct option long_options[] = { - {"catalog", required_argument, NULL, 'c'}, - {"log_id", required_argument, NULL, 'l'}, - {"log_idx", required_argument, NULL, 'i'}, - {"help", no_argument, NULL, 'h'}, - {NULL, 0, NULL, 0} - }; + const char *const short_opts = "c:l:i:h"; + const struct option long_opts[] = { + { .val = 'c', .name = "catalog", .has_arg = required_argument }, + { .val = 'h', .name = "help", .has_arg = no_argument }, + { .val = 'i', .name = "log_idx", .has_arg = required_argument }, + { .val = 'l', .name = "log_id", .has_arg = required_argument }, + { .name = NULL } }; /* sanity check */ if (!data || argc <= 1) { @@ -2671,8 +2670,8 @@ static int llog_cancel_parse_optional(int argc, char **argv, } /*now process command line arguments*/ - while ((cOpt = getopt_long(argc, argv, short_options, - long_options, NULL)) != -1) { + while ((cOpt = getopt_long(argc, argv, short_opts, + long_opts, NULL)) != -1) { switch (cOpt) { case 'c': data->ioc_inllen1 = strlen(optarg) + 1; @@ -3439,28 +3438,15 @@ int jt_nodemap_add_range(int argc, char **argv) int rc = 0; int c; - static struct option long_options[] = { - { - .name = "name", - .has_arg = required_argument, - .flag = 0, - .val = 'n', - }, - { - .name = "range", - .has_arg = required_argument, - .flag = 0, - .val = 'r', - }, - { - NULL - } - }; + static struct option long_opts[] = { + { .val = 'n', .name = "name", .has_arg = required_argument }, + { .val = 'r', .name = "range", .has_arg = required_argument }, + { .name = NULL } }; INIT_LIST_HEAD(&nidlist); while ((c = getopt_long(argc, argv, "n:r:", - long_options, NULL)) != -1) { + long_opts, NULL)) != -1) { switch (c) { case 'n': nodemap_name = optarg;