Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 176088
b: refs/heads/master
c: f6af949
h: refs/heads/master
v: v3
  • Loading branch information
NeilBrown committed Dec 14, 2009
1 parent 61b8685 commit 19109c2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9cd30fdc33cde9ae4ac55a1ccbbb89f3f7b9b2f2
refs/heads/master: f6af949c5672115313cc3c976d85b0533f607d7e
14 changes: 11 additions & 3 deletions trunk/drivers/md/bitmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ static void bitmap_checkfree(struct bitmap *bitmap, unsigned long page)
*/

/* IO operations when bitmap is stored near all superblocks */
static struct page *read_sb_page(mddev_t *mddev, long offset,
static struct page *read_sb_page(mddev_t *mddev, loff_t offset,
struct page *page,
unsigned long index, int size)
{
Expand Down Expand Up @@ -287,14 +287,22 @@ static int write_sb_page(struct bitmap *bitmap, struct page *page, int wait)

while ((rdev = next_active_rdev(rdev, mddev)) != NULL) {
int size = PAGE_SIZE;
long offset = mddev->bitmap_info.offset;
loff_t offset = mddev->bitmap_info.offset;
if (page->index == bitmap->file_pages-1)
size = roundup(bitmap->last_page_size,
bdev_logical_block_size(rdev->bdev));
/* Just make sure we aren't corrupting data or
* metadata
*/
if (offset < 0) {
if (mddev->external) {
/* Bitmap could be anywhere. */
if (rdev->sb_start + offset + (page->index *(PAGE_SIZE/512)) >
rdev->data_offset &&
rdev->sb_start + offset <
rdev->data_offset + mddev->dev_sectors +
(PAGE_SIZE/512))
goto bad_alignment;
} else if (offset < 0) {
/* DATA BITMAP METADATA */
if (offset
+ (long)(page->index * (PAGE_SIZE/512))
Expand Down
6 changes: 4 additions & 2 deletions trunk/drivers/md/md.h
Original file line number Diff line number Diff line change
Expand Up @@ -282,11 +282,13 @@ struct mddev_s
struct bitmap *bitmap; /* the bitmap for the device */
struct {
struct file *file; /* the bitmap file */
long offset; /* offset from superblock of
loff_t offset; /* offset from superblock of
* start of bitmap. May be
* negative, but not '0'
* For external metadata, offset
* from start of device.
*/
long default_offset; /* this is the offset to use when
loff_t default_offset; /* this is the offset to use when
* hot-adding a bitmap. It should
* eventually be settable by sysfs.
*/
Expand Down

0 comments on commit 19109c2

Please sign in to comment.