diff options
author | Volker Lendecke <vl@samba.org> | 2008-11-04 14:29:33 +0100 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2008-11-04 20:52:07 +0100 |
commit | eddb43c7137409bb551834511711362c45633508 (patch) | |
tree | e5adb34e5286901a286dc8165645db4019ea7235 /source3/smbd | |
parent | f0ba601c26d750f52368dc6133f26e3427732d83 (diff) | |
download | samba-eddb43c7137409bb551834511711362c45633508.tar.gz samba-eddb43c7137409bb551834511711362c45633508.tar.bz2 samba-eddb43c7137409bb551834511711362c45633508.zip |
Slightly simplify logic in cancel_pending_lock_requests_by_fid()
Use a "continue" for (blr->fsp->fnum != fsp->fnum)
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/blocking.c | 44 |
1 files changed, 24 insertions, 20 deletions
diff --git a/source3/smbd/blocking.c b/source3/smbd/blocking.c index 02091d18ef..f3649159c9 100644 --- a/source3/smbd/blocking.c +++ b/source3/smbd/blocking.c @@ -575,37 +575,41 @@ void cancel_pending_lock_requests_by_fid(files_struct *fsp, struct byte_range_lo blocking_lock_record *blr, *next = NULL; for(blr = blocking_lock_queue; blr; blr = next) { + unsigned char locktype = 0; + next = blr->next; - if(blr->fsp->fnum == fsp->fnum) { - unsigned char locktype = 0; + if (blr->fsp->fnum != fsp->fnum) { + continue; + } - if (blr->com_type == SMBlockingX) { - locktype = CVAL(blr->inbuf,smb_vwv3); - } + if (blr->com_type == SMBlockingX) { + locktype = CVAL(blr->inbuf,smb_vwv3); + } - if (br_lck) { - DEBUG(10,("remove_pending_lock_requests_by_fid - removing request type %d for \ -file %s fnum = %d\n", blr->com_type, fsp->fsp_name, fsp->fnum )); + if (br_lck) { + DEBUG(10, ("remove_pending_lock_requests_by_fid - " + "removing request type %d for file %s fnum " + "= %d\n", blr->com_type, fsp->fsp_name, + fsp->fnum)); - brl_lock_cancel(br_lck, + brl_lock_cancel(br_lck, blr->lock_pid, procid_self(), blr->offset, blr->count, blr->lock_flav); - blocking_lock_cancel(fsp, - blr->lock_pid, - blr->offset, - blr->count, - blr->lock_flav, - locktype, - NT_STATUS_RANGE_NOT_LOCKED); - } - /* We're closing the file fsp here, so ensure - * we don't have a dangling pointer. */ - blr->fsp = NULL; + blocking_lock_cancel(fsp, + blr->lock_pid, + blr->offset, + blr->count, + blr->lock_flav, + locktype, + NT_STATUS_RANGE_NOT_LOCKED); } + /* We're closing the file fsp here, so ensure + * we don't have a dangling pointer. */ + blr->fsp = NULL; } } |