NFS: cache_lib: use complete() instead of complete_all()
authorDaniel Wagner <daniel.wagner@bmw-carit.de>
Thu, 22 Sep 2016 11:54:29 +0000 (13:54 +0200)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Fri, 23 Sep 2016 13:40:12 +0000 (09:40 -0400)
There is only one waiter for the completion, therefore there
is no need to use complete_all(). Let's make that clear by
using complete() instead of complete_all().

The generic caching code from sunrpc is calling revisit() only once.

The usage pattern of the completion is:

waiter context                          waker context

do_cache_lookup_wait()
  nfs_cache_defer_req_alloc()
    init_completion()
  do_cache_lookup()
  nfs_cache_wait_for_upcall()
    wait_for_completion_timeout()

nfs_dns_cache_revisit()
  complete()

  nfs_cache_defer_req_put()

Signed-off-by: Daniel Wagner <daniel.wagner@bmw-carit.de>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
fs/nfs/cache_lib.c

index 5f7b053720eed9741250193784f0c33ac378df69..6de15709d02497642eaefc4940f43064d820676a 100644 (file)
@@ -76,7 +76,7 @@ static void nfs_dns_cache_revisit(struct cache_deferred_req *d, int toomany)
 
        dreq = container_of(d, struct nfs_cache_defer_req, deferred_req);
 
-       complete_all(&dreq->completion);
+       complete(&dreq->completion);
        nfs_cache_defer_req_put(dreq);
 }