diff options
author | NeilBrown <neilb@suse.de> | 2006-10-03 04:15:46 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-03 11:04:17 -0400 |
commit | 850b2b420cd5b363ed4cf48a8816d656c8b5251b (patch) | |
tree | b63aa37b3fb7dfb7a0b674d5a2ebe9da13cc7405 /include/linux/raid | |
parent | 6814d5368d68341ec6b5e4ecd10ea5947130775a (diff) |
[PATCH] md: replace magic numbers in sb_dirty with well defined bit flags
Instead of magic numbers (0,1,2,3) in sb_dirty, we have
some flags instead:
MD_CHANGE_DEVS
Some device state has changed requiring superblock update
on all devices.
MD_CHANGE_CLEAN
The array has transitions from 'clean' to 'dirty' or back,
requiring a superblock update on active devices, but possibly
not on spares
MD_CHANGE_PENDING
A superblock update is underway.
We wait for an update to complete by waiting for all flags to be clear. A
flag can be set at any time, even during an update, without risk that the
change will be lost.
Stop exporting md_update_sb - isn't needed.
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')
-rw-r--r-- | include/linux/raid/md.h | 1 | ||||
-rw-r--r-- | include/linux/raid/md_k.h | 6 |
2 files changed, 5 insertions, 2 deletions
diff --git a/include/linux/raid/md.h b/include/linux/raid/md.h index c588709acbbc..866a1e2b0ce0 100644 --- a/include/linux/raid/md.h +++ b/include/linux/raid/md.h | |||
@@ -95,7 +95,6 @@ extern int sync_page_io(struct block_device *bdev, sector_t sector, int size, | |||
95 | extern void md_do_sync(mddev_t *mddev); | 95 | extern void md_do_sync(mddev_t *mddev); |
96 | extern void md_new_event(mddev_t *mddev); | 96 | extern void md_new_event(mddev_t *mddev); |
97 | 97 | ||
98 | extern void md_update_sb(mddev_t * mddev); | ||
99 | 98 | ||
100 | #endif /* CONFIG_MD */ | 99 | #endif /* CONFIG_MD */ |
101 | #endif | 100 | #endif |
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h index 920b94fe31fa..e423dad1a7fd 100644 --- a/include/linux/raid/md_k.h +++ b/include/linux/raid/md_k.h | |||
@@ -116,7 +116,11 @@ struct mddev_s | |||
116 | dev_t unit; | 116 | dev_t unit; |
117 | int md_minor; | 117 | int md_minor; |
118 | struct list_head disks; | 118 | struct list_head disks; |
119 | int sb_dirty; | 119 | unsigned long flags; |
120 | #define MD_CHANGE_DEVS 0 /* Some device status has changed */ | ||
121 | #define MD_CHANGE_CLEAN 1 /* transition to or from 'clean' */ | ||
122 | #define MD_CHANGE_PENDING 2 /* superblock update in progress */ | ||
123 | |||
120 | int ro; | 124 | int ro; |
121 | 125 | ||
122 | struct gendisk *gendisk; | 126 | struct gendisk *gendisk; |