Lines Matching refs:dreq
568 static void __unhash_deferred_req(struct cache_deferred_req *dreq) in __unhash_deferred_req() argument
570 hlist_del_init(&dreq->hash); in __unhash_deferred_req()
571 if (!list_empty(&dreq->recent)) { in __unhash_deferred_req()
572 list_del_init(&dreq->recent); in __unhash_deferred_req()
577 static void __hash_deferred_req(struct cache_deferred_req *dreq, struct cache_head *item) in __hash_deferred_req() argument
581 INIT_LIST_HEAD(&dreq->recent); in __hash_deferred_req()
582 hlist_add_head(&dreq->hash, &cache_defer_hash[hash]); in __hash_deferred_req()
585 static void setup_deferral(struct cache_deferred_req *dreq, in setup_deferral() argument
590 dreq->item = item; in setup_deferral()
594 __hash_deferred_req(dreq, item); in setup_deferral()
598 list_add(&dreq->recent, &cache_defer_list); in setup_deferral()
610 static void cache_restart_thread(struct cache_deferred_req *dreq, int too_many) in cache_restart_thread() argument
613 container_of(dreq, struct thread_deferred_req, handle); in cache_restart_thread()
620 struct cache_deferred_req *dreq = &sleeper.handle; in cache_wait_req() local
623 dreq->revisit = cache_restart_thread; in cache_wait_req()
625 setup_deferral(dreq, item, 0); in cache_wait_req()
679 struct cache_deferred_req *dreq; in cache_defer_req() local
686 dreq = req->defer(req); in cache_defer_req()
687 if (dreq == NULL) in cache_defer_req()
689 setup_deferral(dreq, item, 1); in cache_defer_req()
702 struct cache_deferred_req *dreq; in cache_revisit_request() local
710 hlist_for_each_entry_safe(dreq, tmp, &cache_defer_hash[hash], hash) in cache_revisit_request()
711 if (dreq->item == item) { in cache_revisit_request()
712 __unhash_deferred_req(dreq); in cache_revisit_request()
713 list_add(&dreq->recent, &pending); in cache_revisit_request()
719 dreq = list_entry(pending.next, struct cache_deferred_req, recent); in cache_revisit_request()
720 list_del_init(&dreq->recent); in cache_revisit_request()
721 dreq->revisit(dreq, 0); in cache_revisit_request()
727 struct cache_deferred_req *dreq, *tmp; in cache_clean_deferred() local
734 list_for_each_entry_safe(dreq, tmp, &cache_defer_list, recent) { in cache_clean_deferred()
735 if (dreq->owner == owner) { in cache_clean_deferred()
736 __unhash_deferred_req(dreq); in cache_clean_deferred()
737 list_add(&dreq->recent, &pending); in cache_clean_deferred()
743 dreq = list_entry(pending.next, struct cache_deferred_req, recent); in cache_clean_deferred()
744 list_del_init(&dreq->recent); in cache_clean_deferred()
745 dreq->revisit(dreq, 1); in cache_clean_deferred()