Commit e1ee7d85 authored by Al Viro's avatar Al Viro

cramfs: switch to use of errofc() et.al.

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 77cb271e
...@@ -534,7 +534,7 @@ static int cramfs_read_super(struct super_block *sb, struct fs_context *fc, ...@@ -534,7 +534,7 @@ static int cramfs_read_super(struct super_block *sb, struct fs_context *fc,
/* check for wrong endianness */ /* check for wrong endianness */
if (super->magic == CRAMFS_MAGIC_WEND) { if (super->magic == CRAMFS_MAGIC_WEND) {
if (!silent) if (!silent)
errorf(fc, "cramfs: wrong endianness"); errorfc(fc, "wrong endianness");
return -EINVAL; return -EINVAL;
} }
...@@ -546,22 +546,22 @@ static int cramfs_read_super(struct super_block *sb, struct fs_context *fc, ...@@ -546,22 +546,22 @@ static int cramfs_read_super(struct super_block *sb, struct fs_context *fc,
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)
errorf(fc, "cramfs: wrong endianness"); errorfc(fc, "wrong endianness");
else if (!silent) else if (!silent)
errorf(fc, "cramfs: wrong magic"); errorfc(fc, "wrong magic");
return -EINVAL; return -EINVAL;
} }
} }
/* get feature flags first */ /* get feature flags first */
if (super->flags & ~CRAMFS_SUPPORTED_FLAGS) { if (super->flags & ~CRAMFS_SUPPORTED_FLAGS) {
errorf(fc, "cramfs: unsupported filesystem features"); errorfc(fc, "unsupported filesystem features");
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)) {
errorf(fc, "cramfs: root is not a directory"); errorfc(fc, "root is not a directory");
return -EINVAL; return -EINVAL;
} }
/* correct strange, hard-coded permissions of mkcramfs */ /* correct strange, hard-coded permissions of mkcramfs */
...@@ -580,12 +580,12 @@ static int cramfs_read_super(struct super_block *sb, struct fs_context *fc, ...@@ -580,12 +580,12 @@ static int cramfs_read_super(struct super_block *sb, struct fs_context *fc,
sbi->magic = super->magic; sbi->magic = super->magic;
sbi->flags = super->flags; sbi->flags = super->flags;
if (root_offset == 0) if (root_offset == 0)
infof(fc, "cramfs: empty filesystem"); infofc(fc, "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))))
{ {
errorf(fc, "cramfs: bad root offset %lu", root_offset); errorfc(fc, "bad root offset %lu", root_offset);
return -EINVAL; return -EINVAL;
} }
......
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