Whamcloud - gitweb
LU-5478 utils: get rid of obd_* typedefs
[fs/lustre-release.git] / lustre / quota / lquota_entry.c
index cff6b6d..49a31ac 100644 (file)
  * Author: Niu    Yawei    <yawei.niu@intel.com>
  */
 
-#ifndef EXPORT_SYMTAB
-# define EXPORT_SYMTAB
-#endif
-
 #define DEBUG_SUBSYSTEM S_LQUOTA
 
 #include <linux/module.h>
@@ -47,40 +43,40 @@ static unsigned lqe64_hash_hash(cfs_hash_t *hs, const void *key, unsigned mask)
        return cfs_hash_u64_hash(*((__u64 *)key), mask);
 }
 
-static void *lqe64_hash_key(cfs_hlist_node_t *hnode)
+static void *lqe64_hash_key(struct hlist_node *hnode)
 {
        struct lquota_entry *lqe;
-       lqe = cfs_hlist_entry(hnode, struct lquota_entry, lqe_hash);
+       lqe = hlist_entry(hnode, struct lquota_entry, lqe_hash);
        return &lqe->lqe_id.qid_uid;
 }
 
-static int lqe64_hash_keycmp(const void *key, cfs_hlist_node_t *hnode)
+static int lqe64_hash_keycmp(const void *key, struct hlist_node *hnode)
 {
        struct lquota_entry *lqe;
-       lqe = cfs_hlist_entry(hnode, struct lquota_entry, lqe_hash);
+       lqe = hlist_entry(hnode, struct lquota_entry, lqe_hash);
        return (lqe->lqe_id.qid_uid == *((__u64*)key));
 }
 
-static void *lqe_hash_object(cfs_hlist_node_t *hnode)
+static void *lqe_hash_object(struct hlist_node *hnode)
 {
-       return cfs_hlist_entry(hnode, struct lquota_entry, lqe_hash);
+       return hlist_entry(hnode, struct lquota_entry, lqe_hash);
 }
 
-static void lqe_hash_get(cfs_hash_t *hs, cfs_hlist_node_t *hnode)
+static void lqe_hash_get(cfs_hash_t *hs, struct hlist_node *hnode)
 {
        struct lquota_entry *lqe;
-       lqe = cfs_hlist_entry(hnode, struct lquota_entry, lqe_hash);
+       lqe = hlist_entry(hnode, struct lquota_entry, lqe_hash);
        lqe_getref(lqe);
 }
 
-static void lqe_hash_put_locked(cfs_hash_t *hs, cfs_hlist_node_t *hnode)
+static void lqe_hash_put_locked(cfs_hash_t *hs, struct hlist_node *hnode)
 {
        struct lquota_entry *lqe;
-       lqe = cfs_hlist_entry(hnode, struct lquota_entry, lqe_hash);
+       lqe = hlist_entry(hnode, struct lquota_entry, lqe_hash);
        lqe_putref(lqe);
 }
 
-static void lqe_hash_exit(cfs_hash_t *hs, cfs_hlist_node_t *hnode)
+static void lqe_hash_exit(cfs_hash_t *hs, struct hlist_node *hnode)
 {
        CERROR("Should not have any item left!\n");
 }
@@ -119,12 +115,12 @@ struct lqe_iter_data {
 };
 
 static int lqe_iter_cb(cfs_hash_t *hs, cfs_hash_bd_t *bd,
-                      cfs_hlist_node_t *hnode, void *data)
+                      struct hlist_node *hnode, void *data)
 {
        struct lqe_iter_data *d = (struct lqe_iter_data *)data;
        struct lquota_entry  *lqe;
 
-       lqe = cfs_hlist_entry(hnode, struct lquota_entry, lqe_hash);
+       lqe = hlist_entry(hnode, struct lquota_entry, lqe_hash);
        LASSERT(atomic_read(&lqe->lqe_ref) > 0);
 
        /* Only one reference held by hash table, and nobody else can
@@ -176,7 +172,7 @@ retry:
                        "freed:%lu, repeat:%u\n", hash,
                        d.lid_inuse, d.lid_freed, repeat);
                repeat++;
-               cfs_schedule_timeout_and_set_state(CFS_TASK_INTERRUPTIBLE,
+               schedule_timeout_and_set_state(TASK_INTERRUPTIBLE,
                                                cfs_time_seconds(1));
                goto retry;
        }
@@ -326,7 +322,7 @@ struct lquota_entry *lqe_locate(const struct lu_env *env,
                RETURN(lqe);
        }
 
-       OBD_SLAB_ALLOC_PTR_GFP(new, lqe_kmem, __GFP_IO);
+       OBD_SLAB_ALLOC_PTR_GFP(new, lqe_kmem, GFP_NOFS);
        if (new == NULL) {
                CERROR("Fail to allocate lqe for id:"LPU64", "
                        "hash:%s\n", qid->qid_uid, site->lqs_hash->hs_name);
@@ -336,7 +332,7 @@ struct lquota_entry *lqe_locate(const struct lu_env *env,
        atomic_set(&new->lqe_ref, 1); /* hold 1 for caller */
        new->lqe_id     = *qid;
        new->lqe_site   = site;
-       CFS_INIT_LIST_HEAD(&new->lqe_link);
+       INIT_LIST_HEAD(&new->lqe_link);
 
        /* quota settings need to be updated from disk, that's why
         * lqe->lqe_uptodate isn't set yet */