vdev_mirror.c (219089) | vdev_mirror.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 --- 9 unchanged lines hidden (view full) --- 18 * 19 * CDDL HEADER END 20 */ 21/* 22 * Copyright 2010 Sun Microsystems, Inc. All rights reserved. 23 * Use is subject to license terms. 24 */ 25 | 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 --- 9 unchanged lines hidden (view full) --- 18 * 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 |
|
26#include <sys/zfs_context.h> 27#include <sys/spa.h> 28#include <sys/vdev_impl.h> 29#include <sys/zio.h> 30#include <sys/fs/zfs.h> 31 32/* 33 * Virtual device vector for mirroring. --- 88 unchanged lines hidden (view full) --- 122 } 123 124 zio->io_vsd = mm; 125 zio->io_vsd_ops = &vdev_mirror_vsd_ops; 126 return (mm); 127} 128 129static int | 30#include <sys/zfs_context.h> 31#include <sys/spa.h> 32#include <sys/vdev_impl.h> 33#include <sys/zio.h> 34#include <sys/fs/zfs.h> 35 36/* 37 * Virtual device vector for mirroring. --- 88 unchanged lines hidden (view full) --- 126 } 127 128 zio->io_vsd = mm; 129 zio->io_vsd_ops = &vdev_mirror_vsd_ops; 130 return (mm); 131} 132 133static int |
130vdev_mirror_open(vdev_t *vd, uint64_t *asize, uint64_t *ashift) | 134vdev_mirror_open(vdev_t *vd, uint64_t *asize, uint64_t *max_asize, 135 uint64_t *ashift) |
131{ 132 int numerrors = 0; 133 int lasterror = 0; 134 135 if (vd->vdev_children == 0) { 136 vd->vdev_stat.vs_aux = VDEV_AUX_BAD_LABEL; 137 return (EINVAL); 138 } --- 5 unchanged lines hidden (view full) --- 144 145 if (cvd->vdev_open_error) { 146 lasterror = cvd->vdev_open_error; 147 numerrors++; 148 continue; 149 } 150 151 *asize = MIN(*asize - 1, cvd->vdev_asize - 1) + 1; | 136{ 137 int numerrors = 0; 138 int lasterror = 0; 139 140 if (vd->vdev_children == 0) { 141 vd->vdev_stat.vs_aux = VDEV_AUX_BAD_LABEL; 142 return (EINVAL); 143 } --- 5 unchanged lines hidden (view full) --- 149 150 if (cvd->vdev_open_error) { 151 lasterror = cvd->vdev_open_error; 152 numerrors++; 153 continue; 154 } 155 156 *asize = MIN(*asize - 1, cvd->vdev_asize - 1) + 1; |
157 *max_asize = MIN(*max_asize - 1, cvd->vdev_max_asize - 1) + 1; |
|
152 *ashift = MAX(*ashift, cvd->vdev_ashift); 153 } 154 155 if (numerrors == vd->vdev_children) { 156 vd->vdev_stat.vs_aux = VDEV_AUX_NO_REPLICAS; 157 return (lasterror); 158 } 159 --- 326 unchanged lines hidden --- | 158 *ashift = MAX(*ashift, cvd->vdev_ashift); 159 } 160 161 if (numerrors == vd->vdev_children) { 162 vd->vdev_stat.vs_aux = VDEV_AUX_NO_REPLICAS; 163 return (lasterror); 164 } 165 --- 326 unchanged lines hidden --- |