zap_micro.c revision 87e5029a3226958edab1512d6182bc74d8d80c9a
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/zfs_context.h>
#include <sys/zap_impl.h>
#include <sys/zap_leaf.h>
static void
{
int i, max;
for (i = 0; i < max; i++) {
}
}
void
{
switch (block_type) {
case ZBT_MICRO:
/* ASSERT(magic == ZAP_LEAF_MAGIC); */
return;
default:
return;
}
}
static int
{
return (+1);
return (-1);
return (+1);
return (-1);
return (0);
}
static void
{
}
static mzap_ent_t *
{
return (NULL);
return (mze);
}
return (NULL);
}
static uint32_t
{
cd = 0;
break;
cd++;
}
return (cd);
}
static void
{
}
static void
{
}
static zap_t *
{
int i;
} else {
}
/*
* Make sure that zap_ismicro is set before we let others see
* it, because zap_lockdir() checks zap_ismicro without the lock
* held.
*/
return (winner);
}
if (zap->zap_ismicro) {
mze_insert(zap, i,
}
}
} else {
}
return (zap);
}
int
{
int err;
#ifdef ZFS_DEBUG
{
}
#endif
/*
* The zap can deal with EIO here, but its callers don't yet, so
* spare them by doing a mustsucceed read.
*/
/*
* We're checking zap_ismicro without the lock held, in order to
* tell what type of lock we want. Once we have some sort of
* lock, see if it really is the right type. In practice this
* can only be different if it was upgraded from micro to fat,
* and micro wanted WRITER but fat only needs READER.
*/
/* it was upgraded, now we only need reader */
}
if (newsz > MZAP_MAX_BLKSZ) {
dprintf("upgrading obj %llu: num_entries=%u\n",
return (0);
}
}
return (0);
}
void
{
}
static void
{
dprintf("upgrading obj=%llu with %u chunks\n",
for (i = 0; i < nchunks; i++) {
int err;
continue;
dprintf("adding %s=%llu\n",
}
}
{
uint8_t c;
/*
* Only use 28 bits, since we need 4 bits in the cookie for the
* collision differentiator. We MUST use the high bits, since
* those are the onces that we first pay attention to when
* chosing the bucket.
*/
return (crc);
}
static void
{
#ifdef ZFS_DEBUG
{
}
#endif
}
int
{
int err;
if (err != 0)
return (err);
return (0);
}
{
return (obj);
}
int
{
/*
* dmu_object_free will free the object number and free the
* data. Freeing the data will cause our pageout function to be
* called, which will destroy our data (zap_leaf_t's and zap_t).
*/
}
void
{
if (zap->zap_ismicro) {
}
}
int
{
int err;
if (err)
return (err);
if (!zap->zap_ismicro) {
} else {
}
return (err);
}
/*
* Routines for maniplulating attributes.
*/
int
{
int err;
if (err)
return (err);
if (!zap->zap_ismicro) {
} else {
} else {
if (num_integers < 1)
else if (integer_size != 8)
else
}
}
return (err);
}
int
{
int err;
if (err)
return (err);
if (!zap->zap_ismicro) {
} else {
} else {
if (integer_size)
*integer_size = 8;
if (num_integers)
*num_integers = 1;
}
}
return (err);
}
static void
{
int i;
#ifdef ZFS_DEBUG
}
#endif
/* given the limited size of the microzap, this can't happen */
return;
}
}
if (start != 0) {
start = 0;
goto again;
}
ASSERT(!"out of entries!");
}
int
{
int err;
if (err)
return (err);
if (!zap->zap_ismicro) {
dprintf("upgrading obj %llu: intsz=%u numint=%llu name=%s\n",
} else {
} else {
}
}
return (err);
}
int
{
int err;
if (err)
return (err);
if (!zap->zap_ismicro) {
dprintf("upgrading obj %llu: intsz=%u numint=%llu name=%s\n",
} else {
} else {
}
}
return (0);
}
int
{
int err;
if (err)
return (err);
if (!zap->zap_ismicro) {
} else {
} else {
sizeof (mzap_ent_phys_t));
}
}
return (err);
}
/*
* Routines for iterating over the attributes.
*/
/*
* We want to keep the high 32 bits of the cursor zero if we can, so
* that 32-bit programs can access this. So use a small hash value so
* we can fit 4 bits of cd into the 32-bit cursor.
*
* [ 4 zero bits | 32-bit collision differentiator | 28-bit hash value ]
*/
void
{
if (serialized == -1ULL) {
} else {
}
}
void
{
}
void
{
}
}
}
{
return (-1ULL);
}
int
{
int err;
return (ENOENT);
if (err)
return (err);
} else {
}
} else {
}
if (mze) {
err = 0;
} else {
}
}
return (err);
}
void
{
return;
}
}
int
{
int err;
if (err)
return (err);
if (zap->zap_ismicro) {
} else {
}
return (0);
}