summaryrefslogtreecommitdiff
path: root/mdmon.h
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2008-09-28 12:12:06 -0700
committerDan Williams <dan.j.williams@intel.com>2008-10-15 14:15:51 -0700
commit593add1b56877a6881419c2496eb26dd1f82d39b (patch)
tree104f8a56227c11845036fe9b9f782e4eb21395f1 /mdmon.h
parent14e8215b1b996813e467ae6fba71b0e4f5690103 (diff)
monitor: protect against CONFIG_LBD=n
md/resync_start reports different terminal values depending on kernel configuration (~0UL versus ~0ULL). Make detection of the resync-complete state more robust by comparing against array size. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'mdmon.h')
-rw-r--r--mdmon.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/mdmon.h b/mdmon.h
index 62f34f7e..41222e1c 100644
--- a/mdmon.h
+++ b/mdmon.h
@@ -59,3 +59,14 @@ struct mdstat_ent *mdstat_read(int hold, int start);
extern int exit_now, manager_ready;
extern int mon_tid, mgr_tid;
extern int monitor_loop_cnt;
+
+/* helper routine to determine resync completion since MaxSector is a
+ * moving target
+ */
+static inline int is_resync_complete(struct active_array *a)
+{
+ if (a->resync_start >= a->info.component_size)
+ return 1;
+ return 0;
+}
+