Skip to content

Commit 36dfd11

Browse files
Fabian Fredericktorvalds
authored andcommitted
fs/fscache: convert printk to pr_foo()
All printk converted to pr_foo() except internal.h: printk(KERN_DEBUG Coalesce formats. Add pr_fmt Signed-off-by: Fabian Frederick <fabf@skynet.be> Cc: David Howells <dhowells@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 8fe6929 commit 36dfd11

7 files changed

Lines changed: 32 additions & 32 deletions

File tree

‎fs/fscache/cache.c‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -280,15 +280,15 @@ int fscache_add_cache(struct fscache_cache *cache,
280280
spin_unlock(&fscache_fsdef_index.lock);
281281
up_write(&fscache_addremove_sem);
282282

283-
printk(KERN_NOTICE "FS-Cache: Cache \"%s\" added (type %s)\n",
284-
cache->tag->name, cache->ops->name);
283+
pr_notice("Cache \"%s\" added (type %s)\n",
284+
cache->tag->name, cache->ops->name);
285285
kobject_uevent(cache->kobj, KOBJ_ADD);
286286

287287
_leave(" = 0 [%s]", cache->identifier);
288288
return 0;
289289

290290
tag_in_use:
291-
printk(KERN_ERR "FS-Cache: Cache tag '%s' already in use\n", tagname);
291+
pr_err("Cache tag '%s' already in use\n", tagname);
292292
__fscache_release_cache_tag(tag);
293293
_leave(" = -EXIST");
294294
return -EEXIST;
@@ -317,8 +317,7 @@ EXPORT_SYMBOL(fscache_add_cache);
317317
void fscache_io_error(struct fscache_cache *cache)
318318
{
319319
if (!test_and_set_bit(FSCACHE_IOERROR, &cache->flags))
320-
printk(KERN_ERR "FS-Cache:"
321-
" Cache '%s' stopped due to I/O error\n",
320+
pr_err("Cache '%s' stopped due to I/O error\n",
322321
cache->ops->name);
323322
}
324323
EXPORT_SYMBOL(fscache_io_error);
@@ -369,8 +368,8 @@ void fscache_withdraw_cache(struct fscache_cache *cache)
369368

370369
_enter("");
371370

372-
printk(KERN_NOTICE "FS-Cache: Withdrawing cache \"%s\"\n",
373-
cache->tag->name);
371+
pr_notice("Withdrawing cache \"%s\"\n",
372+
cache->tag->name);
374373

375374
/* make the cache unavailable for cookie acquisition */
376375
if (test_and_set_bit(FSCACHE_CACHE_WITHDRAWN, &cache->flags))

‎fs/fscache/cookie.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ void __fscache_disable_cookie(struct fscache_cookie *cookie, bool invalidate)
519519
ASSERTCMP(atomic_read(&cookie->n_active), >, 0);
520520

521521
if (atomic_read(&cookie->n_children) != 0) {
522-
printk(KERN_ERR "FS-Cache: Cookie '%s' still has children\n",
522+
pr_err("Cookie '%s' still has children\n",
523523
cookie->def->name);
524524
BUG();
525525
}

‎fs/fscache/internal.h‎

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@
2222
*
2323
*/
2424

25+
#ifdef pr_fmt
26+
#undef pr_fmt
27+
#endif
28+
29+
#define pr_fmt(fmt) "FS-Cache: " fmt
30+
2531
#include <linux/fscache-cache.h>
2632
#include <linux/sched.h>
2733

@@ -413,18 +419,18 @@ do { \
413419
#define ASSERT(X) \
414420
do { \
415421
if (unlikely(!(X))) { \
416-
printk(KERN_ERR "\n"); \
417-
printk(KERN_ERR "FS-Cache: Assertion failed\n"); \
422+
pr_err("\n"); \
423+
pr_err("Assertion failed\n"); \
418424
BUG(); \
419425
} \
420426
} while (0)
421427

422428
#define ASSERTCMP(X, OP, Y) \
423429
do { \
424430
if (unlikely(!((X) OP (Y)))) { \
425-
printk(KERN_ERR "\n"); \
426-
printk(KERN_ERR "FS-Cache: Assertion failed\n"); \
427-
printk(KERN_ERR "%lx " #OP " %lx is false\n", \
431+
pr_err("\n"); \
432+
pr_err("Assertion failed\n"); \
433+
pr_err("%lx " #OP " %lx is false\n", \
428434
(unsigned long)(X), (unsigned long)(Y)); \
429435
BUG(); \
430436
} \
@@ -433,18 +439,18 @@ do { \
433439
#define ASSERTIF(C, X) \
434440
do { \
435441
if (unlikely((C) && !(X))) { \
436-
printk(KERN_ERR "\n"); \
437-
printk(KERN_ERR "FS-Cache: Assertion failed\n"); \
442+
pr_err("\n"); \
443+
pr_err("Assertion failed\n"); \
438444
BUG(); \
439445
} \
440446
} while (0)
441447

442448
#define ASSERTIFCMP(C, X, OP, Y) \
443449
do { \
444450
if (unlikely((C) && !((X) OP (Y)))) { \
445-
printk(KERN_ERR "\n"); \
446-
printk(KERN_ERR "FS-Cache: Assertion failed\n"); \
447-
printk(KERN_ERR "%lx " #OP " %lx is false\n", \
451+
pr_err("\n"); \
452+
pr_err("Assertion failed\n"); \
453+
pr_err("%lx " #OP " %lx is false\n", \
448454
(unsigned long)(X), (unsigned long)(Y)); \
449455
BUG(); \
450456
} \

‎fs/fscache/main.c‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,7 @@ static int __init fscache_init(void)
146146
0,
147147
fscache_cookie_init_once);
148148
if (!fscache_cookie_jar) {
149-
printk(KERN_NOTICE
150-
"FS-Cache: Failed to allocate a cookie jar\n");
149+
pr_notice("Failed to allocate a cookie jar\n");
151150
ret = -ENOMEM;
152151
goto error_cookie_jar;
153152
}
@@ -156,7 +155,7 @@ static int __init fscache_init(void)
156155
if (!fscache_root)
157156
goto error_kobj;
158157

159-
printk(KERN_NOTICE "FS-Cache: Loaded\n");
158+
pr_notice("Loaded\n");
160159
return 0;
161160

162161
error_kobj:
@@ -192,7 +191,7 @@ static void __exit fscache_exit(void)
192191
fscache_proc_cleanup();
193192
destroy_workqueue(fscache_op_wq);
194193
destroy_workqueue(fscache_object_wq);
195-
printk(KERN_NOTICE "FS-Cache: Unloaded\n");
194+
pr_notice("Unloaded\n");
196195
}
197196

198197
module_exit(fscache_exit);

‎fs/fscache/netfs.c‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@ int __fscache_register_netfs(struct fscache_netfs *netfs)
6565
list_add(&netfs->link, &fscache_netfs_list);
6666
ret = 0;
6767

68-
printk(KERN_NOTICE "FS-Cache: Netfs '%s' registered for caching\n",
69-
netfs->name);
68+
pr_notice("Netfs '%s' registered for caching\n", netfs->name);
7069

7170
already_registered:
7271
up_write(&fscache_addremove_sem);
@@ -97,8 +96,8 @@ void __fscache_unregister_netfs(struct fscache_netfs *netfs)
9796

9897
up_write(&fscache_addremove_sem);
9998

100-
printk(KERN_NOTICE "FS-Cache: Netfs '%s' unregistered from caching\n",
101-
netfs->name);
99+
pr_notice("Netfs '%s' unregistered from caching\n",
100+
netfs->name);
102101

103102
_leave("");
104103
}

‎fs/fscache/operation.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ void fscache_enqueue_operation(struct fscache_operation *op)
5151
_debug("queue for caller's attention");
5252
break;
5353
default:
54-
printk(KERN_ERR "FS-Cache: Unexpected op type %lx",
55-
op->flags);
54+
pr_err("Unexpected op type %lx", op->flags);
5655
BUG();
5756
break;
5857
}

‎fs/fscache/page.c‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,10 +1108,8 @@ void fscache_mark_page_cached(struct fscache_retrieval *op, struct page *page)
11081108
static bool once_only;
11091109
if (!once_only) {
11101110
once_only = true;
1111-
printk(KERN_WARNING "FS-Cache:"
1112-
" Cookie type %s marked page %lx"
1113-
" multiple times\n",
1114-
cookie->def->name, page->index);
1111+
pr_warn("Cookie type %s marked page %lx multiple times\n",
1112+
cookie->def->name, page->index);
11151113
}
11161114
}
11171115

0 commit comments

Comments
 (0)