diff options
author | Michael Holzheu <holzheu@linux.vnet.ibm.com> | 2010-05-17 04:00:20 -0400 |
---|---|---|
committer | Martin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com> | 2010-05-17 04:00:17 -0400 |
commit | 57b28f66316d287b9dbf7b28358ca90257230769 (patch) | |
tree | 9486fff9e7c746721dbcbbbeb34ddd1307460e89 /arch/s390/hypfs/inode.c | |
parent | cc961d400e06e78c7aa39aeab1f001eb8f76ef90 (diff) |
[S390] s390_hypfs: Add new attributes
In order to access the data of the hypfs diagnose calls from user
space also in binary form, this patch adds two new attributes in
debugfs:
* z/VM: s390_hypfs/d2fc_bin
* LPAR: s390_hypfs/d204_bin
Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/hypfs/inode.c')
-rw-r--r-- | arch/s390/hypfs/inode.c | 40 |
1 files changed, 24 insertions, 16 deletions
diff --git a/arch/s390/hypfs/inode.c b/arch/s390/hypfs/inode.c index 95c1aaac06cd..6b120f073043 100644 --- a/arch/s390/hypfs/inode.c +++ b/arch/s390/hypfs/inode.c | |||
@@ -46,6 +46,8 @@ static const struct super_operations hypfs_s_ops; | |||
46 | /* start of list of all dentries, which have to be deleted on update */ | 46 | /* start of list of all dentries, which have to be deleted on update */ |
47 | static struct dentry *hypfs_last_dentry; | 47 | static struct dentry *hypfs_last_dentry; |
48 | 48 | ||
49 | struct dentry *hypfs_dbfs_dir; | ||
50 | |||
49 | static void hypfs_update_update(struct super_block *sb) | 51 | static void hypfs_update_update(struct super_block *sb) |
50 | { | 52 | { |
51 | struct hypfs_sb_info *sb_info = sb->s_fs_info; | 53 | struct hypfs_sb_info *sb_info = sb->s_fs_info; |
@@ -468,20 +470,22 @@ static int __init hypfs_init(void) | |||
468 | { | 470 | { |
469 | int rc; | 471 | int rc; |
470 | 472 | ||
471 | if (MACHINE_IS_VM) { | 473 | hypfs_dbfs_dir = debugfs_create_dir("s390_hypfs", NULL); |
472 | if (hypfs_vm_init()) | 474 | if (IS_ERR(hypfs_dbfs_dir)) |
473 | /* no diag 2fc, just exit */ | 475 | return PTR_ERR(hypfs_dbfs_dir); |
474 | return -ENODATA; | 476 | |
475 | } else { | 477 | if (hypfs_diag_init()) { |
476 | if (hypfs_diag_init()) { | 478 | rc = -ENODATA; |
477 | rc = -ENODATA; | 479 | goto fail_debugfs_remove; |
478 | goto fail_diag; | 480 | } |
479 | } | 481 | if (hypfs_vm_init()) { |
482 | rc = -ENODATA; | ||
483 | goto fail_hypfs_diag_exit; | ||
480 | } | 484 | } |
481 | s390_kobj = kobject_create_and_add("s390", hypervisor_kobj); | 485 | s390_kobj = kobject_create_and_add("s390", hypervisor_kobj); |
482 | if (!s390_kobj) { | 486 | if (!s390_kobj) { |
483 | rc = -ENOMEM; | 487 | rc = -ENOMEM; |
484 | goto fail_sysfs; | 488 | goto fail_hypfs_vm_exit; |
485 | } | 489 | } |
486 | rc = register_filesystem(&hypfs_type); | 490 | rc = register_filesystem(&hypfs_type); |
487 | if (rc) | 491 | if (rc) |
@@ -490,18 +494,22 @@ static int __init hypfs_init(void) | |||
490 | 494 | ||
491 | fail_filesystem: | 495 | fail_filesystem: |
492 | kobject_put(s390_kobj); | 496 | kobject_put(s390_kobj); |
493 | fail_sysfs: | 497 | fail_hypfs_vm_exit: |
494 | if (!MACHINE_IS_VM) | 498 | hypfs_vm_exit(); |
495 | hypfs_diag_exit(); | 499 | fail_hypfs_diag_exit: |
496 | fail_diag: | 500 | hypfs_diag_exit(); |
501 | fail_debugfs_remove: | ||
502 | debugfs_remove(hypfs_dbfs_dir); | ||
503 | |||
497 | pr_err("Initialization of hypfs failed with rc=%i\n", rc); | 504 | pr_err("Initialization of hypfs failed with rc=%i\n", rc); |
498 | return rc; | 505 | return rc; |
499 | } | 506 | } |
500 | 507 | ||
501 | static void __exit hypfs_exit(void) | 508 | static void __exit hypfs_exit(void) |
502 | { | 509 | { |
503 | if (!MACHINE_IS_VM) | 510 | hypfs_diag_exit(); |
504 | hypfs_diag_exit(); | 511 | hypfs_vm_exit(); |
512 | debugfs_remove(hypfs_dbfs_dir); | ||
505 | unregister_filesystem(&hypfs_type); | 513 | unregister_filesystem(&hypfs_type); |
506 | kobject_put(s390_kobj); | 514 | kobject_put(s390_kobj); |
507 | } | 515 | } |