Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 2589
b: refs/heads/master
c: aa3163f
h: refs/heads/master
i:
  2587: 0cb9c25
v: v3
  • Loading branch information
NeilBrown authored and Linus Torvalds committed Jun 22, 2005
1 parent fed803f commit 1604cca
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 19 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: 77ad4bc706fe6c52ab953f31c287a6af712d080c
refs/heads/master: aa3163f81654fa057039258e32a6811147bf0c14
35 changes: 17 additions & 18 deletions trunk/drivers/md/bitmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -897,7 +897,7 @@ static bitmap_counter_t *bitmap_get_counter(struct bitmap *bitmap,

int bitmap_daemon_work(struct bitmap *bitmap)
{
unsigned long bit, j;
unsigned long j;
unsigned long flags;
struct page *page = NULL, *lastpage = NULL;
int err = 0;
Expand All @@ -920,24 +920,23 @@ int bitmap_daemon_work(struct bitmap *bitmap)
}

page = filemap_get_page(bitmap, j);
/* skip this page unless it's marked as needing cleaning */
if (!((attr=get_page_attr(bitmap, page)) & BITMAP_PAGE_CLEAN)) {
if (attr & BITMAP_PAGE_NEEDWRITE) {
page_cache_get(page);
clear_page_attr(bitmap, page, BITMAP_PAGE_NEEDWRITE);
}
spin_unlock_irqrestore(&bitmap->lock, flags);
if (attr & BITMAP_PAGE_NEEDWRITE) {
if (write_page(bitmap, page, 0))
bitmap_file_kick(bitmap);
page_cache_release(page);
}
continue;
}

bit = file_page_offset(j);

if (page != lastpage) {
/* skip this page unless it's marked as needing cleaning */
if (!((attr=get_page_attr(bitmap, page)) & BITMAP_PAGE_CLEAN)) {
if (attr & BITMAP_PAGE_NEEDWRITE) {
page_cache_get(page);
clear_page_attr(bitmap, page, BITMAP_PAGE_NEEDWRITE);
}
spin_unlock_irqrestore(&bitmap->lock, flags);
if (attr & BITMAP_PAGE_NEEDWRITE) {
if (write_page(bitmap, page, 0))
bitmap_file_kick(bitmap);
page_cache_release(page);
}
continue;
}

/* grab the new page, sync and release the old */
page_cache_get(page);
if (lastpage != NULL) {
Expand Down Expand Up @@ -979,7 +978,7 @@ int bitmap_daemon_work(struct bitmap *bitmap)
-1);

/* clear the bit */
clear_bit(bit, page_address(page));
clear_bit(file_page_offset(j), page_address(page));
}
}
spin_unlock_irqrestore(&bitmap->lock, flags);
Expand Down

0 comments on commit 1604cca

Please sign in to comment.