X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fquota%2Flquota_entry.c;h=49a31acca772faa3cc6f8a12b4df9b41c37bafe6;hb=refs%2Fchanges%2F10%2F13110%2F16;hp=f1d81175066c9c544039d59fd801412660c5747e;hpb=08aa217ce49aba1ded52e0f7adb8a607035123fd;p=fs%2Flustre-release.git diff --git a/lustre/quota/lquota_entry.c b/lustre/quota/lquota_entry.c index f1d8117..49a31ac 100644 --- a/lustre/quota/lquota_entry.c +++ b/lustre/quota/lquota_entry.c @@ -27,10 +27,6 @@ * Author: Niu Yawei */ -#ifndef EXPORT_SYMTAB -# define EXPORT_SYMTAB -#endif - #define DEBUG_SUBSYSTEM S_LQUOTA #include @@ -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, CFS_ALLOC_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 */