summaryrefslogtreecommitdiff
path: root/mdstat.c
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2006-12-21 17:10:52 +1100
committerNeil Brown <neilb@suse.de>2006-12-21 17:10:52 +1100
commit8382f19bdcc6d2d1de92154e11129acdcaab10fa (patch)
tree3b3c93a6ad6189d6354de81714fc8959de8378f5 /mdstat.c
parent350f29f90d1f6bb3ddfafea368327911f9e8b27c (diff)
Add new mode: --incremental
--incremental allows arrays to be assembled one device at a time. This is expected to be used with udev.
Diffstat (limited to 'mdstat.c')
-rw-r--r--mdstat.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/mdstat.c b/mdstat.c
index 5eeac6cc..de31acbf 100644
--- 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;
+}