diff options
author | NeilBrown <neilb@suse.de> | 2009-12-13 20:49:52 -0500 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2009-12-13 20:51:41 -0500 |
commit | c3d9714e88c8685cf9bc837c3241fc005f95fb82 (patch) | |
tree | dd11e16ec911983bb7452bb4fb092769ba612e3b /drivers/md/bitmap.c | |
parent | 709ae4879ae33628ded276ce7da8cd5acfec476b (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.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c index a5e5f2fbf963..c9270f2c9ecd 100644 --- a/drivers/md/bitmap.c +++ b/drivers/md/bitmap.c | |||
@@ -1090,10 +1090,10 @@ void bitmap_daemon_work(mddev_t *mddev) | |||
1090 | /* Use a mutex to guard daemon_work against | 1090 | /* Use a mutex to guard daemon_work against |
1091 | * bitmap_destroy. | 1091 | * bitmap_destroy. |
1092 | */ | 1092 | */ |
1093 | mutex_lock(&mddev->bitmap_mutex); | 1093 | mutex_lock(&mddev->bitmap_info.mutex); |
1094 | bitmap = mddev->bitmap; | 1094 | bitmap = mddev->bitmap; |
1095 | if (bitmap == NULL) { | 1095 | if (bitmap == NULL) { |
1096 | mutex_unlock(&mddev->bitmap_mutex); | 1096 | mutex_unlock(&mddev->bitmap_info.mutex); |
1097 | return; | 1097 | return; |
1098 | } | 1098 | } |
1099 | if (time_before(jiffies, bitmap->daemon_lastrun + bitmap->daemon_sleep*HZ)) | 1099 | if (time_before(jiffies, bitmap->daemon_lastrun + bitmap->daemon_sleep*HZ)) |
@@ -1211,7 +1211,7 @@ void bitmap_daemon_work(mddev_t *mddev) | |||
1211 | done: | 1211 | done: |
1212 | if (bitmap->allclean == 0) | 1212 | if (bitmap->allclean == 0) |
1213 | bitmap->mddev->thread->timeout = bitmap->daemon_sleep * HZ; | 1213 | bitmap->mddev->thread->timeout = bitmap->daemon_sleep * HZ; |
1214 | mutex_unlock(&mddev->bitmap_mutex); | 1214 | mutex_unlock(&mddev->bitmap_info.mutex); |
1215 | } | 1215 | } |
1216 | 1216 | ||
1217 | static bitmap_counter_t *bitmap_get_counter(struct bitmap *bitmap, | 1217 | static bitmap_counter_t *bitmap_get_counter(struct bitmap *bitmap, |
@@ -1591,9 +1591,9 @@ void bitmap_destroy(mddev_t *mddev) | |||
1591 | if (!bitmap) /* there was no bitmap */ | 1591 | if (!bitmap) /* there was no bitmap */ |
1592 | return; | 1592 | return; |
1593 | 1593 | ||
1594 | mutex_lock(&mddev->bitmap_mutex); | 1594 | mutex_lock(&mddev->bitmap_info.mutex); |
1595 | mddev->bitmap = NULL; /* disconnect from the md device */ | 1595 | mddev->bitmap = NULL; /* disconnect from the md device */ |
1596 | mutex_unlock(&mddev->bitmap_mutex); | 1596 | mutex_unlock(&mddev->bitmap_info.mutex); |
1597 | if (mddev->thread) | 1597 | if (mddev->thread) |
1598 | mddev->thread->timeout = MAX_SCHEDULE_TIMEOUT; | 1598 | mddev->thread->timeout = MAX_SCHEDULE_TIMEOUT; |
1599 | 1599 | ||
@@ -1610,16 +1610,16 @@ int bitmap_create(mddev_t *mddev) | |||
1610 | sector_t blocks = mddev->resync_max_sectors; | 1610 | sector_t blocks = mddev->resync_max_sectors; |
1611 | unsigned long chunks; | 1611 | unsigned long chunks; |
1612 | unsigned long pages; | 1612 | unsigned long pages; |
1613 | struct file *file = mddev->bitmap_file; | 1613 | struct file *file = mddev->bitmap_info.file; |
1614 | int err; | 1614 | int err; |
1615 | sector_t start; | 1615 | sector_t start; |
1616 | 1616 | ||
1617 | BUILD_BUG_ON(sizeof(bitmap_super_t) != 256); | 1617 | BUILD_BUG_ON(sizeof(bitmap_super_t) != 256); |
1618 | 1618 | ||
1619 | if (!file && !mddev->bitmap_offset) /* bitmap disabled, nothing to do */ | 1619 | if (!file && !mddev->bitmap_info.offset) /* bitmap disabled, nothing to do */ |
1620 | return 0; | 1620 | return 0; |
1621 | 1621 | ||
1622 | BUG_ON(file && mddev->bitmap_offset); | 1622 | BUG_ON(file && mddev->bitmap_info.offset); |
1623 | 1623 | ||
1624 | bitmap = kzalloc(sizeof(*bitmap), GFP_KERNEL); | 1624 | bitmap = kzalloc(sizeof(*bitmap), GFP_KERNEL); |
1625 | if (!bitmap) | 1625 | if (!bitmap) |
@@ -1633,7 +1633,7 @@ int bitmap_create(mddev_t *mddev) | |||
1633 | bitmap->mddev = mddev; | 1633 | bitmap->mddev = mddev; |
1634 | 1634 | ||
1635 | bitmap->file = file; | 1635 | bitmap->file = file; |
1636 | bitmap->offset = mddev->bitmap_offset; | 1636 | bitmap->offset = mddev->bitmap_info.offset; |
1637 | if (file) { | 1637 | if (file) { |
1638 | get_file(file); | 1638 | get_file(file); |
1639 | /* As future accesses to this file will use bmap, | 1639 | /* As future accesses to this file will use bmap, |