| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: udf_subr.c,v 1.91 2009/05/20 15:30:26 reinoud Exp $ */ | | 1 | /* $NetBSD: udf_subr.c,v 1.92 2009/06/18 15:01:34 reinoud Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 2006, 2008 Reinoud Zandijk | | 4 | * Copyright (c) 2006, 2008 Reinoud Zandijk |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * Redistribution and use in source and binary forms, with or without | | 7 | * Redistribution and use in source and binary forms, with or without |
8 | * modification, are permitted provided that the following conditions | | 8 | * modification, are permitted provided that the following conditions |
9 | * are met: | | 9 | * are met: |
10 | * 1. Redistributions of source code must retain the above copyright | | 10 | * 1. Redistributions of source code must retain the above copyright |
11 | * notice, this list of conditions and the following disclaimer. | | 11 | * notice, this list of conditions and the following disclaimer. |
12 | * 2. Redistributions in binary form must reproduce the above copyright | | 12 | * 2. Redistributions in binary form must reproduce the above copyright |
13 | * notice, this list of conditions and the following disclaimer in the | | 13 | * notice, this list of conditions and the following disclaimer in the |
14 | * documentation and/or other materials provided with the distribution. | | 14 | * documentation and/or other materials provided with the distribution. |
| @@ -19,27 +19,27 @@ | | | @@ -19,27 +19,27 @@ |
19 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | | 19 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | | 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
21 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | | 21 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
22 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | | 22 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
23 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | | 23 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
25 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | | 25 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * | | 26 | * |
27 | */ | | 27 | */ |
28 | | | 28 | |
29 | | | 29 | |
30 | #include <sys/cdefs.h> | | 30 | #include <sys/cdefs.h> |
31 | #ifndef lint | | 31 | #ifndef lint |
32 | __KERNEL_RCSID(0, "$NetBSD: udf_subr.c,v 1.91 2009/05/20 15:30:26 reinoud Exp $"); | | 32 | __KERNEL_RCSID(0, "$NetBSD: udf_subr.c,v 1.92 2009/06/18 15:01:34 reinoud Exp $"); |
33 | #endif /* not lint */ | | 33 | #endif /* not lint */ |
34 | | | 34 | |
35 | | | 35 | |
36 | #if defined(_KERNEL_OPT) | | 36 | #if defined(_KERNEL_OPT) |
37 | #include "opt_compat_netbsd.h" | | 37 | #include "opt_compat_netbsd.h" |
38 | #endif | | 38 | #endif |
39 | | | 39 | |
40 | #include <sys/param.h> | | 40 | #include <sys/param.h> |
41 | #include <sys/systm.h> | | 41 | #include <sys/systm.h> |
42 | #include <sys/sysctl.h> | | 42 | #include <sys/sysctl.h> |
43 | #include <sys/namei.h> | | 43 | #include <sys/namei.h> |
44 | #include <sys/proc.h> | | 44 | #include <sys/proc.h> |
45 | #include <sys/kernel.h> | | 45 | #include <sys/kernel.h> |
| @@ -5484,34 +5484,26 @@ udf_dispose_node(struct udf_node *udf_no | | | @@ -5484,34 +5484,26 @@ udf_dispose_node(struct udf_node *udf_no |
5484 | DPRINTF(NODE, ("udf_dispose_node called on node %p\n", udf_node)); | | 5484 | DPRINTF(NODE, ("udf_dispose_node called on node %p\n", udf_node)); |
5485 | if (!udf_node) { | | 5485 | if (!udf_node) { |
5486 | DPRINTF(NODE, ("UDF: Dispose node on node NULL, ignoring\n")); | | 5486 | DPRINTF(NODE, ("UDF: Dispose node on node NULL, ignoring\n")); |
5487 | return 0; | | 5487 | return 0; |
5488 | } | | 5488 | } |
5489 | | | 5489 | |
5490 | vp = udf_node->vnode; | | 5490 | vp = udf_node->vnode; |
5491 | #ifdef DIAGNOSTIC | | 5491 | #ifdef DIAGNOSTIC |
5492 | if (vp->v_numoutput) | | 5492 | if (vp->v_numoutput) |
5493 | panic("disposing UDF node with pending I/O's, udf_node = %p, " | | 5493 | panic("disposing UDF node with pending I/O's, udf_node = %p, " |
5494 | "v_numoutput = %d", udf_node, vp->v_numoutput); | | 5494 | "v_numoutput = %d", udf_node, vp->v_numoutput); |
5495 | #endif | | 5495 | #endif |
5496 | | | 5496 | |
5497 | /* wait until out of sync (just in case we happen to stumble over one */ | | | |
5498 | KASSERT(!mutex_owned(&mntvnode_lock)); | | | |
5499 | mutex_enter(&mntvnode_lock); | | | |
5500 | while (udf_node->i_flags & IN_SYNCED) { | | | |
5501 | cv_timedwait(&udf_node->ump->dirtynodes_cv, &mntvnode_lock, | | | |
5502 | hz/16); | | | |
5503 | } | | | |
5504 | mutex_exit(&mntvnode_lock); | | | |
5505 | | | 5497 | |
5506 | /* TODO extended attributes and streamdir */ | | 5498 | /* TODO extended attributes and streamdir */ |
5507 | | | 5499 | |
5508 | /* remove dirhash if present */ | | 5500 | /* remove dirhash if present */ |
5509 | dirhash_purge(&udf_node->dir_hash); | | 5501 | dirhash_purge(&udf_node->dir_hash); |
5510 | | | 5502 | |
5511 | /* remove from our hash lookup table */ | | 5503 | /* remove from our hash lookup table */ |
5512 | udf_deregister_node(udf_node); | | 5504 | udf_deregister_node(udf_node); |
5513 | | | 5505 | |
5514 | /* destroy our lock */ | | 5506 | /* destroy our lock */ |
5515 | mutex_destroy(&udf_node->node_mutex); | | 5507 | mutex_destroy(&udf_node->node_mutex); |
5516 | cv_destroy(&udf_node->node_lock); | | 5508 | cv_destroy(&udf_node->node_lock); |
5517 | | | 5509 | |