Print this page
expandable RAID-Z
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/uts/common/fs/zfs/vdev_missing.c
+++ new/usr/src/uts/common/fs/zfs/vdev_missing.c
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21 /*
22 22 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
23 23 * Use is subject to license terms.
24 24 */
25 25
26 26 #pragma ident "%Z%%M% %I% %E% SMI"
27 27
28 28 /*
29 29 * The 'missing' vdev is a special vdev type used only during import. It
30 30 * signifies a placeholder in the root vdev for some vdev that we know is
31 31 * missing. We pass it down to the kernel to allow the rest of the
32 32 * configuration to parsed and an attempt made to open all available devices.
33 33 * Because its GUID is always 0, we know that the guid sum will mismatch and we
34 34 * won't be able to open the pool anyway.
35 35 */
36 36
37 37 #include <sys/zfs_context.h>
38 38 #include <sys/spa.h>
39 39 #include <sys/vdev_impl.h>
40 40 #include <sys/fs/zfs.h>
41 41 #include <sys/zio.h>
42 42
43 43 /* ARGSUSED */
44 44 static int
45 45 vdev_missing_open(vdev_t *vd, uint64_t *psize, uint64_t *ashift)
46 46 {
47 47 /*
48 48 * Really this should just fail. But then the root vdev will be in the
49 49 * faulted state with VDEV_AUX_NO_REPLICAS, when what we really want is
50 50 * VDEV_AUX_BAD_GUID_SUM. So we pretend to succeed, knowing that we
51 51 * will fail the GUID sum check before ever trying to open the pool.
52 52 */
53 53 *psize = SPA_MINDEVSIZE;
54 54 *ashift = SPA_MINBLOCKSHIFT;
55 55 return (0);
56 56 }
57 57
58 58 /* ARGSUSED */
59 59 static void
60 60 vdev_missing_close(vdev_t *vd)
61 61 {
62 62 }
63 63
64 64 /* ARGSUSED */
65 65 static int
66 66 vdev_missing_io_start(zio_t *zio)
67 67 {
68 68 zio->io_error = ENOTSUP;
69 69 return (ZIO_PIPELINE_CONTINUE);
70 70 }
71 71
72 72 /* ARGSUSED */
73 73 static int
74 74 vdev_missing_io_done(zio_t *zio)
75 75 {
76 76 return (ZIO_PIPELINE_CONTINUE);
77 77 }
78 78
79 79 /* ARGSUSED */
80 80 static int
81 81 vdev_missing_probe(vdev_t *vd)
82 82 {
83 83 return (0);
|
↓ open down ↓ |
83 lines elided |
↑ open up ↑ |
84 84 }
85 85
86 86 vdev_ops_t vdev_missing_ops = {
87 87 vdev_missing_open,
88 88 vdev_missing_close,
89 89 vdev_missing_probe,
90 90 vdev_default_asize,
91 91 vdev_missing_io_start,
92 92 vdev_missing_io_done,
93 93 NULL,
94 + NULL,
94 95 VDEV_TYPE_MISSING, /* name of this vdev type */
95 96 B_TRUE /* leaf vdev */
96 97 };
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX