xfs_vnode.c 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*
  2. * Copyright (c) 2000-2003,2005 Silicon Graphics, Inc.
  3. * All Rights Reserved.
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License as
  7. * published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it would be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write the Free Software Foundation,
  16. * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  17. */
  18. #include "xfs.h"
  19. #include "xfs_vnodeops.h"
  20. #include "xfs_bmap_btree.h"
  21. #include "xfs_inode.h"
  22. /*
  23. * And this gunk is needed for xfs_mount.h"
  24. */
  25. #include "xfs_log.h"
  26. #include "xfs_trans.h"
  27. #include "xfs_sb.h"
  28. #include "xfs_dmapi.h"
  29. #include "xfs_inum.h"
  30. #include "xfs_ag.h"
  31. #include "xfs_mount.h"
  32. #ifdef XFS_INODE_TRACE
  33. #define KTRACE_ENTER(ip, vk, s, line, ra) \
  34. ktrace_enter( (ip)->i_trace, \
  35. /* 0 */ (void *)(__psint_t)(vk), \
  36. /* 1 */ (void *)(s), \
  37. /* 2 */ (void *)(__psint_t) line, \
  38. /* 3 */ (void *)(__psint_t)atomic_read(&VFS_I(ip)->i_count), \
  39. /* 4 */ (void *)(ra), \
  40. /* 5 */ NULL, \
  41. /* 6 */ (void *)(__psint_t)current_cpu(), \
  42. /* 7 */ (void *)(__psint_t)current_pid(), \
  43. /* 8 */ (void *)__return_address, \
  44. /* 9 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL)
  45. /*
  46. * Vnode tracing code.
  47. */
  48. void
  49. _xfs_itrace_entry(xfs_inode_t *ip, const char *func, inst_t *ra)
  50. {
  51. KTRACE_ENTER(ip, INODE_KTRACE_ENTRY, func, 0, ra);
  52. }
  53. void
  54. _xfs_itrace_exit(xfs_inode_t *ip, const char *func, inst_t *ra)
  55. {
  56. KTRACE_ENTER(ip, INODE_KTRACE_EXIT, func, 0, ra);
  57. }
  58. void
  59. xfs_itrace_hold(xfs_inode_t *ip, char *file, int line, inst_t *ra)
  60. {
  61. KTRACE_ENTER(ip, INODE_KTRACE_HOLD, file, line, ra);
  62. }
  63. void
  64. _xfs_itrace_ref(xfs_inode_t *ip, char *file, int line, inst_t *ra)
  65. {
  66. KTRACE_ENTER(ip, INODE_KTRACE_REF, file, line, ra);
  67. }
  68. void
  69. xfs_itrace_rele(xfs_inode_t *ip, char *file, int line, inst_t *ra)
  70. {
  71. KTRACE_ENTER(ip, INODE_KTRACE_RELE, file, line, ra);
  72. }
  73. #endif /* XFS_INODE_TRACE */