1. 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
  2. 06 May, 2007 2 commits
  3. 03 Feb, 2007 1 commit
  4. 13 Dec, 2006 1 commit
  5. 08 Dec, 2006 1 commit
  6. 20 Oct, 2006 1 commit
  7. 04 Oct, 2006 5 commits
  8. 02 Oct, 2006 1 commit
  9. 03 Aug, 2006 1 commit
  10. 30 Jun, 2006 1 commit
  11. 19 Apr, 2006 1 commit
  12. 21 Mar, 2006 1 commit
  13. 20 Mar, 2006 13 commits
  14. 06 Jan, 2006 5 commits