internal.h 922 B

1234567891011121314151617181920212223242526272829303132
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * internal.h - declarations internal to debugfs
  4. *
  5. * Copyright (C) 2016 Nicolai Stange <nicstange@gmail.com>
  6. */
  7. #ifndef _DEBUGFS_INTERNAL_H_
  8. #define _DEBUGFS_INTERNAL_H_
  9. struct file_operations;
  10. /* declared over in file.c */
  11. extern const struct file_operations debugfs_noop_file_operations;
  12. extern const struct file_operations debugfs_open_proxy_file_operations;
  13. extern const struct file_operations debugfs_full_proxy_file_operations;
  14. struct debugfs_fsdata {
  15. const struct file_operations *real_fops;
  16. refcount_t active_users;
  17. struct completion active_users_drained;
  18. };
  19. /*
  20. * A dentry's ->d_fsdata either points to the real fops or to a
  21. * dynamically allocated debugfs_fsdata instance.
  22. * In order to distinguish between these two cases, a real fops
  23. * pointer gets its lowest bit set.
  24. */
  25. #define DEBUGFS_FSDATA_IS_REAL_FOPS_BIT BIT(0)
  26. #endif /* _DEBUGFS_INTERNAL_H_ */