hypfs.h 1.7 KB

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