Based on a conversation with Volker, refactor some of the oplock code to make it...
authorJeremy Allison <jra@samba.org>
Wed, 2 Feb 2011 00:01:57 +0000 (16:01 -0800)
committerJeremy Allison <jra@samba.org>
Wed, 2 Feb 2011 00:52:21 +0000 (01:52 +0100)
commit3d4a9ddc244bd4937af9ff1c6e898ab45a7d28b5
tree2f6c0c79561f9fb6967cd4ac93e92533acc84fca
parenta19c1cbb8d74307e05cba379903c739e7abc0943
Based on a conversation with Volker, refactor some of the oplock code to make it comprehensible.

delay_for_oplocks() did 4 things.

1). Validation of existing oplock types.
2). Check for compatibility with batch oplocks (pass 1).
3). Check for compatibility with exclusive oplocks (pass 2).
4). Set the correct oplock type from the requested value.

Refactor into 4 separate functions:

1). find_oplock_types() - does validation of oplock types and
returns pointers to specific values.
2). delay_for_batch_oplocks() - the pass 1 phase above.
3). delay_for_exclusive_oplocks() - the pass 2 phase above
4). grant_fsp_oplock_type() - Set the correct oplock type from the requested value.

Now separated out this code should be much easier to understand
and modify. This also fixes an erroneous SMB_ASSERT which was
hidden by the previous complexity of the single delay_for_oplocks()
code.

Jeremy.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Feb  2 01:52:21 CET 2011 on sn-devel-104
source3/smbd/open.c