1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-10 12:58:35 +03:00

r14574: Allow use of sendfile as long as the write cache has not been enabled

on the particular file we are performing I/O on, irrespective of whether
the write cache is globally enabled
(This used to be commit 0809e2cb1dfff1cd0e8631b23b415cb2d8a67312)
This commit is contained in:
James Peach 2006-03-19 23:32:50 +00:00 committed by Gerald (Jerry) Carter
parent 49ecd176ee
commit 1af229a8f8

View File

@ -2176,7 +2176,8 @@ void send_file_readbraw(connection_struct *conn, files_struct *fsp, SMB_OFF_T st
* reply_readbraw has already checked the length.
*/
if (chain_size ==0 && (nread > 0) && (lp_write_cache_size(SNUM(conn)) == 0) && lp_use_sendfile(SNUM(conn)) ) {
if ( (chain_size == 0) && (nread > 0) &&
(fsp->wcp == NULL) && lp_use_sendfile(SNUM(conn)) ) {
DATA_BLOB header;
_smb_setlen(outbuf,nread);
@ -2529,8 +2530,8 @@ int send_file_readX(connection_struct *conn, char *inbuf,char *outbuf,int length
* on a train in Germany :-). JRA.
*/
if (chain_size ==0 && (CVAL(inbuf,smb_vwv0) == 0xFF) && lp_use_sendfile(SNUM(conn)) &&
(lp_write_cache_size(SNUM(conn)) == 0) ) {
if ((chain_size == 0) && (CVAL(inbuf,smb_vwv0) == 0xFF) &&
lp_use_sendfile(SNUM(conn)) && (fsp->wcp == NULL) ) {
SMB_STRUCT_STAT sbuf;
DATA_BLOB header;