+ /* declare EA in SA */
+ if (dt_object_exists(&obj->oo_dt)) {
+ LASSERT(obj->oo_sa_hdl);
+ /* XXX: it should be possible to skip spill
+ * declaration if specific EA is part of
+ * bonus and doesn't grow */
+ dmu_tx_hold_spill(tx, obj->oo_dn->dn_object);
+ return;
+ }
+
+ bonuslen = osd_obj_bonuslen(obj);
+
+ /* the object doesn't exist, but we've declared bonus
+ * in osd_declare_object_create() yet */
+ if (obj->oo_ea_in_bonus > bonuslen) {
+ /* spill has been declared already */
+ } else if (obj->oo_ea_in_bonus + vallen > bonuslen) {
+ /* we're about to exceed bonus, let's declare spill */
+ dmu_tx_hold_spill(tx, DMU_NEW_OBJECT);
+ }
+ obj->oo_ea_in_bonus += vallen;