Mercurial > illumos > illumos-gate
annotate usr/src/uts/common/fs/zfs/vdev_file.c @ 13971:d1648d817bd6
3581 spa_zio_taskq[ZIO_TYPE_FREE][ZIO_TASKQ_ISSUE]->tq_lock is piping hot
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Christopher Siden <christopher.siden@delphix.com>
Reviewed by: Gordon Ross <gordon.ross@nexenta.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
author | Adam Leventhal <ahl@delphix.com> |
---|---|
date | Mon, 25 Feb 2013 21:41:47 -0800 |
parents | a9c12c2c1647 |
children | d7059eb1884c |
rev | line source |
---|---|
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 /* | |
12247
5bcd281629f8
6911420 ZFS device removal detection should work with SCSAv3
George Wilson <George.Wilson@Sun.COM>
parents:
11958
diff
changeset
|
22 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. |
13570
3411fd5f1589
1948 zpool list should show more detailed pool information
George Wilson <George.Wilson@delphix.com>
parents:
12247
diff
changeset
|
23 * Copyright (c) 2012 by Delphix. All rights reserved. |
789 | 24 */ |
25 | |
26 #include <sys/zfs_context.h> | |
27 #include <sys/spa.h> | |
13871
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
28 #include <sys/spa_impl.h> |
789 | 29 #include <sys/vdev_file.h> |
30 #include <sys/vdev_impl.h> | |
31 #include <sys/zio.h> | |
32 #include <sys/fs/zfs.h> | |
6976
cae5f06df471
PSARC 2008/388 Short circuit for vdev probe failure
eschrock
parents:
6523
diff
changeset
|
33 #include <sys/fm/fs/zfs.h> |
789 | 34 |
35 /* | |
36 * Virtual device vector for files. | |
37 */ | |
38 | |
11958
575ffe1e978d
6923585 deadlock while booting OpenSolaris build 132 from mirrored rpool with removed submirror
George Wilson <George.Wilson@Sun.COM>
parents:
10850
diff
changeset
|
39 static void |
575ffe1e978d
6923585 deadlock while booting OpenSolaris build 132 from mirrored rpool with removed submirror
George Wilson <George.Wilson@Sun.COM>
parents:
10850
diff
changeset
|
40 vdev_file_hold(vdev_t *vd) |
575ffe1e978d
6923585 deadlock while booting OpenSolaris build 132 from mirrored rpool with removed submirror
George Wilson <George.Wilson@Sun.COM>
parents:
10850
diff
changeset
|
41 { |
575ffe1e978d
6923585 deadlock while booting OpenSolaris build 132 from mirrored rpool with removed submirror
George Wilson <George.Wilson@Sun.COM>
parents:
10850
diff
changeset
|
42 ASSERT(vd->vdev_path != NULL); |
575ffe1e978d
6923585 deadlock while booting OpenSolaris build 132 from mirrored rpool with removed submirror
George Wilson <George.Wilson@Sun.COM>
parents:
10850
diff
changeset
|
43 } |
575ffe1e978d
6923585 deadlock while booting OpenSolaris build 132 from mirrored rpool with removed submirror
George Wilson <George.Wilson@Sun.COM>
parents:
10850
diff
changeset
|
44 |
575ffe1e978d
6923585 deadlock while booting OpenSolaris build 132 from mirrored rpool with removed submirror
George Wilson <George.Wilson@Sun.COM>
parents:
10850
diff
changeset
|
45 static void |
575ffe1e978d
6923585 deadlock while booting OpenSolaris build 132 from mirrored rpool with removed submirror
George Wilson <George.Wilson@Sun.COM>
parents:
10850
diff
changeset
|
46 vdev_file_rele(vdev_t *vd) |
575ffe1e978d
6923585 deadlock while booting OpenSolaris build 132 from mirrored rpool with removed submirror
George Wilson <George.Wilson@Sun.COM>
parents:
10850
diff
changeset
|
47 { |
575ffe1e978d
6923585 deadlock while booting OpenSolaris build 132 from mirrored rpool with removed submirror
George Wilson <George.Wilson@Sun.COM>
parents:
10850
diff
changeset
|
48 ASSERT(vd->vdev_path != NULL); |
575ffe1e978d
6923585 deadlock while booting OpenSolaris build 132 from mirrored rpool with removed submirror
George Wilson <George.Wilson@Sun.COM>
parents:
10850
diff
changeset
|
49 } |
575ffe1e978d
6923585 deadlock while booting OpenSolaris build 132 from mirrored rpool with removed submirror
George Wilson <George.Wilson@Sun.COM>
parents:
10850
diff
changeset
|
50 |
789 | 51 static int |
13570
3411fd5f1589
1948 zpool list should show more detailed pool information
George Wilson <George.Wilson@delphix.com>
parents:
12247
diff
changeset
|
52 vdev_file_open(vdev_t *vd, uint64_t *psize, uint64_t *max_psize, |
3411fd5f1589
1948 zpool list should show more detailed pool information
George Wilson <George.Wilson@delphix.com>
parents:
12247
diff
changeset
|
53 uint64_t *ashift) |
789 | 54 { |
55 vdev_file_t *vf; | |
56 vnode_t *vp; | |
7754
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
6976
diff
changeset
|
57 vattr_t vattr; |
789 | 58 int error; |
59 | |
60 /* | |
61 * We must have a pathname, and it must be absolute. | |
62 */ | |
63 if (vd->vdev_path == NULL || vd->vdev_path[0] != '/') { | |
64 vd->vdev_stat.vs_aux = VDEV_AUX_BAD_LABEL; | |
65 return (EINVAL); | |
66 } | |
67 | |
10850
bb29ac73664d
6840704 osol_0906 PV guests sometimes hang at login prompt
George Wilson <George.Wilson@Sun.COM>
parents:
8241
diff
changeset
|
68 /* |
bb29ac73664d
6840704 osol_0906 PV guests sometimes hang at login prompt
George Wilson <George.Wilson@Sun.COM>
parents:
8241
diff
changeset
|
69 * Reopen the device if it's not currently open. Otherwise, |
bb29ac73664d
6840704 osol_0906 PV guests sometimes hang at login prompt
George Wilson <George.Wilson@Sun.COM>
parents:
8241
diff
changeset
|
70 * just update the physical size of the device. |
bb29ac73664d
6840704 osol_0906 PV guests sometimes hang at login prompt
George Wilson <George.Wilson@Sun.COM>
parents:
8241
diff
changeset
|
71 */ |
bb29ac73664d
6840704 osol_0906 PV guests sometimes hang at login prompt
George Wilson <George.Wilson@Sun.COM>
parents:
8241
diff
changeset
|
72 if (vd->vdev_tsd != NULL) { |
bb29ac73664d
6840704 osol_0906 PV guests sometimes hang at login prompt
George Wilson <George.Wilson@Sun.COM>
parents:
8241
diff
changeset
|
73 ASSERT(vd->vdev_reopening); |
bb29ac73664d
6840704 osol_0906 PV guests sometimes hang at login prompt
George Wilson <George.Wilson@Sun.COM>
parents:
8241
diff
changeset
|
74 vf = vd->vdev_tsd; |
bb29ac73664d
6840704 osol_0906 PV guests sometimes hang at login prompt
George Wilson <George.Wilson@Sun.COM>
parents:
8241
diff
changeset
|
75 goto skip_open; |
bb29ac73664d
6840704 osol_0906 PV guests sometimes hang at login prompt
George Wilson <George.Wilson@Sun.COM>
parents:
8241
diff
changeset
|
76 } |
bb29ac73664d
6840704 osol_0906 PV guests sometimes hang at login prompt
George Wilson <George.Wilson@Sun.COM>
parents:
8241
diff
changeset
|
77 |
789 | 78 vf = vd->vdev_tsd = kmem_zalloc(sizeof (vdev_file_t), KM_SLEEP); |
79 | |
80 /* | |
81 * We always open the files from the root of the global zone, even if | |
82 * we're in a local zone. If the user has gotten to this point, the | |
83 * administrator has already decided that the pool should be available | |
84 * to local zone users, so the underlying devices should be as well. | |
85 */ | |
86 ASSERT(vd->vdev_path != NULL && vd->vdev_path[0] == '/'); | |
5329 | 87 error = vn_openat(vd->vdev_path + 1, UIO_SYSSPACE, |
8241
5a60f16123ba
6328632 zpool offline is a bit too conservative
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7754
diff
changeset
|
88 spa_mode(vd->vdev_spa) | FOFFMAX, 0, &vp, 0, 0, rootdir, -1); |
789 | 89 |
90 if (error) { | |
91 vd->vdev_stat.vs_aux = VDEV_AUX_OPEN_FAILED; | |
92 return (error); | |
93 } | |
94 | |
95 vf->vf_vnode = vp; | |
96 | |
97 #ifdef _KERNEL | |
98 /* | |
99 * Make sure it's a regular file. | |
100 */ | |
101 if (vp->v_type != VREG) { | |
102 vd->vdev_stat.vs_aux = VDEV_AUX_OPEN_FAILED; | |
103 return (ENODEV); | |
104 } | |
105 #endif | |
10850
bb29ac73664d
6840704 osol_0906 PV guests sometimes hang at login prompt
George Wilson <George.Wilson@Sun.COM>
parents:
8241
diff
changeset
|
106 |
bb29ac73664d
6840704 osol_0906 PV guests sometimes hang at login prompt
George Wilson <George.Wilson@Sun.COM>
parents:
8241
diff
changeset
|
107 skip_open: |
789 | 108 /* |
109 * Determine the physical size of the file. | |
110 */ | |
111 vattr.va_mask = AT_SIZE; | |
5331 | 112 error = VOP_GETATTR(vf->vf_vnode, &vattr, 0, kcred, NULL); |
789 | 113 if (error) { |
114 vd->vdev_stat.vs_aux = VDEV_AUX_OPEN_FAILED; | |
115 return (error); | |
116 } | |
117 | |
13570
3411fd5f1589
1948 zpool list should show more detailed pool information
George Wilson <George.Wilson@delphix.com>
parents:
12247
diff
changeset
|
118 *max_psize = *psize = vattr.va_size; |
789 | 119 *ashift = SPA_MINBLOCKSHIFT; |
120 | |
121 return (0); | |
122 } | |
123 | |
124 static void | |
125 vdev_file_close(vdev_t *vd) | |
126 { | |
127 vdev_file_t *vf = vd->vdev_tsd; | |
128 | |
10850
bb29ac73664d
6840704 osol_0906 PV guests sometimes hang at login prompt
George Wilson <George.Wilson@Sun.COM>
parents:
8241
diff
changeset
|
129 if (vd->vdev_reopening || vf == NULL) |
789 | 130 return; |
131 | |
132 if (vf->vf_vnode != NULL) { | |
5331 | 133 (void) VOP_PUTPAGE(vf->vf_vnode, 0, 0, B_INVAL, kcred, NULL); |
8241
5a60f16123ba
6328632 zpool offline is a bit too conservative
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7754
diff
changeset
|
134 (void) VOP_CLOSE(vf->vf_vnode, spa_mode(vd->vdev_spa), 1, 0, |
5a60f16123ba
6328632 zpool offline is a bit too conservative
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7754
diff
changeset
|
135 kcred, NULL); |
789 | 136 VN_RELE(vf->vf_vnode); |
137 } | |
138 | |
12247
5bcd281629f8
6911420 ZFS device removal detection should work with SCSAv3
George Wilson <George.Wilson@Sun.COM>
parents:
11958
diff
changeset
|
139 vd->vdev_delayed_close = B_FALSE; |
789 | 140 kmem_free(vf, sizeof (vdev_file_t)); |
141 vd->vdev_tsd = NULL; | |
142 } | |
143 | |
13871
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
144 /* |
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
145 * Implements the interrupt side for file vdev types. This routine will be |
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
146 * called when the I/O completes allowing us to transfer the I/O to the |
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
147 * interrupt taskqs. For consistency, the code structure mimics disk vdev |
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
148 * types. |
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
149 */ |
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
150 static void |
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
151 vdev_file_io_intr(buf_t *bp) |
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
152 { |
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
153 vdev_buf_t *vb = (vdev_buf_t *)bp; |
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
154 zio_t *zio = vb->vb_io; |
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
155 |
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
156 zio->io_error = (geterror(bp) != 0 ? EIO : 0); |
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
157 if (zio->io_error == 0 && bp->b_resid != 0) |
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
158 zio->io_error = ENOSPC; |
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
159 |
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
160 kmem_free(vb, sizeof (vdev_buf_t)); |
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
161 zio_interrupt(zio); |
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
162 } |
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
163 |
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
164 static void |
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
165 vdev_file_io_strategy(void *arg) |
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
166 { |
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
167 buf_t *bp = arg; |
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
168 vnode_t *vp = bp->b_private; |
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
169 ssize_t resid; |
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
170 int error; |
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
171 |
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
172 error = vn_rdwr((bp->b_flags & B_READ) ? UIO_READ : UIO_WRITE, |
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
173 vp, bp->b_un.b_addr, bp->b_bcount, ldbtob(bp->b_lblkno), |
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
174 UIO_SYSSPACE, 0, RLIM64_INFINITY, kcred, &resid); |
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
175 |
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
176 if (error == 0) { |
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
177 bp->b_resid = resid; |
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
178 biodone(bp); |
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
179 } else { |
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
180 bioerror(bp, error); |
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
181 biodone(bp); |
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
182 } |
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
183 } |
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
184 |
5329 | 185 static int |
789 | 186 vdev_file_io_start(zio_t *zio) |
187 { | |
13871
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
188 spa_t *spa = zio->io_spa; |
789 | 189 vdev_t *vd = zio->io_vd; |
190 vdev_file_t *vf = vd->vdev_tsd; | |
13871
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
191 vdev_buf_t *vb; |
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
192 buf_t *bp; |
789 | 193 |
194 if (zio->io_type == ZIO_TYPE_IOCTL) { | |
195 /* XXPOLICY */ | |
5329 | 196 if (!vdev_readable(vd)) { |
789 | 197 zio->io_error = ENXIO; |
5530 | 198 return (ZIO_PIPELINE_CONTINUE); |
789 | 199 } |
200 | |
201 switch (zio->io_cmd) { | |
202 case DKIOCFLUSHWRITECACHE: | |
203 zio->io_error = VOP_FSYNC(vf->vf_vnode, FSYNC | FDSYNC, | |
5331 | 204 kcred, NULL); |
789 | 205 break; |
206 default: | |
207 zio->io_error = ENOTSUP; | |
208 } | |
209 | |
5530 | 210 return (ZIO_PIPELINE_CONTINUE); |
789 | 211 } |
212 | |
13871
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
213 vb = kmem_alloc(sizeof (vdev_buf_t), KM_SLEEP); |
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
214 |
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
215 vb->vb_io = zio; |
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
216 bp = &vb->vb_buf; |
789 | 217 |
13871
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
218 bioinit(bp); |
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
219 bp->b_flags = (zio->io_type == ZIO_TYPE_READ ? B_READ : B_WRITE); |
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
220 bp->b_bcount = zio->io_size; |
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
221 bp->b_un.b_addr = zio->io_data; |
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
222 bp->b_lblkno = lbtodb(zio->io_offset); |
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
223 bp->b_bufsize = zio->io_size; |
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
224 bp->b_private = vf->vf_vnode; |
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
225 bp->b_iodone = (int (*)())vdev_file_io_intr; |
789 | 226 |
13971
d1648d817bd6
3581 spa_zio_taskq[ZIO_TYPE_FREE][ZIO_TASKQ_ISSUE]->tq_lock is piping hot
Adam Leventhal <ahl@delphix.com>
parents:
13871
diff
changeset
|
227 spa_taskq_dispatch_ent(spa, ZIO_TYPE_FREE, ZIO_TASKQ_ISSUE, |
13871
a9c12c2c1647
3306 zdb should be able to issue reads in parallel
George Wilson <george.wilson@delphix.com>
parents:
13570
diff
changeset
|
228 vdev_file_io_strategy, bp, 0, &zio->io_tqent); |
5530 | 229 |
230 return (ZIO_PIPELINE_STOP); | |
789 | 231 } |
232 | |
7754
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
6976
diff
changeset
|
233 /* ARGSUSED */ |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
6976
diff
changeset
|
234 static void |
789 | 235 vdev_file_io_done(zio_t *zio) |
236 { | |
237 } | |
238 | |
239 vdev_ops_t vdev_file_ops = { | |
240 vdev_file_open, | |
241 vdev_file_close, | |
242 vdev_default_asize, | |
243 vdev_file_io_start, | |
244 vdev_file_io_done, | |
245 NULL, | |
11958
575ffe1e978d
6923585 deadlock while booting OpenSolaris build 132 from mirrored rpool with removed submirror
George Wilson <George.Wilson@Sun.COM>
parents:
10850
diff
changeset
|
246 vdev_file_hold, |
575ffe1e978d
6923585 deadlock while booting OpenSolaris build 132 from mirrored rpool with removed submirror
George Wilson <George.Wilson@Sun.COM>
parents:
10850
diff
changeset
|
247 vdev_file_rele, |
789 | 248 VDEV_TYPE_FILE, /* name of this vdev type */ |
249 B_TRUE /* leaf vdev */ | |
250 }; | |
251 | |
252 /* | |
253 * From userland we access disks just like files. | |
254 */ | |
255 #ifndef _KERNEL | |
256 | |
257 vdev_ops_t vdev_disk_ops = { | |
258 vdev_file_open, | |
259 vdev_file_close, | |
260 vdev_default_asize, | |
261 vdev_file_io_start, | |
262 vdev_file_io_done, | |
263 NULL, | |
11958
575ffe1e978d
6923585 deadlock while booting OpenSolaris build 132 from mirrored rpool with removed submirror
George Wilson <George.Wilson@Sun.COM>
parents:
10850
diff
changeset
|
264 vdev_file_hold, |
575ffe1e978d
6923585 deadlock while booting OpenSolaris build 132 from mirrored rpool with removed submirror
George Wilson <George.Wilson@Sun.COM>
parents:
10850
diff
changeset
|
265 vdev_file_rele, |
789 | 266 VDEV_TYPE_DISK, /* name of this vdev type */ |
267 B_TRUE /* leaf vdev */ | |
268 }; | |
269 | |
270 #endif |