]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/s390/hypfs/inode.c
Merge master.kernel.org:/pub/scm/linux/kernel/git/davej/agpgart
[linux-2.6-omap-h63xx.git] / arch / s390 / hypfs / inode.c
index cd702ae45d6ddda9d52df2a5632278fcd34a5414..ba5d3167df0db3175fb76525843094ac653582e6 100644 (file)
@@ -19,7 +19,6 @@
 #include <linux/module.h>
 #include <asm/ebcdic.h>
 #include "hypfs.h"
-#include "hypfs_diag.h"
 
 #define HYPFS_MAGIC 0x687970   /* ASCII 'hyp' */
 #define TMP_SIZE 64            /* size of temporary buffers */
@@ -35,7 +34,7 @@ struct hypfs_sb_info {
        struct mutex lock;              /* lock to protect update process */
 };
 
-static struct file_operations hypfs_file_ops;
+static const struct file_operations hypfs_file_ops;
 static struct file_system_type hypfs_type;
 static struct super_operations hypfs_s_ops;
 
@@ -109,7 +108,7 @@ static void hypfs_drop_inode(struct inode *inode)
 
 static int hypfs_open(struct inode *inode, struct file *filp)
 {
-       char *data = filp->f_dentry->d_inode->i_private;
+       char *data = filp->f_path.dentry->d_inode->i_private;
        struct hypfs_sb_info *fs_info;
 
        if (filp->f_mode & FMODE_WRITE) {
@@ -174,7 +173,7 @@ static ssize_t hypfs_aio_write(struct kiocb *iocb, const struct iovec *iov,
        struct hypfs_sb_info *fs_info;
        size_t count = iov_length(iov, nr_segs);
 
-       sb = iocb->ki_filp->f_dentry->d_inode->i_sb;
+       sb = iocb->ki_filp->f_path.dentry->d_inode->i_sb;
        fs_info = sb->s_fs_info;
        /*
         * Currently we only allow one update per second for two reasons:
@@ -192,7 +191,10 @@ static ssize_t hypfs_aio_write(struct kiocb *iocb, const struct iovec *iov,
                goto out;
        }
        hypfs_delete_tree(sb->s_root);
-       rc = hypfs_diag_create_files(sb, sb->s_root);
+       if (MACHINE_IS_VM)
+               rc = hypfs_vm_create_files(sb, sb->s_root);
+       else
+               rc = hypfs_diag_create_files(sb, sb->s_root);
        if (rc) {
                printk(KERN_ERR "hypfs: Update failed\n");
                hypfs_delete_tree(sb->s_root);
@@ -289,7 +291,10 @@ static int hypfs_fill_super(struct super_block *sb, void *data, int silent)
                rc = -ENOMEM;
                goto err_alloc;
        }
-       rc = hypfs_diag_create_files(sb, root_dentry);
+       if (MACHINE_IS_VM)
+               rc = hypfs_vm_create_files(sb, root_dentry);
+       else
+               rc = hypfs_diag_create_files(sb, root_dentry);
        if (rc)
                goto err_tree;
        sbi->update_file = hypfs_create_update_file(sb, root_dentry);
@@ -435,7 +440,7 @@ struct dentry *hypfs_create_str(struct super_block *sb, struct dentry *dir,
        return dentry;
 }
 
-static struct file_operations hypfs_file_ops = {
+static const struct file_operations hypfs_file_ops = {
        .open           = hypfs_open,
        .release        = hypfs_release,
        .read           = do_sync_read,
@@ -462,11 +467,15 @@ static int __init hypfs_init(void)
 {
        int rc;
 
-       if (MACHINE_IS_VM)
-               return -ENODATA;
-       if (hypfs_diag_init()) {
-               rc = -ENODATA;
-               goto fail_diag;
+       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;
+               }
        }
        kset_set_kset_s(&s390_subsys, hypervisor_subsys);
        rc = subsystem_register(&s390_subsys);
@@ -480,7 +489,8 @@ static int __init hypfs_init(void)
 fail_filesystem:
        subsystem_unregister(&s390_subsys);
 fail_sysfs:
-       hypfs_diag_exit();
+       if (!MACHINE_IS_VM)
+               hypfs_diag_exit();
 fail_diag:
        printk(KERN_ERR "hypfs: Initialization failed with rc = %i.\n", rc);
        return rc;
@@ -488,7 +498,8 @@ fail_diag:
 
 static void __exit hypfs_exit(void)
 {
-       hypfs_diag_exit();
+       if (!MACHINE_IS_VM)
+               hypfs_diag_exit();
        unregister_filesystem(&hypfs_type);
        subsystem_unregister(&s390_subsys);
 }