struct lock_list *ulist = NULL;
struct lock_list *ul = NULL;
- DEBUG(5, ("release_posix_lock_windows_flavour: File %s, offset = %ju, "
- "count = %ju\n", fsp_str_dbg(fsp),
- (uintmax_t)u_offset, (uintmax_t)u_count));
+ DBG_INFO("File %s, offset = %" PRIu64 ", "
+ "count = %" PRIu64 "\n",
+ fsp_str_dbg(fsp),
+ u_offset,
+ u_count);
/* Remember the number of locks we have on this dev/ino pair. */
decrement_lock_ref_count(fsp);
}
if ((ul_ctx = talloc_init("release_posix_lock")) == NULL) {
- DEBUG(0,("release_posix_lock_windows_flavour: unable to init talloc context.\n"));
+ DBG_ERR("unable to init talloc context.\n");
return False;
}
if ((ul = talloc(ul_ctx, struct lock_list)) == NULL) {
- DEBUG(0,("release_posix_lock_windows_flavour: unable to talloc unlock list.\n"));
+ DBG_ERR("unable to talloc unlock list.\n");
talloc_destroy(ul_ctx);
return False;
}
if (deleted_lock_type == WRITE_LOCK &&
(!ulist || ulist->next != NULL || ulist->start != offset || ulist->size != count)) {
- DEBUG(5, ("release_posix_lock_windows_flavour: downgrading "
- "lock to READ: offset = %ju, count = %ju\n",
- (uintmax_t)offset, (uintmax_t)count ));
+ DBG_INFO("downgrading lock to READ: offset = %" PRIu64
+ ", count = %" PRIu64 "\n",
+ offset,
+ count);
if (!posix_fcntl_lock(fsp,F_SETLK,offset,count,F_RDLCK)) {
- DEBUG(0,("release_posix_lock_windows_flavour: downgrade of lock failed with error %s !\n", strerror(errno) ));
+ DBG_ERR("downgrade of lock failed with error %s !\n",
+ strerror(errno));
talloc_destroy(ul_ctx);
return False;
}
offset = ulist->start;
count = ulist->size;
- DEBUG(5, ("release_posix_lock_windows_flavour: Real unlock: "
- "offset = %ju, count = %ju\n",
- (uintmax_t)offset, (uintmax_t)count ));
+ DBG_INFO("Real unlock: offset = %" PRIu64 ", count = %" PRIu64
+ "\n",
+ offset,
+ count);
if (!posix_fcntl_lock(fsp,F_SETLK,offset,count,F_UNLCK)) {
ret = False;
hdr,
in_offset,
in_length);
- DEBUG(10,("smb2_sendfile_send_data: SMB_VFS_SENDFILE returned %d on file %s\n",
- (int)nread,
- fsp_str_dbg(fsp) ));
+ DBG_DEBUG("SMB_VFS_SENDFILE returned %zd on file %s\n",
+ nread,
+ fsp_str_dbg(fsp));
if (nread == -1) {
saved_errno = errno;
nread = fake_sendfile(xconn, fsp, in_offset, in_length);
if (nread == -1) {
saved_errno = errno;
- DEBUG(0,("smb2_sendfile_send_data: fake_sendfile "
- "failed for file %s (%s) for client %s. "
- "Terminating\n",
- fsp_str_dbg(fsp), strerror(saved_errno),
- smbXsrv_connection_dbg(xconn)));
+ DBG_ERR("fake_sendfile failed for file %s "
+ "(%s) for client %s. Terminating\n",
+ fsp_str_dbg(fsp),
+ strerror(saved_errno),
+ smbXsrv_connection_dbg(xconn));
*pstatus = map_nt_error_from_unix_common(saved_errno);
return 0;
}
goto out;
}
- DEBUG(0,("smb2_sendfile_send_data: sendfile failed for file "
- "%s (%s) for client %s. Terminating\n",
- fsp_str_dbg(fsp), strerror(saved_errno),
- smbXsrv_connection_dbg(xconn)));
+ DBG_ERR("sendfile failed for file "
+ "%s (%s) for client %s. Terminating\n",
+ fsp_str_dbg(fsp),
+ strerror(saved_errno),
+ smbXsrv_connection_dbg(xconn));
*pstatus = map_nt_error_from_unix_common(saved_errno);
return 0;
} else if (nread == 0) {
* fallback to the normal read path so the header gets
* the correct byte count.
*/
- DEBUG(3, ("send_file_readX: sendfile sent zero bytes "
- "falling back to the normal read: %s\n",
- fsp_str_dbg(fsp)));
+ DBG_NOTICE("sendfile sent zero bytes "
+ "falling back to the normal read: %s\n",
+ fsp_str_dbg(fsp));
goto normal_read;
}
(const char *)hdr->data, hdr->length);
if (ret != hdr->length) {
saved_errno = errno;
- DEBUG(0,("smb2_sendfile_send_data: write_data failed for file "
- "%s (%s) for client %s. Terminating\n",
- fsp_str_dbg(fsp), strerror(saved_errno),
- smbXsrv_connection_dbg(xconn)));
+ DBG_ERR("write_data failed for file "
+ "%s (%s) for client %s. Terminating\n",
+ fsp_str_dbg(fsp),
+ strerror(saved_errno),
+ smbXsrv_connection_dbg(xconn));
*pstatus = map_nt_error_from_unix_common(saved_errno);
return 0;
}
nread = fake_sendfile(xconn, fsp, in_offset, in_length);
if (nread == -1) {
- saved_errno = errno;
- DEBUG(0,("smb2_sendfile_send_data: fake_sendfile "
- "failed for file %s (%s) for client %s. "
- "Terminating\n",
- fsp_str_dbg(fsp), strerror(saved_errno),
- smbXsrv_connection_dbg(xconn)));
+ DBG_ERR("fake_sendfile failed for file %s (%s) for client %s. "
+ "Terminating\n",
+ fsp_str_dbg(fsp),
+ strerror(saved_errno),
+ smbXsrv_connection_dbg(xconn));
*pstatus = map_nt_error_from_unix_common(saved_errno);
return 0;
}
hdr->length, in_length);
if (ret == -1) {
saved_errno = errno;
- DEBUG(0,("%s: sendfile_short_send "
- "failed for file %s (%s) for client %s. "
- "Terminating\n",
- __func__,
- fsp_str_dbg(fsp), strerror(saved_errno),
- smbXsrv_connection_dbg(xconn)));
+ DBG_ERR("sendfile_short_send "
+ "failed for file %s (%s) for client %s. "
+ "Terminating\n",
+ fsp_str_dbg(fsp),
+ strerror(saved_errno),
+ smbXsrv_connection_dbg(xconn));
*pstatus = map_nt_error_from_unix_common(saved_errno);
return 0;
}
*pea_total_len +=
4 + strlen(dos_ea_name) + 1 + listp->ea.value.length;
- DEBUG(10,("get_ea_list_from_file: total_len = %u, %s, val len "
- "= %u\n", (unsigned int)*pea_total_len, dos_ea_name,
- (unsigned int)listp->ea.value.length));
+ DBG_DEBUG("total_len = %zu, %s, val len = %zu\n",
+ *pea_total_len,
+ dos_ea_name,
+ listp->ea.value.length);
DLIST_ADD_END(ea_list_head, listp);
*pea_total_len += 4;
}
- DEBUG(10, ("get_ea_list_from_file: total_len = %u\n",
- (unsigned int)*pea_total_len));
+ DBG_DEBUG("total_len = %zu\n", *pea_total_len);
*ea_list = ea_list_head;
return NT_STATUS_OK;
}
space_remaining -= pad;
- DEBUG(10,("smbd_marshall_dir_entry: space_remaining = %d\n",
- space_remaining ));
+ DBG_DEBUG("space_remaining = %d\n", space_remaining);
pdata += pad;
p = pdata;
switch (info_level) {
case SMB_FIND_INFO_STANDARD:
- DEBUG(10,("smbd_marshall_dir_entry: SMB_FIND_INFO_STANDARD\n"));
+ DBG_DEBUG("SMB_FIND_INFO_STANDARD\n");
if(requires_resume_key) {
SIVAL(p,0,reskey);
p += 4;
break;
case SMB_FIND_EA_SIZE:
- DEBUG(10,("smbd_marshall_dir_entry: SMB_FIND_EA_SIZE\n"));
+ DBG_DEBUG("SMB_FIND_EA_SIZE\n");
if (requires_resume_key) {
SIVAL(p,0,reskey);
p += 4;
struct ea_list *file_list = NULL;
size_t ea_len = 0;
- DEBUG(10,("smbd_marshall_dir_entry: SMB_FIND_EA_LIST\n"));
+ DBG_DEBUG("SMB_FIND_EA_LIST\n");
if (!name_list) {
return NT_STATUS_INVALID_PARAMETER;
}
}
case SMB_FIND_FILE_BOTH_DIRECTORY_INFO:
- DEBUG(10,("smbd_marshall_dir_entry: SMB_FIND_FILE_BOTH_DIRECTORY_INFO\n"));
+ DBG_DEBUG("SMB_FIND_FILE_BOTH_DIRECTORY_INFO\n");
was_8_3 = mangle_is_8_3(fname, True, conn->params);
p += 4;
SIVAL(p,0,reskey); p += 4;
break;
case SMB_FIND_FILE_DIRECTORY_INFO:
- DEBUG(10,("smbd_marshall_dir_entry: SMB_FIND_FILE_DIRECTORY_INFO\n"));
+ DBG_DEBUG("SMB_FIND_FILE_DIRECTORY_INFO\n");
p += 4;
SIVAL(p,0,reskey); p += 4;
put_long_date_full_timespec(conn->ts_res,p,&create_date_ts); p += 8;
break;
case SMB_FIND_FILE_FULL_DIRECTORY_INFO:
- DEBUG(10,("smbd_marshall_dir_entry: SMB_FIND_FILE_FULL_DIRECTORY_INFO\n"));
+ DBG_DEBUG("SMB_FIND_FILE_FULL_DIRECTORY_INFO\n");
p += 4;
SIVAL(p,0,reskey); p += 4;
put_long_date_full_timespec(conn->ts_res,p,&create_date_ts); p += 8;
break;
case SMB_FIND_FILE_NAMES_INFO:
- DEBUG(10,("smbd_marshall_dir_entry: SMB_FIND_FILE_NAMES_INFO\n"));
+ DBG_DEBUG("SMB_FIND_FILE_NAMES_INFO\n");
p += 4;
SIVAL(p,0,reskey); p += 4;
p += 4;
break;
case SMB_FIND_ID_FULL_DIRECTORY_INFO:
- DEBUG(10,("smbd_marshall_dir_entry: SMB_FIND_ID_FULL_DIRECTORY_INFO\n"));
+ DBG_DEBUG("SMB_FIND_ID_FULL_DIRECTORY_INFO\n");
p += 4;
SIVAL(p,0,reskey); p += 4;
put_long_date_full_timespec(conn->ts_res,p,&create_date_ts); p += 8;
break;
case SMB_FIND_ID_BOTH_DIRECTORY_INFO:
- DEBUG(10,("smbd_marshall_dir_entry: SMB_FIND_ID_BOTH_DIRECTORY_INFO\n"));
+ DBG_DEBUG("SMB_FIND_ID_BOTH_DIRECTORY_INFO\n");
was_8_3 = mangle_is_8_3(fname, True, conn->params);
p += 4;
SIVAL(p,0,reskey); p += 4;
/* Begin of SMB_QUERY_FILE_UNIX_BASIC */
if (info_level == SMB_FIND_FILE_UNIX) {
- DEBUG(10,("smbd_marshall_dir_entry: SMB_FIND_FILE_UNIX\n"));
+ DBG_DEBUG("SMB_FIND_FILE_UNIX\n");
p = store_file_unix_basic(conn, p,
NULL, &smb_fname->st);
status = srvstr_push(base_data, flags2, p,
return status;
}
} else {
- DEBUG(10,("smbd_marshall_dir_entry: SMB_FIND_FILE_UNIX_INFO2\n"));
+ DBG_DEBUG("SMB_FIND_FILE_UNIX_INFO2\n");
p = store_file_unix_basic_info2(conn, p,
NULL, &smb_fname->st);
nameptr = p;