Commit 4f21e1ea authored by Fabian Frederick's avatar Fabian Frederick Committed by Linus Torvalds

fs/cramfs: use pr_fmt

Use module name for "cramfs: " prefix.  (note that uncompress.c printk had
no prefix).
Signed-off-by: default avatarFabian Frederick <fabf@skynet.be>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent f175ff81
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
* The actual compression is based on zlib, see the other files. * The actual compression is based on zlib, see the other files.
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/module.h> #include <linux/module.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/pagemap.h> #include <linux/pagemap.h>
...@@ -277,7 +279,7 @@ static int cramfs_fill_super(struct super_block *sb, void *data, int silent) ...@@ -277,7 +279,7 @@ static int cramfs_fill_super(struct super_block *sb, void *data, int silent)
/* check for wrong endianness */ /* check for wrong endianness */
if (super.magic == CRAMFS_MAGIC_WEND) { if (super.magic == CRAMFS_MAGIC_WEND) {
if (!silent) if (!silent)
pr_err("cramfs: wrong endianness\n"); pr_err("wrong endianness\n");
return -EINVAL; return -EINVAL;
} }
...@@ -287,22 +289,22 @@ static int cramfs_fill_super(struct super_block *sb, void *data, int silent) ...@@ -287,22 +289,22 @@ static int cramfs_fill_super(struct super_block *sb, void *data, int silent)
mutex_unlock(&read_mutex); mutex_unlock(&read_mutex);
if (super.magic != CRAMFS_MAGIC) { if (super.magic != CRAMFS_MAGIC) {
if (super.magic == CRAMFS_MAGIC_WEND && !silent) if (super.magic == CRAMFS_MAGIC_WEND && !silent)
pr_err("cramfs: wrong endianness\n"); pr_err("wrong endianness\n");
else if (!silent) else if (!silent)
pr_err("cramfs: wrong magic\n"); pr_err("wrong magic\n");
return -EINVAL; return -EINVAL;
} }
} }
/* get feature flags first */ /* get feature flags first */
if (super.flags & ~CRAMFS_SUPPORTED_FLAGS) { if (super.flags & ~CRAMFS_SUPPORTED_FLAGS) {
pr_err("cramfs: unsupported filesystem features\n"); pr_err("unsupported filesystem features\n");
return -EINVAL; return -EINVAL;
} }
/* Check that the root inode is in a sane state */ /* Check that the root inode is in a sane state */
if (!S_ISDIR(super.root.mode)) { if (!S_ISDIR(super.root.mode)) {
pr_err("cramfs: root is not a directory\n"); pr_err("root is not a directory\n");
return -EINVAL; return -EINVAL;
} }
/* correct strange, hard-coded permissions of mkcramfs */ /* correct strange, hard-coded permissions of mkcramfs */
...@@ -321,12 +323,12 @@ static int cramfs_fill_super(struct super_block *sb, void *data, int silent) ...@@ -321,12 +323,12 @@ static int cramfs_fill_super(struct super_block *sb, void *data, int silent)
sbi->magic=super.magic; sbi->magic=super.magic;
sbi->flags=super.flags; sbi->flags=super.flags;
if (root_offset == 0) if (root_offset == 0)
pr_info("cramfs: empty filesystem"); pr_info("empty filesystem");
else if (!(super.flags & CRAMFS_FLAG_SHIFTED_ROOT_OFFSET) && else if (!(super.flags & CRAMFS_FLAG_SHIFTED_ROOT_OFFSET) &&
((root_offset != sizeof(struct cramfs_super)) && ((root_offset != sizeof(struct cramfs_super)) &&
(root_offset != 512 + sizeof(struct cramfs_super)))) (root_offset != 512 + sizeof(struct cramfs_super))))
{ {
pr_err("cramfs: bad root offset %lu\n", root_offset); pr_err("bad root offset %lu\n", root_offset);
return -EINVAL; return -EINVAL;
} }
...@@ -511,7 +513,7 @@ static int cramfs_readpage(struct file *file, struct page * page) ...@@ -511,7 +513,7 @@ static int cramfs_readpage(struct file *file, struct page * page)
if (compr_len == 0) if (compr_len == 0)
; /* hole */ ; /* hole */
else if (unlikely(compr_len > (PAGE_CACHE_SIZE << 1))) { else if (unlikely(compr_len > (PAGE_CACHE_SIZE << 1))) {
pr_err("cramfs: bad compressed blocksize %u\n", pr_err("bad compressed blocksize %u\n",
compr_len); compr_len);
goto err; goto err;
} else { } else {
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
* then is used by multiple filesystems. * then is used by multiple filesystems.
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment