diff options
author | NeilBrown <neilb@suse.de> | 2008-08-19 14:54:55 +1000 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2008-08-19 14:54:55 +1000 |
commit | 01f157d74ab29d3acf46800ffdaac3a0d0345b51 (patch) | |
tree | 57520e26c75ab39ba8689ee476fbd5ed65690161 /super-ddf.c | |
parent | 9296754385aa1fecb45097ba06fc82cbc0e5f14a (diff) |
Extra option for set_array_state: you choose dirty or clean.
When we first start an array, it might be good to start recovery
straight away. That requires setting the array to 'dirty', but
only the metadata handler can know if that is required or not.
So have a third possible 'consistent' option to set_array_state.
Either 'no' or 'yes' or 'you choose'.
Return value indicates what was chosen.
'1' (no) should be chosen unless there is a good reason.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'super-ddf.c')
-rw-r--r-- | super-ddf.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/super-ddf.c b/super-ddf.c index 5d387504..e41afa65 100644 --- a/super-ddf.c +++ b/super-ddf.c @@ -2680,11 +2680,17 @@ static int ddf_open_new(struct supertype *c, struct active_array *a, char *inst) * For DDF, we need to clear the DDF_state_inconsistent bit in the * !global! virtual_disk.virtual_entry structure. */ -static void ddf_set_array_state(struct active_array *a, int consistent) +static int ddf_set_array_state(struct active_array *a, int consistent) { struct ddf_super *ddf = a->container->sb; int inst = a->info.container_member; int old = ddf->virt->entries[inst].state; + if (consistent == 2) { + /* Should check if a recovery should be started FIXME */ + consistent = 1; + if (a->resync_start != ~0ULL) + consistent = 0; + } if (consistent) ddf->virt->entries[inst].state &= ~DDF_state_inconsistent; else @@ -2705,6 +2711,7 @@ static void ddf_set_array_state(struct active_array *a, int consistent) dprintf("ddf mark %d %s %llu\n", inst, consistent?"clean":"dirty", a->resync_start); + return consistent; } /* |