|
@@ -903,6 +903,11 @@ static void bitmap_file_set_bit(struct bitmap *bitmap, sector_t block)
|
|
struct page *page;
|
|
struct page *page;
|
|
void *kaddr;
|
|
void *kaddr;
|
|
unsigned long chunk = block >> bitmap->counts.chunkshift;
|
|
unsigned long chunk = block >> bitmap->counts.chunkshift;
|
|
|
|
+ struct bitmap_storage *store = &bitmap->storage;
|
|
|
|
+ unsigned long node_offset = 0;
|
|
|
|
+
|
|
|
|
+ if (mddev_is_clustered(bitmap->mddev))
|
|
|
|
+ node_offset = bitmap->cluster_slot * store->file_pages;
|
|
|
|
|
|
page = filemap_get_page(&bitmap->storage, chunk);
|
|
page = filemap_get_page(&bitmap->storage, chunk);
|
|
if (!page)
|
|
if (!page)
|
|
@@ -918,7 +923,7 @@ static void bitmap_file_set_bit(struct bitmap *bitmap, sector_t block)
|
|
kunmap_atomic(kaddr);
|
|
kunmap_atomic(kaddr);
|
|
pr_debug("set file bit %lu page %lu\n", bit, page->index);
|
|
pr_debug("set file bit %lu page %lu\n", bit, page->index);
|
|
/* record page number so it gets flushed to disk when unplug occurs */
|
|
/* record page number so it gets flushed to disk when unplug occurs */
|
|
- set_page_attr(bitmap, page->index, BITMAP_PAGE_DIRTY);
|
|
|
|
|
|
+ set_page_attr(bitmap, page->index - node_offset, BITMAP_PAGE_DIRTY);
|
|
}
|
|
}
|
|
|
|
|
|
static void bitmap_file_clear_bit(struct bitmap *bitmap, sector_t block)
|
|
static void bitmap_file_clear_bit(struct bitmap *bitmap, sector_t block)
|
|
@@ -927,6 +932,11 @@ static void bitmap_file_clear_bit(struct bitmap *bitmap, sector_t block)
|
|
struct page *page;
|
|
struct page *page;
|
|
void *paddr;
|
|
void *paddr;
|
|
unsigned long chunk = block >> bitmap->counts.chunkshift;
|
|
unsigned long chunk = block >> bitmap->counts.chunkshift;
|
|
|
|
+ struct bitmap_storage *store = &bitmap->storage;
|
|
|
|
+ unsigned long node_offset = 0;
|
|
|
|
+
|
|
|
|
+ if (mddev_is_clustered(bitmap->mddev))
|
|
|
|
+ node_offset = bitmap->cluster_slot * store->file_pages;
|
|
|
|
|
|
page = filemap_get_page(&bitmap->storage, chunk);
|
|
page = filemap_get_page(&bitmap->storage, chunk);
|
|
if (!page)
|
|
if (!page)
|
|
@@ -938,8 +948,8 @@ static void bitmap_file_clear_bit(struct bitmap *bitmap, sector_t block)
|
|
else
|
|
else
|
|
clear_bit_le(bit, paddr);
|
|
clear_bit_le(bit, paddr);
|
|
kunmap_atomic(paddr);
|
|
kunmap_atomic(paddr);
|
|
- if (!test_page_attr(bitmap, page->index, BITMAP_PAGE_NEEDWRITE)) {
|
|
|
|
- set_page_attr(bitmap, page->index, BITMAP_PAGE_PENDING);
|
|
|
|
|
|
+ if (!test_page_attr(bitmap, page->index - node_offset, BITMAP_PAGE_NEEDWRITE)) {
|
|
|
|
+ set_page_attr(bitmap, page->index - node_offset, BITMAP_PAGE_PENDING);
|
|
bitmap->allclean = 0;
|
|
bitmap->allclean = 0;
|
|
}
|
|
}
|
|
}
|
|
}
|