From 1af229a8f822e3595e3282fc3187c2e7d705aac0 Mon Sep 17 00:00:00 2001 From: James Peach Date: Sun, 19 Mar 2006 23:32:50 +0000 Subject: 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) --- source3/smbd/reply.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source3') diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index 83f527d326..ce41266a1c 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -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; -- cgit