]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - mdstat.c
Add new mode: --incremental
[thirdparty/mdadm.git] / mdstat.c
index 5eeac6ccc8bb8d5d647c4002c0969e3dfd02500c..de31acbf305ea96c6101857ff1b228ee23eb1719 100644 (file)
--- a/mdstat.c
+++ b/mdstat.c
@@ -251,3 +251,15 @@ void mdstat_wait(int seconds)
        tm.tv_usec = 0;
        select(mdstat_fd >2 ? mdstat_fd+1:3, NULL, NULL, &fds, &tm);
 }
+
+int mddev_busy(int devnum)
+{
+       struct mdstat_ent *mdstat = mdstat_read(0, 0);
+       struct mdstat_ent *me;
+
+       for (me = mdstat ; me ; me = me->next)
+               if (me->devnum == devnum)
+                       break;
+       free_mdstat(mdstat);
+       return me != NULL;
+}