FreeBSD ZFS
The Zettabyte File System
|
00001 /* 00002 * CDDL HEADER START 00003 * 00004 * The contents of this file are subject to the terms of the 00005 * Common Development and Distribution License (the "License"). 00006 * You may not use this file except in compliance with the License. 00007 * 00008 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 00009 * or http://www.opensolaris.org/os/licensing. 00010 * See the License for the specific language governing permissions 00011 * and limitations under the License. 00012 * 00013 * When distributing Covered Code, include this CDDL HEADER in each 00014 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 00015 * If applicable, add the following below this CDDL HEADER, with the 00016 * fields enclosed by brackets "[]" replaced with your own identifying 00017 * information: Portions Copyright [yyyy] [name of copyright owner] 00018 * 00019 * CDDL HEADER END 00020 */ 00021 /* 00022 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. 00023 * Copyright (c) 2012 by Delphix. All rights reserved. 00024 */ 00025 00026 #ifndef _SYS_DMU_TRAVERSE_H 00027 #define _SYS_DMU_TRAVERSE_H 00028 00029 #include <sys/zfs_context.h> 00030 #include <sys/spa.h> 00031 #include <sys/zio.h> 00032 00033 #ifdef __cplusplus 00034 extern "C" { 00035 #endif 00036 00037 struct dnode_phys; 00038 struct dsl_dataset; 00039 struct zilog; 00040 struct arc_buf; 00041 00042 typedef int (blkptr_cb_t)(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, 00043 struct arc_buf *pbuf, const zbookmark_t *zb, const struct dnode_phys *dnp, 00044 void *arg); 00045 00046 #define TRAVERSE_PRE (1<<0) 00047 #define TRAVERSE_POST (1<<1) 00048 #define TRAVERSE_PREFETCH_METADATA (1<<2) 00049 #define TRAVERSE_PREFETCH_DATA (1<<3) 00050 #define TRAVERSE_PREFETCH (TRAVERSE_PREFETCH_METADATA | TRAVERSE_PREFETCH_DATA) 00051 #define TRAVERSE_HARD (1<<4) 00052 00054 #define TRAVERSE_VISIT_NO_CHILDREN -1 00055 00056 int traverse_dataset(struct dsl_dataset *ds, 00057 uint64_t txg_start, int flags, blkptr_cb_t func, void *arg); 00058 int traverse_dataset_destroyed(spa_t *spa, blkptr_t *blkptr, 00059 uint64_t txg_start, zbookmark_t *resume, int flags, 00060 blkptr_cb_t func, void *arg); 00061 int traverse_pool(spa_t *spa, 00062 uint64_t txg_start, int flags, blkptr_cb_t func, void *arg); 00063 00064 #ifdef __cplusplus 00065 } 00066 #endif 00067 00068 #endif /* _SYS_DMU_TRAVERSE_H */