1789Sahrens /* 2789Sahrens * CDDL HEADER START 3789Sahrens * 4789Sahrens * The contents of this file are subject to the terms of the 51544Seschrock * Common Development and Distribution License (the "License"). 61544Seschrock * You may not use this file except in compliance with the License. 7789Sahrens * 8789Sahrens * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9789Sahrens * or http://www.opensolaris.org/os/licensing. 10789Sahrens * See the License for the specific language governing permissions 11789Sahrens * and limitations under the License. 12789Sahrens * 13789Sahrens * When distributing Covered Code, include this CDDL HEADER in each 14789Sahrens * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15789Sahrens * If applicable, add the following below this CDDL HEADER, with the 16789Sahrens * fields enclosed by brackets "[]" replaced with your own identifying 17789Sahrens * information: Portions Copyright [yyyy] [name of copyright owner] 18789Sahrens * 19789Sahrens * CDDL HEADER END 20789Sahrens */ 21789Sahrens /* 2212296SLin.Ling@Sun.COM * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. 23789Sahrens */ 24789Sahrens 25789Sahrens #ifndef _SYS_DMU_TRAVERSE_H 26789Sahrens #define _SYS_DMU_TRAVERSE_H 27789Sahrens 28789Sahrens #include <sys/zfs_context.h> 29789Sahrens #include <sys/spa.h> 30789Sahrens #include <sys/zio.h> 31789Sahrens 32789Sahrens #ifdef __cplusplus 33789Sahrens extern "C" { 34789Sahrens #endif 35789Sahrens 367837SMatthew.Ahrens@Sun.COM struct dnode_phys; 377837SMatthew.Ahrens@Sun.COM struct dsl_dataset; 3810922SJeff.Bonwick@Sun.COM struct zilog; 3912296SLin.Ling@Sun.COM struct arc_buf; 40789Sahrens 4110922SJeff.Bonwick@Sun.COM typedef int (blkptr_cb_t)(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, 4212296SLin.Ling@Sun.COM struct arc_buf *pbuf, const zbookmark_t *zb, const struct dnode_phys *dnp, 4312296SLin.Ling@Sun.COM void *arg); 44789Sahrens 457837SMatthew.Ahrens@Sun.COM #define TRAVERSE_PRE (1<<0) 467837SMatthew.Ahrens@Sun.COM #define TRAVERSE_POST (1<<1) 477837SMatthew.Ahrens@Sun.COM #define TRAVERSE_PREFETCH_METADATA (1<<2) 487837SMatthew.Ahrens@Sun.COM #define TRAVERSE_PREFETCH_DATA (1<<3) 497837SMatthew.Ahrens@Sun.COM #define TRAVERSE_PREFETCH (TRAVERSE_PREFETCH_METADATA | TRAVERSE_PREFETCH_DATA) 5011724SVictor.Latushkin@Sun.COM #define TRAVERSE_HARD (1<<4) 51789Sahrens 52*13043STim.Haley@Sun.COM /* Special traverse error return value to indicate skipping of children */ 53*13043STim.Haley@Sun.COM #define TRAVERSE_VISIT_NO_CHILDREN -1 54*13043STim.Haley@Sun.COM 5511125SJeff.Bonwick@Sun.COM int traverse_dataset(struct dsl_dataset *ds, 5611125SJeff.Bonwick@Sun.COM uint64_t txg_start, int flags, blkptr_cb_t func, void *arg); 5711125SJeff.Bonwick@Sun.COM int traverse_pool(spa_t *spa, 5811125SJeff.Bonwick@Sun.COM uint64_t txg_start, int flags, blkptr_cb_t func, void *arg); 59789Sahrens 60789Sahrens #ifdef __cplusplus 61789Sahrens } 62789Sahrens #endif 63789Sahrens 64789Sahrens #endif /* _SYS_DMU_TRAVERSE_H */ 65