hypfs.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. * arch/s390/hypfs/hypfs.h
  3. * Hypervisor filesystem for Linux on s390.
  4. *
  5. * Copyright (C) IBM Corp. 2006
  6. * Author(s): Michael Holzheu <holzheu@de.ibm.com>
  7. */
  8. #ifndef _HYPFS_H_
  9. #define _HYPFS_H_
  10. #include <linux/fs.h>
  11. #include <linux/types.h>
  12. #include <linux/debugfs.h>
  13. #include <linux/workqueue.h>
  14. #include <linux/kref.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 super_block *sb, struct dentry *parent,
  19. const char *name);
  20. extern struct dentry *hypfs_create_u64(struct super_block *sb,
  21. struct dentry *dir, const char *name,
  22. __u64 value);
  23. extern struct dentry *hypfs_create_str(struct super_block *sb,
  24. struct dentry *dir, const char *name,
  25. char *string);
  26. /* LPAR Hypervisor */
  27. extern int hypfs_diag_init(void);
  28. extern void hypfs_diag_exit(void);
  29. extern int hypfs_diag_create_files(struct super_block *sb, struct dentry *root);
  30. /* VM Hypervisor */
  31. extern int hypfs_vm_init(void);
  32. extern void hypfs_vm_exit(void);
  33. extern int hypfs_vm_create_files(struct super_block *sb, struct dentry *root);
  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. /* Private data for hypfs_dbfs.c */
  49. struct hypfs_dbfs_data *data;
  50. struct delayed_work data_free_work;
  51. struct mutex lock;
  52. struct dentry *dentry;
  53. };
  54. extern int hypfs_dbfs_init(void);
  55. extern void hypfs_dbfs_exit(void);
  56. extern int hypfs_dbfs_create_file(struct hypfs_dbfs_file *df);
  57. extern void hypfs_dbfs_remove_file(struct hypfs_dbfs_file *df);
  58. #endif /* _HYPFS_H_ */