Add VFS ops for Windows BRL: Lock, Unlock and Cancel:
authorZack Kirsch <zack.kirsch@isilon.com>
Tue, 10 Feb 2009 05:51:29 +0000 (21:51 -0800)
committerJeremy Allison <jra@samba.org>
Fri, 13 Feb 2009 18:08:40 +0000 (10:08 -0800)
commit813273c87e4f48d7d8415c8ee9a1a553ed369429
tree2f6140e3f75d987f437ff93a291a4e8e14117d1b
parenteb3d964f20f44deaf2b4f07adba64785875710e0
Add VFS ops for Windows BRL: Lock, Unlock and Cancel:

This patch adds 3 new VFS OPs for Windows byte range locking: BRL_LOCK_WINDOWS,
BRL_UNLOCK_WINDOWS and BRL_CANCEL_WINDOWS. Specifically:

* I renamed brl_lock_windows, brl_unlock_windows and brl_lock_cancel to
  *_default as the default implementations of the VFS ops.
* The blocking_lock_record (BLR) is now passed into the brl_lock_windows and
  brl_cancel_windows paths. The Onefs implementation uses it - future
  implementations may find it useful too.
* Created brl_lock_cancel to do what brl_lock/brl_unlock do: set up a
  lock_struct and call either the Posix or Windows lock function. These happen
  to be the same for the default implementation.
* Added helper functions: increment_current_lock_count() and
  decrement_current_lock_count().
* Minor spelling correction in brl_timeout_fn: brl -> blr.
* Changed blocking_lock_cancel() to return the BLR that it has cancelled. This
  allows us to assert its the lock that we wanted to cancel. If this assert ever
  fires, this path will need to take in the BLR to cancel, rather than choosing
  on its own.
* Adds a small helper function: find_blocking_lock_record_by_id(). Used by the
  OneFS implementation, but could be useful for others.
source3/include/locking.h
source3/include/proto.h
source3/include/vfs.h
source3/include/vfs_macros.h
source3/locking/brlock.c
source3/locking/locking.c
source3/modules/vfs_default.c
source3/modules/vfs_full_audit.c
source3/smbd/blocking.c
source3/smbd/reply.c
source3/smbd/trans2.c