]> git.proxmox.com Git - mirror_spl-debian.git/blob - module/splat/splat-vnode.c
Linux 3.4 compat, __clear_close_on_exec replaces FD_CLR
[mirror_spl-debian.git] / module / splat / splat-vnode.c
1 /*****************************************************************************\
2 * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC.
3 * Copyright (C) 2007 The Regents of the University of California.
4 * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
5 * Written by Brian Behlendorf <behlendorf1@llnl.gov>.
6 * UCRL-CODE-235197
7 *
8 * This file is part of the SPL, Solaris Porting Layer.
9 * For details, see <http://github.com/behlendorf/spl/>.
10 *
11 * The SPL is free software; you can redistribute it and/or modify it
12 * under the terms of the GNU General Public License as published by the
13 * Free Software Foundation; either version 2 of the License, or (at your
14 * option) any later version.
15 *
16 * The SPL is distributed in the hope that it will be useful, but WITHOUT
17 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19 * for more details.
20 *
21 * You should have received a copy of the GNU General Public License along
22 * with the SPL. If not, see <http://www.gnu.org/licenses/>.
23 *****************************************************************************
24 * Solaris Porting LAyer Tests (SPLAT) Vnode Tests.
25 \*****************************************************************************/
26
27 #include "splat-internal.h"
28 #include <linux/rcupdate.h>
29
30 #define SPLAT_VNODE_NAME "vnode"
31 #define SPLAT_VNODE_DESC "Kernel Vnode Tests"
32
33 #define SPLAT_VNODE_TEST1_ID 0x0901
34 #define SPLAT_VNODE_TEST1_NAME "vn_open"
35 #define SPLAT_VNODE_TEST1_DESC "Vn_open Test"
36
37 #define SPLAT_VNODE_TEST2_ID 0x0902
38 #define SPLAT_VNODE_TEST2_NAME "vn_openat"
39 #define SPLAT_VNODE_TEST2_DESC "Vn_openat Test"
40
41 #define SPLAT_VNODE_TEST3_ID 0x0903
42 #define SPLAT_VNODE_TEST3_NAME "vn_rdwr"
43 #define SPLAT_VNODE_TEST3_DESC "Vn_rdwrt Test"
44
45 #define SPLAT_VNODE_TEST4_ID 0x0904
46 #define SPLAT_VNODE_TEST4_NAME "vn_rename"
47 #define SPLAT_VNODE_TEST4_DESC "Vn_rename Test"
48
49 #define SPLAT_VNODE_TEST5_ID 0x0905
50 #define SPLAT_VNODE_TEST5_NAME "vn_getattr"
51 #define SPLAT_VNODE_TEST5_DESC "Vn_getattr Test"
52
53 #define SPLAT_VNODE_TEST6_ID 0x0906
54 #define SPLAT_VNODE_TEST6_NAME "vn_sync"
55 #define SPLAT_VNODE_TEST6_DESC "Vn_sync Test"
56
57 #define SPLAT_VNODE_TEST7_ID 0x0907
58 #define SPLAT_VNODE_TEST7_NAME "vn_getf"
59 #define SPLAT_VNODE_TEST7_DESC "vn_getf/vn_releasef Test"
60
61 #define SPLAT_VNODE_TEST_FILE "/etc/fstab"
62 #define SPLAT_VNODE_TEST_FILE_AT "etc/fstab"
63 #define SPLAT_VNODE_TEST_FILE_RW "/tmp/spl.vnode.tmp"
64 #define SPLAT_VNODE_TEST_FILE_RW1 "/tmp/spl.vnode.tmp.1"
65 #define SPLAT_VNODE_TEST_FILE_RW2 "/tmp/spl.vnode.tmp.2"
66
67 static int
68 splat_vnode_user_cmd(struct file *file, void *arg,
69 char *name, char *cmd)
70 {
71 char sh_path[] = "/bin/sh";
72 char *argv[] = { sh_path,
73 "-c",
74 cmd,
75 NULL };
76 char *envp[] = { "HOME=/",
77 "TERM=linux",
78 "PATH=/sbin:/usr/sbin:/bin:/usr/bin",
79 NULL };
80 int rc;
81
82 rc = call_usermodehelper(sh_path, argv, envp, 1);
83 if (rc) {
84 splat_vprint(file, name,
85 "Failed command: %s %s %s (%d)\n",
86 argv[0], argv[1], cmd, rc);
87 return -EPERM;
88 }
89
90 return 0;
91 }
92
93 static int
94 splat_vnode_unlink_all(struct file *file, void *arg, char *name)
95 {
96 char *cmds[] = { "rm -f " SPLAT_VNODE_TEST_FILE_RW,
97 "rm -f " SPLAT_VNODE_TEST_FILE_RW1,
98 "rm -f " SPLAT_VNODE_TEST_FILE_RW2,
99 NULL };
100 int i = 0, rc = 0;
101
102 while (cmds[i] != NULL) {
103 if ((rc = splat_vnode_user_cmd(file, arg, name, cmds[i])))
104 return rc;
105
106 i++;
107 }
108
109 return rc;
110 }
111
112 static int
113 splat_vnode_test1(struct file *file, void *arg)
114 {
115 vnode_t *vp;
116 int rc;
117
118 if ((rc = vn_open(SPLAT_VNODE_TEST_FILE, UIO_SYSSPACE,
119 FREAD, 0644, &vp, 0, 0))) {
120 splat_vprint(file, SPLAT_VNODE_TEST1_NAME,
121 "Failed to vn_open test file: %s (%d)\n",
122 SPLAT_VNODE_TEST_FILE, rc);
123 return -rc;
124 }
125
126 rc = VOP_CLOSE(vp, 0, 0, 0, 0, 0);
127
128 if (rc) {
129 splat_vprint(file, SPLAT_VNODE_TEST1_NAME,
130 "Failed to vn_close test file: %s (%d)\n",
131 SPLAT_VNODE_TEST_FILE, rc);
132 return -rc;
133 }
134
135 splat_vprint(file, SPLAT_VNODE_TEST1_NAME, "Successfully vn_open'ed "
136 "and vn_closed test file: %s\n", SPLAT_VNODE_TEST_FILE);
137
138 return -rc;
139 } /* splat_vnode_test1() */
140
141 static int
142 splat_vnode_test2(struct file *file, void *arg)
143 {
144 vnode_t *vp;
145 int rc;
146
147 if ((rc = vn_openat(SPLAT_VNODE_TEST_FILE_AT, UIO_SYSSPACE,
148 FREAD, 0644, &vp, 0, 0, rootdir, 0))) {
149 splat_vprint(file, SPLAT_VNODE_TEST2_NAME,
150 "Failed to vn_openat test file: %s (%d)\n",
151 SPLAT_VNODE_TEST_FILE, rc);
152 return -rc;
153 }
154
155 rc = VOP_CLOSE(vp, 0, 0, 0, 0, 0);
156
157 if (rc) {
158 splat_vprint(file, SPLAT_VNODE_TEST2_NAME,
159 "Failed to vn_close test file: %s (%d)\n",
160 SPLAT_VNODE_TEST_FILE, rc);
161 return -rc;
162 }
163
164 splat_vprint(file, SPLAT_VNODE_TEST2_NAME, "Successfully vn_openat'ed "
165 "and vn_closed test file: %s\n", SPLAT_VNODE_TEST_FILE);
166
167 return -rc;
168 } /* splat_vnode_test2() */
169
170 static int
171 splat_vnode_test3(struct file *file, void *arg)
172 {
173 vnode_t *vp;
174 char buf1[32] = "SPL VNode Interface Test File\n";
175 char buf2[32] = "";
176 int rc;
177
178 if ((rc = splat_vnode_unlink_all(file, arg, SPLAT_VNODE_TEST3_NAME)))
179 return rc;
180
181 if ((rc = vn_open(SPLAT_VNODE_TEST_FILE_RW, UIO_SYSSPACE,
182 FWRITE | FREAD | FCREAT | FEXCL,
183 0644, &vp, 0, 0))) {
184 splat_vprint(file, SPLAT_VNODE_TEST3_NAME,
185 "Failed to vn_open test file: %s (%d)\n",
186 SPLAT_VNODE_TEST_FILE_RW, rc);
187 return -rc;
188 }
189
190 rc = vn_rdwr(UIO_WRITE, vp, buf1, strlen(buf1), 0,
191 UIO_SYSSPACE, 0, RLIM64_INFINITY, 0, NULL);
192 if (rc) {
193 splat_vprint(file, SPLAT_VNODE_TEST3_NAME,
194 "Failed vn_rdwr write of test file: %s (%d)\n",
195 SPLAT_VNODE_TEST_FILE_RW, rc);
196 goto out;
197 }
198
199 rc = vn_rdwr(UIO_READ, vp, buf2, strlen(buf1), 0,
200 UIO_SYSSPACE, 0, RLIM64_INFINITY, 0, NULL);
201 if (rc) {
202 splat_vprint(file, SPLAT_VNODE_TEST3_NAME,
203 "Failed vn_rdwr read of test file: %s (%d)\n",
204 SPLAT_VNODE_TEST_FILE_RW, rc);
205 goto out;
206 }
207
208 if (strncmp(buf1, buf2, strlen(buf1))) {
209 rc = EINVAL;
210 splat_vprint(file, SPLAT_VNODE_TEST3_NAME,
211 "Failed strncmp data written does not match "
212 "data read\nWrote: %sRead: %s\n", buf1, buf2);
213 goto out;
214 }
215
216 rc = 0;
217 splat_vprint(file, SPLAT_VNODE_TEST3_NAME, "Wrote: %s", buf1);
218 splat_vprint(file, SPLAT_VNODE_TEST3_NAME, "Read: %s", buf2);
219 splat_vprint(file, SPLAT_VNODE_TEST3_NAME, "Successfully wrote and "
220 "read expected data pattern to test file: %s\n",
221 SPLAT_VNODE_TEST_FILE_RW);
222
223 out:
224 VOP_CLOSE(vp, 0, 0, 0, 0, 0);
225 vn_remove(SPLAT_VNODE_TEST_FILE_RW, UIO_SYSSPACE, RMFILE);
226
227 return -rc;
228 } /* splat_vnode_test3() */
229
230 static int
231 splat_vnode_test4(struct file *file, void *arg)
232 {
233 vnode_t *vp;
234 char buf1[32] = "SPL VNode Interface Test File\n";
235 char buf2[32] = "";
236 int rc;
237
238 if ((rc = splat_vnode_unlink_all(file, arg, SPLAT_VNODE_TEST4_NAME)))
239 return rc;
240
241 if ((rc = vn_open(SPLAT_VNODE_TEST_FILE_RW1, UIO_SYSSPACE,
242 FWRITE | FREAD | FCREAT | FEXCL, 0644, &vp, 0, 0))) {
243 splat_vprint(file, SPLAT_VNODE_TEST4_NAME,
244 "Failed to vn_open test file: %s (%d)\n",
245 SPLAT_VNODE_TEST_FILE_RW1, rc);
246 goto out;
247 }
248
249 rc = vn_rdwr(UIO_WRITE, vp, buf1, strlen(buf1), 0,
250 UIO_SYSSPACE, 0, RLIM64_INFINITY, 0, NULL);
251 if (rc) {
252 splat_vprint(file, SPLAT_VNODE_TEST4_NAME,
253 "Failed vn_rdwr write of test file: %s (%d)\n",
254 SPLAT_VNODE_TEST_FILE_RW1, rc);
255 goto out2;
256 }
257
258 VOP_CLOSE(vp, 0, 0, 0, 0, 0);
259
260 rc = vn_rename(SPLAT_VNODE_TEST_FILE_RW1,SPLAT_VNODE_TEST_FILE_RW2,0);
261 if (rc) {
262 splat_vprint(file, SPLAT_VNODE_TEST4_NAME, "Failed vn_rename "
263 "%s -> %s (%d)\n",
264 SPLAT_VNODE_TEST_FILE_RW1,
265 SPLAT_VNODE_TEST_FILE_RW2, rc);
266 goto out;
267 }
268
269 if ((rc = vn_open(SPLAT_VNODE_TEST_FILE_RW2, UIO_SYSSPACE,
270 FREAD | FEXCL, 0644, &vp, 0, 0))) {
271 splat_vprint(file, SPLAT_VNODE_TEST4_NAME,
272 "Failed to vn_open test file: %s (%d)\n",
273 SPLAT_VNODE_TEST_FILE_RW2, rc);
274 goto out;
275 }
276
277 rc = vn_rdwr(UIO_READ, vp, buf2, strlen(buf1), 0,
278 UIO_SYSSPACE, 0, RLIM64_INFINITY, 0, NULL);
279 if (rc) {
280 splat_vprint(file, SPLAT_VNODE_TEST4_NAME,
281 "Failed vn_rdwr read of test file: %s (%d)\n",
282 SPLAT_VNODE_TEST_FILE_RW2, rc);
283 goto out2;
284 }
285
286 if (strncmp(buf1, buf2, strlen(buf1))) {
287 rc = EINVAL;
288 splat_vprint(file, SPLAT_VNODE_TEST4_NAME,
289 "Failed strncmp data written does not match "
290 "data read\nWrote: %sRead: %s\n", buf1, buf2);
291 goto out2;
292 }
293
294 rc = 0;
295 splat_vprint(file, SPLAT_VNODE_TEST4_NAME, "Wrote to %s: %s",
296 SPLAT_VNODE_TEST_FILE_RW1, buf1);
297 splat_vprint(file, SPLAT_VNODE_TEST4_NAME, "Read from %s: %s",
298 SPLAT_VNODE_TEST_FILE_RW2, buf2);
299 splat_vprint(file, SPLAT_VNODE_TEST4_NAME, "Successfully renamed "
300 "test file %s -> %s and verified data pattern\n",
301 SPLAT_VNODE_TEST_FILE_RW1, SPLAT_VNODE_TEST_FILE_RW2);
302 out2:
303 VOP_CLOSE(vp, 0, 0, 0, 0, 0);
304 out:
305 vn_remove(SPLAT_VNODE_TEST_FILE_RW1, UIO_SYSSPACE, RMFILE);
306 vn_remove(SPLAT_VNODE_TEST_FILE_RW2, UIO_SYSSPACE, RMFILE);
307
308 return -rc;
309 } /* splat_vnode_test4() */
310
311 static int
312 splat_vnode_test5(struct file *file, void *arg)
313 {
314 vnode_t *vp;
315 vattr_t vap;
316 int rc;
317
318 if ((rc = vn_open(SPLAT_VNODE_TEST_FILE, UIO_SYSSPACE,
319 FREAD, 0644, &vp, 0, 0))) {
320 splat_vprint(file, SPLAT_VNODE_TEST5_NAME,
321 "Failed to vn_open test file: %s (%d)\n",
322 SPLAT_VNODE_TEST_FILE, rc);
323 return -rc;
324 }
325
326 rc = VOP_GETATTR(vp, &vap, 0, 0, NULL);
327 if (rc) {
328 splat_vprint(file, SPLAT_VNODE_TEST5_NAME,
329 "Failed to vn_getattr test file: %s (%d)\n",
330 SPLAT_VNODE_TEST_FILE, rc);
331 goto out;
332 }
333
334 if (vap.va_type != VREG) {
335 rc = EINVAL;
336 splat_vprint(file, SPLAT_VNODE_TEST5_NAME,
337 "Failed expected regular file type "
338 "(%d != VREG): %s (%d)\n", vap.va_type,
339 SPLAT_VNODE_TEST_FILE, rc);
340 goto out;
341 }
342
343 splat_vprint(file, SPLAT_VNODE_TEST1_NAME, "Successfully "
344 "vn_getattr'ed test file: %s\n", SPLAT_VNODE_TEST_FILE);
345
346 out:
347 VOP_CLOSE(vp, 0, 0, 0, 0, 0);
348
349 return -rc;
350 } /* splat_vnode_test5() */
351
352 static int
353 splat_vnode_test6(struct file *file, void *arg)
354 {
355 vnode_t *vp;
356 char buf[32] = "SPL VNode Interface Test File\n";
357 int rc;
358
359 if ((rc = splat_vnode_unlink_all(file, arg, SPLAT_VNODE_TEST6_NAME)))
360 return rc;
361
362 if ((rc = vn_open(SPLAT_VNODE_TEST_FILE_RW, UIO_SYSSPACE,
363 FWRITE | FCREAT | FEXCL, 0644, &vp, 0, 0))) {
364 splat_vprint(file, SPLAT_VNODE_TEST6_NAME,
365 "Failed to vn_open test file: %s (%d)\n",
366 SPLAT_VNODE_TEST_FILE_RW, rc);
367 return -rc;
368 }
369
370 rc = vn_rdwr(UIO_WRITE, vp, buf, strlen(buf), 0,
371 UIO_SYSSPACE, 0, RLIM64_INFINITY, 0, NULL);
372 if (rc) {
373 splat_vprint(file, SPLAT_VNODE_TEST6_NAME,
374 "Failed vn_rdwr write of test file: %s (%d)\n",
375 SPLAT_VNODE_TEST_FILE_RW, rc);
376 goto out;
377 }
378
379 rc = vn_fsync(vp, 0, 0, 0);
380 if (rc) {
381 splat_vprint(file, SPLAT_VNODE_TEST6_NAME,
382 "Failed vn_fsync of test file: %s (%d)\n",
383 SPLAT_VNODE_TEST_FILE_RW, rc);
384 goto out;
385 }
386
387 rc = 0;
388 splat_vprint(file, SPLAT_VNODE_TEST6_NAME, "Successfully "
389 "fsync'ed test file %s\n", SPLAT_VNODE_TEST_FILE_RW);
390 out:
391 VOP_CLOSE(vp, 0, 0, 0, 0, 0);
392 vn_remove(SPLAT_VNODE_TEST_FILE_RW, UIO_SYSSPACE, RMFILE);
393
394 return -rc;
395 } /* splat_vnode_test6() */
396
397 /* Basically a slightly modified version of sys_close() */
398 static int
399 fd_uninstall(int fd)
400 {
401 struct file *fp;
402 struct files_struct *files = current->files;
403 #ifdef HAVE_FILES_FDTABLE
404 struct fdtable *fdt;
405
406 spin_lock(&files->file_lock);
407 fdt = files_fdtable(files);
408
409 if (fd >= fdt->max_fds)
410 goto out_unlock;
411
412 fp = fdt->fd[fd];
413 if (!fp)
414 goto out_unlock;
415
416 rcu_assign_pointer(fdt->fd[fd], NULL);
417 __clear_close_on_exec(fd, fdt);
418 #else
419 spin_lock(&files->file_lock);
420 if (fd >= files->max_fds)
421 goto out_unlock;
422
423 fp = files->fd[fd];
424 if (!fp)
425 goto out_unlock;
426
427 files->fd[fd] = NULL;
428 FD_CLR(fd, files->close_on_exec);
429 #endif
430 /* Dropping the lock here exposes a minor race but it allows me
431 * to use the existing kernel interfaces for this, and for a test
432 * case I think that's reasonable. */
433 spin_unlock(&files->file_lock);
434 put_unused_fd(fd);
435 return 0;
436
437 out_unlock:
438 spin_unlock(&files->file_lock);
439 return -EBADF;
440 } /* fd_uninstall() */
441
442 static int
443 splat_vnode_test7(struct file *file, void *arg)
444 {
445 char buf1[32] = "SPL VNode Interface Test File\n";
446 char buf2[32] = "";
447 struct file *lfp;
448 file_t *fp;
449 int rc, fd;
450
451 if ((rc = splat_vnode_unlink_all(file, arg, SPLAT_VNODE_TEST7_NAME)))
452 return rc;
453
454 /* Prep work needed to test getf/releasef */
455 fd = get_unused_fd();
456 if (fd < 0) {
457 splat_vprint(file, SPLAT_VNODE_TEST7_NAME,
458 "Failed to get unused fd (%d)\n", fd);
459 return fd;
460 }
461
462 lfp = filp_open(SPLAT_VNODE_TEST_FILE_RW, O_RDWR|O_CREAT|O_EXCL, 0644);
463 if (IS_ERR(lfp)) {
464 put_unused_fd(fd);
465 rc = PTR_ERR(lfp);
466 splat_vprint(file, SPLAT_VNODE_TEST7_NAME,
467 "Failed to filp_open: %s (%d)\n",
468 SPLAT_VNODE_TEST_FILE_RW, rc);
469 return rc;
470 }
471
472 /* Pair up the new fd and lfp in the current context, this allows
473 * getf to lookup the file struct simply by the known open fd */
474 fd_install(fd, lfp);
475
476 /* Actual getf()/releasef() test */
477 fp = vn_getf(fd);
478 if (fp == NULL) {
479 rc = EINVAL;
480 splat_vprint(file, SPLAT_VNODE_TEST7_NAME,
481 "Failed to getf fd %d: (%d)\n", fd, rc);
482 goto out;
483 }
484
485 rc = vn_rdwr(UIO_WRITE, fp->f_vnode, buf1, strlen(buf1), 0,
486 UIO_SYSSPACE, 0, RLIM64_INFINITY, 0, NULL);
487 if (rc) {
488 splat_vprint(file, SPLAT_VNODE_TEST7_NAME,
489 "Failed vn_rdwr write of test file: %s (%d)\n",
490 SPLAT_VNODE_TEST_FILE_RW, rc);
491 goto out;
492 }
493
494 rc = vn_rdwr(UIO_READ, fp->f_vnode, buf2, strlen(buf1), 0,
495 UIO_SYSSPACE, 0, RLIM64_INFINITY, 0, NULL);
496 if (rc) {
497 splat_vprint(file, SPLAT_VNODE_TEST7_NAME,
498 "Failed vn_rdwr read of test file: %s (%d)\n",
499 SPLAT_VNODE_TEST_FILE_RW, rc);
500 goto out;
501 }
502
503 if (strncmp(buf1, buf2, strlen(buf1))) {
504 rc = EINVAL;
505 splat_vprint(file, SPLAT_VNODE_TEST7_NAME,
506 "Failed strncmp data written does not match "
507 "data read\nWrote: %sRead: %s\n", buf1, buf2);
508 goto out;
509 }
510
511 rc = 0;
512 splat_vprint(file, SPLAT_VNODE_TEST3_NAME, "Wrote: %s", buf1);
513 splat_vprint(file, SPLAT_VNODE_TEST3_NAME, "Read: %s", buf2);
514 splat_vprint(file, SPLAT_VNODE_TEST3_NAME, "Successfully wrote and "
515 "read expected data pattern to test file: %s\n",
516 SPLAT_VNODE_TEST_FILE_RW);
517 out:
518 vn_releasef(fd);
519 fd_uninstall(fd);
520 filp_close(lfp, 0);
521 vn_remove(SPLAT_VNODE_TEST_FILE_RW, UIO_SYSSPACE, RMFILE);
522
523 return -rc;
524 } /* splat_vnode_test7() */
525
526 splat_subsystem_t *
527 splat_vnode_init(void)
528 {
529 splat_subsystem_t *sub;
530
531 sub = kmalloc(sizeof(*sub), GFP_KERNEL);
532 if (sub == NULL)
533 return NULL;
534
535 memset(sub, 0, sizeof(*sub));
536 strncpy(sub->desc.name, SPLAT_VNODE_NAME, SPLAT_NAME_SIZE);
537 strncpy(sub->desc.desc, SPLAT_VNODE_DESC, SPLAT_DESC_SIZE);
538 INIT_LIST_HEAD(&sub->subsystem_list);
539 INIT_LIST_HEAD(&sub->test_list);
540 spin_lock_init(&sub->test_lock);
541 sub->desc.id = SPLAT_SUBSYSTEM_VNODE;
542
543 SPLAT_TEST_INIT(sub, SPLAT_VNODE_TEST1_NAME, SPLAT_VNODE_TEST1_DESC,
544 SPLAT_VNODE_TEST1_ID, splat_vnode_test1);
545 SPLAT_TEST_INIT(sub, SPLAT_VNODE_TEST2_NAME, SPLAT_VNODE_TEST2_DESC,
546 SPLAT_VNODE_TEST2_ID, splat_vnode_test2);
547 SPLAT_TEST_INIT(sub, SPLAT_VNODE_TEST3_NAME, SPLAT_VNODE_TEST3_DESC,
548 SPLAT_VNODE_TEST3_ID, splat_vnode_test3);
549 SPLAT_TEST_INIT(sub, SPLAT_VNODE_TEST4_NAME, SPLAT_VNODE_TEST4_DESC,
550 SPLAT_VNODE_TEST4_ID, splat_vnode_test4);
551 SPLAT_TEST_INIT(sub, SPLAT_VNODE_TEST5_NAME, SPLAT_VNODE_TEST5_DESC,
552 SPLAT_VNODE_TEST5_ID, splat_vnode_test5);
553 SPLAT_TEST_INIT(sub, SPLAT_VNODE_TEST6_NAME, SPLAT_VNODE_TEST6_DESC,
554 SPLAT_VNODE_TEST6_ID, splat_vnode_test6);
555 SPLAT_TEST_INIT(sub, SPLAT_VNODE_TEST7_NAME, SPLAT_VNODE_TEST7_DESC,
556 SPLAT_VNODE_TEST7_ID, splat_vnode_test7);
557
558 return sub;
559 } /* splat_vnode_init() */
560
561 void
562 splat_vnode_fini(splat_subsystem_t *sub)
563 {
564 ASSERT(sub);
565
566 SPLAT_TEST_FINI(sub, SPLAT_VNODE_TEST7_ID);
567 SPLAT_TEST_FINI(sub, SPLAT_VNODE_TEST6_ID);
568 SPLAT_TEST_FINI(sub, SPLAT_VNODE_TEST5_ID);
569 SPLAT_TEST_FINI(sub, SPLAT_VNODE_TEST4_ID);
570 SPLAT_TEST_FINI(sub, SPLAT_VNODE_TEST3_ID);
571 SPLAT_TEST_FINI(sub, SPLAT_VNODE_TEST2_ID);
572 SPLAT_TEST_FINI(sub, SPLAT_VNODE_TEST1_ID);
573
574 kfree(sub);
575 } /* splat_vnode_fini() */
576
577 int
578 splat_vnode_id(void)
579 {
580 return SPLAT_SUBSYSTEM_VNODE;
581 } /* splat_vnode_id() */