* 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>
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 */
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,
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)));
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: