]> git.proxmox.com Git - mirror_spl-debian.git/blob - module/splat/splat-vnode.c
Public Release Prep
[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 VN_RELE(vp);
128
129 if (rc) {
130 splat_vprint(file, SPLAT_VNODE_TEST1_NAME,
131 "Failed to vn_close test file: %s (%d)\n",
132 SPLAT_VNODE_TEST_FILE, rc);
133 return -rc;
134 }
135
136 splat_vprint(file, SPLAT_VNODE_TEST1_NAME, "Successfully vn_open'ed "
137 "and vn_closed test file: %s\n", SPLAT_VNODE_TEST_FILE);
138
139 return -rc;
140 } /* splat_vnode_test1() */
141
142 static int
143 splat_vnode_test2(struct file *file, void *arg)
144 {
145 vnode_t *vp;
146 int rc;
147
148 if ((rc = vn_openat(SPLAT_VNODE_TEST_FILE_AT, UIO_SYSSPACE,
149 FREAD, 0644, &vp, 0, 0, rootdir, 0))) {
150 splat_vprint(file, SPLAT_VNODE_TEST2_NAME,
151 "Failed to vn_openat test file: %s (%d)\n",
152 SPLAT_VNODE_TEST_FILE, rc);
153 return -rc;
154 }
155
156 rc = VOP_CLOSE(vp, 0, 0, 0, 0, 0);
157 VN_RELE(vp);
158
159 if (rc) {
160 splat_vprint(file, SPLAT_VNODE_TEST2_NAME,
161 "Failed to vn_close test file: %s (%d)\n",
162 SPLAT_VNODE_TEST_FILE, rc);
163 return -rc;
164 }
165
166 splat_vprint(file, SPLAT_VNODE_TEST2_NAME, "Successfully vn_openat'ed "
167 "and vn_closed test file: %s\n", SPLAT_VNODE_TEST_FILE);
168
169 return -rc;
170 } /* splat_vnode_test2() */
171
172 static int
173 splat_vnode_test3(struct file *file, void *arg)
174 {
175 vnode_t *vp;
176 char buf1[32] = "SPL VNode Interface Test File\n";
177 char buf2[32] = "";
178 int rc;
179
180 if ((rc = splat_vnode_unlink_all(file, arg, SPLAT_VNODE_TEST3_NAME)))
181 return rc;
182
183 if ((rc = vn_open(SPLAT_VNODE_TEST_FILE_RW, UIO_SYSSPACE,
184 FWRITE | FREAD | FCREAT | FEXCL,
185 0644, &vp, 0, 0))) {
186 splat_vprint(file, SPLAT_VNODE_TEST3_NAME,
187 "Failed to vn_open test file: %s (%d)\n",
188 SPLAT_VNODE_TEST_FILE_RW, rc);
189 return -rc;
190 }
191
192 rc = vn_rdwr(UIO_WRITE, vp, buf1, strlen(buf1), 0,
193 UIO_SYSSPACE, 0, RLIM64_INFINITY, 0, NULL);
194 if (rc) {
195 splat_vprint(file, SPLAT_VNODE_TEST3_NAME,
196 "Failed vn_rdwr write of test file: %s (%d)\n",
197 SPLAT_VNODE_TEST_FILE_RW, rc);
198 goto out;
199 }
200
201 rc = vn_rdwr(UIO_READ, vp, buf2, strlen(buf1), 0,
202 UIO_SYSSPACE, 0, RLIM64_INFINITY, 0, NULL);
203 if (rc) {
204 splat_vprint(file, SPLAT_VNODE_TEST3_NAME,
205 "Failed vn_rdwr read of test file: %s (%d)\n",
206 SPLAT_VNODE_TEST_FILE_RW, rc);
207 goto out;
208 }
209
210 if (strncmp(buf1, buf2, strlen(buf1))) {
211 rc = EINVAL;
212 splat_vprint(file, SPLAT_VNODE_TEST3_NAME,
213 "Failed strncmp data written does not match "
214 "data read\nWrote: %sRead: %s\n", buf1, buf2);
215 goto out;
216 }
217
218 rc = 0;
219 splat_vprint(file, SPLAT_VNODE_TEST3_NAME, "Wrote: %s", buf1);
220 splat_vprint(file, SPLAT_VNODE_TEST3_NAME, "Read: %s", buf2);
221 splat_vprint(file, SPLAT_VNODE_TEST3_NAME, "Successfully wrote and "
222 "read expected data pattern to test file: %s\n",
223 SPLAT_VNODE_TEST_FILE_RW);
224
225 out:
226 VOP_CLOSE(vp, 0, 0, 0, 0, 0);
227 VN_RELE(vp);
228 vn_remove(SPLAT_VNODE_TEST_FILE_RW, UIO_SYSSPACE, RMFILE);
229
230 return -rc;
231 } /* splat_vnode_test3() */
232
233 static int
234 splat_vnode_test4(struct file *file, void *arg)
235 {
236 vnode_t *vp;
237 char buf1[32] = "SPL VNode Interface Test File\n";
238 char buf2[32] = "";
239 int rc;
240
241 if ((rc = splat_vnode_unlink_all(file, arg, SPLAT_VNODE_TEST4_NAME)))
242 return rc;
243
244 if ((rc = vn_open(SPLAT_VNODE_TEST_FILE_RW1, UIO_SYSSPACE,
245 FWRITE | FREAD | FCREAT | FEXCL, 0644, &vp, 0, 0))) {
246 splat_vprint(file, SPLAT_VNODE_TEST4_NAME,
247 "Failed to vn_open test file: %s (%d)\n",
248 SPLAT_VNODE_TEST_FILE_RW1, rc);
249 goto out;
250 }
251
252 rc = vn_rdwr(UIO_WRITE, vp, buf1, strlen(buf1), 0,
253 UIO_SYSSPACE, 0, RLIM64_INFINITY, 0, NULL);
254 if (rc) {
255 splat_vprint(file, SPLAT_VNODE_TEST4_NAME,
256 "Failed vn_rdwr write of test file: %s (%d)\n",
257 SPLAT_VNODE_TEST_FILE_RW1, rc);
258 goto out2;
259 }
260
261 VOP_CLOSE(vp, 0, 0, 0, 0, 0);
262 VN_RELE(vp);
263
264 rc = vn_rename(SPLAT_VNODE_TEST_FILE_RW1,SPLAT_VNODE_TEST_FILE_RW2,0);
265 if (rc) {
266 splat_vprint(file, SPLAT_VNODE_TEST4_NAME, "Failed vn_rename "
267 "%s -> %s (%d)\n",
268 SPLAT_VNODE_TEST_FILE_RW1,
269 SPLAT_VNODE_TEST_FILE_RW2, rc);
270 goto out;
271 }
272
273 if ((rc = vn_open(SPLAT_VNODE_TEST_FILE_RW2, UIO_SYSSPACE,
274 FREAD | FEXCL, 0644, &vp, 0, 0))) {
275 splat_vprint(file, SPLAT_VNODE_TEST4_NAME,
276 "Failed to vn_open test file: %s (%d)\n",
277 SPLAT_VNODE_TEST_FILE_RW2, rc);
278 goto out;
279 }
280
281 rc = vn_rdwr(UIO_READ, vp, buf2, strlen(buf1), 0,
282 UIO_SYSSPACE, 0, RLIM64_INFINITY, 0, NULL);
283 if (rc) {
284 splat_vprint(file, SPLAT_VNODE_TEST4_NAME,
285 "Failed vn_rdwr read of test file: %s (%d)\n",
286 SPLAT_VNODE_TEST_FILE_RW2, rc);
287 goto out2;
288 }
289
290 if (strncmp(buf1, buf2, strlen(buf1))) {
291 rc = EINVAL;
292 splat_vprint(file, SPLAT_VNODE_TEST4_NAME,
293 "Failed strncmp data written does not match "
294 "data read\nWrote: %sRead: %s\n", buf1, buf2);
295 goto out2;
296 }
297
298 rc = 0;
299 splat_vprint(file, SPLAT_VNODE_TEST4_NAME, "Wrote to %s: %s",
300 SPLAT_VNODE_TEST_FILE_RW1, buf1);
301 splat_vprint(file, SPLAT_VNODE_TEST4_NAME, "Read from %s: %s",
302 SPLAT_VNODE_TEST_FILE_RW2, buf2);
303 splat_vprint(file, SPLAT_VNODE_TEST4_NAME, "Successfully renamed "
304 "test file %s -> %s and verified data pattern\n",
305 SPLAT_VNODE_TEST_FILE_RW1, SPLAT_VNODE_TEST_FILE_RW2);
306 out2:
307 VOP_CLOSE(vp, 0, 0, 0, 0, 0);
308 VN_RELE(vp);
309 out:
310 vn_remove(SPLAT_VNODE_TEST_FILE_RW1, UIO_SYSSPACE, RMFILE);
311 vn_remove(SPLAT_VNODE_TEST_FILE_RW2, UIO_SYSSPACE, RMFILE);
312
313 return -rc;
314 } /* splat_vnode_test4() */
315
316 static int
317 splat_vnode_test5(struct file *file, void *arg)
318 {
319 vnode_t *vp;
320 vattr_t vap;
321 int rc;
322
323 if ((rc = vn_open(SPLAT_VNODE_TEST_FILE, UIO_SYSSPACE,
324 FREAD, 0644, &vp, 0, 0))) {
325 splat_vprint(file, SPLAT_VNODE_TEST5_NAME,
326 "Failed to vn_open test file: %s (%d)\n",
327 SPLAT_VNODE_TEST_FILE, rc);
328 return -rc;
329 }
330
331 rc = VOP_GETATTR(vp, &vap, 0, 0, NULL);
332 if (rc) {
333 splat_vprint(file, SPLAT_VNODE_TEST5_NAME,
334 "Failed to vn_getattr test file: %s (%d)\n",
335 SPLAT_VNODE_TEST_FILE, rc);
336 goto out;
337 }
338
339 if (vap.va_type != VREG) {
340 rc = EINVAL;
341 splat_vprint(file, SPLAT_VNODE_TEST5_NAME,
342 "Failed expected regular file type "
343 "(%d != VREG): %s (%d)\n", vap.va_type,
344 SPLAT_VNODE_TEST_FILE, rc);
345 goto out;
346 }
347
348 splat_vprint(file, SPLAT_VNODE_TEST1_NAME, "Successfully "
349 "vn_getattr'ed test file: %s\n", SPLAT_VNODE_TEST_FILE);
350
351 out:
352 VOP_CLOSE(vp, 0, 0, 0, 0, 0);
353 VN_RELE(vp);
354
355 return -rc;
356 } /* splat_vnode_test5() */
357
358 static int
359 splat_vnode_test6(struct file *file, void *arg)
360 {
361 vnode_t *vp;
362 char buf[32] = "SPL VNode Interface Test File\n";
363 int rc;
364
365 if ((rc = splat_vnode_unlink_all(file, arg, SPLAT_VNODE_TEST6_NAME)))
366 return rc;
367
368 if ((rc = vn_open(SPLAT_VNODE_TEST_FILE_RW, UIO_SYSSPACE,
369 FWRITE | FCREAT | FEXCL, 0644, &vp, 0, 0))) {
370 splat_vprint(file, SPLAT_VNODE_TEST6_NAME,
371 "Failed to vn_open test file: %s (%d)\n",
372 SPLAT_VNODE_TEST_FILE_RW, rc);
373 return -rc;
374 }
375
376 rc = vn_rdwr(UIO_WRITE, vp, buf, strlen(buf), 0,
377 UIO_SYSSPACE, 0, RLIM64_INFINITY, 0, NULL);
378 if (rc) {
379 splat_vprint(file, SPLAT_VNODE_TEST6_NAME,
380 "Failed vn_rdwr write of test file: %s (%d)\n",
381 SPLAT_VNODE_TEST_FILE_RW, rc);
382 goto out;
383 }
384
385 rc = vn_fsync(vp, 0, 0, 0);
386 if (rc) {
387 splat_vprint(file, SPLAT_VNODE_TEST6_NAME,
388 "Failed vn_fsync of test file: %s (%d)\n",
389 SPLAT_VNODE_TEST_FILE_RW, rc);
390 goto out;
391 }
392
393 rc = 0;
394 splat_vprint(file, SPLAT_VNODE_TEST6_NAME, "Successfully "
395 "fsync'ed test file %s\n", SPLAT_VNODE_TEST_FILE_RW);
396 out:
397 VOP_CLOSE(vp, 0, 0, 0, 0, 0);
398 VN_RELE(vp);
399 vn_remove(SPLAT_VNODE_TEST_FILE_RW, UIO_SYSSPACE, RMFILE);
400
401 return -rc;
402 } /* splat_vnode_test6() */
403
404 /* Basically a slightly modified version of sys_close() */
405 static int
406 fd_uninstall(int fd)
407 {
408 struct file *fp;
409 struct files_struct *files = current->files;
410 #ifdef HAVE_FILES_FDTABLE
411 struct fdtable *fdt;
412
413 spin_lock(&files->file_lock);
414 fdt = files_fdtable(files);
415
416 if (fd >= fdt->max_fds)
417 goto out_unlock;
418
419 fp = fdt->fd[fd];
420 if (!fp)
421 goto out_unlock;
422
423 rcu_assign_pointer(fdt->fd[fd], NULL);
424 FD_CLR(fd, fdt->close_on_exec);
425 #else
426 spin_lock(&files->file_lock);
427 if (fd >= files->max_fds)
428 goto out_unlock;
429
430 fp = files->fd[fd];
431 if (!fp)
432 goto out_unlock;
433
434 files->fd[fd] = NULL;
435 FD_CLR(fd, files->close_on_exec);
436 #endif
437 /* Dropping the lock here exposes a minor race but it allows me
438 * to use the existing kernel interfaces for this, and for a test
439 * case I think that's reasonable. */
440 spin_unlock(&files->file_lock);
441 put_unused_fd(fd);
442 return 0;
443
444 out_unlock:
445 spin_unlock(&files->file_lock);
446 return -EBADF;
447 } /* fd_uninstall() */
448
449 static int
450 splat_vnode_test7(struct file *file, void *arg)
451 {
452 char buf1[32] = "SPL VNode Interface Test File\n";
453 char buf2[32] = "";
454 struct file *lfp;
455 file_t *fp;
456 int rc, fd;
457
458 if ((rc = splat_vnode_unlink_all(file, arg, SPLAT_VNODE_TEST7_NAME)))
459 return rc;
460
461 /* Prep work needed to test getf/releasef */
462 fd = get_unused_fd();
463 if (fd < 0) {
464 splat_vprint(file, SPLAT_VNODE_TEST7_NAME,
465 "Failed to get unused fd (%d)\n", fd);
466 return fd;
467 }
468
469 lfp = filp_open(SPLAT_VNODE_TEST_FILE_RW, O_RDWR|O_CREAT|O_EXCL, 0644);
470 if (IS_ERR(lfp)) {
471 put_unused_fd(fd);
472 rc = PTR_ERR(lfp);
473 splat_vprint(file, SPLAT_VNODE_TEST7_NAME,
474 "Failed to filp_open: %s (%d)\n",
475 SPLAT_VNODE_TEST_FILE_RW, rc);
476 return rc;
477 }
478
479 /* Pair up the new fd and lfp in the current context, this allows
480 * getf to lookup the file struct simply by the known open fd */
481 fd_install(fd, lfp);
482
483 /* Actual getf()/releasef() test */
484 fp = vn_getf(fd);
485 if (fp == NULL) {
486 rc = EINVAL;
487 splat_vprint(file, SPLAT_VNODE_TEST7_NAME,
488 "Failed to getf fd %d: (%d)\n", fd, rc);
489 goto out;
490 }
491
492 rc = vn_rdwr(UIO_WRITE, fp->f_vnode, buf1, strlen(buf1), 0,
493 UIO_SYSSPACE, 0, RLIM64_INFINITY, 0, NULL);
494 if (rc) {
495 splat_vprint(file, SPLAT_VNODE_TEST7_NAME,
496 "Failed vn_rdwr write of test file: %s (%d)\n",
497 SPLAT_VNODE_TEST_FILE_RW, rc);
498 goto out;
499 }
500
501 rc = vn_rdwr(UIO_READ, fp->f_vnode, buf2, strlen(buf1), 0,
502 UIO_SYSSPACE, 0, RLIM64_INFINITY, 0, NULL);
503 if (rc) {
504 splat_vprint(file, SPLAT_VNODE_TEST7_NAME,
505 "Failed vn_rdwr read of test file: %s (%d)\n",
506 SPLAT_VNODE_TEST_FILE_RW, rc);
507 goto out;
508 }
509
510 if (strncmp(buf1, buf2, strlen(buf1))) {
511 rc = EINVAL;
512 splat_vprint(file, SPLAT_VNODE_TEST7_NAME,
513 "Failed strncmp data written does not match "
514 "data read\nWrote: %sRead: %s\n", buf1, buf2);
515 goto out;
516 }
517
518 rc = 0;
519 splat_vprint(file, SPLAT_VNODE_TEST3_NAME, "Wrote: %s", buf1);
520 splat_vprint(file, SPLAT_VNODE_TEST3_NAME, "Read: %s", buf2);
521 splat_vprint(file, SPLAT_VNODE_TEST3_NAME, "Successfully wrote and "
522 "read expected data pattern to test file: %s\n",
523 SPLAT_VNODE_TEST_FILE_RW);
524 out:
525 vn_releasef(fd);
526 fd_uninstall(fd);
527 filp_close(lfp, 0);
528 vn_remove(SPLAT_VNODE_TEST_FILE_RW, UIO_SYSSPACE, RMFILE);
529
530 return -rc;
531 } /* splat_vnode_test7() */
532
533 splat_subsystem_t *
534 splat_vnode_init(void)
535 {
536 splat_subsystem_t *sub;
537
538 sub = kmalloc(sizeof(*sub), GFP_KERNEL);
539 if (sub == NULL)
540 return NULL;
541
542 memset(sub, 0, sizeof(*sub));
543 strncpy(sub->desc.name, SPLAT_VNODE_NAME, SPLAT_NAME_SIZE);
544 strncpy(sub->desc.desc, SPLAT_VNODE_DESC, SPLAT_DESC_SIZE);
545 INIT_LIST_HEAD(&sub->subsystem_list);
546 INIT_LIST_HEAD(&sub->test_list);
547 spin_lock_init(&sub->test_lock);
548 sub->desc.id = SPLAT_SUBSYSTEM_VNODE;
549
550 SPLAT_TEST_INIT(sub, SPLAT_VNODE_TEST1_NAME, SPLAT_VNODE_TEST1_DESC,
551 SPLAT_VNODE_TEST1_ID, splat_vnode_test1);
552 SPLAT_TEST_INIT(sub, SPLAT_VNODE_TEST2_NAME, SPLAT_VNODE_TEST2_DESC,
553 SPLAT_VNODE_TEST2_ID, splat_vnode_test2);
554 SPLAT_TEST_INIT(sub, SPLAT_VNODE_TEST3_NAME, SPLAT_VNODE_TEST3_DESC,
555 SPLAT_VNODE_TEST3_ID, splat_vnode_test3);
556 SPLAT_TEST_INIT(sub, SPLAT_VNODE_TEST4_NAME, SPLAT_VNODE_TEST4_DESC,
557 SPLAT_VNODE_TEST4_ID, splat_vnode_test4);
558 SPLAT_TEST_INIT(sub, SPLAT_VNODE_TEST5_NAME, SPLAT_VNODE_TEST5_DESC,
559 SPLAT_VNODE_TEST5_ID, splat_vnode_test5);
560 SPLAT_TEST_INIT(sub, SPLAT_VNODE_TEST6_NAME, SPLAT_VNODE_TEST6_DESC,
561 SPLAT_VNODE_TEST6_ID, splat_vnode_test6);
562 SPLAT_TEST_INIT(sub, SPLAT_VNODE_TEST7_NAME, SPLAT_VNODE_TEST7_DESC,
563 SPLAT_VNODE_TEST7_ID, splat_vnode_test7);
564
565 return sub;
566 } /* splat_vnode_init() */
567
568 void
569 splat_vnode_fini(splat_subsystem_t *sub)
570 {
571 ASSERT(sub);
572
573 SPLAT_TEST_FINI(sub, SPLAT_VNODE_TEST7_ID);
574 SPLAT_TEST_FINI(sub, SPLAT_VNODE_TEST6_ID);
575 SPLAT_TEST_FINI(sub, SPLAT_VNODE_TEST5_ID);
576 SPLAT_TEST_FINI(sub, SPLAT_VNODE_TEST4_ID);
577 SPLAT_TEST_FINI(sub, SPLAT_VNODE_TEST3_ID);
578 SPLAT_TEST_FINI(sub, SPLAT_VNODE_TEST2_ID);
579 SPLAT_TEST_FINI(sub, SPLAT_VNODE_TEST1_ID);
580
581 kfree(sub);
582 } /* splat_vnode_fini() */
583
584 int
585 splat_vnode_id(void)
586 {
587 return SPLAT_SUBSYSTEM_VNODE;
588 } /* splat_vnode_id() */