zfeature.c (236884) | zfeature.c (238926) |
---|---|
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 --- 159 unchanged lines hidden (view full) --- 168 169/* 170 * Checks that the features active in the specified object are supported by 171 * this software. Adds each unsupported feature (name -> description) to 172 * the supplied nvlist. 173 */ 174boolean_t 175feature_is_supported(objset_t *os, uint64_t obj, uint64_t desc_obj, | 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 --- 159 unchanged lines hidden (view full) --- 168 169/* 170 * Checks that the features active in the specified object are supported by 171 * this software. Adds each unsupported feature (name -> description) to 172 * the supplied nvlist. 173 */ 174boolean_t 175feature_is_supported(objset_t *os, uint64_t obj, uint64_t desc_obj, |
176 nvlist_t *unsup_feat) | 176 nvlist_t *unsup_feat, nvlist_t *enabled_feat) |
177{ 178 boolean_t supported; 179 zap_cursor_t zc; 180 zap_attribute_t za; 181 182 supported = B_TRUE; 183 for (zap_cursor_init(&zc, os, obj); 184 zap_cursor_retrieve(&zc, &za) == 0; 185 zap_cursor_advance(&zc)) { 186 ASSERT(za.za_integer_length == sizeof (uint64_t) && 187 za.za_num_integers == 1); 188 | 177{ 178 boolean_t supported; 179 zap_cursor_t zc; 180 zap_attribute_t za; 181 182 supported = B_TRUE; 183 for (zap_cursor_init(&zc, os, obj); 184 zap_cursor_retrieve(&zc, &za) == 0; 185 zap_cursor_advance(&zc)) { 186 ASSERT(za.za_integer_length == sizeof (uint64_t) && 187 za.za_num_integers == 1); 188 |
189 if (NULL != enabled_feat) { 190 fnvlist_add_uint64(enabled_feat, za.za_name, 191 za.za_first_integer); 192 } 193 |
|
189 if (za.za_first_integer != 0 && 190 !zfeature_is_supported(za.za_name)) { 191 supported = B_FALSE; 192 | 194 if (za.za_first_integer != 0 && 195 !zfeature_is_supported(za.za_name)) { 196 supported = B_FALSE; 197 |
193 if (unsup_feat != NULL) { | 198 if (NULL != unsup_feat) { |
194 char *desc = ""; 195 char buf[MAXPATHLEN]; 196 197 if (zap_lookup(os, desc_obj, za.za_name, 198 1, sizeof (buf), buf) == 0) 199 desc = buf; 200 201 VERIFY(nvlist_add_string(unsup_feat, za.za_name, --- 213 unchanged lines hidden --- | 199 char *desc = ""; 200 char buf[MAXPATHLEN]; 201 202 if (zap_lookup(os, desc_obj, za.za_name, 203 1, sizeof (buf), buf) == 0) 204 desc = buf; 205 206 VERIFY(nvlist_add_string(unsup_feat, za.za_name, --- 213 unchanged lines hidden --- |