vol: Blank opts in VOptDefaults 80/14280/2
authorAndrew Deason <adeason@sinenomine.net>
Fri, 29 May 2020 17:57:50 +0000 (12:57 -0500)
committerBenjamin Kaduk <kaduk@mit.edu>
Fri, 24 Jul 2020 16:05:51 +0000 (12:05 -0400)
Instead of needing to set every single field in the 'opts' structure
individually, blank the whole thing to make sure the entire struct is
initialized. Remove the now-redundant lines that initialize various
items to 0.

Change-Id: I799cdb55becd66a8f3d6ec2f81338843038d0abd
Reviewed-on: https://gerrit.openafs.org/14280
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Kailas Zadbuke <kailashsz@in.ibm.com>
Reviewed-by: Yadavendra Yadav <yadayada@in.ibm.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

src/vol/volume.c

index 4c2c10e..6d4af59 100644 (file)
@@ -456,14 +456,10 @@ bit32 VolumeCacheCheck;           /* Incremented everytime a volume goes on line--
 void
 VOptDefaults(ProgramType pt, VolumePackageOptions *opts)
 {
-    opts->nLargeVnodes = opts->nSmallVnodes = 5;
-    opts->volcache = 0;
+    memset(opts, 0, sizeof(*opts));
 
-    opts->canScheduleSalvage = 0;
-    opts->canUseFSSYNC = 0;
-    opts->canUseSALVSYNC = 0;
+    opts->nLargeVnodes = opts->nSmallVnodes = 5;
 
-    opts->interrupt_rxcall = NULL;
     opts->offline_timeout = -1;
     opts->offline_shutdown_timeout = -1;
     opts->usage_threshold = 128;
@@ -471,9 +467,7 @@ VOptDefaults(ProgramType pt, VolumePackageOptions *opts)
 
 #ifdef FAST_RESTART
     opts->unsafe_attach = 1;
-#else /* !FAST_RESTART */
-    opts->unsafe_attach = 0;
-#endif /* !FAST_RESTART */
+#endif
 
     switch (pt) {
     case fileServer: