From c6f1f055fdeee29ad7c5b2ae9909e8f1b1a7daec Mon Sep 17 00:00:00 2001 From: Tim Prouty Date: Tue, 3 Feb 2009 11:56:35 -0800 Subject: 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/smbd/reply.c | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'source3/smbd/reply.c') diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index 60e2e5dc7a..151f9d0827 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -3010,8 +3010,6 @@ void reply_lockread(struct smb_request *req) return; } - release_level_2_oplocks_on_change(fsp); - numtoread = SVAL(req->vwv+1, 0); startpos = IVAL_TO_SMB_OFF_T(req->vwv+2, 0); @@ -4497,8 +4495,6 @@ void reply_lock(struct smb_request *req) return; } - release_level_2_oplocks_on_change(fsp); - count = (uint64_t)IVAL(req->vwv+1, 0); offset = (uint64_t)IVAL(req->vwv+3, 0); @@ -6870,13 +6866,6 @@ void reply_lockingX(struct smb_request *req) } } - /* - * We do this check *after* we have checked this is not a oplock break - * response message. JRA. - */ - - release_level_2_oplocks_on_change(fsp); - if (req->buflen < (num_ulocks + num_locks) * (large_file_format ? 20 : 10)) { reply_nterror(req, NT_STATUS_INVALID_PARAMETER); -- cgit