diff options
author | Coly Li <colyli@suse.de> | 2018-08-11 01:19:49 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2018-08-11 17:46:41 -0400 |
commit | 6ae63e3501c493616612b90be26b35a6084fc75d (patch) | |
tree | 9929883154bbea146c638d12d4921439c2805925 | |
parent | 958bf494ecf0a6755309569a9083bf123d6e3754 (diff) |
bcache: replace printk() by pr_*() routines
There are still many places in bcache use printk to display kernel
message, which are suggested to be preplaced by pr_*() routines like
pr_err(), pr_info(), or pr_notice().
This patch replaces all printk() with a proper pr_*() routine for
bcache code.
Signed-off-by: Coly Li <colyli@suse.de>
Reviewed-by: Shenghui Wang <shhuiw@foxmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r-- | drivers/md/bcache/bset.c | 8 | ||||
-rw-r--r-- | drivers/md/bcache/debug.c | 10 | ||||
-rw-r--r-- | drivers/md/bcache/extents.c | 8 | ||||
-rw-r--r-- | drivers/md/bcache/super.c | 4 |
4 files changed, 15 insertions, 15 deletions
diff --git a/drivers/md/bcache/bset.c b/drivers/md/bcache/bset.c index 19b4febe5b45..b6a3f9d291a9 100644 --- a/drivers/md/bcache/bset.c +++ b/drivers/md/bcache/bset.c | |||
@@ -25,18 +25,18 @@ void bch_dump_bset(struct btree_keys *b, struct bset *i, unsigned int set) | |||
25 | for (k = i->start; k < bset_bkey_last(i); k = next) { | 25 | for (k = i->start; k < bset_bkey_last(i); k = next) { |
26 | next = bkey_next(k); | 26 | next = bkey_next(k); |
27 | 27 | ||
28 | printk(KERN_ERR "block %u key %u/%u: ", set, | 28 | pr_err("block %u key %u/%u: ", set, |
29 | (unsigned int) ((u64 *) k - i->d), i->keys); | 29 | (unsigned int) ((u64 *) k - i->d), i->keys); |
30 | 30 | ||
31 | if (b->ops->key_dump) | 31 | if (b->ops->key_dump) |
32 | b->ops->key_dump(b, k); | 32 | b->ops->key_dump(b, k); |
33 | else | 33 | else |
34 | printk("%llu:%llu\n", KEY_INODE(k), KEY_OFFSET(k)); | 34 | pr_err("%llu:%llu\n", KEY_INODE(k), KEY_OFFSET(k)); |
35 | 35 | ||
36 | if (next < bset_bkey_last(i) && | 36 | if (next < bset_bkey_last(i) && |
37 | bkey_cmp(k, b->ops->is_extents ? | 37 | bkey_cmp(k, b->ops->is_extents ? |
38 | &START_KEY(next) : next) > 0) | 38 | &START_KEY(next) : next) > 0) |
39 | printk(KERN_ERR "Key skipped backwards\n"); | 39 | pr_err("Key skipped backwards\n"); |
40 | } | 40 | } |
41 | } | 41 | } |
42 | 42 | ||
@@ -482,7 +482,7 @@ void inorder_test(void) | |||
482 | unsigned int i = 1, j = rounddown_pow_of_two(size - 1); | 482 | unsigned int i = 1, j = rounddown_pow_of_two(size - 1); |
483 | 483 | ||
484 | if (!(size % 4096)) | 484 | if (!(size % 4096)) |
485 | printk(KERN_NOTICE "loop %u, %llu per us\n", size, | 485 | pr_notice("loop %u, %llu per us\n", size, |
486 | done / ktime_us_delta(ktime_get(), start)); | 486 | done / ktime_us_delta(ktime_get(), start)); |
487 | 487 | ||
488 | while (1) { | 488 | while (1) { |
diff --git a/drivers/md/bcache/debug.c b/drivers/md/bcache/debug.c index a8f70c916fdb..06da66b2488a 100644 --- a/drivers/md/bcache/debug.c +++ b/drivers/md/bcache/debug.c | |||
@@ -74,28 +74,28 @@ void bch_btree_verify(struct btree *b) | |||
74 | 74 | ||
75 | console_lock(); | 75 | console_lock(); |
76 | 76 | ||
77 | printk(KERN_ERR "*** in memory:\n"); | 77 | pr_err("*** in memory:\n"); |
78 | bch_dump_bset(&b->keys, inmemory, 0); | 78 | bch_dump_bset(&b->keys, inmemory, 0); |
79 | 79 | ||
80 | printk(KERN_ERR "*** read back in:\n"); | 80 | pr_err("*** read back in:\n"); |
81 | bch_dump_bset(&v->keys, sorted, 0); | 81 | bch_dump_bset(&v->keys, sorted, 0); |
82 | 82 | ||
83 | for_each_written_bset(b, ondisk, i) { | 83 | for_each_written_bset(b, ondisk, i) { |
84 | unsigned int block = ((void *) i - (void *) ondisk) / | 84 | unsigned int block = ((void *) i - (void *) ondisk) / |
85 | block_bytes(b->c); | 85 | block_bytes(b->c); |
86 | 86 | ||
87 | printk(KERN_ERR "*** on disk block %u:\n", block); | 87 | pr_err("*** on disk block %u:\n", block); |
88 | bch_dump_bset(&b->keys, i, block); | 88 | bch_dump_bset(&b->keys, i, block); |
89 | } | 89 | } |
90 | 90 | ||
91 | printk(KERN_ERR "*** block %zu not written\n", | 91 | pr_err("*** block %zu not written\n", |
92 | ((void *) i - (void *) ondisk) / block_bytes(b->c)); | 92 | ((void *) i - (void *) ondisk) / block_bytes(b->c)); |
93 | 93 | ||
94 | for (j = 0; j < inmemory->keys; j++) | 94 | for (j = 0; j < inmemory->keys; j++) |
95 | if (inmemory->d[j] != sorted->d[j]) | 95 | if (inmemory->d[j] != sorted->d[j]) |
96 | break; | 96 | break; |
97 | 97 | ||
98 | printk(KERN_ERR "b->written %u\n", b->written); | 98 | pr_err("b->written %u\n", b->written); |
99 | 99 | ||
100 | console_unlock(); | 100 | console_unlock(); |
101 | panic("verify failed at %u\n", j); | 101 | panic("verify failed at %u\n", j); |
diff --git a/drivers/md/bcache/extents.c b/drivers/md/bcache/extents.c index cb3b2c613ed6..c809724e6571 100644 --- a/drivers/md/bcache/extents.c +++ b/drivers/md/bcache/extents.c | |||
@@ -130,18 +130,18 @@ static void bch_bkey_dump(struct btree_keys *keys, const struct bkey *k) | |||
130 | char buf[80]; | 130 | char buf[80]; |
131 | 131 | ||
132 | bch_extent_to_text(buf, sizeof(buf), k); | 132 | bch_extent_to_text(buf, sizeof(buf), k); |
133 | printk(" %s", buf); | 133 | pr_err(" %s", buf); |
134 | 134 | ||
135 | for (j = 0; j < KEY_PTRS(k); j++) { | 135 | for (j = 0; j < KEY_PTRS(k); j++) { |
136 | size_t n = PTR_BUCKET_NR(b->c, k, j); | 136 | size_t n = PTR_BUCKET_NR(b->c, k, j); |
137 | 137 | ||
138 | printk(" bucket %zu", n); | 138 | pr_err(" bucket %zu", n); |
139 | if (n >= b->c->sb.first_bucket && n < b->c->sb.nbuckets) | 139 | if (n >= b->c->sb.first_bucket && n < b->c->sb.nbuckets) |
140 | printk(" prio %i", | 140 | pr_err(" prio %i", |
141 | PTR_BUCKET(b->c, k, j)->prio); | 141 | PTR_BUCKET(b->c, k, j)->prio); |
142 | } | 142 | } |
143 | 143 | ||
144 | printk(" %s\n", bch_ptr_status(b->c, k)); | 144 | pr_err(" %s\n", bch_ptr_status(b->c, k)); |
145 | } | 145 | } |
146 | 146 | ||
147 | /* Btree ptrs */ | 147 | /* Btree ptrs */ |
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c index 296fc8c31c6c..2a7be104557e 100644 --- a/drivers/md/bcache/super.c +++ b/drivers/md/bcache/super.c | |||
@@ -1472,13 +1472,13 @@ bool bch_cache_set_error(struct cache_set *c, const char *fmt, ...) | |||
1472 | acquire_console_sem(); | 1472 | acquire_console_sem(); |
1473 | */ | 1473 | */ |
1474 | 1474 | ||
1475 | printk(KERN_ERR "bcache: error on %pU: ", c->sb.set_uuid); | 1475 | pr_err("bcache: error on %pU: ", c->sb.set_uuid); |
1476 | 1476 | ||
1477 | va_start(args, fmt); | 1477 | va_start(args, fmt); |
1478 | vprintk(fmt, args); | 1478 | vprintk(fmt, args); |
1479 | va_end(args); | 1479 | va_end(args); |
1480 | 1480 | ||
1481 | printk(", disabling caching\n"); | 1481 | pr_err(", disabling caching\n"); |
1482 | 1482 | ||
1483 | if (c->on_error == ON_ERROR_PANIC) | 1483 | if (c->on_error == ON_ERROR_PANIC) |
1484 | panic("panic forced after error\n"); | 1484 | panic("panic forced after error\n"); |