void locking_close_file(struct messaging_context *msg_ctx, files_struct *fsp, enum file_close_type close_type) { struct byte_range_lock *br_lck; if (!lp_locking(fsp->conn->params)) { return; } /* If we have not outstanding locks or pending * locks then we don't need to look in the lock db. */ if (fsp->current_lock_count == 0) { return; } br_lck = brl_get_locks(talloc_tos(),fsp); if (br_lck) { cancel_pending_lock_requests_by_fid(fsp, br_lck, close_type); brl_close_fnum(msg_ctx, br_lck); TALLOC_FREE(br_lck); } }
void locking_close_file(files_struct *fsp) { struct byte_range_lock *br_lck; if (!lp_locking(fsp->conn->params)) { return; } /* If we have not outstanding locks or pending * locks then we don't need to look in the lock db. */ if (fsp->current_lock_count == 0) { return; } br_lck = brl_get_locks(NULL,fsp); if (br_lck) { cancel_pending_lock_requests_by_fid(fsp, br_lck); brl_close_fnum(br_lck); TALLOC_FREE(br_lck); } }