20
20
*/
21
21
/*
22
22
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
23
- * Copyright (c) 2012, 2015 by Delphix. All rights reserved.
23
+ * Copyright (c) 2012, 2016 by Delphix. All rights reserved.
24
24
* Copyright (c) 2014 Spectra Logic Corporation, All rights reserved.
25
25
*/
26
26
@@ -605,7 +605,8 @@ zap_deref_leaf(zap_t *zap, uint64_t h, dmu_tx_t *tx, krw_t lt, zap_leaf_t **lp)
605
605
}
606
606
607
607
static int
608
- zap_expand_leaf (zap_name_t * zn , zap_leaf_t * l , dmu_tx_t * tx , zap_leaf_t * * lp )
608
+ zap_expand_leaf (zap_name_t * zn , zap_leaf_t * l ,
609
+ void * tag , dmu_tx_t * tx , zap_leaf_t * * lp )
609
610
{
610
611
zap_t * zap = zn -> zn_zap ;
611
612
uint64_t hash = zn -> zn_hash ;
@@ -627,9 +628,9 @@ zap_expand_leaf(zap_name_t *zn, zap_leaf_t *l, dmu_tx_t *tx, zap_leaf_t **lp)
627
628
uint64_t object = zap -> zap_object ;
628
629
629
630
zap_put_leaf (l );
630
- zap_unlockdir (zap );
631
+ zap_unlockdir (zap , tag );
631
632
err = zap_lockdir (os , object , tx , RW_WRITER ,
632
- FALSE, FALSE, & zn -> zn_zap );
633
+ FALSE, FALSE, tag , & zn -> zn_zap );
633
634
zap = zn -> zn_zap ;
634
635
if (err )
635
636
return (err );
@@ -692,7 +693,8 @@ zap_expand_leaf(zap_name_t *zn, zap_leaf_t *l, dmu_tx_t *tx, zap_leaf_t **lp)
692
693
}
693
694
694
695
static void
695
- zap_put_leaf_maybe_grow_ptrtbl (zap_name_t * zn , zap_leaf_t * l , dmu_tx_t * tx )
696
+ zap_put_leaf_maybe_grow_ptrtbl (zap_name_t * zn , zap_leaf_t * l ,
697
+ void * tag , dmu_tx_t * tx )
696
698
{
697
699
zap_t * zap = zn -> zn_zap ;
698
700
int shift = zap_f_phys (zap )-> zap_ptrtbl .zt_shift ;
@@ -712,9 +714,9 @@ zap_put_leaf_maybe_grow_ptrtbl(zap_name_t *zn, zap_leaf_t *l, dmu_tx_t *tx)
712
714
objset_t * os = zap -> zap_objset ;
713
715
uint64_t zapobj = zap -> zap_object ;
714
716
715
- zap_unlockdir (zap );
717
+ zap_unlockdir (zap , tag );
716
718
err = zap_lockdir (os , zapobj , tx ,
717
- RW_WRITER , FALSE, FALSE, & zn -> zn_zap );
719
+ RW_WRITER , FALSE, FALSE, tag , & zn -> zn_zap );
718
720
zap = zn -> zn_zap ;
719
721
if (err )
720
722
return ;
@@ -804,7 +806,7 @@ fzap_lookup(zap_name_t *zn,
804
806
int
805
807
fzap_add_cd (zap_name_t * zn ,
806
808
uint64_t integer_size , uint64_t num_integers ,
807
- const void * val , uint32_t cd , dmu_tx_t * tx )
809
+ const void * val , uint32_t cd , void * tag , dmu_tx_t * tx )
808
810
{
809
811
zap_leaf_t * l ;
810
812
int err ;
@@ -833,34 +835,35 @@ fzap_add_cd(zap_name_t *zn,
833
835
if (err == 0 ) {
834
836
zap_increment_num_entries (zap , 1 , tx );
835
837
} else if (err == EAGAIN ) {
836
- err = zap_expand_leaf (zn , l , tx , & l );
838
+ err = zap_expand_leaf (zn , l , tag , tx , & l );
837
839
zap = zn -> zn_zap ; /* zap_expand_leaf() may change zap */
838
840
if (err == 0 )
839
841
goto retry ;
840
842
}
841
843
842
844
out :
843
845
if (zap != NULL )
844
- zap_put_leaf_maybe_grow_ptrtbl (zn , l , tx );
846
+ zap_put_leaf_maybe_grow_ptrtbl (zn , l , tag , tx );
845
847
return (err );
846
848
}
847
849
848
850
int
849
851
fzap_add (zap_name_t * zn ,
850
852
uint64_t integer_size , uint64_t num_integers ,
851
- const void * val , dmu_tx_t * tx )
853
+ const void * val , void * tag , dmu_tx_t * tx )
852
854
{
853
855
int err = fzap_check (zn , integer_size , num_integers );
854
856
if (err != 0 )
855
857
return (err );
856
858
857
859
return (fzap_add_cd (zn , integer_size , num_integers ,
858
- val , ZAP_NEED_CD , tx ));
860
+ val , ZAP_NEED_CD , tag , tx ));
859
861
}
860
862
861
863
int
862
864
fzap_update (zap_name_t * zn ,
863
- int integer_size , uint64_t num_integers , const void * val , dmu_tx_t * tx )
865
+ int integer_size , uint64_t num_integers , const void * val ,
866
+ void * tag , dmu_tx_t * tx )
864
867
{
865
868
zap_leaf_t * l ;
866
869
int err , create ;
@@ -890,14 +893,14 @@ fzap_update(zap_name_t *zn,
890
893
}
891
894
892
895
if (err == EAGAIN ) {
893
- err = zap_expand_leaf (zn , l , tx , & l );
896
+ err = zap_expand_leaf (zn , l , tag , tx , & l );
894
897
zap = zn -> zn_zap ; /* zap_expand_leaf() may change zap */
895
898
if (err == 0 )
896
899
goto retry ;
897
900
}
898
901
899
902
if (zap != NULL )
900
- zap_put_leaf_maybe_grow_ptrtbl (zn , l , tx );
903
+ zap_put_leaf_maybe_grow_ptrtbl (zn , l , tag , tx );
901
904
return (err );
902
905
}
903
906
0 commit comments