fdesc_vnops.c (111742) | fdesc_vnops.c (111748) |
---|---|
1/* 2 * Copyright (c) 1992, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software donated to Berkeley by 6 * Jan-Simon Pendry. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 21 unchanged lines hidden (view full) --- 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 * 36 * @(#)fdesc_vnops.c 8.9 (Berkeley) 1/21/94 37 * | 1/* 2 * Copyright (c) 1992, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software donated to Berkeley by 6 * Jan-Simon Pendry. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 21 unchanged lines hidden (view full) --- 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 * 36 * @(#)fdesc_vnops.c 8.9 (Berkeley) 1/21/94 37 * |
38 * $FreeBSD: head/sys/fs/fdescfs/fdesc_vnops.c 111742 2003-03-02 15:56:49Z des $ | 38 * $FreeBSD: head/sys/fs/fdescfs/fdesc_vnops.c 111748 2003-03-02 16:54:40Z des $ |
39 */ 40 41/* 42 * /dev/fd Filesystem 43 */ 44 45#include <sys/param.h> 46#include <sys/systm.h> --- 70 unchanged lines hidden (view full) --- 117 } 118 119 /* 120 * otherwise lock the array while we call getnewvnode 121 * since that can block. 122 */ 123 if (fdcache_lock & FDL_LOCKED) { 124 fdcache_lock |= FDL_WANT; | 39 */ 40 41/* 42 * /dev/fd Filesystem 43 */ 44 45#include <sys/param.h> 46#include <sys/systm.h> --- 70 unchanged lines hidden (view full) --- 117 } 118 119 /* 120 * otherwise lock the array while we call getnewvnode 121 * since that can block. 122 */ 123 if (fdcache_lock & FDL_LOCKED) { 124 fdcache_lock |= FDL_WANT; |
125 (void) tsleep((caddr_t) &fdcache_lock, PINOD, "fdalvp", 0); | 125 (void) tsleep( &fdcache_lock, PINOD, "fdalvp", 0); |
126 goto loop; 127 } 128 fdcache_lock |= FDL_LOCKED; 129 130 /* 131 * Do the MALLOC before the getnewvnode since doing so afterward 132 * might cause a bogus v_data pointer to get dereferenced 133 * elsewhere if MALLOC should block. --- 12 unchanged lines hidden (view full) --- 146 fd->fd_ix = ix; 147 LIST_INSERT_HEAD(fc, fd, fd_hash); 148 149out: 150 fdcache_lock &= ~FDL_LOCKED; 151 152 if (fdcache_lock & FDL_WANT) { 153 fdcache_lock &= ~FDL_WANT; | 126 goto loop; 127 } 128 fdcache_lock |= FDL_LOCKED; 129 130 /* 131 * Do the MALLOC before the getnewvnode since doing so afterward 132 * might cause a bogus v_data pointer to get dereferenced 133 * elsewhere if MALLOC should block. --- 12 unchanged lines hidden (view full) --- 146 fd->fd_ix = ix; 147 LIST_INSERT_HEAD(fc, fd, fd_hash); 148 149out: 150 fdcache_lock &= ~FDL_LOCKED; 151 152 if (fdcache_lock & FDL_WANT) { 153 fdcache_lock &= ~FDL_WANT; |
154 wakeup((caddr_t) &fdcache_lock); | 154 wakeup( &fdcache_lock); |
155 } 156 157 return (error); 158} 159 160/* 161 * vp is the current namei directory 162 * ndp is the name to locate in that directory... --- 395 unchanged lines hidden --- | 155 } 156 157 return (error); 158} 159 160/* 161 * vp is the current namei directory 162 * ndp is the name to locate in that directory... --- 395 unchanged lines hidden --- |