fs/fscache: convert printk to pr_foo()
authorFabian Frederick <fabf@skynet.be>
Wed, 4 Jun 2014 23:05:38 +0000 (16:05 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 4 Jun 2014 23:53:51 +0000 (16:53 -0700)
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>
fs/fscache/cache.c
fs/fscache/cookie.c
fs/fscache/internal.h
fs/fscache/main.c
fs/fscache/netfs.c
fs/fscache/operation.c
fs/fscache/page.c

index f7cff367db7f2df8c358b5a723889b4bd8790f54..56cce7fdd39ec3ed492717a3949a6091fdb765df 100644 (file)
@@ -280,15 +280,15 @@ int fscache_add_cache(struct fscache_cache *cache,
        spin_unlock(&fscache_fsdef_index.lock);
        up_write(&fscache_addremove_sem);
 
-       printk(KERN_NOTICE "FS-Cache: Cache \"%s\" added (type %s)\n",
-              cache->tag->name, cache->ops->name);
+       pr_notice("Cache \"%s\" added (type %s)\n",
+                 cache->tag->name, cache->ops->name);
        kobject_uevent(cache->kobj, KOBJ_ADD);
 
        _leave(" = 0 [%s]", cache->identifier);
        return 0;
 
 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);
        _leave(" = -EXIST");
        return -EEXIST;
@@ -317,8 +317,7 @@ EXPORT_SYMBOL(fscache_add_cache);
 void fscache_io_error(struct fscache_cache *cache)
 {
        if (!test_and_set_bit(FSCACHE_IOERROR, &cache->flags))
-               printk(KERN_ERR "FS-Cache:"
-                      " Cache '%s' stopped due to I/O error\n",
+               pr_err("Cache '%s' stopped due to I/O error\n",
                       cache->ops->name);
 }
 EXPORT_SYMBOL(fscache_io_error);
@@ -369,8 +368,8 @@ void fscache_withdraw_cache(struct fscache_cache *cache)
 
        _enter("");
 
-       printk(KERN_NOTICE "FS-Cache: Withdrawing cache \"%s\"\n",
-              cache->tag->name);
+       pr_notice("Withdrawing cache \"%s\"\n",
+                 cache->tag->name);
 
        /* make the cache unavailable for cookie acquisition */
        if (test_and_set_bit(FSCACHE_CACHE_WITHDRAWN, &cache->flags))
index 29d7feb62cf7a5784a3828d9e6b19db4c30ceb01..aec01be91b0adaafff51cd052edbd8ac12915dfa 100644 (file)
@@ -519,7 +519,7 @@ void __fscache_disable_cookie(struct fscache_cookie *cookie, bool invalidate)
        ASSERTCMP(atomic_read(&cookie->n_active), >, 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);
                BUG();
        }
index 4226f6680b06b7ff5dae4c3934009dab2ef18201..bc6c08fcfddd6cda35bfe888ec29f118caf70500 100644 (file)
  *
  */
 
+#ifdef pr_fmt
+#undef pr_fmt
+#endif
+
+#define pr_fmt(fmt) "FS-Cache: " fmt
+
 #include <linux/fscache-cache.h>
 #include <linux/sched.h>
 
@@ -413,8 +419,8 @@ do {                                                \
 #define ASSERT(X)                                                      \
 do {                                                                   \
        if (unlikely(!(X))) {                                           \
-               printk(KERN_ERR "\n");                                  \
-               printk(KERN_ERR "FS-Cache: Assertion failed\n");        \
+               pr_err("\n");                                   \
+               pr_err("Assertion failed\n");   \
                BUG();                                                  \
        }                                                               \
 } while (0)
@@ -422,9 +428,9 @@ do {                                                                        \
 #define ASSERTCMP(X, OP, Y)                                            \
 do {                                                                   \
        if (unlikely(!((X) OP (Y)))) {                                  \
-               printk(KERN_ERR "\n");                                  \
-               printk(KERN_ERR "FS-Cache: Assertion failed\n");        \
-               printk(KERN_ERR "%lx " #OP " %lx is false\n",           \
+               pr_err("\n");                                   \
+               pr_err("Assertion failed\n");   \
+               pr_err("%lx " #OP " %lx is false\n",            \
                       (unsigned long)(X), (unsigned long)(Y));         \
                BUG();                                                  \
        }                                                               \
@@ -433,8 +439,8 @@ do {                                                                        \
 #define ASSERTIF(C, X)                                                 \
 do {                                                                   \
        if (unlikely((C) && !(X))) {                                    \
-               printk(KERN_ERR "\n");                                  \
-               printk(KERN_ERR "FS-Cache: Assertion failed\n");        \
+               pr_err("\n");                                   \
+               pr_err("Assertion failed\n");   \
                BUG();                                                  \
        }                                                               \
 } while (0)
@@ -442,9 +448,9 @@ do {                                                                        \
 #define ASSERTIFCMP(C, X, OP, Y)                                       \
 do {                                                                   \
        if (unlikely((C) && !((X) OP (Y)))) {                           \
-               printk(KERN_ERR "\n");                                  \
-               printk(KERN_ERR "FS-Cache: Assertion failed\n");        \
-               printk(KERN_ERR "%lx " #OP " %lx is false\n",           \
+               pr_err("\n");                                   \
+               pr_err("Assertion failed\n");   \
+               pr_err("%lx " #OP " %lx is false\n",            \
                       (unsigned long)(X), (unsigned long)(Y));         \
                BUG();                                                  \
        }                                                               \
index 7c27907e650c216cade20928cd8fb4f0f1ac4363..acd4bf1fc2779a43fece1e33e94fa5865106e6d1 100644 (file)
@@ -146,8 +146,7 @@ static int __init fscache_init(void)
                                               0,
                                               fscache_cookie_init_once);
        if (!fscache_cookie_jar) {
-               printk(KERN_NOTICE
-                      "FS-Cache: Failed to allocate a cookie jar\n");
+               pr_notice("Failed to allocate a cookie jar\n");
                ret = -ENOMEM;
                goto error_cookie_jar;
        }
@@ -156,7 +155,7 @@ static int __init fscache_init(void)
        if (!fscache_root)
                goto error_kobj;
 
-       printk(KERN_NOTICE "FS-Cache: Loaded\n");
+       pr_notice("Loaded\n");
        return 0;
 
 error_kobj:
@@ -192,7 +191,7 @@ static void __exit fscache_exit(void)
        fscache_proc_cleanup();
        destroy_workqueue(fscache_op_wq);
        destroy_workqueue(fscache_object_wq);
-       printk(KERN_NOTICE "FS-Cache: Unloaded\n");
+       pr_notice("Unloaded\n");
 }
 
 module_exit(fscache_exit);
index 989f394015472bafe7758c19e006a16c57a59e4c..6d941f56faf436398f0d20c146ad9b7dc77d0b61 100644 (file)
@@ -65,8 +65,7 @@ int __fscache_register_netfs(struct fscache_netfs *netfs)
        list_add(&netfs->link, &fscache_netfs_list);
        ret = 0;
 
-       printk(KERN_NOTICE "FS-Cache: Netfs '%s' registered for caching\n",
-              netfs->name);
+       pr_notice("Netfs '%s' registered for caching\n", netfs->name);
 
 already_registered:
        up_write(&fscache_addremove_sem);
@@ -97,8 +96,8 @@ void __fscache_unregister_netfs(struct fscache_netfs *netfs)
 
        up_write(&fscache_addremove_sem);
 
-       printk(KERN_NOTICE "FS-Cache: Netfs '%s' unregistered from caching\n",
-              netfs->name);
+       pr_notice("Netfs '%s' unregistered from caching\n",
+                 netfs->name);
 
        _leave("");
 }
index 318071aca217e54385044afd7c9d6407c70fde4c..e7b87a0e5185b53ac304d50b46daf14d8149356c 100644 (file)
@@ -51,8 +51,7 @@ void fscache_enqueue_operation(struct fscache_operation *op)
                _debug("queue for caller's attention");
                break;
        default:
-               printk(KERN_ERR "FS-Cache: Unexpected op type %lx",
-                      op->flags);
+               pr_err("Unexpected op type %lx", op->flags);
                BUG();
                break;
        }
index 7f5c658af755f9b43296c1dacfab5def788c4a1c..ed70714503fa776080807ecf5a33230f500d3e54 100644 (file)
@@ -1108,10 +1108,8 @@ void fscache_mark_page_cached(struct fscache_retrieval *op, struct page *page)
                static bool once_only;
                if (!once_only) {
                        once_only = true;
-                       printk(KERN_WARNING "FS-Cache:"
-                              " Cookie type %s marked page %lx"
-                              " multiple times\n",
-                              cookie->def->name, page->index);
+                       pr_warn("Cookie type %s marked page %lx multiple times\n",
+                               cookie->def->name, page->index);
                }
        }