Deleted Added
full compact
vdev_raidz.c (219089) vdev_raidz.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

--- 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 (c) 2012 by Delphix. All rights reserved.
24 */
25
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/zio_checksum.h>
31#include <sys/fs/zfs.h>

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

1436
1437 code = vdev_raidz_reconstruct_general(rm, tgts, ntgts);
1438 ASSERT(code < (1 << VDEV_RAIDZ_MAXPARITY));
1439 ASSERT(code > 0);
1440 return (code);
1441}
1442
1443static int
25 */
26
27#include <sys/zfs_context.h>
28#include <sys/spa.h>
29#include <sys/vdev_impl.h>
30#include <sys/zio.h>
31#include <sys/zio_checksum.h>
32#include <sys/fs/zfs.h>

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

1437
1438 code = vdev_raidz_reconstruct_general(rm, tgts, ntgts);
1439 ASSERT(code < (1 << VDEV_RAIDZ_MAXPARITY));
1440 ASSERT(code > 0);
1441 return (code);
1442}
1443
1444static int
1444vdev_raidz_open(vdev_t *vd, uint64_t *asize, uint64_t *ashift)
1445vdev_raidz_open(vdev_t *vd, uint64_t *asize, uint64_t *max_asize,
1446 uint64_t *ashift)
1445{
1446 vdev_t *cvd;
1447 uint64_t nparity = vd->vdev_nparity;
1448 int c;
1449 int lasterror = 0;
1450 int numerrors = 0;
1451
1452 ASSERT(nparity > 0);

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

1464
1465 if (cvd->vdev_open_error != 0) {
1466 lasterror = cvd->vdev_open_error;
1467 numerrors++;
1468 continue;
1469 }
1470
1471 *asize = MIN(*asize - 1, cvd->vdev_asize - 1) + 1;
1447{
1448 vdev_t *cvd;
1449 uint64_t nparity = vd->vdev_nparity;
1450 int c;
1451 int lasterror = 0;
1452 int numerrors = 0;
1453
1454 ASSERT(nparity > 0);

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

1466
1467 if (cvd->vdev_open_error != 0) {
1468 lasterror = cvd->vdev_open_error;
1469 numerrors++;
1470 continue;
1471 }
1472
1473 *asize = MIN(*asize - 1, cvd->vdev_asize - 1) + 1;
1474 *max_asize = MIN(*max_asize - 1, cvd->vdev_max_asize - 1) + 1;
1472 *ashift = MAX(*ashift, cvd->vdev_ashift);
1473 }
1474
1475 *asize *= vd->vdev_children;
1475 *ashift = MAX(*ashift, cvd->vdev_ashift);
1476 }
1477
1478 *asize *= vd->vdev_children;
1479 *max_asize *= vd->vdev_children;
1476
1477 if (numerrors > nparity) {
1478 vd->vdev_stat.vs_aux = VDEV_AUX_NO_REPLICAS;
1479 return (lasterror);
1480 }
1481
1482 return (0);
1483}

--- 663 unchanged lines hidden ---
1480
1481 if (numerrors > nparity) {
1482 vd->vdev_stat.vs_aux = VDEV_AUX_NO_REPLICAS;
1483 return (lasterror);
1484 }
1485
1486 return (0);
1487}

--- 663 unchanged lines hidden ---