hypfs.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. #define REG_FILE_MODE 0440
  15. #define UPDATE_FILE_MODE 0220
  16. #define DIR_MODE 0550
  17. extern struct dentry *hypfs_mkdir(struct super_block *sb, struct dentry *parent,
  18. const char *name);
  19. extern struct dentry *hypfs_create_u64(struct super_block *sb,
  20. struct dentry *dir, const char *name,
  21. __u64 value);
  22. extern struct dentry *hypfs_create_str(struct super_block *sb,
  23. struct dentry *dir, const char *name,
  24. char *string);
  25. /* LPAR Hypervisor */
  26. extern int hypfs_diag_init(void);
  27. extern void hypfs_diag_exit(void);
  28. extern int hypfs_diag_create_files(struct super_block *sb, struct dentry *root);
  29. /* VM Hypervisor */
  30. extern int hypfs_vm_init(void);
  31. extern void hypfs_vm_exit(void);
  32. extern int hypfs_vm_create_files(struct super_block *sb, struct dentry *root);
  33. /* debugfs interface */
  34. struct hypfs_dbfs_file;
  35. struct hypfs_dbfs_data {
  36. void *buf;
  37. void *buf_free_ptr;
  38. size_t size;
  39. struct hypfs_dbfs_file *dbfs_file;
  40. struct kref kref;
  41. };
  42. struct hypfs_dbfs_file {
  43. const char *name;
  44. int (*data_create)(void **data, void **data_free_ptr,
  45. size_t *size);
  46. void (*data_free)(const void *buf_free_ptr);
  47. /* Private data for hypfs_dbfs.c */
  48. struct hypfs_dbfs_data *data;
  49. struct delayed_work data_free_work;
  50. struct mutex lock;
  51. struct dentry *dentry;
  52. };
  53. extern int hypfs_dbfs_init(void);
  54. extern void hypfs_dbfs_exit(void);
  55. extern int hypfs_dbfs_create_file(struct hypfs_dbfs_file *df);
  56. extern void hypfs_dbfs_remove_file(struct hypfs_dbfs_file *df);
  57. #endif /* _HYPFS_H_ */