2 * Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved.
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of version 2 of the GNU General Public License as
6 * published by the Free Software Foundation.
8 * This program is distributed in the hope that it would be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 * Further, this software is distributed without any warranty that it is
13 * free of the rightful claim of any third person regarding infringement
14 * or the like. Any license provided herein, whether implied or
15 * otherwise, applies only to this software file. Patent licenses, if
16 * any, provided herein do not apply to combinations of this program with
17 * other software, or any other product whatsoever.
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write the Free Software Foundation, Inc., 59
21 * Temple Place - Suite 330, Boston MA 02111-1307, USA.
23 * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
24 * Mountain View, CA 94043, or:
28 * For further information regarding this notice, see:
30 * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
35 * Tracing for xfs v2 directories.
39 #include "xfs_types.h"
43 #include "xfs_bmap_btree.h"
44 #include "xfs_attr_sf.h"
45 #include "xfs_dir_sf.h"
46 #include "xfs_dir2_sf.h"
47 #include "xfs_dinode.h"
48 #include "xfs_inode.h"
49 #include "xfs_da_btree.h"
50 #include "xfs_dir2_trace.h"
53 ktrace_t *xfs_dir2_trace_buf;
56 * Enter something in the trace buffers.
76 ASSERT(xfs_dir2_trace_buf);
77 ASSERT(dp->i_dir_trace);
79 memcpy(n, name, min((int)sizeof(n), namelen));
81 memset((char *)n, 0, sizeof(n));
82 ktrace_enter(xfs_dir2_trace_buf,
83 (void *)(long)type, (void *)where,
84 (void *)a0, (void *)a1, (void *)a2, (void *)a3,
85 (void *)a4, (void *)a5, (void *)a6, (void *)a7,
86 (void *)(long)namelen,
87 (void *)n[0], (void *)n[1], (void *)n[2],
88 (void *)n[3], (void *)n[4]);
89 ktrace_enter(dp->i_dir_trace,
90 (void *)(long)type, (void *)where,
91 (void *)a0, (void *)a1, (void *)a2, (void *)a3,
92 (void *)a4, (void *)a5, (void *)a6, (void *)a7,
93 (void *)(long)namelen,
94 (void *)n[0], (void *)n[1], (void *)n[2],
95 (void *)n[3], (void *)n[4]);
103 xfs_dir2_trace_enter(args->dp, XFS_DIR2_KTRACE_ARGS, where,
104 (char *)args->name, (int)args->namelen,
105 (void *)(unsigned long)args->hashval,
106 (void *)((unsigned long)(args->inumber >> 32)),
107 (void *)((unsigned long)(args->inumber & 0xFFFFFFFF)),
108 (void *)args->dp, (void *)args->trans,
109 (void *)(unsigned long)args->justcheck, NULL, NULL);
113 xfs_dir2_trace_args_b(
118 xfs_dir2_trace_enter(args->dp, XFS_DIR2_KTRACE_ARGS_B, where,
119 (char *)args->name, (int)args->namelen,
120 (void *)(unsigned long)args->hashval,
121 (void *)((unsigned long)(args->inumber >> 32)),
122 (void *)((unsigned long)(args->inumber & 0xFFFFFFFF)),
123 (void *)args->dp, (void *)args->trans,
124 (void *)(unsigned long)args->justcheck,
125 (void *)(bp ? bp->bps[0] : NULL), NULL);
129 xfs_dir2_trace_args_bb(
135 xfs_dir2_trace_enter(args->dp, XFS_DIR2_KTRACE_ARGS_BB, where,
136 (char *)args->name, (int)args->namelen,
137 (void *)(unsigned long)args->hashval,
138 (void *)((unsigned long)(args->inumber >> 32)),
139 (void *)((unsigned long)(args->inumber & 0xFFFFFFFF)),
140 (void *)args->dp, (void *)args->trans,
141 (void *)(unsigned long)args->justcheck,
142 (void *)(lbp ? lbp->bps[0] : NULL),
143 (void *)(dbp ? dbp->bps[0] : NULL));
147 xfs_dir2_trace_args_bibii(
156 xfs_buf_t *bpbs = bs ? bs->bps[0] : NULL;
157 xfs_buf_t *bpbd = bd ? bd->bps[0] : NULL;
159 xfs_dir2_trace_enter(args->dp, XFS_DIR2_KTRACE_ARGS_BIBII, where,
160 (char *)args->name, (int)args->namelen,
161 (void *)args->dp, (void *)args->trans,
162 (void *)bpbs, (void *)(long)ss, (void *)bpbd, (void *)(long)sd,
163 (void *)(long)c, NULL);
167 xfs_dir2_trace_args_db(
173 xfs_buf_t *dbp = bp ? bp->bps[0] : NULL;
175 xfs_dir2_trace_enter(args->dp, XFS_DIR2_KTRACE_ARGS_DB, where,
176 (char *)args->name, (int)args->namelen,
177 (void *)(unsigned long)args->hashval,
178 (void *)((unsigned long)(args->inumber >> 32)),
179 (void *)((unsigned long)(args->inumber & 0xFFFFFFFF)),
180 (void *)args->dp, (void *)args->trans,
181 (void *)(unsigned long)args->justcheck, (void *)(long)db,
186 xfs_dir2_trace_args_i(
191 xfs_dir2_trace_enter(args->dp, XFS_DIR2_KTRACE_ARGS_I, where,
192 (char *)args->name, (int)args->namelen,
193 (void *)(unsigned long)args->hashval,
194 (void *)((unsigned long)(args->inumber >> 32)),
195 (void *)((unsigned long)(args->inumber & 0xFFFFFFFF)),
196 (void *)args->dp, (void *)args->trans,
197 (void *)(unsigned long)args->justcheck,
198 (void *)((unsigned long)(i >> 32)),
199 (void *)((unsigned long)(i & 0xFFFFFFFF)));
203 xfs_dir2_trace_args_s(
208 xfs_dir2_trace_enter(args->dp, XFS_DIR2_KTRACE_ARGS_S, where,
209 (char *)args->name, (int)args->namelen,
210 (void *)(unsigned long)args->hashval,
211 (void *)((unsigned long)(args->inumber >> 32)),
212 (void *)((unsigned long)(args->inumber & 0xFFFFFFFF)),
213 (void *)args->dp, (void *)args->trans,
214 (void *)(unsigned long)args->justcheck, (void *)(long)s, NULL);
218 xfs_dir2_trace_args_sb(
224 xfs_buf_t *dbp = bp ? bp->bps[0] : NULL;
226 xfs_dir2_trace_enter(args->dp, XFS_DIR2_KTRACE_ARGS_SB, where,
227 (char *)args->name, (int)args->namelen,
228 (void *)(unsigned long)args->hashval,
229 (void *)((unsigned long)(args->inumber >> 32)),
230 (void *)((unsigned long)(args->inumber & 0xFFFFFFFF)),
231 (void *)args->dp, (void *)args->trans,
232 (void *)(unsigned long)args->justcheck, (void *)(long)s,
235 #endif /* XFS_DIR2_TRACE */