diff options
author | Shaohua Li <shli@fb.com> | 2016-12-08 15:48:19 -0800 |
---|---|---|
committer | Shaohua Li <shli@fb.com> | 2016-12-08 22:01:47 -0800 |
commit | 2953079c692da067aeb6345659875b97378f9b0a (patch) | |
tree | 06bec98f71114629966da122360fd38a6f8ec422 /drivers/md/md.h | |
parent | 82a301cb0ea2df8a5c88213094a01660067c7fb4 (diff) | |
download | linux-2953079c692da067aeb6345659875b97378f9b0a.tar.gz linux-2953079c692da067aeb6345659875b97378f9b0a.tar.bz2 linux-2953079c692da067aeb6345659875b97378f9b0a.zip |
md: separate flags for superblock changes
The mddev->flags are used for different purposes. There are a lot of
places we check/change the flags without masking unrelated flags, we
could check/change unrelated flags. These usage are most for superblock
write, so spearate superblock related flags. This should make the code
clearer and also fix real bugs.
Reviewed-by: NeilBrown <neilb@suse.com>
Signed-off-by: Shaohua Li <shli@fb.com>
Diffstat (limited to 'drivers/md/md.h')
-rw-r--r-- | drivers/md/md.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/md/md.h b/drivers/md/md.h index 5c08f84101fa..e38936d05df1 100644 --- a/drivers/md/md.h +++ b/drivers/md/md.h @@ -213,9 +213,6 @@ extern int rdev_clear_badblocks(struct md_rdev *rdev, sector_t s, int sectors, struct md_cluster_info; enum mddev_flags { - MD_CHANGE_DEVS, /* Some device status has changed */ - MD_CHANGE_CLEAN, /* transition to or from 'clean' */ - MD_CHANGE_PENDING, /* switch from 'clean' to 'active' in progress */ MD_ARRAY_FIRST_USE, /* First use of array, needs initialization */ MD_CLOSING, /* If set, we are closing the array, do not open * it then */ @@ -231,11 +228,15 @@ enum mddev_flags { * supported as calls to md_error() will * never cause the array to become failed. */ - MD_NEED_REWRITE, /* metadata write needs to be repeated */ }; -#define MD_UPDATE_SB_FLAGS (BIT(MD_CHANGE_DEVS) | \ - BIT(MD_CHANGE_CLEAN) | \ - BIT(MD_CHANGE_PENDING)) /* If these are set, md_update_sb needed */ + +enum mddev_sb_flags { + MD_SB_CHANGE_DEVS, /* Some device status has changed */ + MD_SB_CHANGE_CLEAN, /* transition to or from 'clean' */ + MD_SB_CHANGE_PENDING, /* switch from 'clean' to 'active' in progress */ + MD_SB_NEED_REWRITE, /* metadata write needs to be repeated */ +}; + struct mddev { void *private; struct md_personality *pers; @@ -243,6 +244,7 @@ struct mddev { int md_minor; struct list_head disks; unsigned long flags; + unsigned long sb_flags; int suspended; atomic_t active_io; |