ufs_dirhash.c (107868) | ufs_dirhash.c (109623) |
---|---|
1/* 2 * Copyright (c) 2001, 2002 Ian Dowse. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 8 unchanged lines hidden (view full) --- 17 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23 * SUCH DAMAGE. 24 * | 1/* 2 * Copyright (c) 2001, 2002 Ian Dowse. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 8 unchanged lines hidden (view full) --- 17 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23 * SUCH DAMAGE. 24 * |
25 * $FreeBSD: head/sys/ufs/ufs/ufs_dirhash.c 107868 2002-12-14 17:16:16Z iedowse $ | 25 * $FreeBSD: head/sys/ufs/ufs/ufs_dirhash.c 109623 2003-01-21 08:56:16Z alfred $ |
26 */ 27/* 28 * This implements a hash-based lookup scheme for UFS directories. 29 */ 30 31#include "opt_ufs.h" 32 33#ifdef UFS_DIRHASH --- 148 unchanged lines hidden (view full) --- 182 MALLOC(dh->dh_hash, doff_t **, narrays * sizeof(dh->dh_hash[0]), 183 M_DIRHASH, M_NOWAIT | M_ZERO); 184 MALLOC(dh->dh_blkfree, u_int8_t *, nblocks * sizeof(dh->dh_blkfree[0]), 185 M_DIRHASH, M_NOWAIT); 186 if (dh->dh_hash == NULL || dh->dh_blkfree == NULL) 187 goto fail; 188 for (i = 0; i < narrays; i++) { 189 if ((dh->dh_hash[i] = uma_zalloc(ufsdirhash_zone, | 26 */ 27/* 28 * This implements a hash-based lookup scheme for UFS directories. 29 */ 30 31#include "opt_ufs.h" 32 33#ifdef UFS_DIRHASH --- 148 unchanged lines hidden (view full) --- 182 MALLOC(dh->dh_hash, doff_t **, narrays * sizeof(dh->dh_hash[0]), 183 M_DIRHASH, M_NOWAIT | M_ZERO); 184 MALLOC(dh->dh_blkfree, u_int8_t *, nblocks * sizeof(dh->dh_blkfree[0]), 185 M_DIRHASH, M_NOWAIT); 186 if (dh->dh_hash == NULL || dh->dh_blkfree == NULL) 187 goto fail; 188 for (i = 0; i < narrays; i++) { 189 if ((dh->dh_hash[i] = uma_zalloc(ufsdirhash_zone, |
190 M_WAITOK)) == NULL) | 190 0)) == NULL) |
191 goto fail; 192 for (j = 0; j < DH_NBLKOFF; j++) 193 dh->dh_hash[i][j] = DIRHASH_EMPTY; 194 } 195 196 /* Initialise the hash table and block statistics. */ 197 mtx_init(&dh->dh_mtx, "dirhash", NULL, MTX_DEF); 198 dh->dh_narrays = narrays; --- 884 unchanged lines hidden --- | 191 goto fail; 192 for (j = 0; j < DH_NBLKOFF; j++) 193 dh->dh_hash[i][j] = DIRHASH_EMPTY; 194 } 195 196 /* Initialise the hash table and block statistics. */ 197 mtx_init(&dh->dh_mtx, "dirhash", NULL, MTX_DEF); 198 dh->dh_narrays = narrays; --- 884 unchanged lines hidden --- |