diff options
author | Dan Williams <dan.j.williams@intel.com> | 2009-12-14 12:57:55 -0700 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2009-12-14 12:57:55 -0700 |
commit | b7941fd68de046be58de4d53fe08925fdb9008f0 (patch) | |
tree | d2ec919476da339a8e934192135b90f06f927eb5 /super-ddf.c | |
parent | 071cfc42580673b149140339a862f90399dc00b5 (diff) | |
download | mdadm-b7941fd68de046be58de4d53fe08925fdb9008f0.tar.gz mdadm-b7941fd68de046be58de4d53fe08925fdb9008f0.tar.xz mdadm-b7941fd68de046be58de4d53fe08925fdb9008f0.zip |
mdmon: cleanup resync_start
We don't need to sprinkle reads of this attribute all over the place,
just once at the entry of read_and_act(). Also, the mdinfo structure
for the array already has a 'resync_start' member, so just reuse that.
Finally, rename get_resync_start() to read_resync_start to make it
consistent with the other sysfs accessors in monitor.c.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'super-ddf.c')
-rw-r--r-- | super-ddf.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/super-ddf.c b/super-ddf.c index fe83642..f5eb816 100644 --- a/super-ddf.c +++ b/super-ddf.c @@ -3066,7 +3066,7 @@ static int ddf_set_array_state(struct active_array *a, int consistent) if (consistent == 2) { /* Should check if a recovery should be started FIXME */ consistent = 1; - if (!is_resync_complete(a)) + if (!is_resync_complete(&a->info)) consistent = 0; } if (consistent) @@ -3078,9 +3078,9 @@ static int ddf_set_array_state(struct active_array *a, int consistent) old = ddf->virt->entries[inst].init_state; ddf->virt->entries[inst].init_state &= ~DDF_initstate_mask; - if (is_resync_complete(a)) + if (is_resync_complete(&a->info)) ddf->virt->entries[inst].init_state |= DDF_init_full; - else if (a->resync_start == 0) + else if (a->info.resync_start == 0) ddf->virt->entries[inst].init_state |= DDF_init_not; else ddf->virt->entries[inst].init_state |= DDF_init_quick; @@ -3088,7 +3088,7 @@ static int ddf_set_array_state(struct active_array *a, int consistent) ddf->updates_pending = 1; dprintf("ddf mark %d %s %llu\n", inst, consistent?"clean":"dirty", - a->resync_start); + a->info.resync_start); return consistent; } |