aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/raid/md_k.h
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2005-11-09 00:39:31 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-09 10:56:38 -0500
commitb2d444d7ad975d555bb919601bcdc0e58975a40e (patch)
tree963a29258af95f05dd28d9de0180ac9ef533aeed /include/linux/raid/md_k.h
parentba22dcbf106338a5c46d6979f9b19564faae3d49 (diff)
[PATCH] md: convert 'faulty' and 'in_sync' fields to bits in 'flags' field
This has the advantage of removing the confusion caused by 'rdev_t' and 'mddev_t' both having 'in_sync' fields. Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/raid/md_k.h')
-rw-r--r--include/linux/raid/md_k.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h
index 200c69e34fc0..11629f92180a 100644
--- a/include/linux/raid/md_k.h
+++ b/include/linux/raid/md_k.h
@@ -117,10 +117,10 @@ struct mdk_rdev_s
117 * It can never have faulty==1, in_sync==1 117 * It can never have faulty==1, in_sync==1
118 * This reduces the burden of testing multiple flags in many cases 118 * This reduces the burden of testing multiple flags in many cases
119 */ 119 */
120 int faulty; /* if faulty do not issue IO requests */
121 int in_sync; /* device is a full member of the array */
122 120
123 unsigned long flags; /* Should include faulty and in_sync here. */ 121 unsigned long flags;
122#define Faulty 1 /* device is known to have a fault */
123#define In_sync 2 /* device is in_sync with rest of array */
124#define WriteMostly 4 /* Avoid reading if at all possible */ 124#define WriteMostly 4 /* Avoid reading if at all possible */
125 125
126 int desc_nr; /* descriptor index in the superblock */ 126 int desc_nr; /* descriptor index in the superblock */
@@ -247,7 +247,7 @@ struct mddev_s
247 247
248static inline void rdev_dec_pending(mdk_rdev_t *rdev, mddev_t *mddev) 248static inline void rdev_dec_pending(mdk_rdev_t *rdev, mddev_t *mddev)
249{ 249{
250 int faulty = rdev->faulty; 250 int faulty = test_bit(Faulty, &rdev->flags);
251 if (atomic_dec_and_test(&rdev->nr_pending) && faulty) 251 if (atomic_dec_and_test(&rdev->nr_pending) && faulty)
252 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); 252 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
253} 253}