usr/src/uts/common/fs/zfs/dsl_deleg.c
changeset 13700 2889e2596bd6
parent 13524 f0e12b33f77c
child 13743 95aba6e49b9f
equal deleted inserted replaced
13699:733714f4dc24 13700:2889e2596bd6
    18  *
    18  *
    19  * CDDL HEADER END
    19  * CDDL HEADER END
    20  */
    20  */
    21 /*
    21 /*
    22  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
    22  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
    23  * Copyright (c) 2011 by Delphix. All rights reserved.
    23  * Copyright (c) 2012 by Delphix. All rights reserved.
    24  */
    24  */
    25 
    25 
    26 /*
    26 /*
    27  * DSL permissions are stored in a two level zap attribute
    27  * DSL permissions are stored in a two level zap attribute
    28  * mechanism.   The first level identifies the "class" of
    28  * mechanism.   The first level identifies the "class" of
   169 		uint64_t jumpobj;
   169 		uint64_t jumpobj;
   170 
   170 
   171 		VERIFY(nvpair_value_nvlist(whopair, &perms) == 0);
   171 		VERIFY(nvpair_value_nvlist(whopair, &perms) == 0);
   172 
   172 
   173 		if (zap_lookup(mos, zapobj, whokey, 8, 1, &jumpobj) != 0) {
   173 		if (zap_lookup(mos, zapobj, whokey, 8, 1, &jumpobj) != 0) {
   174 			jumpobj = zap_create(mos, DMU_OT_DSL_PERMS,
   174 			jumpobj = zap_create_link(mos, DMU_OT_DSL_PERMS,
   175 			    DMU_OT_NONE, 0, tx);
   175 			    zapobj, whokey, tx);
   176 			VERIFY(zap_update(mos, zapobj,
       
   177 			    whokey, 8, 1, &jumpobj, tx) == 0);
       
   178 		}
   176 		}
   179 
   177 
   180 		while (permpair = nvlist_next_nvpair(perms, permpair)) {
   178 		while (permpair = nvlist_next_nvpair(perms, permpair)) {
   181 			const char *perm = nvpair_name(permpair);
   179 			const char *perm = nvpair_name(permpair);
   182 			uint64_t n = 0;
   180 			uint64_t n = 0;