libzfs_import.c (168498) | libzfs_import.c (168926) |
---|---|
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 --- 206 unchanged lines hidden (view full) --- 215 /* 216 * If this is a hot spare not currently in use, add it to the list of 217 * names to translate, but don't do anything else. 218 */ 219 if (nvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_STATE, 220 &state) == 0 && state == POOL_STATE_SPARE && 221 nvlist_lookup_uint64(config, ZPOOL_CONFIG_GUID, &vdev_guid) == 0) { 222 if ((ne = zfs_alloc(hdl, sizeof (name_entry_t))) == NULL) | 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 --- 206 unchanged lines hidden (view full) --- 215 /* 216 * If this is a hot spare not currently in use, add it to the list of 217 * names to translate, but don't do anything else. 218 */ 219 if (nvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_STATE, 220 &state) == 0 && state == POOL_STATE_SPARE && 221 nvlist_lookup_uint64(config, ZPOOL_CONFIG_GUID, &vdev_guid) == 0) { 222 if ((ne = zfs_alloc(hdl, sizeof (name_entry_t))) == NULL) |
223 return (-1); | 223 return (-1); |
224 225 if ((ne->ne_name = zfs_strdup(hdl, path)) == NULL) { 226 free(ne); 227 return (-1); 228 } 229 ne->ne_guid = vdev_guid; 230 ne->ne_next = pl->names; 231 pl->names = ne; --- 511 unchanged lines hidden (view full) --- 743 * Given a list of directories to search, find all pools stored on disk. This 744 * includes partial pools which are not available to import. If no args are 745 * given (argc is 0), then the default directory (/dev) is searched. 746 */ 747nvlist_t * 748zpool_find_import(libzfs_handle_t *hdl, int argc, char **argv) 749{ 750 int i; | 224 225 if ((ne->ne_name = zfs_strdup(hdl, path)) == NULL) { 226 free(ne); 227 return (-1); 228 } 229 ne->ne_guid = vdev_guid; 230 ne->ne_next = pl->names; 231 pl->names = ne; --- 511 unchanged lines hidden (view full) --- 743 * Given a list of directories to search, find all pools stored on disk. This 744 * includes partial pools which are not available to import. If no args are 745 * given (argc is 0), then the default directory (/dev) is searched. 746 */ 747nvlist_t * 748zpool_find_import(libzfs_handle_t *hdl, int argc, char **argv) 749{ 750 int i; |
751 DIR *dirp; | |
752 char path[MAXPATHLEN]; 753 nvlist_t *ret = NULL, *config; 754 int fd; 755 pool_list_t pools = { 0 }; 756 pool_entry_t *pe, *penext; 757 vdev_entry_t *ve, *venext; 758 config_entry_t *ce, *cenext; 759 name_entry_t *ne, *nenext; --- 59 unchanged lines hidden (view full) --- 819 820 for (ne = pools.names; ne != NULL; ne = nenext) { 821 nenext = ne->ne_next; 822 if (ne->ne_name) 823 free(ne->ne_name); 824 free(ne); 825 } 826 | 751 char path[MAXPATHLEN]; 752 nvlist_t *ret = NULL, *config; 753 int fd; 754 pool_list_t pools = { 0 }; 755 pool_entry_t *pe, *penext; 756 vdev_entry_t *ve, *venext; 757 config_entry_t *ce, *cenext; 758 name_entry_t *ne, *nenext; --- 59 unchanged lines hidden (view full) --- 818 819 for (ne = pools.names; ne != NULL; ne = nenext) { 820 nenext = ne->ne_next; 821 if (ne->ne_name) 822 free(ne->ne_name); 823 free(ne); 824 } 825 |
827 | |
828 return (ret); 829} 830 831boolean_t 832find_guid(nvlist_t *nv, uint64_t guid) 833{ 834 uint64_t tmp; 835 nvlist_t **child; --- 190 unchanged lines hidden --- | 826 return (ret); 827} 828 829boolean_t 830find_guid(nvlist_t *nv, uint64_t guid) 831{ 832 uint64_t tmp; 833 nvlist_t **child; --- 190 unchanged lines hidden --- |