aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ufs/super.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ufs/super.c')
-rw-r--r--fs/ufs/super.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/fs/ufs/super.c b/fs/ufs/super.c
index 0072cb33ebec..85b22b5977fa 100644
--- a/fs/ufs/super.c
+++ b/fs/ufs/super.c
@@ -76,7 +76,6 @@
76 76
77#include <linux/errno.h> 77#include <linux/errno.h>
78#include <linux/fs.h> 78#include <linux/fs.h>
79#include <linux/ufs_fs.h>
80#include <linux/slab.h> 79#include <linux/slab.h>
81#include <linux/time.h> 80#include <linux/time.h>
82#include <linux/stat.h> 81#include <linux/stat.h>
@@ -91,6 +90,7 @@
91#include <linux/mount.h> 90#include <linux/mount.h>
92#include <linux/seq_file.h> 91#include <linux/seq_file.h>
93 92
93#include "ufs_fs.h"
94#include "ufs.h" 94#include "ufs.h"
95#include "swab.h" 95#include "swab.h"
96#include "util.h" 96#include "util.h"
@@ -131,6 +131,8 @@ static void ufs_print_super_stuff(struct super_block *sb,
131 printk(KERN_INFO" cs_nffree(Num of free frags): %llu\n", 131 printk(KERN_INFO" cs_nffree(Num of free frags): %llu\n",
132 (unsigned long long) 132 (unsigned long long)
133 fs64_to_cpu(sb, usb3->fs_un1.fs_u2.cs_nffree)); 133 fs64_to_cpu(sb, usb3->fs_un1.fs_u2.cs_nffree));
134 printk(KERN_INFO" fs_maxsymlinklen: %u\n",
135 fs32_to_cpu(sb, usb3->fs_un2.fs_44.fs_maxsymlinklen));
134 } else { 136 } else {
135 printk(" sblkno: %u\n", fs32_to_cpu(sb, usb1->fs_sblkno)); 137 printk(" sblkno: %u\n", fs32_to_cpu(sb, usb1->fs_sblkno));
136 printk(" cblkno: %u\n", fs32_to_cpu(sb, usb1->fs_cblkno)); 138 printk(" cblkno: %u\n", fs32_to_cpu(sb, usb1->fs_cblkno));
@@ -633,6 +635,7 @@ static int ufs_fill_super(struct super_block *sb, void *data, int silent)
633 unsigned block_size, super_block_size; 635 unsigned block_size, super_block_size;
634 unsigned flags; 636 unsigned flags;
635 unsigned super_block_offset; 637 unsigned super_block_offset;
638 int ret = -EINVAL;
636 639
637 uspi = NULL; 640 uspi = NULL;
638 ubh = NULL; 641 ubh = NULL;
@@ -1060,17 +1063,21 @@ magic_found:
1060 uspi->s_bpf = uspi->s_fsize << 3; 1063 uspi->s_bpf = uspi->s_fsize << 3;
1061 uspi->s_bpfshift = uspi->s_fshift + 3; 1064 uspi->s_bpfshift = uspi->s_fshift + 3;
1062 uspi->s_bpfmask = uspi->s_bpf - 1; 1065 uspi->s_bpfmask = uspi->s_bpf - 1;
1063 if ((sbi->s_mount_opt & UFS_MOUNT_UFSTYPE) == 1066 if ((sbi->s_mount_opt & UFS_MOUNT_UFSTYPE) == UFS_MOUNT_UFSTYPE_44BSD ||
1064 UFS_MOUNT_UFSTYPE_44BSD) 1067 (sbi->s_mount_opt & UFS_MOUNT_UFSTYPE) == UFS_MOUNT_UFSTYPE_UFS2)
1065 uspi->s_maxsymlinklen = 1068 uspi->s_maxsymlinklen =
1066 fs32_to_cpu(sb, usb3->fs_un2.fs_44.fs_maxsymlinklen); 1069 fs32_to_cpu(sb, usb3->fs_un2.fs_44.fs_maxsymlinklen);
1067 1070
1068 inode = iget(sb, UFS_ROOTINO); 1071 inode = ufs_iget(sb, UFS_ROOTINO);
1069 if (!inode || is_bad_inode(inode)) 1072 if (IS_ERR(inode)) {
1073 ret = PTR_ERR(inode);
1070 goto failed; 1074 goto failed;
1075 }
1071 sb->s_root = d_alloc_root(inode); 1076 sb->s_root = d_alloc_root(inode);
1072 if (!sb->s_root) 1077 if (!sb->s_root) {
1078 ret = -ENOMEM;
1073 goto dalloc_failed; 1079 goto dalloc_failed;
1080 }
1074 1081
1075 ufs_setup_cstotal(sb); 1082 ufs_setup_cstotal(sb);
1076 /* 1083 /*
@@ -1092,7 +1099,7 @@ failed:
1092 kfree(sbi); 1099 kfree(sbi);
1093 sb->s_fs_info = NULL; 1100 sb->s_fs_info = NULL;
1094 UFSD("EXIT (FAILED)\n"); 1101 UFSD("EXIT (FAILED)\n");
1095 return -EINVAL; 1102 return ret;
1096 1103
1097failed_nomem: 1104failed_nomem:
1098 UFSD("EXIT (NOMEM)\n"); 1105 UFSD("EXIT (NOMEM)\n");
@@ -1326,7 +1333,6 @@ static ssize_t ufs_quota_write(struct super_block *, int, const char *, size_t,
1326static const struct super_operations ufs_super_ops = { 1333static const struct super_operations ufs_super_ops = {
1327 .alloc_inode = ufs_alloc_inode, 1334 .alloc_inode = ufs_alloc_inode,
1328 .destroy_inode = ufs_destroy_inode, 1335 .destroy_inode = ufs_destroy_inode,
1329 .read_inode = ufs_read_inode,
1330 .write_inode = ufs_write_inode, 1336 .write_inode = ufs_write_inode,
1331 .delete_inode = ufs_delete_inode, 1337 .delete_inode = ufs_delete_inode,
1332 .put_super = ufs_put_super, 1338 .put_super = ufs_put_super,