Whamcloud - gitweb
LU-15880 quota: fix issues in reserving quota
[fs/lustre-release.git] / lustre / osd-ldiskfs / osd_handler.c
index 8d45211..ab7facf 100644 (file)
@@ -2541,23 +2541,20 @@ const int osd_dto_credits_noquota[DTO_NR] = {
 /* reserve or free quota for some operation */
 static int osd_reserve_or_free_quota(const struct lu_env *env,
                                     struct dt_device *dev,
-                                    enum quota_type type, __u64 uid,
-                                    __u64 gid, __s64 count, bool is_md)
+                                    struct lquota_id_info *qi)
 {
-       int rc;
        struct osd_device       *osd = osd_dt_dev(dev);
-       struct osd_thread_info  *info = osd_oti_get(env);
-       struct lquota_id_info   *qi = &info->oti_qi;
        struct qsd_instance     *qsd = NULL;
+       int rc;
 
        ENTRY;
 
-       if (is_md)
-               qsd = osd->od_quota_slave_md;
-       else
+       if (qi->lqi_is_blk)
                qsd = osd->od_quota_slave_dt;
+       else
+               qsd = osd->od_quota_slave_md;
 
-       rc = quota_reserve_or_free(env, qsd, qi, type, uid, gid, count, is_md);
+       rc = qsd_reserve_or_free_quota(env, qsd, qi);
        RETURN(rc);
 }