dmu_traverse.c revision 44f92b7dbae22574cbeb46a120d108f45d9e2f29
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (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
*/
/*
*/
#include <sys/zfs_context.h>
#include <sys/dmu_objset.h>
#include <sys/dmu_traverse.h>
#include <sys/dsl_dataset.h>
#include <sys/dsl_pool.h>
#include <sys/dmu_impl.h>
int zfs_pd_blks_max = 100;
struct prefetch_data {
int pd_blks_max;
int pd_blks_fetched;
int pd_flags;
};
struct traverse_data {
int td_flags;
struct prefetch_data *td_pfd;
void *td_arg;
};
/* ARGSUSED */
static int
{
return (0);
return (0);
return (0);
}
/* ARGSUSED */
static int
{
return (0);
return (0);
}
return (0);
}
static void
{
/*
* We only want to visit blocks that have been claimed but not yet
* replayed; plus, in read-only mode, blocks that are already stable.
*/
return;
}
static int
{
return (err);
}
return (0);
pd->pd_blks_fetched--;
}
if (err)
return (err);
}
if (BP_GET_LEVEL(bp) > 0) {
int i;
if (err)
return (err);
/* recursively visitbp() blocks below this */
if (err) {
if (!hard)
break;
}
}
int i;
if (err)
return (err);
/* recursively visitbp() blocks below this */
if (err) {
if (!hard)
break;
}
}
if (err)
return (err);
err = 0;
}
}
err = 0;
}
}
}
if (buf)
}
}
static int
{
for (j = 0; j < dnp->dn_nblkptr; j++) {
if (err) {
if (!hard)
break;
}
}
object, 0, DMU_SPILL_BLKID);
if (err) {
if (!hard)
return (err);
}
}
}
/* ARGSUSED */
static int
void *arg)
{
return (EINTR);
return (0);
pfd->pd_blks_fetched++;
return (0);
}
static void
traverse_prefetch_thread(void *arg)
{
}
/*
* NB: dataset must not be changing on-disk (eg, is a snapshot or we are
* in syncing context).
*/
static int
{
struct traverse_data td;
struct prefetch_data pd = { 0 };
int err;
if (!(flags & TRAVERSE_PREFETCH) ||
&td, TQ_NOQUEUE))
return (err);
}
/*
* NB: dataset must not be changing on-disk (eg, is a snapshot or we are
* in syncing context).
*/
int
{
}
/*
* NB: pool must not be changing on-disk (eg, from zdb or sync context).
*/
int
{
/* visit the MOS */
if (err)
return (err);
/* visit each dataset */
if (err) {
if (!hard)
return (err);
continue;
}
if (err) {
if (!hard)
return (err);
continue;
}
if (err) {
if (!hard)
return (err);
}
}
}
err = 0;
}