usr/src/uts/common/fs/zfs/dmu_objset.c
changeset 12432 222dd376dd6c
parent 12296 7cf402a7f374
child 12493 89ce40422cea
equal deleted inserted replaced
12431:b81cd0b6b1b9 12432:222dd376dd6c
  1146 		 * the block of the zap obj could be shared between
  1146 		 * the block of the zap obj could be shared between
  1147 		 * datasets but need to be different between them after
  1147 		 * datasets but need to be different between them after
  1148 		 * a bprewrite.
  1148 		 * a bprewrite.
  1149 		 */
  1149 		 */
  1150 
  1150 
  1151 		/*
       
  1152 		 * The mutex is needed here for interlock with dnode_allocate.
       
  1153 		 */
       
  1154 		mutex_enter(&dn->dn_mtx);
  1151 		mutex_enter(&dn->dn_mtx);
  1155 		ASSERT(dn->dn_id_flags);
  1152 		ASSERT(dn->dn_id_flags);
  1156 		if (dn->dn_id_flags & DN_ID_OLD_EXIST)  {
  1153 		if (dn->dn_id_flags & DN_ID_OLD_EXIST)  {
  1157 			do_userquota_update(os, dn->dn_oldused, dn->dn_oldflags,
  1154 			do_userquota_update(os, dn->dn_oldused, dn->dn_oldflags,
  1158 			    dn->dn_olduid, dn->dn_oldgid, B_TRUE, tx);
  1155 			    dn->dn_olduid, dn->dn_oldgid, B_TRUE, tx);
  1172 			if (dn->dn_bonuslen == 0)
  1169 			if (dn->dn_bonuslen == 0)
  1173 				dn->dn_id_flags |= DN_ID_CHKED_SPILL;
  1170 				dn->dn_id_flags |= DN_ID_CHKED_SPILL;
  1174 			else
  1171 			else
  1175 				dn->dn_id_flags |= DN_ID_CHKED_BONUS;
  1172 				dn->dn_id_flags |= DN_ID_CHKED_BONUS;
  1176 		}
  1173 		}
  1177 		dn->dn_id_flags &= ~(DN_ID_NEW_EXIST|DN_ID_SYNC);
  1174 		dn->dn_id_flags &= ~(DN_ID_NEW_EXIST);
  1178 		mutex_exit(&dn->dn_mtx);
  1175 		mutex_exit(&dn->dn_mtx);
  1179 
  1176 
  1180 		list_remove(list, dn);
  1177 		list_remove(list, dn);
  1181 		dnode_rele(dn, list);
  1178 		dnode_rele(dn, list);
  1182 	}
  1179 	}