diff options
| author | Neil Brown <neilb@cse.unsw.edu.au> | 2003-03-14 02:08:40 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2003-03-14 02:08:40 -0800 |
| commit | cb129263c29145416deb93988deb2c54c84849f0 (patch) | |
| tree | b61b3a267808eb673f3eaaa4623994fd5dd237cf /include/linux | |
| parent | 07b24141669f233c3e9d5bb3459fb5646bdb1054 (diff) | |
[PATCH] md: Tidy up recovery_running flags in md
Md uses ->recovery_running and ->recovery_err to keep track of the
status or recovery. This is rather ad hoc and race prone.
This patch changes it to ->recovery which has bit flags for various
states.
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/raid/md_k.h | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h index cf7505f655da..137c64966057 100644 --- a/include/linux/raid/md_k.h +++ b/include/linux/raid/md_k.h @@ -210,18 +210,24 @@ struct mddev_s unsigned long curr_resync; /* blocks scheduled */ unsigned long resync_mark; /* a recent timestamp */ unsigned long resync_mark_cnt;/* blocks written at resync_mark */ - /* recovery_running is 0 for no recovery/resync, - * 1 for active recovery - * 2 for active resync - * -error for an error (e.g. -EINTR) - * it can only be set > 0 under reconfig_sem + + /* recovery/resync flags + * RUNNING: a thread is running, or about to be started + * SYNC: actually doing a resync, not a recovery + * ERR: and IO error was detected - abort the resync/recovery + * INTR: someone requested a (clean) early abort. + * DONE: thread is done and is waiting to be reaped */ - int recovery_running; - int recovery_error; /* error from recovery write */ +#define MD_RECOVERY_RUNNING 0 +#define MD_RECOVERY_SYNC 1 +#define MD_RECOVERY_ERR 2 +#define MD_RECOVERY_INTR 3 +#define MD_RECOVERY_DONE 4 + unsigned long recovery; + int in_sync; /* know to not need resync */ struct semaphore reconfig_sem; atomic_t active; - int spares; int degraded; /* whether md should consider * adding a spare |
