author | Joshua M. Clulow <jmc@joyent.com> |
Mon, 04 Mar 2013 23:52:56 +0000 | |
changeset 14188 | afe390b9f1e0 |
parent 13980 | d7059eb1884c |
permissions | -rw-r--r-- |
789 | 1 |
/* |
2 |
* CDDL HEADER START |
|
3 |
* |
|
4 |
* The contents of this file are subject to the terms of the |
|
1544 | 5 |
* Common Development and Distribution License (the "License"). |
6 |
* You may not use this file except in compliance with the License. |
|
789 | 7 |
* |
8 |
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE |
|
9 |
* or http://www.opensolaris.org/os/licensing. |
|
10 |
* See the License for the specific language governing permissions |
|
11 |
* and limitations under the License. |
|
12 |
* |
|
13 |
* When distributing Covered Code, include this CDDL HEADER in each |
|
14 |
* file and include the License file at usr/src/OPENSOLARIS.LICENSE. |
|
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 |
/* |
|
12296
7cf402a7f374
6675946 'zpool status' should show the progress of resilvering for individual disk.
Lin Ling <Lin.Ling@Sun.COM>
parents:
11935
diff
changeset
|
22 |
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. |
13980
d7059eb1884c
3598 want to dtrace when errors are generated in zfs
Matthew Ahrens <mahrens@delphix.com>
parents:
13973
diff
changeset
|
23 |
* Copyright (c) 2013 by Delphix. All rights reserved. |
789 | 24 |
*/ |
25 |
||
26 |
#include <sys/zfs_context.h> |
|
27 |
#include <sys/dmu_objset.h> |
|
28 |
#include <sys/dmu_traverse.h> |
|
29 |
#include <sys/dsl_dataset.h> |
|
30 |
#include <sys/dsl_dir.h> |
|
31 |
#include <sys/dsl_pool.h> |
|
32 |
#include <sys/dnode.h> |
|
33 |
#include <sys/spa.h> |
|
34 |
#include <sys/zio.h> |
|
35 |
#include <sys/dmu_impl.h> |
|
11935
538c866aaac6
6716117 ZFS needs native system attribute infrastructure
Mark Shellenbaum <Mark.Shellenbaum@Sun.COM>
parents:
11724
diff
changeset
|
36 |
#include <sys/sa.h> |
538c866aaac6
6716117 ZFS needs native system attribute infrastructure
Mark Shellenbaum <Mark.Shellenbaum@Sun.COM>
parents:
11724
diff
changeset
|
37 |
#include <sys/sa_impl.h> |
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
38 |
#include <sys/callb.h> |
789 | 39 |
|
12605
6790e683d5a5
6959846 DMU traverse prefetch size should be a global tunable
Chris Kirby <Chris.Kirby@oracle.com>
parents:
12296
diff
changeset
|
40 |
int zfs_pd_blks_max = 100; |
6790e683d5a5
6959846 DMU traverse prefetch size should be a global tunable
Chris Kirby <Chris.Kirby@oracle.com>
parents:
12296
diff
changeset
|
41 |
|
12839
1eab9192da8b
6844896 recursive snapshots take a long time
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
12605
diff
changeset
|
42 |
typedef struct prefetch_data { |
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
43 |
kmutex_t pd_mtx; |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
44 |
kcondvar_t pd_cv; |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
45 |
int pd_blks_max; |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
46 |
int pd_blks_fetched; |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
47 |
int pd_flags; |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
48 |
boolean_t pd_cancel; |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
49 |
boolean_t pd_exited; |
12839
1eab9192da8b
6844896 recursive snapshots take a long time
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
12605
diff
changeset
|
50 |
} prefetch_data_t; |
789 | 51 |
|
12839
1eab9192da8b
6844896 recursive snapshots take a long time
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
12605
diff
changeset
|
52 |
typedef struct traverse_data { |
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
53 |
spa_t *td_spa; |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
54 |
uint64_t td_objset; |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
55 |
blkptr_t *td_rootbp; |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
56 |
uint64_t td_min_txg; |
13700
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
57 |
zbookmark_t *td_resume; |
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
58 |
int td_flags; |
12839
1eab9192da8b
6844896 recursive snapshots take a long time
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
12605
diff
changeset
|
59 |
prefetch_data_t *td_pfd; |
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
60 |
blkptr_cb_t *td_func; |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
61 |
void *td_arg; |
12839
1eab9192da8b
6844896 recursive snapshots take a long time
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
12605
diff
changeset
|
62 |
} traverse_data_t; |
789 | 63 |
|
12839
1eab9192da8b
6844896 recursive snapshots take a long time
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
12605
diff
changeset
|
64 |
static int traverse_dnode(traverse_data_t *td, const dnode_phys_t *dnp, |
13941
d48547176ab4
3498 panic in arc_read(): !refcount_is_zero(&pbuf->b_hdr->b_refcnt)
George Wilson <george.wilson@delphix.com>
parents:
13805
diff
changeset
|
65 |
uint64_t objset, uint64_t object); |
13792
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
66 |
static void prefetch_dnode_metadata(traverse_data_t *td, const dnode_phys_t *, |
13941
d48547176ab4
3498 panic in arc_read(): !refcount_is_zero(&pbuf->b_hdr->b_refcnt)
George Wilson <george.wilson@delphix.com>
parents:
13805
diff
changeset
|
67 |
uint64_t objset, uint64_t object); |
9396
f41cf682d0d3
PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
8746
diff
changeset
|
68 |
|
10922
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
69 |
static int |
1601
438b928f80c7
6397197 ADVANCE_ZIL should only visit claimed-but-not-yet-replayed logs
bonwick
parents:
1544
diff
changeset
|
70 |
traverse_zil_block(zilog_t *zilog, blkptr_t *bp, void *arg, uint64_t claim_txg) |
1544 | 71 |
{ |
12839
1eab9192da8b
6844896 recursive snapshots take a long time
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
12605
diff
changeset
|
72 |
traverse_data_t *td = arg; |
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
73 |
zbookmark_t zb; |
1544 | 74 |
|
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
75 |
if (bp->blk_birth == 0) |
10922
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
76 |
return (0); |
1601
438b928f80c7
6397197 ADVANCE_ZIL should only visit claimed-but-not-yet-replayed logs
bonwick
parents:
1544
diff
changeset
|
77 |
|
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
78 |
if (claim_txg == 0 && bp->blk_birth >= spa_first_txg(td->td_spa)) |
10922
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
79 |
return (0); |
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
80 |
|
10922
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
81 |
SET_BOOKMARK(&zb, td->td_objset, ZB_ZIL_OBJECT, ZB_ZIL_LEVEL, |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
82 |
bp->blk_cksum.zc_word[ZIL_ZC_SEQ]); |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
83 |
|
13941
d48547176ab4
3498 panic in arc_read(): !refcount_is_zero(&pbuf->b_hdr->b_refcnt)
George Wilson <george.wilson@delphix.com>
parents:
13805
diff
changeset
|
84 |
(void) td->td_func(td->td_spa, zilog, bp, &zb, NULL, td->td_arg); |
10922
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
85 |
|
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
86 |
return (0); |
1544 | 87 |
} |
88 |
||
10922
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
89 |
static int |
1601
438b928f80c7
6397197 ADVANCE_ZIL should only visit claimed-but-not-yet-replayed logs
bonwick
parents:
1544
diff
changeset
|
90 |
traverse_zil_record(zilog_t *zilog, lr_t *lrc, void *arg, uint64_t claim_txg) |
1544 | 91 |
{ |
12839
1eab9192da8b
6844896 recursive snapshots take a long time
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
12605
diff
changeset
|
92 |
traverse_data_t *td = arg; |
1544 | 93 |
|
94 |
if (lrc->lrc_txtype == TX_WRITE) { |
|
95 |
lr_write_t *lr = (lr_write_t *)lrc; |
|
96 |
blkptr_t *bp = &lr->lr_blkptr; |
|
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
97 |
zbookmark_t zb; |
1544 | 98 |
|
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
99 |
if (bp->blk_birth == 0) |
10922
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
100 |
return (0); |
1601
438b928f80c7
6397197 ADVANCE_ZIL should only visit claimed-but-not-yet-replayed logs
bonwick
parents:
1544
diff
changeset
|
101 |
|
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
102 |
if (claim_txg == 0 || bp->blk_birth < claim_txg) |
10922
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
103 |
return (0); |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
104 |
|
12839
1eab9192da8b
6844896 recursive snapshots take a long time
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
12605
diff
changeset
|
105 |
SET_BOOKMARK(&zb, td->td_objset, lr->lr_foid, |
1eab9192da8b
6844896 recursive snapshots take a long time
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
12605
diff
changeset
|
106 |
ZB_ZIL_LEVEL, lr->lr_offset / BP_GET_LSIZE(bp)); |
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
107 |
|
13941
d48547176ab4
3498 panic in arc_read(): !refcount_is_zero(&pbuf->b_hdr->b_refcnt)
George Wilson <george.wilson@delphix.com>
parents:
13805
diff
changeset
|
108 |
(void) td->td_func(td->td_spa, zilog, bp, &zb, NULL, |
10922
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
109 |
td->td_arg); |
1544 | 110 |
} |
10922
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
111 |
return (0); |
1544 | 112 |
} |
113 |
||
114 |
static void |
|
12839
1eab9192da8b
6844896 recursive snapshots take a long time
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
12605
diff
changeset
|
115 |
traverse_zil(traverse_data_t *td, zil_header_t *zh) |
1544 | 116 |
{ |
1601
438b928f80c7
6397197 ADVANCE_ZIL should only visit claimed-but-not-yet-replayed logs
bonwick
parents:
1544
diff
changeset
|
117 |
uint64_t claim_txg = zh->zh_claim_txg; |
1544 | 118 |
zilog_t *zilog; |
119 |
||
1601
438b928f80c7
6397197 ADVANCE_ZIL should only visit claimed-but-not-yet-replayed logs
bonwick
parents:
1544
diff
changeset
|
120 |
/* |
438b928f80c7
6397197 ADVANCE_ZIL should only visit claimed-but-not-yet-replayed logs
bonwick
parents:
1544
diff
changeset
|
121 |
* We only want to visit blocks that have been claimed but not yet |
10922
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
122 |
* replayed; plus, in read-only mode, blocks that are already stable. |
1601
438b928f80c7
6397197 ADVANCE_ZIL should only visit claimed-but-not-yet-replayed logs
bonwick
parents:
1544
diff
changeset
|
123 |
*/ |
8241
5a60f16123ba
6328632 zpool offline is a bit too conservative
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
8012
diff
changeset
|
124 |
if (claim_txg == 0 && spa_writeable(td->td_spa)) |
1601
438b928f80c7
6397197 ADVANCE_ZIL should only visit claimed-but-not-yet-replayed logs
bonwick
parents:
1544
diff
changeset
|
125 |
return; |
438b928f80c7
6397197 ADVANCE_ZIL should only visit claimed-but-not-yet-replayed logs
bonwick
parents:
1544
diff
changeset
|
126 |
|
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
127 |
zilog = zil_alloc(spa_get_dsl(td->td_spa)->dp_meta_objset, zh); |
1544 | 128 |
|
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
129 |
(void) zil_parse(zilog, traverse_zil_block, traverse_zil_record, td, |
1601
438b928f80c7
6397197 ADVANCE_ZIL should only visit claimed-but-not-yet-replayed logs
bonwick
parents:
1544
diff
changeset
|
130 |
claim_txg); |
1544 | 131 |
|
132 |
zil_free(zilog); |
|
133 |
} |
|
134 |
||
13700
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
135 |
typedef enum resume_skip { |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
136 |
RESUME_SKIP_ALL, |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
137 |
RESUME_SKIP_NONE, |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
138 |
RESUME_SKIP_CHILDREN |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
139 |
} resume_skip_t; |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
140 |
|
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
141 |
/* |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
142 |
* Returns RESUME_SKIP_ALL if td indicates that we are resuming a traversal and |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
143 |
* the block indicated by zb does not need to be visited at all. Returns |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
144 |
* RESUME_SKIP_CHILDREN if we are resuming a post traversal and we reach the |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
145 |
* resume point. This indicates that this block should be visited but not its |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
146 |
* children (since they must have been visited in a previous traversal). |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
147 |
* Otherwise returns RESUME_SKIP_NONE. |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
148 |
*/ |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
149 |
static resume_skip_t |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
150 |
resume_skip_check(traverse_data_t *td, const dnode_phys_t *dnp, |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
151 |
const zbookmark_t *zb) |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
152 |
{ |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
153 |
if (td->td_resume != NULL && !ZB_IS_ZERO(td->td_resume)) { |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
154 |
/* |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
155 |
* If we already visited this bp & everything below, |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
156 |
* don't bother doing it again. |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
157 |
*/ |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
158 |
if (zbookmark_is_before(dnp, zb, td->td_resume)) |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
159 |
return (RESUME_SKIP_ALL); |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
160 |
|
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
161 |
/* |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
162 |
* If we found the block we're trying to resume from, zero |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
163 |
* the bookmark out to indicate that we have resumed. |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
164 |
*/ |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
165 |
ASSERT3U(zb->zb_object, <=, td->td_resume->zb_object); |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
166 |
if (bcmp(zb, td->td_resume, sizeof (*zb)) == 0) { |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
167 |
bzero(td->td_resume, sizeof (*zb)); |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
168 |
if (td->td_flags & TRAVERSE_POST) |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
169 |
return (RESUME_SKIP_CHILDREN); |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
170 |
} |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
171 |
} |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
172 |
return (RESUME_SKIP_NONE); |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
173 |
} |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
174 |
|
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
175 |
static void |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
176 |
traverse_pause(traverse_data_t *td, const zbookmark_t *zb) |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
177 |
{ |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
178 |
ASSERT(td->td_resume != NULL); |
13805
e3a9ae14a119
3006 VERIFY[S,U,P] and ASSERT[S,U,P] frequently check if first argument is zero
Madhav Suresh <madhav.suresh@delphix.com>
parents:
13792
diff
changeset
|
179 |
ASSERT0(zb->zb_level); |
13700
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
180 |
bcopy(zb, td->td_resume, sizeof (*td->td_resume)); |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
181 |
} |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
182 |
|
13792
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
183 |
static void |
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
184 |
traverse_prefetch_metadata(traverse_data_t *td, |
13941
d48547176ab4
3498 panic in arc_read(): !refcount_is_zero(&pbuf->b_hdr->b_refcnt)
George Wilson <george.wilson@delphix.com>
parents:
13805
diff
changeset
|
185 |
const blkptr_t *bp, const zbookmark_t *zb) |
13792
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
186 |
{ |
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
187 |
uint32_t flags = ARC_NOWAIT | ARC_PREFETCH; |
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
188 |
|
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
189 |
if (!(td->td_flags & TRAVERSE_PREFETCH_METADATA)) |
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
190 |
return; |
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
191 |
/* |
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
192 |
* If we are in the process of resuming, don't prefetch, because |
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
193 |
* some children will not be needed (and in fact may have already |
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
194 |
* been freed). |
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
195 |
*/ |
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
196 |
if (td->td_resume != NULL && !ZB_IS_ZERO(td->td_resume)) |
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
197 |
return; |
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
198 |
if (BP_IS_HOLE(bp) || bp->blk_birth <= td->td_min_txg) |
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
199 |
return; |
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
200 |
if (BP_GET_LEVEL(bp) == 0 && BP_GET_TYPE(bp) != DMU_OT_DNODE) |
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
201 |
return; |
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
202 |
|
13941
d48547176ab4
3498 panic in arc_read(): !refcount_is_zero(&pbuf->b_hdr->b_refcnt)
George Wilson <george.wilson@delphix.com>
parents:
13805
diff
changeset
|
203 |
(void) arc_read(NULL, td->td_spa, bp, NULL, NULL, |
d48547176ab4
3498 panic in arc_read(): !refcount_is_zero(&pbuf->b_hdr->b_refcnt)
George Wilson <george.wilson@delphix.com>
parents:
13805
diff
changeset
|
204 |
ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, &flags, zb); |
13792
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
205 |
} |
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
206 |
|
789 | 207 |
static int |
12839
1eab9192da8b
6844896 recursive snapshots take a long time
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
12605
diff
changeset
|
208 |
traverse_visitbp(traverse_data_t *td, const dnode_phys_t *dnp, |
13941
d48547176ab4
3498 panic in arc_read(): !refcount_is_zero(&pbuf->b_hdr->b_refcnt)
George Wilson <george.wilson@delphix.com>
parents:
13805
diff
changeset
|
209 |
const blkptr_t *bp, const zbookmark_t *zb) |
789 | 210 |
{ |
8012
8ea30813950f
6765626 zfs send takes up too much stack space
Eric Taylor <Eric.Taylor@Sun.COM>
parents:
7837
diff
changeset
|
211 |
zbookmark_t czb; |
11724
a2728800460e
6848238 zdb -bcsv does not report all corruptions
Victor Latushkin <Victor.Latushkin@Sun.COM>
parents:
11670
diff
changeset
|
212 |
int err = 0, lasterr = 0; |
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
213 |
arc_buf_t *buf = NULL; |
12839
1eab9192da8b
6844896 recursive snapshots take a long time
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
12605
diff
changeset
|
214 |
prefetch_data_t *pd = td->td_pfd; |
11724
a2728800460e
6848238 zdb -bcsv does not report all corruptions
Victor Latushkin <Victor.Latushkin@Sun.COM>
parents:
11670
diff
changeset
|
215 |
boolean_t hard = td->td_flags & TRAVERSE_HARD; |
13700
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
216 |
boolean_t pause = B_FALSE; |
789 | 217 |
|
13700
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
218 |
switch (resume_skip_check(td, dnp, zb)) { |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
219 |
case RESUME_SKIP_ALL: |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
220 |
return (0); |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
221 |
case RESUME_SKIP_CHILDREN: |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
222 |
goto post; |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
223 |
case RESUME_SKIP_NONE: |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
224 |
break; |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
225 |
default: |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
226 |
ASSERT(0); |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
227 |
} |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
228 |
|
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
229 |
if (BP_IS_HOLE(bp)) { |
13941
d48547176ab4
3498 panic in arc_read(): !refcount_is_zero(&pbuf->b_hdr->b_refcnt)
George Wilson <george.wilson@delphix.com>
parents:
13805
diff
changeset
|
230 |
err = td->td_func(td->td_spa, NULL, NULL, zb, dnp, td->td_arg); |
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
231 |
return (err); |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
232 |
} |
789 | 233 |
|
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
234 |
if (bp->blk_birth <= td->td_min_txg) |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
235 |
return (0); |
789 | 236 |
|
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
237 |
if (pd && !pd->pd_exited && |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
238 |
((pd->pd_flags & TRAVERSE_PREFETCH_DATA) || |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
239 |
BP_GET_TYPE(bp) == DMU_OT_DNODE || BP_GET_LEVEL(bp) > 0)) { |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
240 |
mutex_enter(&pd->pd_mtx); |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
241 |
ASSERT(pd->pd_blks_fetched >= 0); |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
242 |
while (pd->pd_blks_fetched == 0 && !pd->pd_exited) |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
243 |
cv_wait(&pd->pd_cv, &pd->pd_mtx); |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
244 |
pd->pd_blks_fetched--; |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
245 |
cv_broadcast(&pd->pd_cv); |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
246 |
mutex_exit(&pd->pd_mtx); |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
247 |
} |
789 | 248 |
|
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
249 |
if (td->td_flags & TRAVERSE_PRE) { |
13941
d48547176ab4
3498 panic in arc_read(): !refcount_is_zero(&pbuf->b_hdr->b_refcnt)
George Wilson <george.wilson@delphix.com>
parents:
13805
diff
changeset
|
250 |
err = td->td_func(td->td_spa, NULL, bp, zb, dnp, |
12296
7cf402a7f374
6675946 'zpool status' should show the progress of resilvering for individual disk.
Lin Ling <Lin.Ling@Sun.COM>
parents:
11935
diff
changeset
|
251 |
td->td_arg); |
13055 | 252 |
if (err == TRAVERSE_VISIT_NO_CHILDREN) |
253 |
return (0); |
|
13700
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
254 |
if (err == ERESTART) |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
255 |
pause = B_TRUE; /* handle pausing at a common point */ |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
256 |
if (err != 0) |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
257 |
goto post; |
789 | 258 |
} |
259 |
||
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
260 |
if (BP_GET_LEVEL(bp) > 0) { |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
261 |
uint32_t flags = ARC_WAIT; |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
262 |
int i; |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
263 |
blkptr_t *cbp; |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
264 |
int epb = BP_GET_LSIZE(bp) >> SPA_BLKPTRSHIFT; |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
265 |
|
13941
d48547176ab4
3498 panic in arc_read(): !refcount_is_zero(&pbuf->b_hdr->b_refcnt)
George Wilson <george.wilson@delphix.com>
parents:
13805
diff
changeset
|
266 |
err = arc_read(NULL, td->td_spa, bp, arc_getbuf_func, &buf, |
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
267 |
ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, &flags, zb); |
13973
4972ab336f54
3464 zfs synctask code needs restructuring
Matthew Ahrens <mahrens@delphix.com>
parents:
13941
diff
changeset
|
268 |
if (err != 0) |
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
269 |
return (err); |
13792
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
270 |
cbp = buf->b_data; |
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
271 |
|
13792
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
272 |
for (i = 0; i < epb; i++) { |
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
273 |
SET_BOOKMARK(&czb, zb->zb_objset, zb->zb_object, |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
274 |
zb->zb_level - 1, |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
275 |
zb->zb_blkid * epb + i); |
13941
d48547176ab4
3498 panic in arc_read(): !refcount_is_zero(&pbuf->b_hdr->b_refcnt)
George Wilson <george.wilson@delphix.com>
parents:
13805
diff
changeset
|
276 |
traverse_prefetch_metadata(td, &cbp[i], &czb); |
13792
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
277 |
} |
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
278 |
|
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
279 |
/* recursively visitbp() blocks below this */ |
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
280 |
for (i = 0; i < epb; i++) { |
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
281 |
SET_BOOKMARK(&czb, zb->zb_objset, zb->zb_object, |
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
282 |
zb->zb_level - 1, |
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
283 |
zb->zb_blkid * epb + i); |
13941
d48547176ab4
3498 panic in arc_read(): !refcount_is_zero(&pbuf->b_hdr->b_refcnt)
George Wilson <george.wilson@delphix.com>
parents:
13805
diff
changeset
|
284 |
err = traverse_visitbp(td, dnp, &cbp[i], &czb); |
13973
4972ab336f54
3464 zfs synctask code needs restructuring
Matthew Ahrens <mahrens@delphix.com>
parents:
13941
diff
changeset
|
285 |
if (err != 0) { |
11724
a2728800460e
6848238 zdb -bcsv does not report all corruptions
Victor Latushkin <Victor.Latushkin@Sun.COM>
parents:
11670
diff
changeset
|
286 |
if (!hard) |
a2728800460e
6848238 zdb -bcsv does not report all corruptions
Victor Latushkin <Victor.Latushkin@Sun.COM>
parents:
11670
diff
changeset
|
287 |
break; |
a2728800460e
6848238 zdb -bcsv does not report all corruptions
Victor Latushkin <Victor.Latushkin@Sun.COM>
parents:
11670
diff
changeset
|
288 |
lasterr = err; |
a2728800460e
6848238 zdb -bcsv does not report all corruptions
Victor Latushkin <Victor.Latushkin@Sun.COM>
parents:
11670
diff
changeset
|
289 |
} |
789 | 290 |
} |
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
291 |
} else if (BP_GET_TYPE(bp) == DMU_OT_DNODE) { |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
292 |
uint32_t flags = ARC_WAIT; |
9396
f41cf682d0d3
PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
8746
diff
changeset
|
293 |
int i; |
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
294 |
int epb = BP_GET_LSIZE(bp) >> DNODE_SHIFT; |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
295 |
|
13941
d48547176ab4
3498 panic in arc_read(): !refcount_is_zero(&pbuf->b_hdr->b_refcnt)
George Wilson <george.wilson@delphix.com>
parents:
13805
diff
changeset
|
296 |
err = arc_read(NULL, td->td_spa, bp, arc_getbuf_func, &buf, |
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
297 |
ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, &flags, zb); |
13973
4972ab336f54
3464 zfs synctask code needs restructuring
Matthew Ahrens <mahrens@delphix.com>
parents:
13941
diff
changeset
|
298 |
if (err != 0) |
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
299 |
return (err); |
13792
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
300 |
dnp = buf->b_data; |
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
301 |
|
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
302 |
for (i = 0; i < epb; i++) { |
13941
d48547176ab4
3498 panic in arc_read(): !refcount_is_zero(&pbuf->b_hdr->b_refcnt)
George Wilson <george.wilson@delphix.com>
parents:
13805
diff
changeset
|
303 |
prefetch_dnode_metadata(td, &dnp[i], zb->zb_objset, |
13792
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
304 |
zb->zb_blkid * epb + i); |
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
305 |
} |
789 | 306 |
|
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
307 |
/* recursively visitbp() blocks below this */ |
13792
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
308 |
for (i = 0; i < epb; i++) { |
13941
d48547176ab4
3498 panic in arc_read(): !refcount_is_zero(&pbuf->b_hdr->b_refcnt)
George Wilson <george.wilson@delphix.com>
parents:
13805
diff
changeset
|
309 |
err = traverse_dnode(td, &dnp[i], zb->zb_objset, |
9396
f41cf682d0d3
PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
8746
diff
changeset
|
310 |
zb->zb_blkid * epb + i); |
13973
4972ab336f54
3464 zfs synctask code needs restructuring
Matthew Ahrens <mahrens@delphix.com>
parents:
13941
diff
changeset
|
311 |
if (err != 0) { |
11724
a2728800460e
6848238 zdb -bcsv does not report all corruptions
Victor Latushkin <Victor.Latushkin@Sun.COM>
parents:
11670
diff
changeset
|
312 |
if (!hard) |
a2728800460e
6848238 zdb -bcsv does not report all corruptions
Victor Latushkin <Victor.Latushkin@Sun.COM>
parents:
11670
diff
changeset
|
313 |
break; |
a2728800460e
6848238 zdb -bcsv does not report all corruptions
Victor Latushkin <Victor.Latushkin@Sun.COM>
parents:
11670
diff
changeset
|
314 |
lasterr = err; |
a2728800460e
6848238 zdb -bcsv does not report all corruptions
Victor Latushkin <Victor.Latushkin@Sun.COM>
parents:
11670
diff
changeset
|
315 |
} |
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
316 |
} |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
317 |
} else if (BP_GET_TYPE(bp) == DMU_OT_OBJSET) { |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
318 |
uint32_t flags = ARC_WAIT; |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
319 |
objset_phys_t *osp; |
9396
f41cf682d0d3
PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
8746
diff
changeset
|
320 |
dnode_phys_t *dnp; |
789 | 321 |
|
13941
d48547176ab4
3498 panic in arc_read(): !refcount_is_zero(&pbuf->b_hdr->b_refcnt)
George Wilson <george.wilson@delphix.com>
parents:
13805
diff
changeset
|
322 |
err = arc_read(NULL, td->td_spa, bp, arc_getbuf_func, &buf, |
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
323 |
ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, &flags, zb); |
13973
4972ab336f54
3464 zfs synctask code needs restructuring
Matthew Ahrens <mahrens@delphix.com>
parents:
13941
diff
changeset
|
324 |
if (err != 0) |
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
325 |
return (err); |
789 | 326 |
|
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
327 |
osp = buf->b_data; |
9396
f41cf682d0d3
PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
8746
diff
changeset
|
328 |
dnp = &osp->os_meta_dnode; |
13941
d48547176ab4
3498 panic in arc_read(): !refcount_is_zero(&pbuf->b_hdr->b_refcnt)
George Wilson <george.wilson@delphix.com>
parents:
13805
diff
changeset
|
329 |
prefetch_dnode_metadata(td, dnp, zb->zb_objset, |
13792
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
330 |
DMU_META_DNODE_OBJECT); |
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
331 |
if (arc_buf_size(buf) >= sizeof (objset_phys_t)) { |
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
332 |
prefetch_dnode_metadata(td, &osp->os_userused_dnode, |
13941
d48547176ab4
3498 panic in arc_read(): !refcount_is_zero(&pbuf->b_hdr->b_refcnt)
George Wilson <george.wilson@delphix.com>
parents:
13805
diff
changeset
|
333 |
zb->zb_objset, DMU_USERUSED_OBJECT); |
13792
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
334 |
prefetch_dnode_metadata(td, &osp->os_groupused_dnode, |
13941
d48547176ab4
3498 panic in arc_read(): !refcount_is_zero(&pbuf->b_hdr->b_refcnt)
George Wilson <george.wilson@delphix.com>
parents:
13805
diff
changeset
|
335 |
zb->zb_objset, DMU_USERUSED_OBJECT); |
13792
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
336 |
} |
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
337 |
|
13941
d48547176ab4
3498 panic in arc_read(): !refcount_is_zero(&pbuf->b_hdr->b_refcnt)
George Wilson <george.wilson@delphix.com>
parents:
13805
diff
changeset
|
338 |
err = traverse_dnode(td, dnp, zb->zb_objset, |
10922
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
339 |
DMU_META_DNODE_OBJECT); |
11724
a2728800460e
6848238 zdb -bcsv does not report all corruptions
Victor Latushkin <Victor.Latushkin@Sun.COM>
parents:
11670
diff
changeset
|
340 |
if (err && hard) { |
a2728800460e
6848238 zdb -bcsv does not report all corruptions
Victor Latushkin <Victor.Latushkin@Sun.COM>
parents:
11670
diff
changeset
|
341 |
lasterr = err; |
a2728800460e
6848238 zdb -bcsv does not report all corruptions
Victor Latushkin <Victor.Latushkin@Sun.COM>
parents:
11670
diff
changeset
|
342 |
err = 0; |
a2728800460e
6848238 zdb -bcsv does not report all corruptions
Victor Latushkin <Victor.Latushkin@Sun.COM>
parents:
11670
diff
changeset
|
343 |
} |
9396
f41cf682d0d3
PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
8746
diff
changeset
|
344 |
if (err == 0 && arc_buf_size(buf) >= sizeof (objset_phys_t)) { |
f41cf682d0d3
PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
8746
diff
changeset
|
345 |
dnp = &osp->os_userused_dnode; |
13941
d48547176ab4
3498 panic in arc_read(): !refcount_is_zero(&pbuf->b_hdr->b_refcnt)
George Wilson <george.wilson@delphix.com>
parents:
13805
diff
changeset
|
346 |
err = traverse_dnode(td, dnp, zb->zb_objset, |
9396
f41cf682d0d3
PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
8746
diff
changeset
|
347 |
DMU_USERUSED_OBJECT); |
f41cf682d0d3
PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
8746
diff
changeset
|
348 |
} |
11724
a2728800460e
6848238 zdb -bcsv does not report all corruptions
Victor Latushkin <Victor.Latushkin@Sun.COM>
parents:
11670
diff
changeset
|
349 |
if (err && hard) { |
a2728800460e
6848238 zdb -bcsv does not report all corruptions
Victor Latushkin <Victor.Latushkin@Sun.COM>
parents:
11670
diff
changeset
|
350 |
lasterr = err; |
a2728800460e
6848238 zdb -bcsv does not report all corruptions
Victor Latushkin <Victor.Latushkin@Sun.COM>
parents:
11670
diff
changeset
|
351 |
err = 0; |
a2728800460e
6848238 zdb -bcsv does not report all corruptions
Victor Latushkin <Victor.Latushkin@Sun.COM>
parents:
11670
diff
changeset
|
352 |
} |
9396
f41cf682d0d3
PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
8746
diff
changeset
|
353 |
if (err == 0 && arc_buf_size(buf) >= sizeof (objset_phys_t)) { |
f41cf682d0d3
PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
8746
diff
changeset
|
354 |
dnp = &osp->os_groupused_dnode; |
13941
d48547176ab4
3498 panic in arc_read(): !refcount_is_zero(&pbuf->b_hdr->b_refcnt)
George Wilson <george.wilson@delphix.com>
parents:
13805
diff
changeset
|
355 |
err = traverse_dnode(td, dnp, zb->zb_objset, |
9396
f41cf682d0d3
PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
8746
diff
changeset
|
356 |
DMU_GROUPUSED_OBJECT); |
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
357 |
} |
789 | 358 |
} |
359 |
||
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
360 |
if (buf) |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
361 |
(void) arc_buf_remove_ref(buf, &buf); |
789 | 362 |
|
13700
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
363 |
post: |
12296
7cf402a7f374
6675946 'zpool status' should show the progress of resilvering for individual disk.
Lin Ling <Lin.Ling@Sun.COM>
parents:
11935
diff
changeset
|
364 |
if (err == 0 && lasterr == 0 && (td->td_flags & TRAVERSE_POST)) { |
13941
d48547176ab4
3498 panic in arc_read(): !refcount_is_zero(&pbuf->b_hdr->b_refcnt)
George Wilson <george.wilson@delphix.com>
parents:
13805
diff
changeset
|
365 |
err = td->td_func(td->td_spa, NULL, bp, zb, dnp, td->td_arg); |
13700
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
366 |
if (err == ERESTART) |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
367 |
pause = B_TRUE; |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
368 |
} |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
369 |
|
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
370 |
if (pause && td->td_resume != NULL) { |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
371 |
ASSERT3U(err, ==, ERESTART); |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
372 |
ASSERT(!hard); |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
373 |
traverse_pause(td, zb); |
12296
7cf402a7f374
6675946 'zpool status' should show the progress of resilvering for individual disk.
Lin Ling <Lin.Ling@Sun.COM>
parents:
11935
diff
changeset
|
374 |
} |
789 | 375 |
|
11724
a2728800460e
6848238 zdb -bcsv does not report all corruptions
Victor Latushkin <Victor.Latushkin@Sun.COM>
parents:
11670
diff
changeset
|
376 |
return (err != 0 ? err : lasterr); |
789 | 377 |
} |
378 |
||
13792
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
379 |
static void |
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
380 |
prefetch_dnode_metadata(traverse_data_t *td, const dnode_phys_t *dnp, |
13941
d48547176ab4
3498 panic in arc_read(): !refcount_is_zero(&pbuf->b_hdr->b_refcnt)
George Wilson <george.wilson@delphix.com>
parents:
13805
diff
changeset
|
381 |
uint64_t objset, uint64_t object) |
13792
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
382 |
{ |
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
383 |
int j; |
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
384 |
zbookmark_t czb; |
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
385 |
|
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
386 |
for (j = 0; j < dnp->dn_nblkptr; j++) { |
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
387 |
SET_BOOKMARK(&czb, objset, object, dnp->dn_nlevels - 1, j); |
13941
d48547176ab4
3498 panic in arc_read(): !refcount_is_zero(&pbuf->b_hdr->b_refcnt)
George Wilson <george.wilson@delphix.com>
parents:
13805
diff
changeset
|
388 |
traverse_prefetch_metadata(td, &dnp->dn_blkptr[j], &czb); |
13792
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
389 |
} |
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
390 |
|
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
391 |
if (dnp->dn_flags & DNODE_FLAG_SPILL_BLKPTR) { |
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
392 |
SET_BOOKMARK(&czb, objset, object, 0, DMU_SPILL_BLKID); |
13941
d48547176ab4
3498 panic in arc_read(): !refcount_is_zero(&pbuf->b_hdr->b_refcnt)
George Wilson <george.wilson@delphix.com>
parents:
13805
diff
changeset
|
393 |
traverse_prefetch_metadata(td, &dnp->dn_spill, &czb); |
13792
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
394 |
} |
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
395 |
} |
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
396 |
|
9396
f41cf682d0d3
PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
8746
diff
changeset
|
397 |
static int |
12839
1eab9192da8b
6844896 recursive snapshots take a long time
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
12605
diff
changeset
|
398 |
traverse_dnode(traverse_data_t *td, const dnode_phys_t *dnp, |
13941
d48547176ab4
3498 panic in arc_read(): !refcount_is_zero(&pbuf->b_hdr->b_refcnt)
George Wilson <george.wilson@delphix.com>
parents:
13805
diff
changeset
|
399 |
uint64_t objset, uint64_t object) |
9396
f41cf682d0d3
PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
8746
diff
changeset
|
400 |
{ |
11724
a2728800460e
6848238 zdb -bcsv does not report all corruptions
Victor Latushkin <Victor.Latushkin@Sun.COM>
parents:
11670
diff
changeset
|
401 |
int j, err = 0, lasterr = 0; |
9396
f41cf682d0d3
PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
8746
diff
changeset
|
402 |
zbookmark_t czb; |
11724
a2728800460e
6848238 zdb -bcsv does not report all corruptions
Victor Latushkin <Victor.Latushkin@Sun.COM>
parents:
11670
diff
changeset
|
403 |
boolean_t hard = (td->td_flags & TRAVERSE_HARD); |
9396
f41cf682d0d3
PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
8746
diff
changeset
|
404 |
|
f41cf682d0d3
PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
8746
diff
changeset
|
405 |
for (j = 0; j < dnp->dn_nblkptr; j++) { |
f41cf682d0d3
PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
8746
diff
changeset
|
406 |
SET_BOOKMARK(&czb, objset, object, dnp->dn_nlevels - 1, j); |
13941
d48547176ab4
3498 panic in arc_read(): !refcount_is_zero(&pbuf->b_hdr->b_refcnt)
George Wilson <george.wilson@delphix.com>
parents:
13805
diff
changeset
|
407 |
err = traverse_visitbp(td, dnp, &dnp->dn_blkptr[j], &czb); |
13973
4972ab336f54
3464 zfs synctask code needs restructuring
Matthew Ahrens <mahrens@delphix.com>
parents:
13941
diff
changeset
|
408 |
if (err != 0) { |
11724
a2728800460e
6848238 zdb -bcsv does not report all corruptions
Victor Latushkin <Victor.Latushkin@Sun.COM>
parents:
11670
diff
changeset
|
409 |
if (!hard) |
a2728800460e
6848238 zdb -bcsv does not report all corruptions
Victor Latushkin <Victor.Latushkin@Sun.COM>
parents:
11670
diff
changeset
|
410 |
break; |
a2728800460e
6848238 zdb -bcsv does not report all corruptions
Victor Latushkin <Victor.Latushkin@Sun.COM>
parents:
11670
diff
changeset
|
411 |
lasterr = err; |
a2728800460e
6848238 zdb -bcsv does not report all corruptions
Victor Latushkin <Victor.Latushkin@Sun.COM>
parents:
11670
diff
changeset
|
412 |
} |
12296
7cf402a7f374
6675946 'zpool status' should show the progress of resilvering for individual disk.
Lin Ling <Lin.Ling@Sun.COM>
parents:
11935
diff
changeset
|
413 |
} |
7cf402a7f374
6675946 'zpool status' should show the progress of resilvering for individual disk.
Lin Ling <Lin.Ling@Sun.COM>
parents:
11935
diff
changeset
|
414 |
|
7cf402a7f374
6675946 'zpool status' should show the progress of resilvering for individual disk.
Lin Ling <Lin.Ling@Sun.COM>
parents:
11935
diff
changeset
|
415 |
if (dnp->dn_flags & DNODE_FLAG_SPILL_BLKPTR) { |
13792
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
416 |
SET_BOOKMARK(&czb, objset, object, 0, DMU_SPILL_BLKID); |
13941
d48547176ab4
3498 panic in arc_read(): !refcount_is_zero(&pbuf->b_hdr->b_refcnt)
George Wilson <george.wilson@delphix.com>
parents:
13805
diff
changeset
|
417 |
err = traverse_visitbp(td, dnp, &dnp->dn_spill, &czb); |
13973
4972ab336f54
3464 zfs synctask code needs restructuring
Matthew Ahrens <mahrens@delphix.com>
parents:
13941
diff
changeset
|
418 |
if (err != 0) { |
12296
7cf402a7f374
6675946 'zpool status' should show the progress of resilvering for individual disk.
Lin Ling <Lin.Ling@Sun.COM>
parents:
11935
diff
changeset
|
419 |
if (!hard) |
7cf402a7f374
6675946 'zpool status' should show the progress of resilvering for individual disk.
Lin Ling <Lin.Ling@Sun.COM>
parents:
11935
diff
changeset
|
420 |
return (err); |
7cf402a7f374
6675946 'zpool status' should show the progress of resilvering for individual disk.
Lin Ling <Lin.Ling@Sun.COM>
parents:
11935
diff
changeset
|
421 |
lasterr = err; |
11935
538c866aaac6
6716117 ZFS needs native system attribute infrastructure
Mark Shellenbaum <Mark.Shellenbaum@Sun.COM>
parents:
11724
diff
changeset
|
422 |
} |
9396
f41cf682d0d3
PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
8746
diff
changeset
|
423 |
} |
11724
a2728800460e
6848238 zdb -bcsv does not report all corruptions
Victor Latushkin <Victor.Latushkin@Sun.COM>
parents:
11670
diff
changeset
|
424 |
return (err != 0 ? err : lasterr); |
9396
f41cf682d0d3
PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
8746
diff
changeset
|
425 |
} |
f41cf682d0d3
PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
8746
diff
changeset
|
426 |
|
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
427 |
/* ARGSUSED */ |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
428 |
static int |
10922
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
429 |
traverse_prefetcher(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, |
13941
d48547176ab4
3498 panic in arc_read(): !refcount_is_zero(&pbuf->b_hdr->b_refcnt)
George Wilson <george.wilson@delphix.com>
parents:
13805
diff
changeset
|
430 |
const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg) |
6423 | 431 |
{ |
12839
1eab9192da8b
6844896 recursive snapshots take a long time
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
12605
diff
changeset
|
432 |
prefetch_data_t *pfd = arg; |
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
433 |
uint32_t aflags = ARC_NOWAIT | ARC_PREFETCH; |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
434 |
|
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
435 |
ASSERT(pfd->pd_blks_fetched >= 0); |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
436 |
if (pfd->pd_cancel) |
13980
d7059eb1884c
3598 want to dtrace when errors are generated in zfs
Matthew Ahrens <mahrens@delphix.com>
parents:
13973
diff
changeset
|
437 |
return (SET_ERROR(EINTR)); |
6423 | 438 |
|
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
439 |
if (bp == NULL || !((pfd->pd_flags & TRAVERSE_PREFETCH_DATA) || |
11670
1d964fb5d948
6595532 ZIL is too talkative
Neil Perrin <Neil.Perrin@Sun.COM>
parents:
11125
diff
changeset
|
440 |
BP_GET_TYPE(bp) == DMU_OT_DNODE || BP_GET_LEVEL(bp) > 0) || |
1d964fb5d948
6595532 ZIL is too talkative
Neil Perrin <Neil.Perrin@Sun.COM>
parents:
11125
diff
changeset
|
441 |
BP_GET_TYPE(bp) == DMU_OT_INTENT_LOG) |
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
442 |
return (0); |
6423 | 443 |
|
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
444 |
mutex_enter(&pfd->pd_mtx); |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
445 |
while (!pfd->pd_cancel && pfd->pd_blks_fetched >= pfd->pd_blks_max) |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
446 |
cv_wait(&pfd->pd_cv, &pfd->pd_mtx); |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
447 |
pfd->pd_blks_fetched++; |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
448 |
cv_broadcast(&pfd->pd_cv); |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
449 |
mutex_exit(&pfd->pd_mtx); |
6423 | 450 |
|
13941
d48547176ab4
3498 panic in arc_read(): !refcount_is_zero(&pbuf->b_hdr->b_refcnt)
George Wilson <george.wilson@delphix.com>
parents:
13805
diff
changeset
|
451 |
(void) arc_read(NULL, spa, bp, NULL, NULL, ZIO_PRIORITY_ASYNC_READ, |
d48547176ab4
3498 panic in arc_read(): !refcount_is_zero(&pbuf->b_hdr->b_refcnt)
George Wilson <george.wilson@delphix.com>
parents:
13805
diff
changeset
|
452 |
ZIO_FLAG_CANFAIL | ZIO_FLAG_SPECULATIVE, &aflags, zb); |
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
453 |
|
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
454 |
return (0); |
6423 | 455 |
} |
456 |
||
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
457 |
static void |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
458 |
traverse_prefetch_thread(void *arg) |
789 | 459 |
{ |
12839
1eab9192da8b
6844896 recursive snapshots take a long time
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
12605
diff
changeset
|
460 |
traverse_data_t *td_main = arg; |
1eab9192da8b
6844896 recursive snapshots take a long time
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
12605
diff
changeset
|
461 |
traverse_data_t td = *td_main; |
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
462 |
zbookmark_t czb; |
789 | 463 |
|
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
464 |
td.td_func = traverse_prefetcher; |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
465 |
td.td_arg = td_main->td_pfd; |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
466 |
td.td_pfd = NULL; |
789 | 467 |
|
10922
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
468 |
SET_BOOKMARK(&czb, td.td_objset, |
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
469 |
ZB_ROOT_OBJECT, ZB_ROOT_LEVEL, ZB_ROOT_BLKID); |
13941
d48547176ab4
3498 panic in arc_read(): !refcount_is_zero(&pbuf->b_hdr->b_refcnt)
George Wilson <george.wilson@delphix.com>
parents:
13805
diff
changeset
|
470 |
(void) traverse_visitbp(&td, NULL, td.td_rootbp, &czb); |
789 | 471 |
|
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
472 |
mutex_enter(&td_main->td_pfd->pd_mtx); |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
473 |
td_main->td_pfd->pd_exited = B_TRUE; |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
474 |
cv_broadcast(&td_main->td_pfd->pd_cv); |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
475 |
mutex_exit(&td_main->td_pfd->pd_mtx); |
789 | 476 |
} |
477 |
||
478 |
/* |
|
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
479 |
* NB: dataset must not be changing on-disk (eg, is a snapshot or we are |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
480 |
* in syncing context). |
789 | 481 |
*/ |
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
482 |
static int |
13700
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
483 |
traverse_impl(spa_t *spa, dsl_dataset_t *ds, uint64_t objset, blkptr_t *rootbp, |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
484 |
uint64_t txg_start, zbookmark_t *resume, int flags, |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
485 |
blkptr_cb_t func, void *arg) |
789 | 486 |
{ |
12839
1eab9192da8b
6844896 recursive snapshots take a long time
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
12605
diff
changeset
|
487 |
traverse_data_t td; |
1eab9192da8b
6844896 recursive snapshots take a long time
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
12605
diff
changeset
|
488 |
prefetch_data_t pd = { 0 }; |
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
489 |
zbookmark_t czb; |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
490 |
int err; |
789 | 491 |
|
13700
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
492 |
ASSERT(ds == NULL || objset == ds->ds_object); |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
493 |
ASSERT(!(flags & TRAVERSE_PRE) || !(flags & TRAVERSE_POST)); |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
494 |
|
13792
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
495 |
/* |
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
496 |
* The data prefetching mechanism (the prefetch thread) is incompatible |
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
497 |
* with resuming from a bookmark. |
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
498 |
*/ |
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
499 |
ASSERT(resume == NULL || !(flags & TRAVERSE_PREFETCH_DATA)); |
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
500 |
|
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
501 |
td.td_spa = spa; |
13700
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
502 |
td.td_objset = objset; |
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
503 |
td.td_rootbp = rootbp; |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
504 |
td.td_min_txg = txg_start; |
13700
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
505 |
td.td_resume = resume; |
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
506 |
td.td_func = func; |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
507 |
td.td_arg = arg; |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
508 |
td.td_pfd = &pd; |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
509 |
td.td_flags = flags; |
789 | 510 |
|
12605
6790e683d5a5
6959846 DMU traverse prefetch size should be a global tunable
Chris Kirby <Chris.Kirby@oracle.com>
parents:
12296
diff
changeset
|
511 |
pd.pd_blks_max = zfs_pd_blks_max; |
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
512 |
pd.pd_flags = flags; |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
513 |
mutex_init(&pd.pd_mtx, NULL, MUTEX_DEFAULT, NULL); |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
514 |
cv_init(&pd.pd_cv, NULL, CV_DEFAULT, NULL); |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
515 |
|
12839
1eab9192da8b
6844896 recursive snapshots take a long time
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
12605
diff
changeset
|
516 |
/* See comment on ZIL traversal in dsl_scan_visitds. */ |
13973
4972ab336f54
3464 zfs synctask code needs restructuring
Matthew Ahrens <mahrens@delphix.com>
parents:
13941
diff
changeset
|
517 |
if (ds != NULL && !dsl_dataset_is_snapshot(ds) && !BP_IS_HOLE(rootbp)) { |
4972ab336f54
3464 zfs synctask code needs restructuring
Matthew Ahrens <mahrens@delphix.com>
parents:
13941
diff
changeset
|
518 |
uint32_t flags = ARC_WAIT; |
4972ab336f54
3464 zfs synctask code needs restructuring
Matthew Ahrens <mahrens@delphix.com>
parents:
13941
diff
changeset
|
519 |
objset_phys_t *osp; |
4972ab336f54
3464 zfs synctask code needs restructuring
Matthew Ahrens <mahrens@delphix.com>
parents:
13941
diff
changeset
|
520 |
arc_buf_t *buf; |
12839
1eab9192da8b
6844896 recursive snapshots take a long time
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
12605
diff
changeset
|
521 |
|
13973
4972ab336f54
3464 zfs synctask code needs restructuring
Matthew Ahrens <mahrens@delphix.com>
parents:
13941
diff
changeset
|
522 |
err = arc_read(NULL, td.td_spa, rootbp, |
4972ab336f54
3464 zfs synctask code needs restructuring
Matthew Ahrens <mahrens@delphix.com>
parents:
13941
diff
changeset
|
523 |
arc_getbuf_func, &buf, |
4972ab336f54
3464 zfs synctask code needs restructuring
Matthew Ahrens <mahrens@delphix.com>
parents:
13941
diff
changeset
|
524 |
ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, &flags, NULL); |
4972ab336f54
3464 zfs synctask code needs restructuring
Matthew Ahrens <mahrens@delphix.com>
parents:
13941
diff
changeset
|
525 |
if (err != 0) |
12839
1eab9192da8b
6844896 recursive snapshots take a long time
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
12605
diff
changeset
|
526 |
return (err); |
1eab9192da8b
6844896 recursive snapshots take a long time
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
12605
diff
changeset
|
527 |
|
13973
4972ab336f54
3464 zfs synctask code needs restructuring
Matthew Ahrens <mahrens@delphix.com>
parents:
13941
diff
changeset
|
528 |
osp = buf->b_data; |
4972ab336f54
3464 zfs synctask code needs restructuring
Matthew Ahrens <mahrens@delphix.com>
parents:
13941
diff
changeset
|
529 |
traverse_zil(&td, &osp->os_zil_header); |
4972ab336f54
3464 zfs synctask code needs restructuring
Matthew Ahrens <mahrens@delphix.com>
parents:
13941
diff
changeset
|
530 |
(void) arc_buf_remove_ref(buf, &buf); |
12839
1eab9192da8b
6844896 recursive snapshots take a long time
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
12605
diff
changeset
|
531 |
} |
1eab9192da8b
6844896 recursive snapshots take a long time
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
12605
diff
changeset
|
532 |
|
13792
4be8368f41e4
3122 zfs destroy filesystem should prefetch blocks
Matthew Ahrens <mahrens@delphix.com>
parents:
13765
diff
changeset
|
533 |
if (!(flags & TRAVERSE_PREFETCH_DATA) || |
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
534 |
0 == taskq_dispatch(system_taskq, traverse_prefetch_thread, |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
535 |
&td, TQ_NOQUEUE)) |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
536 |
pd.pd_exited = B_TRUE; |
789 | 537 |
|
12839
1eab9192da8b
6844896 recursive snapshots take a long time
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
12605
diff
changeset
|
538 |
SET_BOOKMARK(&czb, td.td_objset, |
10922
e2081f502306
PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10921
diff
changeset
|
539 |
ZB_ROOT_OBJECT, ZB_ROOT_LEVEL, ZB_ROOT_BLKID); |
13941
d48547176ab4
3498 panic in arc_read(): !refcount_is_zero(&pbuf->b_hdr->b_refcnt)
George Wilson <george.wilson@delphix.com>
parents:
13805
diff
changeset
|
540 |
err = traverse_visitbp(&td, NULL, rootbp, &czb); |
789 | 541 |
|
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
542 |
mutex_enter(&pd.pd_mtx); |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
543 |
pd.pd_cancel = B_TRUE; |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
544 |
cv_broadcast(&pd.pd_cv); |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
545 |
while (!pd.pd_exited) |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
546 |
cv_wait(&pd.pd_cv, &pd.pd_mtx); |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
547 |
mutex_exit(&pd.pd_mtx); |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
548 |
|
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
549 |
mutex_destroy(&pd.pd_mtx); |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
550 |
cv_destroy(&pd.pd_cv); |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
551 |
|
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
552 |
return (err); |
789 | 553 |
} |
554 |
||
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
555 |
/* |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
556 |
* NB: dataset must not be changing on-disk (eg, is a snapshot or we are |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
557 |
* in syncing context). |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
558 |
*/ |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
559 |
int |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
560 |
traverse_dataset(dsl_dataset_t *ds, uint64_t txg_start, int flags, |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
561 |
blkptr_cb_t func, void *arg) |
789 | 562 |
{ |
13700
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
563 |
return (traverse_impl(ds->ds_dir->dd_pool->dp_spa, ds, ds->ds_object, |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
564 |
&ds->ds_phys->ds_bp, txg_start, NULL, flags, func, arg)); |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
565 |
} |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
566 |
|
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
567 |
int |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
568 |
traverse_dataset_destroyed(spa_t *spa, blkptr_t *blkptr, |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
569 |
uint64_t txg_start, zbookmark_t *resume, int flags, |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
570 |
blkptr_cb_t func, void *arg) |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
571 |
{ |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
572 |
return (traverse_impl(spa, NULL, ZB_DESTROYED_OBJSET, |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
573 |
blkptr, txg_start, resume, flags, func, arg)); |
789 | 574 |
} |
575 |
||
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
576 |
/* |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
577 |
* NB: pool must not be changing on-disk (eg, from zdb or sync context). |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
578 |
*/ |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
579 |
int |
11125
fca3e6d28599
6899923 vdev_offline/vdev_add deadlock
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10922
diff
changeset
|
580 |
traverse_pool(spa_t *spa, uint64_t txg_start, int flags, |
fca3e6d28599
6899923 vdev_offline/vdev_add deadlock
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10922
diff
changeset
|
581 |
blkptr_cb_t func, void *arg) |
789 | 582 |
{ |
11724
a2728800460e
6848238 zdb -bcsv does not report all corruptions
Victor Latushkin <Victor.Latushkin@Sun.COM>
parents:
11670
diff
changeset
|
583 |
int err, lasterr = 0; |
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
584 |
uint64_t obj; |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
585 |
dsl_pool_t *dp = spa_get_dsl(spa); |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
586 |
objset_t *mos = dp->dp_meta_objset; |
11724
a2728800460e
6848238 zdb -bcsv does not report all corruptions
Victor Latushkin <Victor.Latushkin@Sun.COM>
parents:
11670
diff
changeset
|
587 |
boolean_t hard = (flags & TRAVERSE_HARD); |
789 | 588 |
|
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
589 |
/* visit the MOS */ |
13700
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
590 |
err = traverse_impl(spa, NULL, 0, spa_get_rootblkptr(spa), |
2889e2596bd6
2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents:
13055
diff
changeset
|
591 |
txg_start, NULL, flags, func, arg); |
13973
4972ab336f54
3464 zfs synctask code needs restructuring
Matthew Ahrens <mahrens@delphix.com>
parents:
13941
diff
changeset
|
592 |
if (err != 0) |
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
593 |
return (err); |
789 | 594 |
|
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
595 |
/* visit each dataset */ |
11724
a2728800460e
6848238 zdb -bcsv does not report all corruptions
Victor Latushkin <Victor.Latushkin@Sun.COM>
parents:
11670
diff
changeset
|
596 |
for (obj = 1; err == 0 || (err != ESRCH && hard); |
a2728800460e
6848238 zdb -bcsv does not report all corruptions
Victor Latushkin <Victor.Latushkin@Sun.COM>
parents:
11670
diff
changeset
|
597 |
err = dmu_object_next(mos, &obj, FALSE, txg_start)) { |
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
598 |
dmu_object_info_t doi; |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
599 |
|
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
600 |
err = dmu_object_info(mos, obj, &doi); |
13973
4972ab336f54
3464 zfs synctask code needs restructuring
Matthew Ahrens <mahrens@delphix.com>
parents:
13941
diff
changeset
|
601 |
if (err != 0) { |
11724
a2728800460e
6848238 zdb -bcsv does not report all corruptions
Victor Latushkin <Victor.Latushkin@Sun.COM>
parents:
11670
diff
changeset
|
602 |
if (!hard) |
a2728800460e
6848238 zdb -bcsv does not report all corruptions
Victor Latushkin <Victor.Latushkin@Sun.COM>
parents:
11670
diff
changeset
|
603 |
return (err); |
a2728800460e
6848238 zdb -bcsv does not report all corruptions
Victor Latushkin <Victor.Latushkin@Sun.COM>
parents:
11670
diff
changeset
|
604 |
lasterr = err; |
a2728800460e
6848238 zdb -bcsv does not report all corruptions
Victor Latushkin <Victor.Latushkin@Sun.COM>
parents:
11670
diff
changeset
|
605 |
continue; |
a2728800460e
6848238 zdb -bcsv does not report all corruptions
Victor Latushkin <Victor.Latushkin@Sun.COM>
parents:
11670
diff
changeset
|
606 |
} |
789 | 607 |
|
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
608 |
if (doi.doi_type == DMU_OT_DSL_DATASET) { |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
609 |
dsl_dataset_t *ds; |
10921
8aac17999e4d
PSARC 2009/479 zpool recovery support
Tim Haley <Tim.Haley@Sun.COM>
parents:
9396
diff
changeset
|
610 |
uint64_t txg = txg_start; |
8aac17999e4d
PSARC 2009/479 zpool recovery support
Tim Haley <Tim.Haley@Sun.COM>
parents:
9396
diff
changeset
|
611 |
|
13973
4972ab336f54
3464 zfs synctask code needs restructuring
Matthew Ahrens <mahrens@delphix.com>
parents:
13941
diff
changeset
|
612 |
dsl_pool_config_enter(dp, FTAG); |
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
613 |
err = dsl_dataset_hold_obj(dp, obj, FTAG, &ds); |
13973
4972ab336f54
3464 zfs synctask code needs restructuring
Matthew Ahrens <mahrens@delphix.com>
parents:
13941
diff
changeset
|
614 |
dsl_pool_config_exit(dp, FTAG); |
4972ab336f54
3464 zfs synctask code needs restructuring
Matthew Ahrens <mahrens@delphix.com>
parents:
13941
diff
changeset
|
615 |
if (err != 0) { |
11724
a2728800460e
6848238 zdb -bcsv does not report all corruptions
Victor Latushkin <Victor.Latushkin@Sun.COM>
parents:
11670
diff
changeset
|
616 |
if (!hard) |
a2728800460e
6848238 zdb -bcsv does not report all corruptions
Victor Latushkin <Victor.Latushkin@Sun.COM>
parents:
11670
diff
changeset
|
617 |
return (err); |
a2728800460e
6848238 zdb -bcsv does not report all corruptions
Victor Latushkin <Victor.Latushkin@Sun.COM>
parents:
11670
diff
changeset
|
618 |
lasterr = err; |
a2728800460e
6848238 zdb -bcsv does not report all corruptions
Victor Latushkin <Victor.Latushkin@Sun.COM>
parents:
11670
diff
changeset
|
619 |
continue; |
a2728800460e
6848238 zdb -bcsv does not report all corruptions
Victor Latushkin <Victor.Latushkin@Sun.COM>
parents:
11670
diff
changeset
|
620 |
} |
10921
8aac17999e4d
PSARC 2009/479 zpool recovery support
Tim Haley <Tim.Haley@Sun.COM>
parents:
9396
diff
changeset
|
621 |
if (ds->ds_phys->ds_prev_snap_txg > txg) |
8aac17999e4d
PSARC 2009/479 zpool recovery support
Tim Haley <Tim.Haley@Sun.COM>
parents:
9396
diff
changeset
|
622 |
txg = ds->ds_phys->ds_prev_snap_txg; |
11125
fca3e6d28599
6899923 vdev_offline/vdev_add deadlock
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
10922
diff
changeset
|
623 |
err = traverse_dataset(ds, txg, flags, func, arg); |
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
624 |
dsl_dataset_rele(ds, FTAG); |
13973
4972ab336f54
3464 zfs synctask code needs restructuring
Matthew Ahrens <mahrens@delphix.com>
parents:
13941
diff
changeset
|
625 |
if (err != 0) { |
11724
a2728800460e
6848238 zdb -bcsv does not report all corruptions
Victor Latushkin <Victor.Latushkin@Sun.COM>
parents:
11670
diff
changeset
|
626 |
if (!hard) |
a2728800460e
6848238 zdb -bcsv does not report all corruptions
Victor Latushkin <Victor.Latushkin@Sun.COM>
parents:
11670
diff
changeset
|
627 |
return (err); |
a2728800460e
6848238 zdb -bcsv does not report all corruptions
Victor Latushkin <Victor.Latushkin@Sun.COM>
parents:
11670
diff
changeset
|
628 |
lasterr = err; |
a2728800460e
6848238 zdb -bcsv does not report all corruptions
Victor Latushkin <Victor.Latushkin@Sun.COM>
parents:
11670
diff
changeset
|
629 |
} |
789 | 630 |
} |
631 |
} |
|
7837
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
632 |
if (err == ESRCH) |
001de5627df3
6333409 traversal code should be able to issue multiple reads in parallel
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
7046
diff
changeset
|
633 |
err = 0; |
11724
a2728800460e
6848238 zdb -bcsv does not report all corruptions
Victor Latushkin <Victor.Latushkin@Sun.COM>
parents:
11670
diff
changeset
|
634 |
return (err != 0 ? err : lasterr); |
789 | 635 |
} |