1. 15 Jul, 2008 1 commit
    • Jeff Layton's avatar
      lockd: eliminate duplicate nlmsvc_lookup_host call from nlmsvc_testlock · 8f920d5e
      Jeff Layton authored
      nlmsvc_testlock calls nlmsvc_lookup_host to find a nlm_host struct. The
      callers of this functions, however, call nlmsvc_retrieve_args or
      nlm4svc_retrieve_args, which also return a nlm_host struct.
      
      Change nlmsvc_testlock to take a host arg instead of calling
      nlmsvc_lookup_host itself and change the callers to pass a pointer to
      the nlm_host they've already found.
      
      We take a reference to host in the place where nlmsvc_testlock()
      previous did a new lookup, so the reference counting is unchanged from
      before.
      Signed-off-by: default avatarJeff Layton <jlayton@redhat.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
      8f920d5e
  2. 30 Apr, 2008 1 commit
  3. 25 Apr, 2008 1 commit
    • J. Bruce Fields's avatar
      locks: don't call ->copy_lock methods on return of conflicting locks · 1a747ee0
      J. Bruce Fields authored
      The file_lock structure is used both as a heavy-weight representation of
      an active lock, with pointers to reference-counted structures, etc., and
      as a simple container for parameters that describe a file lock.
      
      The conflicting lock returned from __posix_lock_file is an example of
      the latter; so don't call the filesystem or lock manager callbacks when
      copying to it.  This also saves the need for an unnecessary
      locks_init_lock in the nfsv4 server.
      
      Thanks to Trond for pointing out the error.
      Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
      Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
      1a747ee0
  4. 23 Apr, 2008 2 commits
    • J. Bruce Fields's avatar
      lockd: Fix stale nlmsvc_unlink_block comment · 3c61eecb
      J. Bruce Fields authored
      As of 5996a298 ("NLM: don't unlock on
      cancel requests") we no longer unlock in this case, so the comment is no
      longer accurate.
      
      Thanks to Stuart Friedberg for pointing out the inconsistency.
      
      Cc: Stuart Friedberg <sfriedberg@hp.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
      3c61eecb
    • Jeff Layton's avatar
      NLM: Convert lockd to use kthreads · d751a7cd
      Jeff Layton authored
      Have lockd_up start lockd using kthread_run. With this change,
      lockd_down now blocks until lockd actually exits, so there's no longer
      need for the waitqueue code at the end of lockd_down. This also means
      that only one lockd can be running at a time which simplifies the code
      within lockd's main loop.
      
      This also adds a check for kthread_should_stop in the main loop of
      nlmsvc_retry_blocked and after that function returns. There's no sense
      continuing to retry blocks if lockd is coming down anyway.
      Signed-off-by: default avatarJeff Layton <jlayton@redhat.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
      d751a7cd
  5. 10 Feb, 2008 2 commits
  6. 01 Feb, 2008 2 commits
  7. 09 Oct, 2007 1 commit
  8. 26 Sep, 2007 1 commit
  9. 26 Jul, 2007 1 commit
  10. 07 May, 2007 6 commits
    • Marc Eshel's avatar
      lockd: add code to handle deferred lock requests · 1a8322b2
      Marc Eshel authored
      Rewrite nlmsvc_lock() to use the asynchronous interface.
      
      As with testlock, we answer nlm requests in nlmsvc_lock by first looking up
      the block and then using the results we find in the block if B_QUEUED is
      set, and calling vfs_lock_file() otherwise.
      
      If this a new lock request and we get -EINPROGRESS return on a non-blocking
      request then we defer the request.
      
      Also modify nlmsvc_unlock() to call the filesystem method if appropriate.
      Signed-off-by: default avatarMarc Eshel <eshel@almaden.ibm.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
      1a8322b2
    • Marc Eshel's avatar
      lockd: always preallocate block in nlmsvc_lock() · f8120480
      Marc Eshel authored
      Normally we could skip ever having to allocate a block in the case where
      the client asks for a non-blocking lock, or asks for a blocking lock that
      succeeds immediately.
      
      However we're going to want to always look up a block first in order to
      check whether we're revisiting a deferred lock call, and to be prepared to
      handle the case where the filesystem returns -EINPROGRESS--in that case we
      want to make sure the lock we've given the filesystem is the one embedded
      in the block that we'll use to track the deferred request.
      Signed-off-by: default avatarMarc Eshel <eshel@almaden.ibm.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
      f8120480
    • Marc Eshel's avatar
      lockd: handle test_lock deferrals · 5ea0d750
      Marc Eshel authored
      Rewrite nlmsvc_testlock() to use the new asynchronous interface: instead of
      immediately doing a posix_test_lock(), we first look for a matching block.
      If the subsequent test_lock returns anything other than -EINPROGRESS, we
      then remove the block we've found and return the results.
      
      If it returns -EINPROGRESS, then we defer the lock request.
      
      In the case where the block we find in the first step has B_QUEUED set,
      we bypass the vfs_test_lock entirely, instead using the block to decide how
      to respond:
      	with nlm_lck_denied if B_TIMED_OUT is set.
      	with nlm_granted if B_GOT_CALLBACK is set.
      	by dropping if neither B_TIMED_OUT nor B_GOT_CALLBACK is set
      Signed-off-by: default avatarMarc Eshel <eshel@almaden.ibm.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
      5ea0d750
    • Marc Eshel's avatar
      lockd: pass cookie in nlmsvc_testlock · 85f3f1b3
      Marc Eshel authored
      Change NLM internal interface to pass more information for test lock; we
      need this to make sure the cookie information is pushed down to the place
      where we do request deferral, which is handled for testlock by the
      following patch.
      Signed-off-by: default avatarMarc Eshel <eshel@almaden.ibm.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
      85f3f1b3
    • Marc Eshel's avatar
      lockd: handle fl_grant callbacks · 0e4ac9d9
      Marc Eshel authored
      Add code to handle file system callback when the lock is finally granted.
      Signed-off-by: default avatarMarc Eshel <eshel@almaden.ibm.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
      0e4ac9d9
    • Marc Eshel's avatar
      lockd: save lock state on deferral · 2b36f412
      Marc Eshel authored
      We need to keep some state for a pending asynchronous lock request, so this
      patch adds that state to struct nlm_block.
      
      This also adds a function which defers the request, by calling
      rqstp->rq_chandle.defer and storing the resulting deferred request in a
      nlm_block structure which we insert into lockd's global block list.  That
      new function isn't called yet, so it's dead code until a later patch.
      Signed-off-by: default avatarMarc Eshel <eshel@almaden.ibm.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
      2b36f412
  11. 06 May, 2007 2 commits
  12. 03 Feb, 2007 1 commit
  13. 13 Dec, 2006 1 commit
  14. 08 Dec, 2006 1 commit
  15. 20 Oct, 2006 1 commit
  16. 04 Oct, 2006 5 commits
  17. 02 Oct, 2006 1 commit
  18. 03 Aug, 2006 1 commit
  19. 30 Jun, 2006 1 commit
  20. 19 Apr, 2006 1 commit
  21. 21 Mar, 2006 1 commit
  22. 20 Mar, 2006 6 commits