Deleted Added
full compact
vdev.c (277300) vdev.c (284304)
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

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

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
22/*
23 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
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

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

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
22/*
23 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
24 * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
25 * Copyright (c) 2011, 2014 by Delphix. All rights reserved.
24 * Copyright (c) 2011, 2015 by Delphix. All rights reserved.
25 * Copyright 2015 Nexenta Systems, Inc. All rights reserved.
26 * Copyright 2013 Martin Matuska <mm@FreeBSD.org>. All rights reserved.
27 */
28
29#include <sys/zfs_context.h>
30#include <sys/fm/fs/zfs.h>
31#include <sys/spa.h>
32#include <sys/spa_impl.h>
33#include <sys/dmu.h>

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

273}
274
275void
276vdev_add_child(vdev_t *pvd, vdev_t *cvd)
277{
278 size_t oldsize, newsize;
279 uint64_t id = cvd->vdev_id;
280 vdev_t **newchild;
26 * Copyright 2013 Martin Matuska <mm@FreeBSD.org>. All rights reserved.
27 */
28
29#include <sys/zfs_context.h>
30#include <sys/fm/fs/zfs.h>
31#include <sys/spa.h>
32#include <sys/spa_impl.h>
33#include <sys/dmu.h>

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

273}
274
275void
276vdev_add_child(vdev_t *pvd, vdev_t *cvd)
277{
278 size_t oldsize, newsize;
279 uint64_t id = cvd->vdev_id;
280 vdev_t **newchild;
281 spa_t *spa = cvd->vdev_spa;
281
282
282 ASSERT(spa_config_held(cvd->vdev_spa, SCL_ALL, RW_WRITER) == SCL_ALL);
283 ASSERT(spa_config_held(spa, SCL_ALL, RW_WRITER) == SCL_ALL);
283 ASSERT(cvd->vdev_parent == NULL);
284
285 cvd->vdev_parent = pvd;
286
287 if (pvd == NULL)
288 return;
289
290 ASSERT(id >= pvd->vdev_children || pvd->vdev_child[id] == NULL);

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

1393 if (vd->vdev_ops->vdev_op_leaf &&
1394 (error = zio_wait(vdev_probe(vd, NULL))) != 0) {
1395 vdev_set_state(vd, B_TRUE, VDEV_STATE_FAULTED,
1396 VDEV_AUX_ERR_EXCEEDED);
1397 return (error);
1398 }
1399
1400 /*
284 ASSERT(cvd->vdev_parent == NULL);
285
286 cvd->vdev_parent = pvd;
287
288 if (pvd == NULL)
289 return;
290
291 ASSERT(id >= pvd->vdev_children || pvd->vdev_child[id] == NULL);

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

1394 if (vd->vdev_ops->vdev_op_leaf &&
1395 (error = zio_wait(vdev_probe(vd, NULL))) != 0) {
1396 vdev_set_state(vd, B_TRUE, VDEV_STATE_FAULTED,
1397 VDEV_AUX_ERR_EXCEEDED);
1398 return (error);
1399 }
1400
1401 /*
1402 * Track the min and max ashift values for normal data devices.
1403 */
1404 if (vd->vdev_top == vd && vd->vdev_ashift != 0 &&
1405 !vd->vdev_islog && vd->vdev_aux == NULL) {
1406 if (vd->vdev_ashift > spa->spa_max_ashift)
1407 spa->spa_max_ashift = vd->vdev_ashift;
1408 if (vd->vdev_ashift < spa->spa_min_ashift)
1409 spa->spa_min_ashift = vd->vdev_ashift;
1410 }
1411
1412 /*
1401 * If a leaf vdev has a DTL, and seems healthy, then kick off a
1402 * resilver. But don't do this if we are doing a reopen for a scrub,
1403 * since this would just restart the scrub we are already doing.
1404 */
1405 if (vd->vdev_ops->vdev_op_leaf && !spa->spa_scrub_reopen &&
1406 vdev_resilver_needed(vd, NULL, NULL))
1407 spa_async_request(spa, SPA_ASYNC_RESILVER);
1408

--- 2099 unchanged lines hidden ---
1413 * If a leaf vdev has a DTL, and seems healthy, then kick off a
1414 * resilver. But don't do this if we are doing a reopen for a scrub,
1415 * since this would just restart the scrub we are already doing.
1416 */
1417 if (vd->vdev_ops->vdev_op_leaf && !spa->spa_scrub_reopen &&
1418 vdev_resilver_needed(vd, NULL, NULL))
1419 spa_async_request(spa, SPA_ASYNC_RESILVER);
1420

--- 2099 unchanged lines hidden ---