usr/src/uts/common/fs/zfs/zap.c
changeset 13700 2889e2596bd6
parent 12450 c77e20e4e046
child 13764 38b4aca480b3
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) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
    22  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
       
    23  * Copyright (c) 2012 by Delphix. All rights reserved.
    23  */
    24  */
    24 
    25 
    25 /*
    26 /*
    26  * This file contains the top half of the zfs directory structure
    27  * This file contains the top half of the zfs directory structure
    27  * implementation. The bottom half is in zap_leaf.c.
    28  * implementation. The bottom half is in zap_leaf.c.
   944 
   945 
   945 /*
   946 /*
   946  * Helper functions for consumers.
   947  * Helper functions for consumers.
   947  */
   948  */
   948 
   949 
       
   950 uint64_t
       
   951 zap_create_link(objset_t *os, dmu_object_type_t ot, uint64_t parent_obj,
       
   952     const char *name, dmu_tx_t *tx)
       
   953 {
       
   954 	uint64_t new_obj;
       
   955 
       
   956 	VERIFY((new_obj = zap_create(os, ot, DMU_OT_NONE, 0, tx)) > 0);
       
   957 	VERIFY(zap_add(os, parent_obj, name, sizeof (uint64_t), 1, &new_obj,
       
   958 	    tx) == 0);
       
   959 
       
   960 	return (new_obj);
       
   961 }
       
   962 
   949 int
   963 int
   950 zap_value_search(objset_t *os, uint64_t zapobj, uint64_t value, uint64_t mask,
   964 zap_value_search(objset_t *os, uint64_t zapobj, uint64_t value, uint64_t mask,
   951     char *name)
   965     char *name)
   952 {
   966 {
   953 	zap_cursor_t zc;
   967 	zap_cursor_t zc;