summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJames Peach <jpeach@samba.org>2006-03-19 23:32:50 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:15:37 -0500
commit1af229a8f822e3595e3282fc3187c2e7d705aac0 (patch)
treee5906ce434681baceb9e04cb4665ecfe6fff0b4f /source3/smbd
parent49ecd176ee4bb2c4acffa0db548c33d6c90dcad7 (diff)
downloadsamba-1af229a8f822e3595e3282fc3187c2e7d705aac0.tar.gz
samba-1af229a8f822e3595e3282fc3187c2e7d705aac0.tar.bz2
samba-1af229a8f822e3595e3282fc3187c2e7d705aac0.zip
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)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/reply.c7
1 files changed, 4 insertions, 3 deletions
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;