hypfs.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. * Hypervisor filesystem for Linux on s390.
  3. *
  4. * Copyright IBM Corp. 2006
  5. * Author(s): Michael Holzheu <holzheu@de.ibm.com>
  6. */
  7. #ifndef _HYPFS_H_
  8. #define _HYPFS_H_
  9. #include <linux/fs.h>
  10. #include <linux/types.h>
  11. #include <linux/debugfs.h>
  12. #include <linux/workqueue.h>
  13. #include <linux/kref.h>
  14. #include <asm/hypfs.h>
  15. #define REG_FILE_MODE 0440
  16. #define UPDATE_FILE_MODE 0220
  17. #define DIR_MODE 0550
  18. extern struct dentry *hypfs_mkdir(struct dentry *parent, const char *name);
  19. extern struct dentry *hypfs_create_u64(struct dentry *dir, const char *name,
  20. __u64 value);
  21. extern struct dentry *hypfs_create_str(struct dentry *dir, const char *name,
  22. char *string);
  23. /* LPAR Hypervisor */
  24. extern int hypfs_diag_init(void);
  25. extern void hypfs_diag_exit(void);
  26. extern int hypfs_diag_create_files(struct dentry *root);
  27. /* VM Hypervisor */
  28. extern int hypfs_vm_init(void);
  29. extern void hypfs_vm_exit(void);
  30. extern int hypfs_vm_create_files(struct dentry *root);
  31. /* Set Partition-Resource Parameter */
  32. int hypfs_sprp_init(void);
  33. void hypfs_sprp_exit(void);
  34. /* debugfs interface */
  35. struct hypfs_dbfs_file;
  36. struct hypfs_dbfs_data {
  37. void *buf;
  38. void *buf_free_ptr;
  39. size_t size;
  40. struct hypfs_dbfs_file *dbfs_file;
  41. struct kref kref;
  42. };
  43. struct hypfs_dbfs_file {
  44. const char *name;
  45. int (*data_create)(void **data, void **data_free_ptr,
  46. size_t *size);
  47. void (*data_free)(const void *buf_free_ptr);
  48. long (*unlocked_ioctl) (struct file *, unsigned int,
  49. unsigned long);
  50. /* Private data for hypfs_dbfs.c */
  51. struct hypfs_dbfs_data *data;
  52. struct delayed_work data_free_work;
  53. struct mutex lock;
  54. struct dentry *dentry;
  55. };
  56. extern int hypfs_dbfs_init(void);
  57. extern void hypfs_dbfs_exit(void);
  58. extern int hypfs_dbfs_create_file(struct hypfs_dbfs_file *df);
  59. extern void hypfs_dbfs_remove_file(struct hypfs_dbfs_file *df);
  60. #endif /* _HYPFS_H_ */