Whamcloud - gitweb
LU-6210 utils: Use C99 struct initializers in lfs_hsm_state()
[fs/lustre-release.git] / lustre / utils / lfs.c
index 7531605..f0e8543 100644 (file)
@@ -3258,9 +3258,10 @@ static int mntdf(char *mntdir, char *fsname, char *pool, enum mntdf_flags flags)
        struct obd_statfs stat_buf, sum = { .os_bsize = 1 };
        struct obd_uuid uuid_buf;
        char *poolname = NULL;
-       struct ll_stat_type types[] = { { LL_STATFS_LMV, "MDT" },
-                                       { LL_STATFS_LOV, "OST" },
-                                       { 0, NULL } };
+       struct ll_stat_type types[] = {
+               { .st_op = LL_STATFS_LMV,       .st_name = "MDT" },
+               { .st_op = LL_STATFS_LOV,       .st_name = "OST" },
+               { .st_name = NULL } };
        struct ll_stat_type *tp;
        __u64 ost_ffree = 0;
        __u32 index;
@@ -4596,10 +4597,9 @@ static int lfs_fid2path(int argc, char **argv)
 
 static int lfs_path2fid(int argc, char **argv)
 {
-       struct option     long_opts[] = {
-               {"parents", no_argument, 0, 'p'},
-               {0, 0, 0, 0}
-       };
+       struct option long_opts[] = {
+               { .val = 'p', .name = "parents", .has_arg = no_argument },
+               { .name = NULL } };
        char            **path;
        const char        short_opts[] = "p";
        const char       *sep = "";
@@ -4774,14 +4774,13 @@ static int lfs_hsm_state(int argc, char **argv)
 static int lfs_hsm_change_flags(int argc, char **argv, int mode)
 {
        struct option long_opts[] = {
-               {"lost", 0, 0, 'l'},
-               {"norelease", 0, 0, 'r'},
-               {"noarchive", 0, 0, 'a'},
-               {"archived", 0, 0, 'A'},
-               {"dirty", 0, 0, 'd'},
-               {"exists", 0, 0, 'e'},
-               {0, 0, 0, 0}
-       };
+       { .val = 'A',   .name = "archived",     .has_arg = no_argument },
+       { .val = 'a',   .name = "noarchive",    .has_arg = no_argument },
+       { .val = 'd',   .name = "dirty",        .has_arg = no_argument },
+       { .val = 'e',   .name = "exists",       .has_arg = no_argument },
+       { .val = 'l',   .name = "lost",         .has_arg = no_argument },
+       { .val = 'r',   .name = "norelease",    .has_arg = no_argument },
+       { .name = NULL } };
        char short_opts[] = "lraAde";
        __u64 mask = 0;
        int c, rc;