Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 30370
b: refs/heads/master
c: a647e4b
h: refs/heads/master
v: v3
  • Loading branch information
NeilBrown authored and Linus Torvalds committed Jun 26, 2006
1 parent 59067e2 commit 1b3f017
Show file tree
Hide file tree
Showing 2 changed files with 3 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: e16b68b6e456a61b895a198baf5aa473cf2a32bf
refs/heads/master: a647e4bc5ce697e25ff50d2e22de68a581b1ed38
20 changes: 2 additions & 18 deletions trunk/drivers/md/bitmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,6 @@ static int write_page(struct bitmap *bitmap, struct page *page, int wait)
/* add to list to be waited for */
struct page_list *item = mempool_alloc(bitmap->write_pool, GFP_NOIO);
item->page = page;
get_page(page);
spin_lock(&bitmap->write_lock);
list_add(&item->list, &bitmap->complete_pages);
spin_unlock(&bitmap->write_lock);
Expand Down Expand Up @@ -548,7 +547,6 @@ static void bitmap_mask_state(struct bitmap *bitmap, enum bitmap_state bits,
spin_unlock_irqrestore(&bitmap->lock, flags);
return;
}
get_page(bitmap->sb_page);
spin_unlock_irqrestore(&bitmap->lock, flags);
sb = (bitmap_super_t *)kmap_atomic(bitmap->sb_page, KM_USER0);
switch (op) {
Expand All @@ -559,7 +557,6 @@ static void bitmap_mask_state(struct bitmap *bitmap, enum bitmap_state bits,
default: BUG();
}
kunmap_atomic(sb, KM_USER0);
put_page(bitmap->sb_page);
}

/*
Expand Down Expand Up @@ -641,7 +638,6 @@ static void drain_write_queues(struct bitmap *bitmap)

while ((item = dequeue_page(bitmap))) {
/* don't bother to wait */
put_page(item->page);
mempool_free(item, bitmap->write_pool);
}
}
Expand Down Expand Up @@ -744,11 +740,6 @@ static void bitmap_file_set_bit(struct bitmap *bitmap, sector_t block)
page = filemap_get_page(bitmap, chunk);
bit = file_page_offset(chunk);


/* make sure the page stays cached until it gets written out */
if (! test_page_attr(bitmap, page, BITMAP_PAGE_DIRTY))
get_page(page);

/* set the bit */
kaddr = kmap_atomic(page, KM_USER0);
if (bitmap->flags & BITMAP_HOSTENDIAN)
Expand Down Expand Up @@ -1028,10 +1019,9 @@ int bitmap_daemon_work(struct bitmap *bitmap)
if (!test_page_attr(bitmap, page, BITMAP_PAGE_CLEAN)) {
int need_write = test_page_attr(bitmap, page,
BITMAP_PAGE_NEEDWRITE);
if (need_write) {
get_page(page);
if (need_write)
clear_page_attr(bitmap, page, BITMAP_PAGE_NEEDWRITE);
}

spin_unlock_irqrestore(&bitmap->lock, flags);
if (need_write) {
switch (write_page(bitmap, page, 0)) {
Expand All @@ -1043,13 +1033,11 @@ int bitmap_daemon_work(struct bitmap *bitmap)
default:
bitmap_file_kick(bitmap);
}
put_page(page);
}
continue;
}

/* grab the new page, sync and release the old */
get_page(page);
if (lastpage != NULL) {
if (test_page_attr(bitmap, lastpage, BITMAP_PAGE_NEEDWRITE)) {
clear_page_attr(bitmap, lastpage, BITMAP_PAGE_NEEDWRITE);
Expand All @@ -1063,7 +1051,6 @@ int bitmap_daemon_work(struct bitmap *bitmap)
set_page_attr(bitmap, lastpage, BITMAP_PAGE_NEEDWRITE);
spin_unlock_irqrestore(&bitmap->lock, flags);
}
put_page(lastpage);
if (err)
bitmap_file_kick(bitmap);
} else
Expand Down Expand Up @@ -1117,8 +1104,6 @@ int bitmap_daemon_work(struct bitmap *bitmap)
set_page_attr(bitmap, lastpage, BITMAP_PAGE_NEEDWRITE);
spin_unlock_irqrestore(&bitmap->lock, flags);
}

put_page(lastpage);
}

return err;
Expand All @@ -1140,7 +1125,6 @@ static void bitmap_writeback(struct bitmap *bitmap)
PRINTK("finished page writeback: %p\n", page);

err = PageError(page);
put_page(page);
if (err) {
printk(KERN_WARNING "%s: bitmap file writeback "
"failed (page %lu): %d\n",
Expand Down

0 comments on commit 1b3f017

Please sign in to comment.