Deleted Added
full compact
zfeature.c (238926) zfeature.c (239774)
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

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

216static int
217feature_get_refcount(objset_t *os, uint64_t read_obj, uint64_t write_obj,
218 zfeature_info_t *feature, uint64_t *res)
219{
220 int err;
221 uint64_t refcount;
222 uint64_t zapobj = feature->fi_can_readonly ? write_obj : read_obj;
223
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

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

216static int
217feature_get_refcount(objset_t *os, uint64_t read_obj, uint64_t write_obj,
218 zfeature_info_t *feature, uint64_t *res)
219{
220 int err;
221 uint64_t refcount;
222 uint64_t zapobj = feature->fi_can_readonly ? write_obj : read_obj;
223
224 ASSERT(0 != zapobj);
224 /*
225 * If the pool is currently being created, the feature objects may not
226 * have been allocated yet. Act as though all features are disabled.
227 */
228 if (zapobj == 0)
229 return (ENOTSUP);
225
226 err = zap_lookup(os, zapobj, feature->fi_guid, sizeof (uint64_t), 1,
227 &refcount);
228 if (err != 0) {
229 if (err == ENOENT)
230 return (ENOTSUP);
231 else
232 return (err);

--- 187 unchanged lines hidden ---
230
231 err = zap_lookup(os, zapobj, feature->fi_guid, sizeof (uint64_t), 1,
232 &refcount);
233 if (err != 0) {
234 if (err == ENOENT)
235 return (ENOTSUP);
236 else
237 return (err);

--- 187 unchanged lines hidden ---