]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - fs/ocfs2/super.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
[mv-sheeva.git] / fs / ocfs2 / super.c
index 4994f8b0e60410ff576fa63299e29e430192080a..68f4541c2db98b26a3aba49234c721e56d56e3c3 100644 (file)
@@ -108,7 +108,7 @@ static int ocfs2_parse_options(struct super_block *sb, char *options,
                               int is_remount);
 static int ocfs2_check_set_options(struct super_block *sb,
                                   struct mount_options *options);
-static int ocfs2_show_options(struct seq_file *s, struct vfsmount *mnt);
+static int ocfs2_show_options(struct seq_file *s, struct dentry *root);
 static void ocfs2_put_super(struct super_block *sb);
 static int ocfs2_mount_volume(struct super_block *sb);
 static int ocfs2_remount(struct super_block *sb, int *flags, char *data);
@@ -569,7 +569,6 @@ static struct inode *ocfs2_alloc_inode(struct super_block *sb)
 static void ocfs2_i_callback(struct rcu_head *head)
 {
        struct inode *inode = container_of(head, struct inode, i_rcu);
-       INIT_LIST_HEAD(&inode->i_dentry);
        kmem_cache_free(ocfs2_inode_cachep, OCFS2_I(inode));
 }
 
@@ -1155,19 +1154,19 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent)
        }
 
        status = ocfs2_mount_volume(sb);
-       if (osb->root_inode)
-               inode = igrab(osb->root_inode);
-
        if (status < 0)
                goto read_super_error;
 
+       if (osb->root_inode)
+               inode = igrab(osb->root_inode);
+
        if (!inode) {
                status = -EIO;
                mlog_errno(status);
                goto read_super_error;
        }
 
-       root = d_alloc_root(inode);
+       root = d_make_root(inode);
        if (!root) {
                status = -ENOMEM;
                mlog_errno(status);
@@ -1221,9 +1220,6 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent)
 read_super_error:
        brelse(bh);
 
-       if (inode)
-               iput(inode);
-
        if (osb) {
                atomic_set(&osb->vol_state, VOLUME_DISABLED);
                wake_up(&osb->osb_mount_event);
@@ -1534,9 +1530,9 @@ bail:
        return status;
 }
 
-static int ocfs2_show_options(struct seq_file *s, struct vfsmount *mnt)
+static int ocfs2_show_options(struct seq_file *s, struct dentry *root)
 {
-       struct ocfs2_super *osb = OCFS2_SB(mnt->mnt_sb);
+       struct ocfs2_super *osb = OCFS2_SB(root->d_sb);
        unsigned long opts = osb->s_mount_opt;
        unsigned int local_alloc_megs;
 
@@ -1568,8 +1564,7 @@ static int ocfs2_show_options(struct seq_file *s, struct vfsmount *mnt)
        if (osb->preferred_slot != OCFS2_INVALID_SLOT)
                seq_printf(s, ",preferred_slot=%d", osb->preferred_slot);
 
-       if (!(mnt->mnt_flags & MNT_NOATIME) && !(mnt->mnt_flags & MNT_RELATIME))
-               seq_printf(s, ",atime_quantum=%u", osb->s_atime_quantum);
+       seq_printf(s, ",atime_quantum=%u", osb->s_atime_quantum);
 
        if (osb->osb_commit_interval)
                seq_printf(s, ",commit=%u",
@@ -1629,21 +1624,17 @@ static int __init ocfs2_init(void)
                init_waitqueue_head(&ocfs2__ioend_wq[i]);
 
        status = init_ocfs2_uptodate_cache();
-       if (status < 0) {
-               mlog_errno(status);
-               goto leave;
-       }
+       if (status < 0)
+               goto out1;
 
        status = ocfs2_initialize_mem_caches();
-       if (status < 0) {
-               mlog_errno(status);
-               goto leave;
-       }
+       if (status < 0)
+               goto out2;
 
        ocfs2_wq = create_singlethread_workqueue("ocfs2_wq");
        if (!ocfs2_wq) {
                status = -ENOMEM;
-               goto leave;
+               goto out3;
        }
 
        ocfs2_debugfs_root = debugfs_create_dir("ocfs2", NULL);
@@ -1655,17 +1646,23 @@ static int __init ocfs2_init(void)
        ocfs2_set_locking_protocol();
 
        status = register_quota_format(&ocfs2_quota_format);
-leave:
-       if (status < 0) {
-               ocfs2_free_mem_caches();
-               exit_ocfs2_uptodate_cache();
-               mlog_errno(status);
-       }
+       if (status < 0)
+               goto out4;
+       status = register_filesystem(&ocfs2_fs_type);
+       if (!status)
+               return 0;
 
-       if (status >= 0) {
-               return register_filesystem(&ocfs2_fs_type);
-       } else
-               return -1;
+       unregister_quota_format(&ocfs2_quota_format);
+out4:
+       destroy_workqueue(ocfs2_wq);
+       debugfs_remove(ocfs2_debugfs_root);
+out3:
+       ocfs2_free_mem_caches();
+out2:
+       exit_ocfs2_uptodate_cache();
+out1:
+       mlog_errno(status);
+       return status;
 }
 
 static void __exit ocfs2_exit(void)