debugfs.h 847 B

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef _FS_CEPH_DEBUGFS_H
  2. #define _FS_CEPH_DEBUGFS_H
  3. #include "ceph_debug.h"
  4. #include "types.h"
  5. #define CEPH_DEFINE_SHOW_FUNC(name) \
  6. static int name##_open(struct inode *inode, struct file *file) \
  7. { \
  8. struct seq_file *sf; \
  9. int ret; \
  10. \
  11. ret = single_open(file, name, NULL); \
  12. sf = file->private_data; \
  13. sf->private = inode->i_private; \
  14. return ret; \
  15. } \
  16. \
  17. static const struct file_operations name##_fops = { \
  18. .open = name##_open, \
  19. .read = seq_read, \
  20. .llseek = seq_lseek, \
  21. .release = single_release, \
  22. };
  23. /* debugfs.c */
  24. extern int ceph_debugfs_init(void);
  25. extern void ceph_debugfs_cleanup(void);
  26. extern int ceph_debugfs_client_init(struct ceph_client *client);
  27. extern void ceph_debugfs_client_cleanup(struct ceph_client *client);
  28. #endif