1. 09 5月, 2007 15 次提交
  2. 08 5月, 2007 16 次提交
  3. 07 5月, 2007 9 次提交
    • M
      gfs2: nfs lock support for gfs2 · 586759f0
      Marc Eshel 提交于
      Add NFS lock support to GFS2.
      Signed-off-by: NMarc Eshel <eshel@almaden.ibm.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      Acked-by: NSteven Whitehouse <swhiteho@redhat.com>
      586759f0
    • M
      lockd: add code to handle deferred lock requests · 1a8322b2
      Marc Eshel 提交于
      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: NMarc Eshel <eshel@almaden.ibm.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      1a8322b2
    • M
      lockd: always preallocate block in nlmsvc_lock() · f8120480
      Marc Eshel 提交于
      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: NMarc Eshel <eshel@almaden.ibm.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      f8120480
    • M
      lockd: handle test_lock deferrals · 5ea0d750
      Marc Eshel 提交于
      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: NMarc Eshel <eshel@almaden.ibm.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      5ea0d750
    • M
      lockd: pass cookie in nlmsvc_testlock · 85f3f1b3
      Marc Eshel 提交于
      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: NMarc Eshel <eshel@almaden.ibm.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      85f3f1b3
    • M
      lockd: handle fl_grant callbacks · 0e4ac9d9
      Marc Eshel 提交于
      Add code to handle file system callback when the lock is finally granted.
      Signed-off-by: NMarc Eshel <eshel@almaden.ibm.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      0e4ac9d9
    • M
      lockd: save lock state on deferral · 2b36f412
      Marc Eshel 提交于
      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: NMarc Eshel <eshel@almaden.ibm.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      2b36f412
    • M
      locks: add fl_grant callback for asynchronous lock return · 2beb6614
      Marc Eshel 提交于
      Acquiring a lock on a cluster filesystem may require communication with
      remote hosts, and to avoid blocking lockd or nfsd threads during such
      communication, we allow the results to be returned asynchronously.
      
      When a ->lock() call needs to block, the file system will return
      -EINPROGRESS, and then later return the results with a call to the
      routine in the fl_grant field of the lock_manager_operations struct.
      
      This differs from the case when ->lock returns -EAGAIN to a blocking
      lock request; in that case, the filesystem calls fl_notify when the lock
      is granted, and the caller retries the original lock.  So while
      fl_notify is merely a hint to the caller that it should retry, fl_grant
      actually communicates the final result of the lock operation (with the
      lock already acquired in the succesful case).
      
      Therefore fl_grant takes a lock, a status and, for the test lock case, a
      conflicting lock.  We also allow fl_grant to return an error to the
      filesystem, to handle the case where the fl_grant requests arrives after
      the lock manager has already given up waiting for it.
      Signed-off-by: NMarc Eshel <eshel@almaden.ibm.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      2beb6614
    • M
      nfsd4: Convert NFSv4 to new lock interface · fd85b817
      Marc Eshel 提交于
      Convert NFSv4 to the new lock interface.  We don't define any callback for now,
      so we're not taking advantage of the asynchronous feature--that's less critical
      for the multi-threaded nfsd then it is for the single-threaded lockd.  But this
      does allow a cluster filesystems to export cluster-coherent locking to NFS.
      
      Note that it's cluster filesystems that are the issue--of the filesystems that
      define lock methods (nfs, cifs, etc.), most are not exportable by nfsd.
      Signed-off-by: NMarc Eshel <eshel@almaden.ibm.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      fd85b817