summaryrefslogtreecommitdiffstats
path: root/drivers/md/bitmap.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2009-12-14 12:49:52 +1100
committerNeilBrown <neilb@suse.de>2009-12-14 12:51:41 +1100
commitc3d9714e88c8685cf9bc837c3241fc005f95fb82 (patch)
treedd11e16ec911983bb7452bb4fb092769ba612e3b /drivers/md/bitmap.c
parent709ae4879ae33628ded276ce7da8cd5acfec476b (diff)
md: collect bitmap-specific fields into one structure.
In preparation for making bitmap fields configurable via sysfs, start tidying up by making a single structure to contain the configuration fields. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/bitmap.c')
-rw-r--r--drivers/md/bitmap.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
index a5e5f2fbf96..c9270f2c9ec 100644
--- a/drivers/md/bitmap.c
+++ b/drivers/md/bitmap.c
@@ -1090,10 +1090,10 @@ void bitmap_daemon_work(mddev_t *mddev)
/* Use a mutex to guard daemon_work against
* bitmap_destroy.
*/
- mutex_lock(&mddev->bitmap_mutex);
+ mutex_lock(&mddev->bitmap_info.mutex);
bitmap = mddev->bitmap;
if (bitmap == NULL) {
- mutex_unlock(&mddev->bitmap_mutex);
+ mutex_unlock(&mddev->bitmap_info.mutex);
return;
}
if (time_before(jiffies, bitmap->daemon_lastrun + bitmap->daemon_sleep*HZ))
@@ -1211,7 +1211,7 @@ void bitmap_daemon_work(mddev_t *mddev)
done:
if (bitmap->allclean == 0)
bitmap->mddev->thread->timeout = bitmap->daemon_sleep * HZ;
- mutex_unlock(&mddev->bitmap_mutex);
+ mutex_unlock(&mddev->bitmap_info.mutex);
}
static bitmap_counter_t *bitmap_get_counter(struct bitmap *bitmap,
@@ -1591,9 +1591,9 @@ void bitmap_destroy(mddev_t *mddev)
if (!bitmap) /* there was no bitmap */
return;
- mutex_lock(&mddev->bitmap_mutex);
+ mutex_lock(&mddev->bitmap_info.mutex);
mddev->bitmap = NULL; /* disconnect from the md device */
- mutex_unlock(&mddev->bitmap_mutex);
+ mutex_unlock(&mddev->bitmap_info.mutex);
if (mddev->thread)
mddev->thread->timeout = MAX_SCHEDULE_TIMEOUT;
@@ -1610,16 +1610,16 @@ int bitmap_create(mddev_t *mddev)
sector_t blocks = mddev->resync_max_sectors;
unsigned long chunks;
unsigned long pages;
- struct file *file = mddev->bitmap_file;
+ struct file *file = mddev->bitmap_info.file;
int err;
sector_t start;
BUILD_BUG_ON(sizeof(bitmap_super_t) != 256);
- if (!file && !mddev->bitmap_offset) /* bitmap disabled, nothing to do */
+ if (!file && !mddev->bitmap_info.offset) /* bitmap disabled, nothing to do */
return 0;
- BUG_ON(file && mddev->bitmap_offset);
+ BUG_ON(file && mddev->bitmap_info.offset);
bitmap = kzalloc(sizeof(*bitmap), GFP_KERNEL);
if (!bitmap)
@@ -1633,7 +1633,7 @@ int bitmap_create(mddev_t *mddev)
bitmap->mddev = mddev;
bitmap->file = file;
- bitmap->offset = mddev->bitmap_offset;
+ bitmap->offset = mddev->bitmap_info.offset;
if (file) {
get_file(file);
/* As future accesses to this file will use bmap,