* GPL HEADER END
*/
/*
- * Copyright (c) 2012, Intel Corporation.
+ * Copyright (c) 2012, 2014, Intel Corporation.
* Use is subject to license terms.
*
* Author: Johann Lombardi <johann@whamcloud.com>
* \param dtrec - is the record to fill with space usage information
* \param dtkey - is the id the of the user or group for which we would
* like to access disk usage.
- * \param capa - is the capability, not used.
*
* \retval +ve - success : exact match
* \retval -ve - failure
static int osd_acct_index_lookup(const struct lu_env *env,
struct dt_object *dtobj,
struct dt_rec *dtrec,
- const struct dt_key *dtkey,
- struct lustre_capa *capa)
+ const struct dt_key *dtkey)
{
struct osd_thread_info *info = osd_oti_get(env);
char *buf = info->oti_buf;
*
* \param dt - osd index object
* \param attr - not used
- * \param capa - BYPASS_CAPA
*/
static struct dt_it *osd_it_acct_init(const struct lu_env *env,
struct dt_object *dt,
- __u32 attr,
- struct lustre_capa *capa)
+ __u32 attr)
{
struct osd_thread_info *info = osd_oti_get(env);
struct osd_it_quota *it;
if (info == NULL)
RETURN(ERR_PTR(-ENOMEM));
- it = &info->oti_it_quota;
+ OBD_ALLOC_PTR(it);
+ if (it == NULL)
+ RETURN(ERR_PTR(-ENOMEM));
+
memset(it, 0, sizeof(*it));
it->oiq_oid = osd_quota_fid2dmu(lu_object_fid(lo));
/* initialize zap cursor */
rc = osd_zap_cursor_init(&it->oiq_zc, osd->od_os, it->oiq_oid, 0);
- if (rc)
+ if (rc != 0) {
+ OBD_FREE_PTR(it);
RETURN(ERR_PTR(rc));
+ }
/* take object reference */
lu_object_get(lo);
*/
static void osd_it_acct_fini(const struct lu_env *env, struct dt_it *di)
{
- struct osd_it_quota *it = (struct osd_it_quota *)di;
+ struct osd_it_quota *it = (struct osd_it_quota *)di;
ENTRY;
+
osd_zap_cursor_fini(it->oiq_zc);
lu_object_put(env, &it->oiq_obj->oo_dt.do_lu);
+ OBD_FREE_PTR(it);
+
EXIT;
}