Deleted Added
full compact
metaslab.c (243503) metaslab.c (246675)
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 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
23 * Copyright (c) 2012 by Delphix. 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 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
23 * Copyright (c) 2012 by Delphix. All rights reserved.
24 * Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
24 */
25
26#include <sys/zfs_context.h>
27#include <sys/dmu.h>
28#include <sys/dmu_tx.h>
29#include <sys/space_map.h>
30#include <sys/metaslab_impl.h>
31#include <sys/vdev_impl.h>

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

92int metaslab_prefetch_limit = SPA_DVAS_PER_BP;
93
94/*
95 * Percentage bonus multiplier for metaslabs that are in the bonus area.
96 */
97int metaslab_smo_bonus_pct = 150;
98
99/*
25 */
26
27#include <sys/zfs_context.h>
28#include <sys/dmu.h>
29#include <sys/dmu_tx.h>
30#include <sys/space_map.h>
31#include <sys/metaslab_impl.h>
32#include <sys/vdev_impl.h>

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

93int metaslab_prefetch_limit = SPA_DVAS_PER_BP;
94
95/*
96 * Percentage bonus multiplier for metaslabs that are in the bonus area.
97 */
98int metaslab_smo_bonus_pct = 150;
99
100/*
101 * Should we be willing to write data to degraded vdevs?
102 */
103boolean_t zfs_write_to_degraded = B_FALSE;
104SYSCTL_INT(_vfs_zfs, OID_AUTO, write_to_degraded, CTLFLAG_RW,
105 &zfs_write_to_degraded, 0,
106 "Allow writing data to degraded vdevs");
107TUNABLE_INT("vfs.zfs.write_to_degraded", &zfs_write_to_degraded);
108
109/*
100 * ==========================================================================
101 * Metaslab classes
102 * ==========================================================================
103 */
104metaslab_class_t *
105metaslab_class_create(spa_t *spa, space_map_ops_t *ops)
106{
107 metaslab_class_t *mc;

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

1378 } else {
1379 allocatable = vdev_allocatable(vd);
1380 }
1381 if (!allocatable)
1382 goto next;
1383
1384 /*
1385 * Avoid writing single-copy data to a failing vdev
110 * ==========================================================================
111 * Metaslab classes
112 * ==========================================================================
113 */
114metaslab_class_t *
115metaslab_class_create(spa_t *spa, space_map_ops_t *ops)
116{
117 metaslab_class_t *mc;

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

1388 } else {
1389 allocatable = vdev_allocatable(vd);
1390 }
1391 if (!allocatable)
1392 goto next;
1393
1394 /*
1395 * Avoid writing single-copy data to a failing vdev
1396 * unless the user instructs us that it is okay.
1386 */
1387 if ((vd->vdev_stat.vs_write_errors > 0 ||
1388 vd->vdev_state < VDEV_STATE_HEALTHY) &&
1397 */
1398 if ((vd->vdev_stat.vs_write_errors > 0 ||
1399 vd->vdev_state < VDEV_STATE_HEALTHY) &&
1389 d == 0 && dshift == 3) {
1400 d == 0 && dshift == 3 &&
1401 !(zfs_write_to_degraded && vd->vdev_state ==
1402 VDEV_STATE_DEGRADED)) {
1390 all_zero = B_FALSE;
1391 goto next;
1392 }
1393
1394 ASSERT(mg->mg_class == mc);
1395
1396 distance = vd->vdev_asize >> dshift;
1397 if (distance <= (1ULL << vd->vdev_ms_shift))

--- 265 unchanged lines hidden ---
1403 all_zero = B_FALSE;
1404 goto next;
1405 }
1406
1407 ASSERT(mg->mg_class == mc);
1408
1409 distance = vd->vdev_asize >> dshift;
1410 if (distance <= (1ULL << vd->vdev_ms_shift))

--- 265 unchanged lines hidden ---