summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2011-12-15 14:35:07 +0100
committerVolker Lendecke <vl@samba.org>2011-12-16 07:34:48 +0100
commit432ea5f5c627b374948d0881d5da2aa9ba700763 (patch)
tree6853c4cbaf32fdf9374da4430e19a3904823d84f /source3
parentb3d8ecaf52851493afa7ff07d8cfd10cd32d99e6 (diff)
downloadsamba-432ea5f5c627b374948d0881d5da2aa9ba700763.tar.gz
samba-432ea5f5c627b374948d0881d5da2aa9ba700763.tar.bz2
samba-432ea5f5c627b374948d0881d5da2aa9ba700763.zip
s3: Slightly simplify delay_for_exclusive_oplocks
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/open.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index fefed85d0c..82a71c7030 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -1172,20 +1172,26 @@ static bool delay_for_exclusive_oplocks(files_struct *fsp,
int oplock_request,
struct share_mode_entry *ex_entry)
{
+ bool delay_it;
+
if ((oplock_request & INTERNAL_OPEN_ONLY) || is_stat_open(fsp->access_mask)) {
return false;
}
+ if (ex_entry == NULL) {
+ return false;
+ }
- if (ex_entry != NULL) {
- /* Found an exclusive or batch oplock */
- bool delay_it = is_delete_request(fsp) ?
- BATCH_OPLOCK_TYPE(ex_entry->op_type) : true;
- if (delay_it) {
- send_break_message(fsp, ex_entry, mid, oplock_request);
- return true;
- }
+ /* Found an exclusive or batch oplock */
+
+ delay_it = is_delete_request(fsp) ?
+ BATCH_OPLOCK_TYPE(ex_entry->op_type) : true;
+
+ if (!delay_it) {
+ return false;
}
- return false;
+
+ send_break_message(fsp, ex_entry, mid, oplock_request);
+ return true;
}
static void grant_fsp_oplock_type(files_struct *fsp,