1. 14 10月, 2016 1 次提交
  2. 05 10月, 2016 2 次提交
  3. 30 9月, 2016 1 次提交
  4. 28 9月, 2016 32 次提交
  5. 23 9月, 2016 4 次提交
    • D
      NFS: cache_lib: use complete() instead of complete_all() · 2a446a5d
      Daniel Wagner 提交于
      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: NDaniel Wagner <daniel.wagner@bmw-carit.de>
      Signed-off-by: NAnna Schumaker <Anna.Schumaker@Netapp.com>
      2a446a5d
    • D
      NFS: direct: use complete() instead of complete_all() · 024de8f1
      Daniel Wagner 提交于
      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().
      
      nfs_file_direct_write() or nfs_file_direct_read() allocated a request
      object via nfs_direct_req_alloc(), which initializes the
      completion. The request object then is freed later in the exit path.
      Between the initialization and the release either
      nfs_direct_write_schedule_iovec() resp
      nfs_direct_read_schedule_iovec() are called which will asynchronously
      process the request. The calling function waits via nfs_direct_wait()
      till the async work has been done. Thus there is only one waiter on
      the completion.
      
      nfs_direct_pgio_init() and nfs_direct_read_completion() are passed via
      function pointers to nfs pageio. The first function does a ref
      counting (get_dreq() and put_dreq()) which ensures that
      nfs_direct_read_completion() and nfs_direct_read_schedule_iovec() only
      call the completion path once.
      
      The usage pattern of the completion is:
      
      waiter context                          waker context
      
      nfs_file_direct_write()
        dreq = nfs_direct_req_alloc()
          init_completion()
        nfs_direct_write_schedule_iovec()
        nfs_direct_wait()
          wait_for_completion_killable()
      
                                              nfs_direct_write_schedule_work()
                                                nfs_direct_complete()
                                                  complete()
      
      nfs_file_direct_read()
        dreq = nfs_direct_req_all()
          init_completion()
        nfs_direct_read_schedule_iovec()
        nfs_direct_wait()
          wait_for_completion_killable()
                                              nfs_direct_read_schedule_iovec()
                                                nfs_direct_complete()
                                                  complete()
      
                                              nfs_direct_read_completion()
                                                nfs_direct_complete()
                                                  complete()
      Signed-off-by: NDaniel Wagner <daniel.wagner@bmw-carit.de>
      Signed-off-by: NAnna Schumaker <Anna.Schumaker@Netapp.com>
      024de8f1
    • T
      NFS: nfs_prime_dcache must validate the filename · 78d04af4
      Trond Myklebust 提交于
      Before we try to stash it in the dcache, we need to at least check
      that the filename passed to us by the server is non-empty and doesn't
      contain any illegal '\0' or '/' characters.
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      Signed-off-by: NAnna Schumaker <Anna.Schumaker@Netapp.com>
      78d04af4
    • J
      nfs: allow blocking locks to be awoken by lock callbacks · a1d617d8
      Jeff Layton 提交于
      Add a waitqueue head to the client structure. Have clients set a wait
      on that queue prior to requesting a lock from the server. If the lock
      is blocked, then we can use that to wait for wakeups.
      
      Note that we do need to do this "manually" since we need to set the
      wait on the waitqueue prior to requesting the lock, but requesting a
      lock can involve activities that can block.
      
      However, only do that for NFSv4.1 locks, either by compiling out
      all of the waitqueue handling when CONFIG_NFS_V4_1 is disabled, or
      skipping all of it at runtime if we're dealing with v4.0, or v4.1
      servers that don't send lock callbacks.
      
      Note too that even when we expect to get a lock callback, RFC5661
      section 20.11.4 is pretty clear that we still need to poll for them,
      so we do still sleep on a timeout. We do however always poll at the
      longest interval in that case.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      [Anna: nfs4_retry_setlk() "status" should default to -ERESTARTSYS]
      Signed-off-by: NAnna Schumaker <Anna.Schumaker@Netapp.com>
      a1d617d8