nfs_node.c (105563) | nfs_node.c (109623) |
---|---|
1/* 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Rick Macklem at The University of Guelph. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 23 unchanged lines hidden (view full) --- 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 * @(#)nfs_node.c 8.6 (Berkeley) 5/22/95 37 */ 38 39#include <sys/cdefs.h> | 1/* 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Rick Macklem at The University of Guelph. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 23 unchanged lines hidden (view full) --- 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 * @(#)nfs_node.c 8.6 (Berkeley) 5/22/95 37 */ 38 39#include <sys/cdefs.h> |
40__FBSDID("$FreeBSD: head/sys/nfsclient/nfs_node.c 105563 2002-10-20 21:40:55Z phk $"); | 40__FBSDID("$FreeBSD: head/sys/nfsclient/nfs_node.c 109623 2003-01-21 08:56:16Z alfred $"); |
41 42#include <sys/param.h> 43#include <sys/systm.h> 44#include <sys/fnv_hash.h> 45#include <sys/lock.h> 46#include <sys/malloc.h> 47#include <sys/mount.h> 48#include <sys/namei.h> --- 170 unchanged lines hidden (view full) --- 219 } 220 nfs_node_hash_lock = 1; 221 222 /* 223 * Allocate before getnewvnode since doing so afterward 224 * might cause a bogus v_data pointer to get dereferenced 225 * elsewhere if zalloc should block. 226 */ | 41 42#include <sys/param.h> 43#include <sys/systm.h> 44#include <sys/fnv_hash.h> 45#include <sys/lock.h> 46#include <sys/malloc.h> 47#include <sys/mount.h> 48#include <sys/namei.h> --- 170 unchanged lines hidden (view full) --- 219 } 220 nfs_node_hash_lock = 1; 221 222 /* 223 * Allocate before getnewvnode since doing so afterward 224 * might cause a bogus v_data pointer to get dereferenced 225 * elsewhere if zalloc should block. 226 */ |
227 np = uma_zalloc(nfsnode_zone, M_WAITOK); | 227 np = uma_zalloc(nfsnode_zone, 0); |
228 229 error = getnewvnode("nfs", mntp, nfsv2_vnodeop_p, &nvp); 230 if (error) { 231 if (nfs_node_hash_lock < 0) 232 wakeup(&nfs_node_hash_lock); 233 nfs_node_hash_lock = 0; 234 *npp = 0; 235 uma_zfree(nfsnode_zone, np); --- 14 unchanged lines hidden (view full) --- 250 if (nfs_node_hash_lock < 0) 251 wakeup(&nfs_node_hash_lock); 252 nfs_node_hash_lock = 0; 253 uma_zfree(nfsnode_zone, np); 254 goto retry; 255 } 256 LIST_INSERT_HEAD(nhpp, np, n_hash); 257 if (fhsize > NFS_SMALLFH) { | 228 229 error = getnewvnode("nfs", mntp, nfsv2_vnodeop_p, &nvp); 230 if (error) { 231 if (nfs_node_hash_lock < 0) 232 wakeup(&nfs_node_hash_lock); 233 nfs_node_hash_lock = 0; 234 *npp = 0; 235 uma_zfree(nfsnode_zone, np); --- 14 unchanged lines hidden (view full) --- 250 if (nfs_node_hash_lock < 0) 251 wakeup(&nfs_node_hash_lock); 252 nfs_node_hash_lock = 0; 253 uma_zfree(nfsnode_zone, np); 254 goto retry; 255 } 256 LIST_INSERT_HEAD(nhpp, np, n_hash); 257 if (fhsize > NFS_SMALLFH) { |
258 MALLOC(np->n_fhp, nfsfh_t *, fhsize, M_NFSBIGFH, M_WAITOK); | 258 MALLOC(np->n_fhp, nfsfh_t *, fhsize, M_NFSBIGFH, 0); |
259 } else 260 np->n_fhp = &np->n_fh; 261 bcopy((caddr_t)fhp, (caddr_t)np->n_fhp, fhsize); 262 np->n_fhsize = fhsize; 263 lockinit(&np->n_rslock, PVFS | rsflags, "nfrslk", 0, LK_NOPAUSE); 264 *npp = np; 265 266 if (nfs_node_hash_lock < 0) --- 95 unchanged lines hidden --- | 259 } else 260 np->n_fhp = &np->n_fh; 261 bcopy((caddr_t)fhp, (caddr_t)np->n_fhp, fhsize); 262 np->n_fhsize = fhsize; 263 lockinit(&np->n_rslock, PVFS | rsflags, "nfrslk", 0, LK_NOPAUSE); 264 *npp = np; 265 266 if (nfs_node_hash_lock < 0) --- 95 unchanged lines hidden --- |