]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - mdadm.c
Provide a mdstat_ent to subarray helper
[thirdparty/mdadm.git] / mdadm.c
diff --git a/mdadm.c b/mdadm.c
index 4a8547486c36fa35108ec5d2ae004683eb4f3c25..07460c6adc061e1b907ce1b77201eee1e3d1858c 100644 (file)
--- a/mdadm.c
+++ b/mdadm.c
@@ -96,6 +96,7 @@ int main(int argc, char *argv[])
        int daemonise = 0;
        char *pidfile = NULL;
        int oneshot = 0;
+       int spare_sharing = 1;
        struct supertype *ss = NULL;
        int writemostly = 0;
        int re_add = 0;
@@ -104,6 +105,7 @@ int main(int argc, char *argv[])
        int rebuild_map = 0;
        int auto_update_home = 0;
        char *subarray = NULL;
+       char *remove_path = NULL;
 
        int print_help = 0;
        FILE *outf;
@@ -227,6 +229,7 @@ int main(int argc, char *argv[])
                                subarray = optarg;
                        }
                case 'K': if (!mode) newmode = MISC; break;
+               case NoSharing: newmode = MONITOR; break;
                }
                if (mode && newmode == mode) {
                        /* everybody happy ! */
@@ -776,7 +779,9 @@ int main(int argc, char *argv[])
                        openlog("mdadm", LOG_PID, SYSLOG_FACILITY);
                        dosyslog = 1;
                        continue;
-
+               case O(MONITOR, NoSharing):
+                       spare_sharing = 0;
+                       continue;
                        /* now the general management options.  Some are applicable
                         * to other modes. None have arguments.
                         */
@@ -943,6 +948,9 @@ int main(int argc, char *argv[])
                case O(INCREMENTAL, 'r'):
                        rebuild_map = 1;
                        continue;
+               case O(INCREMENTAL, IncrementalPath):
+                       remove_path = optarg;
+                       continue;
                }
                /* We have now processed all the valid options. Anything else is
                 * an error
@@ -1490,7 +1498,7 @@ int main(int argc, char *argv[])
                }
                rv= Monitor(devlist, mailaddr, program,
                            delay?delay:60, daemonise, scan, oneshot,
-                           dosyslog, test, pidfile, increments);
+                           dosyslog, test, pidfile, increments, spare_sharing);
                break;
 
        case GROW:
@@ -1586,12 +1594,13 @@ int main(int argc, char *argv[])
                        rv = 1;
                        break;
                }
-               if (devmode == 'f') {
-                       rv = IncrementalRemove(devlist->devname, verbose-quiet);
-                       break;
-               }
-               rv = Incremental(devlist->devname, verbose-quiet, runstop,
-                                ss, homehost, require_homehost, autof);
+               if (devmode == 'f')
+                       rv = IncrementalRemove(devlist->devname, remove_path,
+                                              verbose-quiet);
+               else
+                       rv = Incremental(devlist->devname, verbose-quiet,
+                                        runstop, ss, homehost,
+                                        require_homehost, autof);
                break;
        case AUTODETECT:
                autodetect();