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

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

19 * CDDL HEADER END
20 */
21/*
22 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
24 */
25
26/*
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

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

19 * CDDL HEADER END
20 */
21/*
22 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
24 */
25
26/*
27 * Copyright (c) 2012 by Delphix. All rights reserved.
28 */
29
30/*
27 * The 'missing' vdev is a special vdev type used only during import. It
28 * signifies a placeholder in the root vdev for some vdev that we know is
29 * missing. We pass it down to the kernel to allow the rest of the
30 * configuration to parsed and an attempt made to open all available devices.
31 * Because its GUID is always 0, we know that the guid sum will mismatch and we
32 * won't be able to open the pool anyway.
33 */
34
35#include <sys/zfs_context.h>
36#include <sys/spa.h>
37#include <sys/vdev_impl.h>
38#include <sys/fs/zfs.h>
39#include <sys/zio.h>
40
41/* ARGSUSED */
42static int
31 * The 'missing' vdev is a special vdev type used only during import. It
32 * signifies a placeholder in the root vdev for some vdev that we know is
33 * missing. We pass it down to the kernel to allow the rest of the
34 * configuration to parsed and an attempt made to open all available devices.
35 * Because its GUID is always 0, we know that the guid sum will mismatch and we
36 * won't be able to open the pool anyway.
37 */
38
39#include <sys/zfs_context.h>
40#include <sys/spa.h>
41#include <sys/vdev_impl.h>
42#include <sys/fs/zfs.h>
43#include <sys/zio.h>
44
45/* ARGSUSED */
46static int
43vdev_missing_open(vdev_t *vd, uint64_t *psize, uint64_t *ashift)
47vdev_missing_open(vdev_t *vd, uint64_t *psize, uint64_t *max_psize,
48 uint64_t *ashift)
44{
45 /*
46 * Really this should just fail. But then the root vdev will be in the
47 * faulted state with VDEV_AUX_NO_REPLICAS, when what we really want is
48 * VDEV_AUX_BAD_GUID_SUM. So we pretend to succeed, knowing that we
49 * will fail the GUID sum check before ever trying to open the pool.
50 */
51 *psize = 0;
49{
50 /*
51 * Really this should just fail. But then the root vdev will be in the
52 * faulted state with VDEV_AUX_NO_REPLICAS, when what we really want is
53 * VDEV_AUX_BAD_GUID_SUM. So we pretend to succeed, knowing that we
54 * will fail the GUID sum check before ever trying to open the pool.
55 */
56 *psize = 0;
57 *max_psize = 0;
52 *ashift = 0;
53 return (0);
54}
55
56/* ARGSUSED */
57static void
58vdev_missing_close(vdev_t *vd)
59{

--- 41 unchanged lines hidden ---
58 *ashift = 0;
59 return (0);
60}
61
62/* ARGSUSED */
63static void
64vdev_missing_close(vdev_t *vd)
65{

--- 41 unchanged lines hidden ---