summaryrefslogtreecommitdiff
path: root/mdstat.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2013-07-10 11:10:54 +1000
committerNeilBrown <neilb@suse.de>2013-07-10 11:10:54 +1000
commita7a0d8a116c11b2208e70fd4dcc8ab920e472b8b (patch)
treed94673f83ff101594347bbc2450698d0dc688493 /mdstat.c
parentb4924f46c04262e7e80aac27acc5848066393c52 (diff)
Grow: use mdstat_wait to wait for delayed reshape.
Having a fix time for a wait is clumsy and can make us wait much too long. So use mdstat_wait and keep the mdstat_fd open. This requires an 'mdstat_close' so it doesn't stay open forever. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'mdstat.c')
-rw-r--r--mdstat.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/mdstat.c b/mdstat.c
index 9ebfc075..8b16d3e8 100644
--- a/mdstat.c
+++ b/mdstat.c
@@ -289,6 +289,13 @@ struct mdstat_ent *mdstat_read(int hold, int start)
return rv;
}
+void mdstat_close(void)
+{
+ if (mdstat_fd >= 0)
+ close(mdstat_fd);
+ mdstat_fd = -1;
+}
+
void mdstat_wait(int seconds)
{
fd_set fds;