aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/bitmap.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2011-10-06 23:23:17 -0400
committerNeilBrown <neilb@suse.de>2011-10-06 23:23:17 -0400
commit36a4e1fe0f454146724c174bf7c1e8e76297a212 (patch)
tree57f0de83fda98e5ae1b4f66d5e993ca27386a793 /drivers/md/bitmap.c
parentbdc04e6b15f70a8f96d8cdfe21df159a6466b49a (diff)
md: remove PRINTK and dprintk debugging and use pr_debug
Being able to dynamically enable these make them much more useful. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/bitmap.c')
-rw-r--r--drivers/md/bitmap.c33
1 files changed, 13 insertions, 20 deletions
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
index 689623c3cffa..cd722b83a0c9 100644
--- a/drivers/md/bitmap.c
+++ b/drivers/md/bitmap.c
@@ -50,14 +50,6 @@
50#define INJECT_FATAL_FAULT_3 0 /* undef */ 50#define INJECT_FATAL_FAULT_3 0 /* undef */
51#endif 51#endif
52 52
53#ifndef PRINTK
54# if DEBUG > 0
55# define PRINTK(x...) printk(KERN_DEBUG x)
56# else
57# define PRINTK(x...)
58# endif
59#endif
60
61static inline char *bmname(struct bitmap *bitmap) 53static inline char *bmname(struct bitmap *bitmap)
62{ 54{
63 return bitmap->mddev ? mdname(bitmap->mddev) : "mdX"; 55 return bitmap->mddev ? mdname(bitmap->mddev) : "mdX";
@@ -78,8 +70,8 @@ static unsigned char *bitmap_alloc_page(struct bitmap *bitmap)
78 if (!page) 70 if (!page)
79 printk("%s: bitmap_alloc_page FAILED\n", bmname(bitmap)); 71 printk("%s: bitmap_alloc_page FAILED\n", bmname(bitmap));
80 else 72 else
81 PRINTK("%s: bitmap_alloc_page: allocated page at %p\n", 73 pr_debug("%s: bitmap_alloc_page: allocated page at %p\n",
82 bmname(bitmap), page); 74 bmname(bitmap), page);
83 return page; 75 return page;
84} 76}
85 77
@@ -88,7 +80,7 @@ static unsigned char *bitmap_alloc_page(struct bitmap *bitmap)
88 */ 80 */
89static void bitmap_free_page(struct bitmap *bitmap, unsigned char *page) 81static void bitmap_free_page(struct bitmap *bitmap, unsigned char *page)
90{ 82{
91 PRINTK("%s: bitmap_free_page: free page %p\n", bmname(bitmap), page); 83 pr_debug("%s: bitmap_free_page: free page %p\n", bmname(bitmap), page);
92 kfree(page); 84 kfree(page);
93} 85}
94 86
@@ -133,8 +125,8 @@ __acquires(bitmap->lock)
133 spin_lock_irq(&bitmap->lock); 125 spin_lock_irq(&bitmap->lock);
134 126
135 if (mappage == NULL) { 127 if (mappage == NULL) {
136 PRINTK("%s: bitmap map page allocation failed, hijacking\n", 128 pr_debug("%s: bitmap map page allocation failed, hijacking\n",
137 bmname(bitmap)); 129 bmname(bitmap));
138 /* failed - set the hijacked flag so that we can use the 130 /* failed - set the hijacked flag so that we can use the
139 * pointer as a counter */ 131 * pointer as a counter */
140 if (!bitmap->bp[page].map) 132 if (!bitmap->bp[page].map)
@@ -409,8 +401,8 @@ static struct page *read_page(struct file *file, unsigned long index,
409 struct buffer_head *bh; 401 struct buffer_head *bh;
410 sector_t block; 402 sector_t block;
411 403
412 PRINTK("read bitmap file (%dB @ %llu)\n", (int)PAGE_SIZE, 404 pr_debug("read bitmap file (%dB @ %llu)\n", (int)PAGE_SIZE,
413 (unsigned long long)index << PAGE_SHIFT); 405 (unsigned long long)index << PAGE_SHIFT);
414 406
415 page = alloc_page(GFP_KERNEL); 407 page = alloc_page(GFP_KERNEL);
416 if (!page) 408 if (!page)
@@ -920,7 +912,7 @@ static void bitmap_file_set_bit(struct bitmap *bitmap, sector_t block)
920 else 912 else
921 __set_bit_le(bit, kaddr); 913 __set_bit_le(bit, kaddr);
922 kunmap_atomic(kaddr, KM_USER0); 914 kunmap_atomic(kaddr, KM_USER0);
923 PRINTK("set file bit %lu page %lu\n", bit, page->index); 915 pr_debug("set file bit %lu page %lu\n", bit, page->index);
924 /* record page number so it gets flushed to disk when unplug occurs */ 916 /* record page number so it gets flushed to disk when unplug occurs */
925 set_page_attr(bitmap, page, BITMAP_PAGE_DIRTY); 917 set_page_attr(bitmap, page, BITMAP_PAGE_DIRTY);
926} 918}
@@ -1364,8 +1356,8 @@ int bitmap_startwrite(struct bitmap *bitmap, sector_t offset, unsigned long sect
1364 if (bw > bitmap->behind_writes_used) 1356 if (bw > bitmap->behind_writes_used)
1365 bitmap->behind_writes_used = bw; 1357 bitmap->behind_writes_used = bw;
1366 1358
1367 PRINTK(KERN_DEBUG "inc write-behind count %d/%d\n", 1359 pr_debug("inc write-behind count %d/%lu\n",
1368 bw, bitmap->max_write_behind); 1360 bw, bitmap->mddev->bitmap_info.max_write_behind);
1369 } 1361 }
1370 1362
1371 while (sectors) { 1363 while (sectors) {
@@ -1424,8 +1416,9 @@ void bitmap_endwrite(struct bitmap *bitmap, sector_t offset, unsigned long secto
1424 if (behind) { 1416 if (behind) {
1425 if (atomic_dec_and_test(&bitmap->behind_writes)) 1417 if (atomic_dec_and_test(&bitmap->behind_writes))
1426 wake_up(&bitmap->behind_wait); 1418 wake_up(&bitmap->behind_wait);
1427 PRINTK(KERN_DEBUG "dec write-behind count %d/%d\n", 1419 pr_debug("dec write-behind count %d/%lu\n",
1428 atomic_read(&bitmap->behind_writes), bitmap->max_write_behind); 1420 atomic_read(&bitmap->behind_writes),
1421 bitmap->mddev->bitmap_info.max_write_behind);
1429 } 1422 }
1430 if (bitmap->mddev->degraded) 1423 if (bitmap->mddev->degraded)
1431 /* Never clear bits or update events_cleared when degraded */ 1424 /* Never clear bits or update events_cleared when degraded */