summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-11-04 14:33:20 +0100
committerVolker Lendecke <vl@samba.org>2008-11-04 20:52:07 +0100
commit59e237cae55e43b1276ebe644752c8c5d2ab74e4 (patch)
treee10bbfaa41296b741ef92d08eeebce5682b12088 /source3
parenteddb43c7137409bb551834511711362c45633508 (diff)
downloadsamba-59e237cae55e43b1276ebe644752c8c5d2ab74e4.tar.gz
samba-59e237cae55e43b1276ebe644752c8c5d2ab74e4.tar.bz2
samba-59e237cae55e43b1276ebe644752c8c5d2ab74e4.zip
Slightly simplify logic in remove_pending_lock_requests_by_mid()
Use "continue" for (SVAL(blr->inbuf,smb_mid) != mid)
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/blocking.c34
1 files changed, 21 insertions, 13 deletions
diff --git a/source3/smbd/blocking.c b/source3/smbd/blocking.c
index f3649159c9..414ea9fc5c 100644
--- a/source3/smbd/blocking.c
+++ b/source3/smbd/blocking.c
@@ -622,28 +622,36 @@ void remove_pending_lock_requests_by_mid(int mid)
blocking_lock_record *blr, *next = NULL;
for(blr = blocking_lock_queue; blr; blr = next) {
+ files_struct *fsp;
+ struct byte_range_lock *br_lck;
+
next = blr->next;
- if(SVAL(blr->inbuf,smb_mid) == mid) {
- files_struct *fsp = blr->fsp;
- struct byte_range_lock *br_lck = brl_get_locks(talloc_tos(), fsp);
- if (br_lck) {
- DEBUG(10,("remove_pending_lock_requests_by_mid - removing request type %d for \
-file %s fnum = %d\n", blr->com_type, fsp->fsp_name, fsp->fnum ));
+ if (SVAL(blr->inbuf,smb_mid) != mid) {
+ continue;
+ }
- brl_lock_cancel(br_lck,
+ fsp = blr->fsp;
+ br_lck = brl_get_locks(talloc_tos(), fsp);
+
+ if (br_lck) {
+ DEBUG(10, ("remove_pending_lock_requests_by_mid - "
+ "removing request type %d for file %s fnum "
+ "= %d\n", blr->com_type, fsp->fsp_name,
+ fsp->fnum ));
+
+ brl_lock_cancel(br_lck,
blr->lock_pid,
procid_self(),
blr->offset,
blr->count,
blr->lock_flav);
- TALLOC_FREE(br_lck);
- }
-
- blocking_lock_reply_error(blr,NT_STATUS_FILE_LOCK_CONFLICT);
- DLIST_REMOVE(blocking_lock_queue, blr);
- TALLOC_FREE(blr);
+ TALLOC_FREE(br_lck);
}
+
+ blocking_lock_reply_error(blr,NT_STATUS_FILE_LOCK_CONFLICT);
+ DLIST_REMOVE(blocking_lock_queue, blr);
+ TALLOC_FREE(blr);
}
}