Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux...
[pandora-kernel.git] / arch / s390 / hypfs / inode.c
index c53f8ac..6b120f0 100644 (file)
@@ -46,6 +46,8 @@ static const struct super_operations hypfs_s_ops;
 /* start of list of all dentries, which have to be deleted on update */
 static struct dentry *hypfs_last_dentry;
 
+struct dentry *hypfs_dbfs_dir;
+
 static void hypfs_update_update(struct super_block *sb)
 {
        struct hypfs_sb_info *sb_info = sb->s_fs_info;
@@ -145,7 +147,7 @@ static int hypfs_open(struct inode *inode, struct file *filp)
                }
                mutex_unlock(&fs_info->lock);
        }
-       return 0;
+       return nonseekable_open(inode, filp);
 }
 
 static ssize_t hypfs_aio_read(struct kiocb *iocb, const struct iovec *iov,
@@ -468,20 +470,22 @@ static int __init hypfs_init(void)
 {
        int rc;
 
-       if (MACHINE_IS_VM) {
-               if (hypfs_vm_init())
-                       /* no diag 2fc, just exit */
-                       return -ENODATA;
-       } else {
-               if (hypfs_diag_init()) {
-                       rc = -ENODATA;
-                       goto fail_diag;
-               }
+       hypfs_dbfs_dir = debugfs_create_dir("s390_hypfs", NULL);
+       if (IS_ERR(hypfs_dbfs_dir))
+               return PTR_ERR(hypfs_dbfs_dir);
+
+       if (hypfs_diag_init()) {
+               rc = -ENODATA;
+               goto fail_debugfs_remove;
+       }
+       if (hypfs_vm_init()) {
+               rc = -ENODATA;
+               goto fail_hypfs_diag_exit;
        }
        s390_kobj = kobject_create_and_add("s390", hypervisor_kobj);
        if (!s390_kobj) {
                rc = -ENOMEM;
-               goto fail_sysfs;
+               goto fail_hypfs_vm_exit;
        }
        rc = register_filesystem(&hypfs_type);
        if (rc)
@@ -490,18 +494,22 @@ static int __init hypfs_init(void)
 
 fail_filesystem:
        kobject_put(s390_kobj);
-fail_sysfs:
-       if (!MACHINE_IS_VM)
-               hypfs_diag_exit();
-fail_diag:
+fail_hypfs_vm_exit:
+       hypfs_vm_exit();
+fail_hypfs_diag_exit:
+       hypfs_diag_exit();
+fail_debugfs_remove:
+       debugfs_remove(hypfs_dbfs_dir);
+
        pr_err("Initialization of hypfs failed with rc=%i\n", rc);
        return rc;
 }
 
 static void __exit hypfs_exit(void)
 {
-       if (!MACHINE_IS_VM)
-               hypfs_diag_exit();
+       hypfs_diag_exit();
+       hypfs_vm_exit();
+       debugfs_remove(hypfs_dbfs_dir);
        unregister_filesystem(&hypfs_type);
        kobject_put(s390_kobj);
 }