diff options
Diffstat (limited to 'arch/s390/hypfs/inode.c')
-rw-r--r-- | arch/s390/hypfs/inode.c | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/arch/s390/hypfs/inode.c b/arch/s390/hypfs/inode.c index b6716c4b9934..a4fda7b53640 100644 --- a/arch/s390/hypfs/inode.c +++ b/arch/s390/hypfs/inode.c | |||
@@ -19,7 +19,6 @@ | |||
19 | #include <linux/module.h> | 19 | #include <linux/module.h> |
20 | #include <asm/ebcdic.h> | 20 | #include <asm/ebcdic.h> |
21 | #include "hypfs.h" | 21 | #include "hypfs.h" |
22 | #include "hypfs_diag.h" | ||
23 | 22 | ||
24 | #define HYPFS_MAGIC 0x687970 /* ASCII 'hyp' */ | 23 | #define HYPFS_MAGIC 0x687970 /* ASCII 'hyp' */ |
25 | #define TMP_SIZE 64 /* size of temporary buffers */ | 24 | #define TMP_SIZE 64 /* size of temporary buffers */ |
@@ -192,7 +191,10 @@ static ssize_t hypfs_aio_write(struct kiocb *iocb, const struct iovec *iov, | |||
192 | goto out; | 191 | goto out; |
193 | } | 192 | } |
194 | hypfs_delete_tree(sb->s_root); | 193 | hypfs_delete_tree(sb->s_root); |
195 | rc = hypfs_diag_create_files(sb, sb->s_root); | 194 | if (MACHINE_IS_VM) |
195 | rc = hypfs_vm_create_files(sb, sb->s_root); | ||
196 | else | ||
197 | rc = hypfs_diag_create_files(sb, sb->s_root); | ||
196 | if (rc) { | 198 | if (rc) { |
197 | printk(KERN_ERR "hypfs: Update failed\n"); | 199 | printk(KERN_ERR "hypfs: Update failed\n"); |
198 | hypfs_delete_tree(sb->s_root); | 200 | hypfs_delete_tree(sb->s_root); |
@@ -289,7 +291,10 @@ static int hypfs_fill_super(struct super_block *sb, void *data, int silent) | |||
289 | rc = -ENOMEM; | 291 | rc = -ENOMEM; |
290 | goto err_alloc; | 292 | goto err_alloc; |
291 | } | 293 | } |
292 | rc = hypfs_diag_create_files(sb, root_dentry); | 294 | if (MACHINE_IS_VM) |
295 | rc = hypfs_vm_create_files(sb, root_dentry); | ||
296 | else | ||
297 | rc = hypfs_diag_create_files(sb, root_dentry); | ||
293 | if (rc) | 298 | if (rc) |
294 | goto err_tree; | 299 | goto err_tree; |
295 | sbi->update_file = hypfs_create_update_file(sb, root_dentry); | 300 | sbi->update_file = hypfs_create_update_file(sb, root_dentry); |
@@ -462,11 +467,15 @@ static int __init hypfs_init(void) | |||
462 | { | 467 | { |
463 | int rc; | 468 | int rc; |
464 | 469 | ||
465 | if (MACHINE_IS_VM) | 470 | if (MACHINE_IS_VM) { |
466 | return -ENODATA; | 471 | if (hypfs_vm_init()) |
467 | if (hypfs_diag_init()) { | 472 | /* no diag 2fc, just exit */ |
468 | rc = -ENODATA; | 473 | return -ENODATA; |
469 | goto fail_diag; | 474 | } else { |
475 | if (hypfs_diag_init()) { | ||
476 | rc = -ENODATA; | ||
477 | goto fail_diag; | ||
478 | } | ||
470 | } | 479 | } |
471 | kset_set_kset_s(&s390_subsys, hypervisor_subsys); | 480 | kset_set_kset_s(&s390_subsys, hypervisor_subsys); |
472 | rc = subsystem_register(&s390_subsys); | 481 | rc = subsystem_register(&s390_subsys); |
@@ -480,7 +489,8 @@ static int __init hypfs_init(void) | |||
480 | fail_filesystem: | 489 | fail_filesystem: |
481 | subsystem_unregister(&s390_subsys); | 490 | subsystem_unregister(&s390_subsys); |
482 | fail_sysfs: | 491 | fail_sysfs: |
483 | hypfs_diag_exit(); | 492 | if (!MACHINE_IS_VM) |
493 | hypfs_diag_exit(); | ||
484 | fail_diag: | 494 | fail_diag: |
485 | printk(KERN_ERR "hypfs: Initialization failed with rc = %i.\n", rc); | 495 | printk(KERN_ERR "hypfs: Initialization failed with rc = %i.\n", rc); |
486 | return rc; | 496 | return rc; |
@@ -488,7 +498,8 @@ fail_diag: | |||
488 | 498 | ||
489 | static void __exit hypfs_exit(void) | 499 | static void __exit hypfs_exit(void) |
490 | { | 500 | { |
491 | hypfs_diag_exit(); | 501 | if (!MACHINE_IS_VM) |
502 | hypfs_diag_exit(); | ||
492 | unregister_filesystem(&hypfs_type); | 503 | unregister_filesystem(&hypfs_type); |
493 | subsystem_unregister(&s390_subsys); | 504 | subsystem_unregister(&s390_subsys); |
494 | } | 505 | } |