From 66ec8a49bf8874ede86cd38e6bedd3cdfe69d19f Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Mon, 19 Mar 2012 12:46:41 +1100 Subject: [PATCH] --- yaml --- r: 292803 b: refs/heads/master c: 792a1d4bbf960000f066358f0a8c6e769c8c72bc h: refs/heads/master i: 292801: d3786b29ae325870d7bae6b3f1590d789802bcaa 292799: 84fcff607a8ab2c71fed02d8132175fc95e884a3 v: v3 --- [refs] | 2 +- trunk/drivers/md/bitmap.c | 31 +++---------------------------- 2 files changed, 4 insertions(+), 29 deletions(-) diff --git a/[refs] b/[refs] index 00ab4e1c0293..2f72fc0baee1 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 5a6c824ebb7c9f8dbbc92ffd3528e6366cad1a54 +refs/heads/master: 792a1d4bbf960000f066358f0a8c6e769c8c72bc diff --git a/trunk/drivers/md/bitmap.c b/trunk/drivers/md/bitmap.c index e12b515bd471..534e0077d21a 100644 --- a/trunk/drivers/md/bitmap.c +++ b/trunk/drivers/md/bitmap.c @@ -35,31 +35,6 @@ static inline char *bmname(struct bitmap *bitmap) return bitmap->mddev ? mdname(bitmap->mddev) : "mdX"; } -/* - * just a placeholder - calls kmalloc for bitmap pages - */ -static unsigned char *bitmap_alloc_page(struct bitmap *bitmap) -{ - unsigned char *page; - - page = kzalloc(PAGE_SIZE, GFP_NOIO); - if (!page) - printk("%s: bitmap_alloc_page FAILED\n", bmname(bitmap)); - else - pr_debug("%s: bitmap_alloc_page: allocated page at %p\n", - bmname(bitmap), page); - return page; -} - -/* - * for now just a placeholder -- just calls kfree for bitmap pages - */ -static void bitmap_free_page(struct bitmap *bitmap, unsigned char *page) -{ - pr_debug("%s: bitmap_free_page: free page %p\n", bmname(bitmap), page); - kfree(page); -} - /* * check a page and, if necessary, allocate it (or hijack it if the alloc fails) * @@ -97,7 +72,7 @@ __acquires(bitmap->lock) /* this page has not been allocated yet */ spin_unlock_irq(&bitmap->lock); - mappage = bitmap_alloc_page(bitmap); + mappage = kzalloc(PAGE_SIZE, GFP_NOIO); spin_lock_irq(&bitmap->lock); if (mappage == NULL) { @@ -110,7 +85,7 @@ __acquires(bitmap->lock) } else if (bitmap->bp[page].map || bitmap->bp[page].hijacked) { /* somebody beat us to getting the page */ - bitmap_free_page(bitmap, mappage); + kfree(mappage); return 0; } else { @@ -142,7 +117,7 @@ static void bitmap_checkfree(struct bitmap *bitmap, unsigned long page) ptr = bitmap->bp[page].map; bitmap->bp[page].map = NULL; bitmap->missing_pages++; - bitmap_free_page(bitmap, ptr); + kfree(ptr); } }