Whamcloud - gitweb
LU-11130 osd-ldiskfs: create non-empty local agent symlinks
[fs/lustre-release.git] / lustre / quota / lquota_disk.c
index af2e299..c823873 100644 (file)
@@ -21,7 +21,7 @@
  * GPL HEADER END
  */
 /*
- * Copyright (c) 2012, 2015, Intel Corporation.
+ * Copyright (c) 2012, 2017, Intel Corporation.
  * Use is subject to license terms.
  *
  * Author: Johann Lombardi <johann.lombardi@intel.com>
@@ -64,10 +64,10 @@ lquota_disk_find_create(const struct lu_env *env, struct dt_device *dev,
                        const struct dt_index_features *idx_feat,
                        char *name)
 {
-       struct lquota_thread_info       *qti = lquota_info(env);
-       struct dt_object                *obj;
-       struct local_oid_storage        *los;
-       int                              rc;
+       struct lquota_thread_info *qti = lquota_info(env);
+       struct dt_object *obj;
+       struct local_oid_storage *los;
+       int rc;
        ENTRY;
 
        /* Set up local storage */
@@ -406,8 +406,7 @@ struct dt_object *lquota_disk_slv_find_create(const struct lu_env *env,
                        RETURN(ERR_PTR(rc));
 
                /* use predefined fid in the reserved oid list */
-               qti->qti_fid.f_oid = (type == USRQUOTA) ? LQUOTA_USR_OID
-                                                       : LQUOTA_GRP_OID;
+               qti->qti_fid.f_oid = qtype2slv_oid(type);
 
                slv_idx = local_index_find_or_create_with_fid(env, dev,
                                                              &qti->qti_fid,
@@ -661,11 +660,11 @@ int lquota_disk_write(const struct lu_env *env, struct thandle *th,
 
        if (rec != NULL) {
                /* insert record with updated quota settings */
-               rc = dt_insert(env, obj, rec, key, th, 1);
+               rc = dt_insert(env, obj, rec, key, th);
                if (rc) {
                        /* try to insert the old one */
                        rc = dt_insert(env, obj, (struct dt_rec *)&qti->qti_rec,
-                                      key, th, 1);
+                                      key, th);
                        LASSERTF(rc == 0, "failed to insert record in quota "
                                 "index "DFID"\n",
                                 PFID(lu_object_fid(&obj->do_lu)));
@@ -783,7 +782,7 @@ int lquota_disk_write_glb(const struct lu_env *env, struct dt_object *obj,
                rc = 0;
        }
 
-       rc = dt_insert(env, obj, (struct dt_rec *)rec, key, th, 1);
+       rc = dt_insert(env, obj, (struct dt_rec *)rec, key, th);
 out_lock:
        dt_write_unlock(env, obj);
 out: