Commit | Line | Data |
---|---|---|
1da177e4 | 1 | /* |
7b718769 NS |
2 | * Copyright (c) 2000-2003,2005 Silicon Graphics, Inc. |
3 | * All Rights Reserved. | |
1da177e4 | 4 | * |
7b718769 NS |
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 | |
1da177e4 LT |
7 | * published by the Free Software Foundation. |
8 | * | |
7b718769 NS |
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. | |
1da177e4 | 13 | * |
7b718769 NS |
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 | |
1da177e4 | 17 | */ |
1da177e4 | 18 | #include "xfs.h" |
739bfb2a CH |
19 | #include "xfs_vnodeops.h" |
20 | #include "xfs_bmap_btree.h" | |
21 | #include "xfs_inode.h" | |
1da177e4 | 22 | |
b677c210 CH |
23 | /* |
24 | * And this gunk is needed for xfs_mount.h" | |
25 | */ | |
26 | #include "xfs_log.h" | |
27 | #include "xfs_trans.h" | |
28 | #include "xfs_sb.h" | |
29 | #include "xfs_dmapi.h" | |
30 | #include "xfs_inum.h" | |
31 | #include "xfs_ag.h" | |
32 | #include "xfs_mount.h" | |
33 | ||
1da177e4 | 34 | |
cf441eeb | 35 | #ifdef XFS_INODE_TRACE |
1da177e4 | 36 | |
1543d79c CH |
37 | #define KTRACE_ENTER(ip, vk, s, line, ra) \ |
38 | ktrace_enter( (ip)->i_trace, \ | |
1da177e4 LT |
39 | /* 0 */ (void *)(__psint_t)(vk), \ |
40 | /* 1 */ (void *)(s), \ | |
41 | /* 2 */ (void *)(__psint_t) line, \ | |
bf904248 | 42 | /* 3 */ (void *)(__psint_t)atomic_read(&VFS_I(ip)->i_count), \ |
1da177e4 | 43 | /* 4 */ (void *)(ra), \ |
b3aea4ed | 44 | /* 5 */ NULL, \ |
1da177e4 LT |
45 | /* 6 */ (void *)(__psint_t)current_cpu(), \ |
46 | /* 7 */ (void *)(__psint_t)current_pid(), \ | |
47 | /* 8 */ (void *)__return_address, \ | |
02de1f0a | 48 | /* 9 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL) |
1da177e4 LT |
49 | |
50 | /* | |
51 | * Vnode tracing code. | |
52 | */ | |
53 | void | |
cf441eeb | 54 | _xfs_itrace_entry(xfs_inode_t *ip, const char *func, inst_t *ra) |
1da177e4 | 55 | { |
cf441eeb | 56 | KTRACE_ENTER(ip, INODE_KTRACE_ENTRY, func, 0, ra); |
1da177e4 LT |
57 | } |
58 | ||
59 | void | |
cf441eeb | 60 | _xfs_itrace_exit(xfs_inode_t *ip, const char *func, inst_t *ra) |
1da177e4 | 61 | { |
cf441eeb | 62 | KTRACE_ENTER(ip, INODE_KTRACE_EXIT, func, 0, ra); |
1da177e4 LT |
63 | } |
64 | ||
65 | void | |
cf441eeb | 66 | xfs_itrace_hold(xfs_inode_t *ip, char *file, int line, inst_t *ra) |
1da177e4 | 67 | { |
cf441eeb | 68 | KTRACE_ENTER(ip, INODE_KTRACE_HOLD, file, line, ra); |
1da177e4 LT |
69 | } |
70 | ||
71 | void | |
cf441eeb | 72 | _xfs_itrace_ref(xfs_inode_t *ip, char *file, int line, inst_t *ra) |
1da177e4 | 73 | { |
cf441eeb | 74 | KTRACE_ENTER(ip, INODE_KTRACE_REF, file, line, ra); |
1da177e4 LT |
75 | } |
76 | ||
77 | void | |
cf441eeb | 78 | xfs_itrace_rele(xfs_inode_t *ip, char *file, int line, inst_t *ra) |
1da177e4 | 79 | { |
cf441eeb | 80 | KTRACE_ENTER(ip, INODE_KTRACE_RELE, file, line, ra); |
1da177e4 | 81 | } |
cf441eeb | 82 | #endif /* XFS_INODE_TRACE */ |