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>
This commit is contained in:
Fabian Frederick 2014-06-04 16:05:38 -07:00 committed by Linus Torvalds
parent 8fe6929cfd
commit 36dfd116ed
7 changed files with 32 additions and 32 deletions

View File

@ -280,15 +280,15 @@ int fscache_add_cache(struct fscache_cache *cache,
spin_unlock(&fscache_fsdef_index.lock); spin_unlock(&fscache_fsdef_index.lock);
up_write(&fscache_addremove_sem); up_write(&fscache_addremove_sem);
printk(KERN_NOTICE "FS-Cache: Cache \"%s\" added (type %s)\n", pr_notice("Cache \"%s\" added (type %s)\n",
cache->tag->name, cache->ops->name); cache->tag->name, cache->ops->name);
kobject_uevent(cache->kobj, KOBJ_ADD); kobject_uevent(cache->kobj, KOBJ_ADD);
_leave(" = 0 [%s]", cache->identifier); _leave(" = 0 [%s]", cache->identifier);
return 0; return 0;
tag_in_use: tag_in_use:
printk(KERN_ERR "FS-Cache: Cache tag '%s' already in use\n", tagname); pr_err("Cache tag '%s' already in use\n", tagname);
__fscache_release_cache_tag(tag); __fscache_release_cache_tag(tag);
_leave(" = -EXIST"); _leave(" = -EXIST");
return -EEXIST; return -EEXIST;
@ -317,8 +317,7 @@ EXPORT_SYMBOL(fscache_add_cache);
void fscache_io_error(struct fscache_cache *cache) void fscache_io_error(struct fscache_cache *cache)
{ {
if (!test_and_set_bit(FSCACHE_IOERROR, &cache->flags)) if (!test_and_set_bit(FSCACHE_IOERROR, &cache->flags))
printk(KERN_ERR "FS-Cache:" pr_err("Cache '%s' stopped due to I/O error\n",
" Cache '%s' stopped due to I/O error\n",
cache->ops->name); cache->ops->name);
} }
EXPORT_SYMBOL(fscache_io_error); EXPORT_SYMBOL(fscache_io_error);
@ -369,8 +368,8 @@ void fscache_withdraw_cache(struct fscache_cache *cache)
_enter(""); _enter("");
printk(KERN_NOTICE "FS-Cache: Withdrawing cache \"%s\"\n", pr_notice("Withdrawing cache \"%s\"\n",
cache->tag->name); cache->tag->name);
/* make the cache unavailable for cookie acquisition */ /* make the cache unavailable for cookie acquisition */
if (test_and_set_bit(FSCACHE_CACHE_WITHDRAWN, &cache->flags)) if (test_and_set_bit(FSCACHE_CACHE_WITHDRAWN, &cache->flags))

View File

@ -519,7 +519,7 @@ void __fscache_disable_cookie(struct fscache_cookie *cookie, bool invalidate)
ASSERTCMP(atomic_read(&cookie->n_active), >, 0); ASSERTCMP(atomic_read(&cookie->n_active), >, 0);
if (atomic_read(&cookie->n_children) != 0) { if (atomic_read(&cookie->n_children) != 0) {
printk(KERN_ERR "FS-Cache: Cookie '%s' still has children\n", pr_err("Cookie '%s' still has children\n",
cookie->def->name); cookie->def->name);
BUG(); BUG();
} }

View File

@ -22,6 +22,12 @@
* *
*/ */
#ifdef pr_fmt
#undef pr_fmt
#endif
#define pr_fmt(fmt) "FS-Cache: " fmt
#include <linux/fscache-cache.h> #include <linux/fscache-cache.h>
#include <linux/sched.h> #include <linux/sched.h>
@ -413,8 +419,8 @@ do { \
#define ASSERT(X) \ #define ASSERT(X) \
do { \ do { \
if (unlikely(!(X))) { \ if (unlikely(!(X))) { \
printk(KERN_ERR "\n"); \ pr_err("\n"); \
printk(KERN_ERR "FS-Cache: Assertion failed\n"); \ pr_err("Assertion failed\n"); \
BUG(); \ BUG(); \
} \ } \
} while (0) } while (0)
@ -422,9 +428,9 @@ do { \
#define ASSERTCMP(X, OP, Y) \ #define ASSERTCMP(X, OP, Y) \
do { \ do { \
if (unlikely(!((X) OP (Y)))) { \ if (unlikely(!((X) OP (Y)))) { \
printk(KERN_ERR "\n"); \ pr_err("\n"); \
printk(KERN_ERR "FS-Cache: Assertion failed\n"); \ pr_err("Assertion failed\n"); \
printk(KERN_ERR "%lx " #OP " %lx is false\n", \ pr_err("%lx " #OP " %lx is false\n", \
(unsigned long)(X), (unsigned long)(Y)); \ (unsigned long)(X), (unsigned long)(Y)); \
BUG(); \ BUG(); \
} \ } \
@ -433,8 +439,8 @@ do { \
#define ASSERTIF(C, X) \ #define ASSERTIF(C, X) \
do { \ do { \
if (unlikely((C) && !(X))) { \ if (unlikely((C) && !(X))) { \
printk(KERN_ERR "\n"); \ pr_err("\n"); \
printk(KERN_ERR "FS-Cache: Assertion failed\n"); \ pr_err("Assertion failed\n"); \
BUG(); \ BUG(); \
} \ } \
} while (0) } while (0)
@ -442,9 +448,9 @@ do { \
#define ASSERTIFCMP(C, X, OP, Y) \ #define ASSERTIFCMP(C, X, OP, Y) \
do { \ do { \
if (unlikely((C) && !((X) OP (Y)))) { \ if (unlikely((C) && !((X) OP (Y)))) { \
printk(KERN_ERR "\n"); \ pr_err("\n"); \
printk(KERN_ERR "FS-Cache: Assertion failed\n"); \ pr_err("Assertion failed\n"); \
printk(KERN_ERR "%lx " #OP " %lx is false\n", \ pr_err("%lx " #OP " %lx is false\n", \
(unsigned long)(X), (unsigned long)(Y)); \ (unsigned long)(X), (unsigned long)(Y)); \
BUG(); \ BUG(); \
} \ } \

View File

@ -146,8 +146,7 @@ static int __init fscache_init(void)
0, 0,
fscache_cookie_init_once); fscache_cookie_init_once);
if (!fscache_cookie_jar) { if (!fscache_cookie_jar) {
printk(KERN_NOTICE pr_notice("Failed to allocate a cookie jar\n");
"FS-Cache: Failed to allocate a cookie jar\n");
ret = -ENOMEM; ret = -ENOMEM;
goto error_cookie_jar; goto error_cookie_jar;
} }
@ -156,7 +155,7 @@ static int __init fscache_init(void)
if (!fscache_root) if (!fscache_root)
goto error_kobj; goto error_kobj;
printk(KERN_NOTICE "FS-Cache: Loaded\n"); pr_notice("Loaded\n");
return 0; return 0;
error_kobj: error_kobj:
@ -192,7 +191,7 @@ static void __exit fscache_exit(void)
fscache_proc_cleanup(); fscache_proc_cleanup();
destroy_workqueue(fscache_op_wq); destroy_workqueue(fscache_op_wq);
destroy_workqueue(fscache_object_wq); destroy_workqueue(fscache_object_wq);
printk(KERN_NOTICE "FS-Cache: Unloaded\n"); pr_notice("Unloaded\n");
} }
module_exit(fscache_exit); module_exit(fscache_exit);

View File

@ -65,8 +65,7 @@ int __fscache_register_netfs(struct fscache_netfs *netfs)
list_add(&netfs->link, &fscache_netfs_list); list_add(&netfs->link, &fscache_netfs_list);
ret = 0; ret = 0;
printk(KERN_NOTICE "FS-Cache: Netfs '%s' registered for caching\n", pr_notice("Netfs '%s' registered for caching\n", netfs->name);
netfs->name);
already_registered: already_registered:
up_write(&fscache_addremove_sem); up_write(&fscache_addremove_sem);
@ -97,8 +96,8 @@ void __fscache_unregister_netfs(struct fscache_netfs *netfs)
up_write(&fscache_addremove_sem); up_write(&fscache_addremove_sem);
printk(KERN_NOTICE "FS-Cache: Netfs '%s' unregistered from caching\n", pr_notice("Netfs '%s' unregistered from caching\n",
netfs->name); netfs->name);
_leave(""); _leave("");
} }

View File

@ -51,8 +51,7 @@ void fscache_enqueue_operation(struct fscache_operation *op)
_debug("queue for caller's attention"); _debug("queue for caller's attention");
break; break;
default: default:
printk(KERN_ERR "FS-Cache: Unexpected op type %lx", pr_err("Unexpected op type %lx", op->flags);
op->flags);
BUG(); BUG();
break; break;
} }

View File

@ -1108,10 +1108,8 @@ void fscache_mark_page_cached(struct fscache_retrieval *op, struct page *page)
static bool once_only; static bool once_only;
if (!once_only) { if (!once_only) {
once_only = true; once_only = true;
printk(KERN_WARNING "FS-Cache:" pr_warn("Cookie type %s marked page %lx multiple times\n",
" Cookie type %s marked page %lx" cookie->def->name, page->index);
" multiple times\n",
cookie->def->name, page->index);
} }
} }