X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Ftarget%2Ftgt_lastrcvd.c;h=387223c061c79a1ee5dccd075c050f7964f376c6;hp=b0f200c39dec483fff251542fbbf12192fdbcf58;hb=40daa59ac41f450b60b42eb2bb0ff42ebd3c998b;hpb=a7460d57fed7239d378e239cf837729dbdd2a21b diff --git a/lustre/target/tgt_lastrcvd.c b/lustre/target/tgt_lastrcvd.c index b0f200c..387223c 100644 --- a/lustre/target/tgt_lastrcvd.c +++ b/lustre/target/tgt_lastrcvd.c @@ -872,28 +872,15 @@ static void tgt_cb_last_committed(struct lu_env *env, struct thandle *th, LASSERT(ccb->llcc_tgt != NULL); LASSERT(ccb->llcc_exp->exp_obd == ccb->llcc_tgt->lut_obd); - if (th->th_reserved_quota.qrr_count > 0) { - struct lu_env temp_env; - int rc; - + if (th->th_reserved_quota.lqi_space > 0) { CDEBUG(D_QUOTA, "free quota %llu %llu\n", - th->th_reserved_quota.qrr_id.qid_gid, - th->th_reserved_quota.qrr_count); - - rc = lu_env_init(&temp_env, LCT_DT_THREAD); - if (rc) { - CERROR("%s: can't initialize environment: rc = %d\n", - ccb->llcc_tgt->lut_obd->obd_name, rc); - goto out; - } + th->th_reserved_quota.lqi_id.qid_gid, + th->th_reserved_quota.lqi_space); - dt_reserve_or_free_quota(&temp_env, th->th_dev, - th->th_reserved_quota.qrr_type, - th->th_reserved_quota.qrr_id.qid_uid, - th->th_reserved_quota.qrr_id.qid_gid, - -th->th_reserved_quota.qrr_count, - false); - lu_env_fini(&temp_env); + /* env can be NULL for freeing reserved quota */ + th->th_reserved_quota.lqi_space *= -1; + dt_reserve_or_free_quota(NULL, th->th_dev, + &th->th_reserved_quota); } /* error hit, don't update last committed to provide chance to