Deleted Added
full compact
dmu_diff.c (248571) dmu_diff.c (249195)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 6 unchanged lines hidden (view full) ---

15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21/*
22 * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 6 unchanged lines hidden (view full) ---

15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21/*
22 * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
23 * Copyright (c) 2012 by Delphix. All rights reserved.
23 * Copyright (c) 2013 by Delphix. All rights reserved.
24 */
25
26#include <sys/dmu.h>
27#include <sys/dmu_impl.h>
28#include <sys/dmu_tx.h>
29#include <sys/dbuf.h>
30#include <sys/dnode.h>
31#include <sys/zfs_context.h>

--- 99 unchanged lines hidden (view full) ---

131static int
132diff_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
133 const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg)
134{
135 struct diffarg *da = arg;
136 int err = 0;
137
138 if (issig(JUSTLOOKING) && issig(FORREAL))
24 */
25
26#include <sys/dmu.h>
27#include <sys/dmu_impl.h>
28#include <sys/dmu_tx.h>
29#include <sys/dbuf.h>
30#include <sys/dnode.h>
31#include <sys/zfs_context.h>

--- 99 unchanged lines hidden (view full) ---

131static int
132diff_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
133 const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg)
134{
135 struct diffarg *da = arg;
136 int err = 0;
137
138 if (issig(JUSTLOOKING) && issig(FORREAL))
139 return (EINTR);
139 return (SET_ERROR(EINTR));
140
141 if (zb->zb_object != DMU_META_DNODE_OBJECT)
142 return (0);
143
144 if (bp == NULL) {
145 uint64_t span = DBP_SPAN(dnp, zb->zb_level);
146 uint64_t dnobj = (zb->zb_blkid * span) >> DNODE_SHIFT;
147

--- 6 unchanged lines hidden (view full) ---

154 arc_buf_t *abuf;
155 uint32_t aflags = ARC_WAIT;
156 int blksz = BP_GET_LSIZE(bp);
157 int i;
158
159 if (arc_read(NULL, spa, bp, arc_getbuf_func, &abuf,
160 ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL,
161 &aflags, zb) != 0)
140
141 if (zb->zb_object != DMU_META_DNODE_OBJECT)
142 return (0);
143
144 if (bp == NULL) {
145 uint64_t span = DBP_SPAN(dnp, zb->zb_level);
146 uint64_t dnobj = (zb->zb_blkid * span) >> DNODE_SHIFT;
147

--- 6 unchanged lines hidden (view full) ---

154 arc_buf_t *abuf;
155 uint32_t aflags = ARC_WAIT;
156 int blksz = BP_GET_LSIZE(bp);
157 int i;
158
159 if (arc_read(NULL, spa, bp, arc_getbuf_func, &abuf,
160 ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL,
161 &aflags, zb) != 0)
162 return (EIO);
162 return (SET_ERROR(EIO));
163
164 blk = abuf->b_data;
165 for (i = 0; i < blksz >> DNODE_SHIFT; i++) {
166 uint64_t dnobj = (zb->zb_blkid <<
167 (DNODE_BLOCK_SHIFT - DNODE_SHIFT)) + i;
168 err = report_dnode(da, dnobj, blk+i);
169 if (err)
170 break;

--- 19 unchanged lines hidden (view full) ---

190 dsl_dataset_t *fromsnap;
191 dsl_dataset_t *tosnap;
192 dsl_pool_t *dp;
193 int error;
194 uint64_t fromtxg;
195
196 if (strchr(tosnap_name, '@') == NULL ||
197 strchr(fromsnap_name, '@') == NULL)
163
164 blk = abuf->b_data;
165 for (i = 0; i < blksz >> DNODE_SHIFT; i++) {
166 uint64_t dnobj = (zb->zb_blkid <<
167 (DNODE_BLOCK_SHIFT - DNODE_SHIFT)) + i;
168 err = report_dnode(da, dnobj, blk+i);
169 if (err)
170 break;

--- 19 unchanged lines hidden (view full) ---

190 dsl_dataset_t *fromsnap;
191 dsl_dataset_t *tosnap;
192 dsl_pool_t *dp;
193 int error;
194 uint64_t fromtxg;
195
196 if (strchr(tosnap_name, '@') == NULL ||
197 strchr(fromsnap_name, '@') == NULL)
198 return (EINVAL);
198 return (SET_ERROR(EINVAL));
199
200 error = dsl_pool_hold(tosnap_name, FTAG, &dp);
201 if (error != 0)
202 return (error);
203
204 error = dsl_dataset_hold(dp, tosnap_name, FTAG, &tosnap);
205 if (error != 0) {
206 dsl_pool_rele(dp, FTAG);

--- 6 unchanged lines hidden (view full) ---

213 dsl_pool_rele(dp, FTAG);
214 return (error);
215 }
216
217 if (!dsl_dataset_is_before(tosnap, fromsnap)) {
218 dsl_dataset_rele(fromsnap, FTAG);
219 dsl_dataset_rele(tosnap, FTAG);
220 dsl_pool_rele(dp, FTAG);
199
200 error = dsl_pool_hold(tosnap_name, FTAG, &dp);
201 if (error != 0)
202 return (error);
203
204 error = dsl_dataset_hold(dp, tosnap_name, FTAG, &tosnap);
205 if (error != 0) {
206 dsl_pool_rele(dp, FTAG);

--- 6 unchanged lines hidden (view full) ---

213 dsl_pool_rele(dp, FTAG);
214 return (error);
215 }
216
217 if (!dsl_dataset_is_before(tosnap, fromsnap)) {
218 dsl_dataset_rele(fromsnap, FTAG);
219 dsl_dataset_rele(tosnap, FTAG);
220 dsl_pool_rele(dp, FTAG);
221 return (EXDEV);
221 return (SET_ERROR(EXDEV));
222 }
223
224 fromtxg = fromsnap->ds_phys->ds_creation_txg;
225 dsl_dataset_rele(fromsnap, FTAG);
226
227 dsl_dataset_long_hold(tosnap, FTAG);
228 dsl_pool_rele(dp, FTAG);
229

--- 22 unchanged lines hidden ---
222 }
223
224 fromtxg = fromsnap->ds_phys->ds_creation_txg;
225 dsl_dataset_rele(fromsnap, FTAG);
226
227 dsl_dataset_long_hold(tosnap, FTAG);
228 dsl_pool_rele(dp, FTAG);
229

--- 22 unchanged lines hidden ---