diff options
author | Volker Lendecke <vl@samba.org> | 2008-11-04 16:57:31 +0100 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2008-11-04 20:52:07 +0100 |
commit | d5f91d7a083820f6ee701873690d896343e9c534 (patch) | |
tree | 50f3036e4e01a6977a6bebfc1c5b67625a073b6a /source3/smbd | |
parent | 3376e7a6a061c0d681a6a0e5c3aedfc82c36f65f (diff) | |
download | samba-d5f91d7a083820f6ee701873690d896343e9c534.tar.gz samba-d5f91d7a083820f6ee701873690d896343e9c534.tar.bz2 samba-d5f91d7a083820f6ee701873690d896343e9c534.zip |
Simplify logic of cancel_pending_lock_requests_by_fid()
The only caller of this function is locking_close_file(). This checks itself if
brl_lock != NULL. The additional check is not necessary here.
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/blocking.c | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/source3/smbd/blocking.c b/source3/smbd/blocking.c index 6428c3684b..6bb73e1b76 100644 --- a/source3/smbd/blocking.c +++ b/source3/smbd/blocking.c @@ -587,27 +587,25 @@ void cancel_pending_lock_requests_by_fid(files_struct *fsp, struct byte_range_lo 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)); + 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, + 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); - 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; |