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; struct process_id pid = procid_self(); if (!lp_locking(SNUM(fsp->conn))) return; /* * Just release all the brl locks, no need to release individually. */ br_lck = brl_get_locks(fsp); if (br_lck) { brl_close_fnum(br_lck, pid); byte_range_lock_destructor(br_lck); } if(lp_posix_locking(SNUM(fsp->conn))) { /* Release all the POSIX locks.*/ posix_locking_close_file(fsp); } }
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); } }