From 8382f19bdcc6d2d1de92154e11129acdcaab10fa Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Thu, 21 Dec 2006 17:10:52 +1100 Subject: Add new mode: --incremental --incremental allows arrays to be assembled one device at a time. This is expected to be used with udev. --- mdstat.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'mdstat.c') diff --git a/mdstat.c b/mdstat.c index 5eeac6c..de31acb 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; +} -- cgit