Whamcloud - gitweb
LU-6349 ptlrpc: remove old protocol compatibility
[fs/lustre-release.git] / lustre / osd-ldiskfs / osd_quota.c
index 38cf125..174fe37 100644 (file)
@@ -21,7 +21,7 @@
  * GPL HEADER END
  */
 /*
- * Copyright (c) 2012, 2013, Intel Corporation.
+ * Copyright (c) 2012, 2014, Intel Corporation.
  * Use is subject to license terms.
  *
  * Author: Johann Lombardi <johann@whamcloud.com>
@@ -92,7 +92,6 @@ int osd_acct_obj_lookup(struct osd_thread_info *info, struct osd_device *osd,
  * \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
@@ -100,8 +99,7 @@ int osd_acct_obj_lookup(struct osd_thread_info *info, struct osd_device *osd,
 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);
 #ifdef HAVE_DQUOT_FS_DISK_QUOTA
@@ -148,13 +146,11 @@ static int osd_acct_index_lookup(const struct lu_env *env,
  *
  * \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;
        struct lu_object        *lo = &dt->do_lu;
        struct osd_object       *obj = osd_dt_obj(dt);
@@ -163,11 +159,10 @@ static struct dt_it *osd_it_acct_init(const struct lu_env *env,
 
        LASSERT(lu_object_exists(lo));
 
-       if (info == NULL)
+       OBD_ALLOC_PTR(it);
+       if (it == NULL)
                RETURN(ERR_PTR(-ENOMEM));
 
-       it = &info->oti_it_quota;
-       memset(it, 0, sizeof(*it));
        lu_object_get(lo);
        it->oiq_obj = obj;
        INIT_LIST_HEAD(&it->oiq_list);
@@ -198,6 +193,9 @@ static void osd_it_acct_fini(const struct lu_env *env, struct dt_it *di)
                list_del_init(&leaf->oql_link);
                OBD_FREE_PTR(leaf);
        }
+
+       OBD_FREE_PTR(it);
+
        EXIT;
 }
 
@@ -379,8 +377,7 @@ static int osd_it_acct_rec(const struct lu_env *env,
 
        ENTRY;
 
-       rc = osd_acct_index_lookup(env, &it->oiq_obj->oo_dt, dtrec, key,
-                                  BYPASS_CAPA);
+       rc = osd_acct_index_lookup(env, &it->oiq_obj->oo_dt, dtrec, key);
        RETURN(rc > 0 ? 0 : rc);
 }
 
@@ -508,8 +505,7 @@ int osd_declare_qid(const struct lu_env *env, struct osd_thandle *oh,
                    struct lquota_id_info *qi, struct osd_object *obj,
                    bool enforce, int *flags)
 {
-       struct osd_thread_info  *info = osd_oti_get(env);
-       struct osd_device       *dev = info->oti_dev;
+       struct osd_device       *dev = osd_dt_dev(oh->ot_super.th_dev);
        struct qsd_instance     *qsd = dev->od_quota_slave;
        struct inode            *inode = NULL;
        int                      i, rc = 0, crd;
@@ -751,7 +747,7 @@ static int osd_it_admin_next(const struct lu_env *env, struct dt_it *di)
        RETURN(rc);
 }
 
-const struct dt_index_operations osd_admin_index_ops = {
+static const struct dt_index_operations osd_admin_index_ops = {
        .dio_lookup     = osd_acct_index_lookup,
        .dio_it         = {
                .init     = osd_it_acct_init,
@@ -824,7 +820,7 @@ static int convert_quota_file(const struct lu_env *env,
 
        /* iterate the old admin file, insert each record into the
         * new index file. */
-       it = iops->init(env, old, 0, BYPASS_CAPA);
+       it = iops->init(env, old, 0);
        if (IS_ERR(it))
                GOTO(out, rc = PTR_ERR(it));
 
@@ -932,11 +928,11 @@ static int truncate_quota_index(const struct lu_env *env, struct dt_object *dt,
                GOTO(out, rc);
 
        dt_write_lock(env, dt, 0);
-       rc = dt_punch(env, dt, 0, OBD_OBJECT_EOF, th, BYPASS_CAPA);
+       rc = dt_punch(env, dt, 0, OBD_OBJECT_EOF, th);
        if (rc)
                GOTO(out_lock, rc);
 
-       rc = dt_attr_set(env, dt, attr, th, BYPASS_CAPA);
+       rc = dt_attr_set(env, dt, attr, th);
        if (rc)
                GOTO(out_lock, rc);