internal.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * internal.h - declarations internal to debugfs
  3. *
  4. * Copyright (C) 2016 Nicolai Stange <nicstange@gmail.com>
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License version
  8. * 2 as published by the Free Software Foundation.
  9. *
  10. */
  11. #ifndef _DEBUGFS_INTERNAL_H_
  12. #define _DEBUGFS_INTERNAL_H_
  13. struct file_operations;
  14. /* declared over in file.c */
  15. extern const struct file_operations debugfs_noop_file_operations;
  16. extern const struct file_operations debugfs_open_proxy_file_operations;
  17. extern const struct file_operations debugfs_full_proxy_file_operations;
  18. struct debugfs_fsdata {
  19. const struct file_operations *real_fops;
  20. refcount_t active_users;
  21. struct completion active_users_drained;
  22. };
  23. /*
  24. * A dentry's ->d_fsdata either points to the real fops or to a
  25. * dynamically allocated debugfs_fsdata instance.
  26. * In order to distinguish between these two cases, a real fops
  27. * pointer gets its lowest bit set.
  28. */
  29. #define DEBUGFS_FSDATA_IS_REAL_FOPS_BIT BIT(0)
  30. #endif /* _DEBUGFS_INTERNAL_H_ */