mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-15 16:53:54 +08:00
cramfs: switch to use of errofc() et.al.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
77cb271e6a
commit
e1ee7d8511
@ -534,7 +534,7 @@ static int cramfs_read_super(struct super_block *sb, struct fs_context *fc,
|
||||
/* check for wrong endianness */
|
||||
if (super->magic == CRAMFS_MAGIC_WEND) {
|
||||
if (!silent)
|
||||
errorf(fc, "cramfs: wrong endianness");
|
||||
errorfc(fc, "wrong endianness");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@ -546,22 +546,22 @@ static int cramfs_read_super(struct super_block *sb, struct fs_context *fc,
|
||||
mutex_unlock(&read_mutex);
|
||||
if (super->magic != CRAMFS_MAGIC) {
|
||||
if (super->magic == CRAMFS_MAGIC_WEND && !silent)
|
||||
errorf(fc, "cramfs: wrong endianness");
|
||||
errorfc(fc, "wrong endianness");
|
||||
else if (!silent)
|
||||
errorf(fc, "cramfs: wrong magic");
|
||||
errorfc(fc, "wrong magic");
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
/* get feature flags first */
|
||||
if (super->flags & ~CRAMFS_SUPPORTED_FLAGS) {
|
||||
errorf(fc, "cramfs: unsupported filesystem features");
|
||||
errorfc(fc, "unsupported filesystem features");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Check that the root inode is in a sane state */
|
||||
if (!S_ISDIR(super->root.mode)) {
|
||||
errorf(fc, "cramfs: root is not a directory");
|
||||
errorfc(fc, "root is not a directory");
|
||||
return -EINVAL;
|
||||
}
|
||||
/* correct strange, hard-coded permissions of mkcramfs */
|
||||
@ -580,12 +580,12 @@ static int cramfs_read_super(struct super_block *sb, struct fs_context *fc,
|
||||
sbi->magic = super->magic;
|
||||
sbi->flags = super->flags;
|
||||
if (root_offset == 0)
|
||||
infof(fc, "cramfs: empty filesystem");
|
||||
infofc(fc, "empty filesystem");
|
||||
else if (!(super->flags & CRAMFS_FLAG_SHIFTED_ROOT_OFFSET) &&
|
||||
((root_offset != 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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user