diff options
author | NeilBrown <neilb@suse.de> | 2012-05-21 23:55:10 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2012-05-21 23:55:10 -0400 |
commit | 1ec885cdd01a9ad867dbb9fd32a1bfcc0875c486 (patch) | |
tree | 232eaa1e1b7820ca8e97782666f7742f78bef175 /drivers/md/md.c | |
parent | d189122d4bca2647441fdc170dc6d4cc5c8bb2fa (diff) |
md/bitmap: move some fields of 'struct bitmap' into a 'storage' substruct.
This new 'struct bitmap_storage' reflects the external storage of the
bitmap.
Having this clearly defined will make it easier to change the storage
used while the array is active.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r-- | drivers/md/md.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 607771bb7e92..9e2336fbbd31 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -1989,7 +1989,7 @@ super_1_allow_new_offset(struct md_rdev *rdev, | |||
1989 | bitmap = rdev->mddev->bitmap; | 1989 | bitmap = rdev->mddev->bitmap; |
1990 | if (bitmap && !rdev->mddev->bitmap_info.file && | 1990 | if (bitmap && !rdev->mddev->bitmap_info.file && |
1991 | rdev->sb_start + rdev->mddev->bitmap_info.offset + | 1991 | rdev->sb_start + rdev->mddev->bitmap_info.offset + |
1992 | bitmap->file_pages * (PAGE_SIZE>>9) > new_offset) | 1992 | bitmap->storage.file_pages * (PAGE_SIZE>>9) > new_offset) |
1993 | return 0; | 1993 | return 0; |
1994 | if (rdev->badblocks.sector + rdev->badblocks.size > new_offset) | 1994 | if (rdev->badblocks.sector + rdev->badblocks.size > new_offset) |
1995 | return 0; | 1995 | return 0; |
@@ -5649,7 +5649,7 @@ static int get_bitmap_file(struct mddev * mddev, void __user * arg) | |||
5649 | goto out; | 5649 | goto out; |
5650 | 5650 | ||
5651 | /* bitmap disabled, zero the first byte and copy out */ | 5651 | /* bitmap disabled, zero the first byte and copy out */ |
5652 | if (!mddev->bitmap || !mddev->bitmap->file) { | 5652 | if (!mddev->bitmap || !mddev->bitmap->storage.file) { |
5653 | file->pathname[0] = '\0'; | 5653 | file->pathname[0] = '\0'; |
5654 | goto copy_out; | 5654 | goto copy_out; |
5655 | } | 5655 | } |
@@ -5658,7 +5658,8 @@ static int get_bitmap_file(struct mddev * mddev, void __user * arg) | |||
5658 | if (!buf) | 5658 | if (!buf) |
5659 | goto out; | 5659 | goto out; |
5660 | 5660 | ||
5661 | ptr = d_path(&mddev->bitmap->file->f_path, buf, sizeof(file->pathname)); | 5661 | ptr = d_path(&mddev->bitmap->storage.file->f_path, |
5662 | buf, sizeof(file->pathname)); | ||
5662 | if (IS_ERR(ptr)) | 5663 | if (IS_ERR(ptr)) |
5663 | goto out; | 5664 | goto out; |
5664 | 5665 | ||
@@ -6299,7 +6300,7 @@ static int update_array_info(struct mddev *mddev, mdu_array_info_t *info) | |||
6299 | /* remove the bitmap */ | 6300 | /* remove the bitmap */ |
6300 | if (!mddev->bitmap) | 6301 | if (!mddev->bitmap) |
6301 | return -ENOENT; | 6302 | return -ENOENT; |
6302 | if (mddev->bitmap->file) | 6303 | if (mddev->bitmap->storage.file) |
6303 | return -EINVAL; | 6304 | return -EINVAL; |
6304 | mddev->pers->quiesce(mddev, 1); | 6305 | mddev->pers->quiesce(mddev, 1); |
6305 | bitmap_destroy(mddev); | 6306 | bitmap_destroy(mddev); |