spa.c (307052) | spa.c (307055) |
---|---|
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 --- 5666 unchanged lines hidden (view full) --- 5675 if (vd == NULL || unspare) { 5676 spa_vdev_remove_aux(spa->spa_spares.sav_config, 5677 ZPOOL_CONFIG_SPARES, spares, nspares, nv); 5678 spa_load_spares(spa); 5679 spa->spa_spares.sav_sync = B_TRUE; 5680 } else { 5681 error = SET_ERROR(EBUSY); 5682 } | 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 --- 5666 unchanged lines hidden (view full) --- 5675 if (vd == NULL || unspare) { 5676 spa_vdev_remove_aux(spa->spa_spares.sav_config, 5677 ZPOOL_CONFIG_SPARES, spares, nspares, nv); 5678 spa_load_spares(spa); 5679 spa->spa_spares.sav_sync = B_TRUE; 5680 } else { 5681 error = SET_ERROR(EBUSY); 5682 } |
5683 spa_event_notify(spa, vd, ESC_ZFS_VDEV_REMOVE_AUX); |
|
5683 } else if (spa->spa_l2cache.sav_vdevs != NULL && 5684 nvlist_lookup_nvlist_array(spa->spa_l2cache.sav_config, 5685 ZPOOL_CONFIG_L2CACHE, &l2cache, &nl2cache) == 0 && 5686 (nv = spa_nvlist_lookup_by_guid(l2cache, nl2cache, guid)) != NULL) { 5687 /* 5688 * Cache devices can always be removed. 5689 */ 5690 spa_vdev_remove_aux(spa->spa_l2cache.sav_config, 5691 ZPOOL_CONFIG_L2CACHE, l2cache, nl2cache, nv); 5692 spa_load_l2cache(spa); 5693 spa->spa_l2cache.sav_sync = B_TRUE; | 5684 } else if (spa->spa_l2cache.sav_vdevs != NULL && 5685 nvlist_lookup_nvlist_array(spa->spa_l2cache.sav_config, 5686 ZPOOL_CONFIG_L2CACHE, &l2cache, &nl2cache) == 0 && 5687 (nv = spa_nvlist_lookup_by_guid(l2cache, nl2cache, guid)) != NULL) { 5688 /* 5689 * Cache devices can always be removed. 5690 */ 5691 spa_vdev_remove_aux(spa->spa_l2cache.sav_config, 5692 ZPOOL_CONFIG_L2CACHE, l2cache, nl2cache, nv); 5693 spa_load_l2cache(spa); 5694 spa->spa_l2cache.sav_sync = B_TRUE; |
5695 spa_event_notify(spa, vd, ESC_ZFS_VDEV_REMOVE_AUX); |
|
5694 } else if (vd != NULL && vd->vdev_islog) { 5695 ASSERT(!locked); 5696 ASSERT(vd == vd->vdev_top); 5697 5698 mg = vd->vdev_mg; 5699 5700 /* 5701 * Stop allocating from this vdev. --- 22 unchanged lines hidden (view full) --- 5724 return (spa_vdev_exit(spa, NULL, txg, error)); 5725 } 5726 5727 /* 5728 * Clean up the vdev namespace. 5729 */ 5730 spa_vdev_remove_from_namespace(spa, vd); 5731 | 5696 } else if (vd != NULL && vd->vdev_islog) { 5697 ASSERT(!locked); 5698 ASSERT(vd == vd->vdev_top); 5699 5700 mg = vd->vdev_mg; 5701 5702 /* 5703 * Stop allocating from this vdev. --- 22 unchanged lines hidden (view full) --- 5726 return (spa_vdev_exit(spa, NULL, txg, error)); 5727 } 5728 5729 /* 5730 * Clean up the vdev namespace. 5731 */ 5732 spa_vdev_remove_from_namespace(spa, vd); 5733 |
5734 spa_event_notify(spa, vd, ESC_ZFS_VDEV_REMOVE_DEV); |
|
5732 } else if (vd != NULL) { 5733 /* 5734 * Normal vdevs cannot be removed (yet). 5735 */ 5736 error = SET_ERROR(ENOTSUP); 5737 } else { 5738 /* 5739 * There is no vdev of any kind with the specified guid. 5740 */ 5741 error = SET_ERROR(ENOENT); 5742 } 5743 5744 if (!locked) | 5735 } else if (vd != NULL) { 5736 /* 5737 * Normal vdevs cannot be removed (yet). 5738 */ 5739 error = SET_ERROR(ENOTSUP); 5740 } else { 5741 /* 5742 * There is no vdev of any kind with the specified guid. 5743 */ 5744 error = SET_ERROR(ENOENT); 5745 } 5746 5747 if (!locked) |
5745 return (spa_vdev_exit(spa, NULL, txg, error)); | 5748 error = spa_vdev_exit(spa, NULL, txg, error); |
5746 5747 return (error); 5748} 5749 5750/* 5751 * Find any device that's done replacing, or a vdev marked 'unspare' that's 5752 * currently spared, so we can detach it. 5753 */ --- 1327 unchanged lines hidden --- | 5749 5750 return (error); 5751} 5752 5753/* 5754 * Find any device that's done replacing, or a vdev marked 'unspare' that's 5755 * currently spared, so we can detach it. 5756 */ --- 1327 unchanged lines hidden --- |