/* ensure we don't overrun the packet size */
maxcount = MIN(65535,maxcount);
- init_strict_lock_struct(fsp, (uint32)req->smbpid,
+ init_strict_lock_struct(fsp, (uint64_t)req->smbpid,
(uint64_t)startpos, (uint64_t)maxcount, READ_LOCK,
&lock);
br_lck = do_lock(smbd_messaging_context(),
fsp,
- req->smbpid,
+ (uint64_t)req->smbpid,
(uint64_t)numtoread,
(uint64_t)startpos,
WRITE_LOCK,
data = smb_buf(req->outbuf) + 3;
- init_strict_lock_struct(fsp, (uint32)req->smbpid,
+ init_strict_lock_struct(fsp, (uint64_t)req->smbpid,
(uint64_t)startpos, (uint64_t)numtoread, READ_LOCK,
&lock);
return;
}
- init_strict_lock_struct(fsp, (uint32)req->smbpid,
+ init_strict_lock_struct(fsp, (uint64_t)req->smbpid,
(uint64_t)startpos, (uint64_t)smb_maxcnt, READ_LOCK,
&lock);
}
if (!fsp->print_file) {
- init_strict_lock_struct(fsp, (uint32)req->smbpid,
+ init_strict_lock_struct(fsp, (uint64_t)req->smbpid,
(uint64_t)startpos, (uint64_t)tcount, WRITE_LOCK,
&lock);
data = (const char *)req->buf + 3;
if (!fsp->print_file && numtowrite > 0) {
- init_strict_lock_struct(fsp, (uint32)req->smbpid,
+ init_strict_lock_struct(fsp, (uint64_t)req->smbpid,
(uint64_t)startpos, (uint64_t)numtowrite, WRITE_LOCK,
&lock);
if (numtowrite && !fsp->print_file) {
status = do_unlock(smbd_messaging_context(),
fsp,
- req->smbpid,
+ (uint64_t)req->smbpid,
(uint64_t)numtowrite,
(uint64_t)startpos,
WINDOWS_LOCK);
data = (const char *)req->buf + 3;
if (!fsp->print_file) {
- init_strict_lock_struct(fsp, (uint32)req->smbpid,
+ init_strict_lock_struct(fsp, (uint64_t)req->smbpid,
(uint64_t)startpos, (uint64_t)numtowrite, WRITE_LOCK,
&lock);
/* NT_STATUS_RETRY - fall through to sync write. */
}
- init_strict_lock_struct(fsp, (uint32)req->smbpid,
+ init_strict_lock_struct(fsp, (uint64_t)req->smbpid,
(uint64_t)startpos, (uint64_t)numtowrite, WRITE_LOCK,
&lock);
data = (const char *)req->buf + 1;
if (!fsp->print_file) {
- init_strict_lock_struct(fsp, (uint32)req->smbpid,
+ init_strict_lock_struct(fsp, (uint64_t)req->smbpid,
(uint64_t)startpos, (uint64_t)numtowrite, WRITE_LOCK,
&lock);
br_lck = do_lock(smbd_messaging_context(),
fsp,
- req->smbpid,
+ (uint64_t)req->smbpid,
count,
offset,
WRITE_LOCK,
status = do_unlock(smbd_messaging_context(),
fsp,
- req->smbpid,
+ (uint64_t)req->smbpid,
count,
offset,
WINDOWS_LOCK);
Get a lock pid, dealing with large count requests.
****************************************************************************/
-uint32 get_lock_pid(const uint8_t *data, int data_offset,
+uint64_t get_lock_pid(const uint8_t *data, int data_offset,
bool large_file_format)
{
if(!large_file_format)
- return (uint32)SVAL(data,SMB_LPID_OFFSET(data_offset));
+ return (uint64_t)SVAL(data,SMB_LPID_OFFSET(data_offset));
else
- return (uint32)SVAL(data,SMB_LARGE_LPID_OFFSET(data_offset));
+ return (uint64_t)SVAL(data,SMB_LARGE_LPID_OFFSET(data_offset));
}
/****************************************************************************
"pid %u, file %s\n",
(double)e->offset,
(double)e->count,
- (unsigned int)e->smbpid,
+ (unsigned int)e->smblctx,
fsp_str_dbg(fsp)));
if (e->brltype != UNLOCK_LOCK) {
status = do_unlock(smbd_messaging_context(),
fsp,
- e->smbpid,
+ e->smblctx,
e->count,
e->offset,
WINDOWS_LOCK);
for(i = 0; i < (int)num_locks; i++) {
struct smbd_lock_element *e = &locks[i];
- DEBUG(10,("smbd_do_locking: lock start=%.0f, len=%.0f for pid "
- "%u, file %s timeout = %d\n",
+ DEBUG(10,("smbd_do_locking: lock start=%.0f, len=%.0f for smblctx "
+ "%llu, file %s timeout = %d\n",
(double)e->offset,
(double)e->count,
- (unsigned int)e->smbpid,
+ (unsigned long long)e->smblctx,
fsp_str_dbg(fsp),
(int)timeout));
return the right error. */
blr = blocking_lock_cancel_smb1(fsp,
- e->smbpid,
+ e->smblctx,
e->offset,
e->count,
WINDOWS_LOCK,
}
/* Remove a matching pending lock. */
status = do_lock_cancel(fsp,
- e->smbpid,
+ e->smblctx,
e->count,
e->offset,
WINDOWS_LOCK,
bool blocking_lock = timeout ? true : false;
bool defer_lock = false;
struct byte_range_lock *br_lck;
- uint32_t block_smbpid;
+ uint64_t block_smblctx;
br_lck = do_lock(smbd_messaging_context(),
fsp,
- e->smbpid,
+ e->smblctx,
e->count,
e->offset,
e->brltype,
WINDOWS_LOCK,
blocking_lock,
&status,
- &block_smbpid,
+ &block_smblctx,
NULL);
if (br_lck && blocking_lock && ERROR_WAS_LOCK_DENIED(status)) {
fsp,
timeout,
i,
- e->smbpid,
+ e->smblctx,
e->brltype,
WINDOWS_LOCK,
e->offset,
e->count,
- block_smbpid)) {
+ block_smblctx)) {
TALLOC_FREE(br_lck);
*async = true;
return NT_STATUS_OK;
do_unlock(smbd_messaging_context(),
fsp,
- e->smbpid,
+ e->smblctx,
e->count,
e->offset,
WINDOWS_LOCK);
/* Data now points at the beginning of the list
of smb_unlkrng structs */
for(i = 0; i < (int)num_ulocks; i++) {
- ulocks[i].smbpid = get_lock_pid(data, i, large_file_format);
+ ulocks[i].smblctx = get_lock_pid(data, i, large_file_format);
ulocks[i].count = get_lock_count(data, i, large_file_format);
ulocks[i].offset = get_lock_offset(data, i, large_file_format, &err);
ulocks[i].brltype = UNLOCK_LOCK;
of smb_lkrng structs */
for(i = 0; i < (int)num_locks; i++) {
- locks[i].smbpid = get_lock_pid(data, i, large_file_format);
+ locks[i].smblctx = get_lock_pid(data, i, large_file_format);
locks[i].count = get_lock_count(data, i, large_file_format);
locks[i].offset = get_lock_offset(data, i, large_file_format, &err);