version 1.4.2.1, 2006/06/21 15:12:39 |
version 1.8, 2006/01/13 00:50:25 |
Line 74 static doff_t ufsdirhash_getprev(struct |
|
Line 74 static doff_t ufsdirhash_getprev(struct |
|
int dirblksiz); |
int dirblksiz); |
static int ufsdirhash_recycle(int wanted); |
static int ufsdirhash_recycle(int wanted); |
|
|
static POOL_INIT(ufsdirhash_pool, DH_NBLKOFF * sizeof(daddr_t), 0, 0, 0, |
POOL_INIT(ufsdirhash_pool, DH_NBLKOFF * sizeof(daddr_t), 0, 0, 0, "ufsdirhash", |
"ufsdirhash", &pool_allocator_nointr); |
&pool_allocator_nointr); |
|
|
#define DIRHASHLIST_LOCK() do { } while (0) |
#define DIRHASHLIST_LOCK() do { } while (0) |
#define DIRHASHLIST_UNLOCK() do { } while (0) |
#define DIRHASHLIST_UNLOCK() do { } while (0) |
Line 163 ufsdirhash_build(struct inode *ip) |
|
Line 163 ufsdirhash_build(struct inode *ip) |
|
DIRHASHLIST_UNLOCK(); |
DIRHASHLIST_UNLOCK(); |
return (-1); |
return (-1); |
} |
} |
dh->dh_hash = (doff_t **)malloc(narrays * sizeof(dh->dh_hash[0]), |
MALLOC(dh->dh_hash, doff_t **, narrays * sizeof(dh->dh_hash[0]), |
M_DIRHASH, M_NOWAIT | M_ZERO); |
M_DIRHASH, M_NOWAIT | M_ZERO); |
dh->dh_blkfree = (u_int8_t *)malloc(nblocks * sizeof(dh->dh_blkfree[0]), |
MALLOC(dh->dh_blkfree, u_int8_t *, nblocks * sizeof(dh->dh_blkfree[0]), |
M_DIRHASH, M_NOWAIT); |
M_DIRHASH, M_NOWAIT); |
if (dh->dh_hash == NULL || dh->dh_blkfree == NULL) |
if (dh->dh_hash == NULL || dh->dh_blkfree == NULL) |
goto fail; |
goto fail; |
Line 202 ufsdirhash_build(struct inode *ip) |
|
Line 202 ufsdirhash_build(struct inode *ip) |
|
if ((pos & bmask) == 0) { |
if ((pos & bmask) == 0) { |
if (bp != NULL) |
if (bp != NULL) |
brelse(bp); |
brelse(bp); |
if (ufs_blkatoff(vp, (off_t)pos, NULL, &bp) != 0) |
if (UFS_BLKATOFF(vp, (off_t)pos, NULL, &bp) != 0) |
goto fail; |
goto fail; |
} |
} |
|
|
|
|
if (bp != NULL) |
if (bp != NULL) |
brelse(bp); |
brelse(bp); |
blkoff = offset & ~bmask; |
blkoff = offset & ~bmask; |
if (ufs_blkatoff(vp, (off_t)blkoff, NULL, &bp) != 0) |
if (UFS_BLKATOFF(vp, (off_t)blkoff, NULL, &bp) != 0) |
return (EJUSTRETURN); |
return (EJUSTRETURN); |
} |
} |
dp = (struct direct *)(bp->b_data + (offset & bmask)); |
dp = (struct direct *)(bp->b_data + (offset & bmask)); |
Line 506 ufsdirhash_findfree(struct inode *ip, in |
|
Line 506 ufsdirhash_findfree(struct inode *ip, in |
|
dh->dh_blkfree[dirblock] >= howmany(slotneeded, DIRALIGN)); |
dh->dh_blkfree[dirblock] >= howmany(slotneeded, DIRALIGN)); |
DIRHASH_UNLOCK(dh); |
DIRHASH_UNLOCK(dh); |
pos = dirblock * dirblksiz; |
pos = dirblock * dirblksiz; |
error = ufs_blkatoff(ip->i_vnode, (off_t)pos, (void *)&dp, &bp); |
error = UFS_BLKATOFF(ip->i_vnode, (off_t)pos, (void *)&dp, &bp); |
if (error) |
if (error) |
return (-1); |
return (-1); |
/* Find the first entry with free space. */ |
/* Find the first entry with free space. */ |