Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 291834
b: refs/heads/master
c: 589973a
h: refs/heads/master
v: v3
  • Loading branch information
Cong Wang authored and Cong Wang committed Mar 20, 2012
1 parent 9f6f722 commit 297d0a1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 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: 97d5dd121c3304c65326f1ce9f04f7d0161827bc
refs/heads/master: 589973a7042f5a91a5b8bf78a32c97ae073e2c72
14 changes: 7 additions & 7 deletions trunk/drivers/block/drbd/drbd_bitmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ static unsigned int bm_bit_to_page_idx(struct drbd_bitmap *b, u64 bitnr)
return page_nr;
}

static unsigned long *__bm_map_pidx(struct drbd_bitmap *b, unsigned int idx, const enum km_type km)
static unsigned long *__bm_map_pidx(struct drbd_bitmap *b, unsigned int idx)
{
struct page *page = b->bm_pages[idx];
return (unsigned long *) kmap_atomic(page);
Expand Down Expand Up @@ -551,15 +551,15 @@ static unsigned long bm_count_bits(struct drbd_bitmap *b)
}
/* last (or only) page */
last_word = ((b->bm_bits - 1) & BITS_PER_PAGE_MASK) >> LN2_BPL;
p_addr = __bm_map_pidx(b, idx, KM_USER0);
p_addr = __bm_map_pidx(b, idx);
for (i = 0; i < last_word; i++)
bits += hweight_long(p_addr[i]);
p_addr[last_word] &= cpu_to_lel(mask);
bits += hweight_long(p_addr[last_word]);
/* 32bit arch, may have an unused padding long */
if (BITS_PER_LONG == 32 && (last_word & 1) == 0)
p_addr[last_word+1] = 0;
__bm_unmap(p_addr, KM_USER0);
__bm_unmap(p_addr);
return bits;
}

Expand Down Expand Up @@ -970,11 +970,11 @@ static void bm_page_io_async(struct bm_aio_ctx *ctx, int page_nr, int rw) __must
* to use pre-allocated page pool */
void *src, *dest;
page = alloc_page(__GFP_HIGHMEM|__GFP_WAIT);
dest = kmap_atomic(page, KM_USER0);
src = kmap_atomic(b->bm_pages[page_nr], KM_USER1);
dest = kmap_atomic(page);
src = kmap_atomic(b->bm_pages[page_nr]);
memcpy(dest, src, PAGE_SIZE);
kunmap_atomic(src, KM_USER1);
kunmap_atomic(dest, KM_USER0);
kunmap_atomic(src);
kunmap_atomic(dest);
bm_store_page_idx(page, page_nr);
} else
page = b->bm_pages[page_nr];
Expand Down

0 comments on commit 297d0a1

Please sign in to comment.