s3 oplocks: Make the level2 oplock contention API more granular
authorTim Prouty <tprouty@samba.org>
Tue, 3 Feb 2009 19:56:35 +0000 (11:56 -0800)
committerTim Prouty <tprouty@samba.org>
Tue, 10 Feb 2009 07:47:45 +0000 (23:47 -0800)
commitc6f1f055fdeee29ad7c5b2ae9909e8f1b1a7daec
tree1fc919526e3c6988ede50457ad72b098d42c1be9
parent9c1310fa6ae1a67dc0fea3bf549d805ff167e78f
s3 oplocks: Make the level2 oplock contention API more granular

This replaces release_level2_oplocks_on_change with
contend_level2_oplock_begin/end in order to contend level2 oplocks
throughout an operation rather than just at the begining.  This is
necessary for some kernel oplock implementations, and also lays the
groundwork for better correctness in Samba's standard level2 oplock
handling.  The next step for non-kernel oplocks is to add additional
state to the share mode lock struct that prevents any new opens from
granting oplocks while a contending operation is in progress.

All operations that contend level 2 oplocks are now correctly spanned
except for aio and synchronous writes.  The two write paths both have
non-trivial error paths that need extra care to get right.

RAW-OPLOCK and the rest of 'make test' are still passing with this
change.
source3/include/proto.h
source3/include/smb.h
source3/lib/dummysmbd.c
source3/locking/brlock.c
source3/smbd/aio.c
source3/smbd/fileio.c
source3/smbd/oplock.c
source3/smbd/oplock_irix.c
source3/smbd/oplock_linux.c
source3/smbd/reply.c
source3/smbd/vfs.c