Author: jpeach Date: 2006-03-19 23:32:50 +0000 (Sun, 19 Mar 2006) New Revision: 14574
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=14574 Log: 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 Modified: branches/SAMBA_3_0/source/smbd/reply.c trunk/source/smbd/reply.c Changeset: Modified: branches/SAMBA_3_0/source/smbd/reply.c =================================================================== --- branches/SAMBA_3_0/source/smbd/reply.c 2006-03-19 20:11:47 UTC (rev 14573) +++ branches/SAMBA_3_0/source/smbd/reply.c 2006-03-19 23:32:50 UTC (rev 14574) @@ -2176,7 +2176,8 @@ * 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 @@ * 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; Modified: trunk/source/smbd/reply.c =================================================================== --- trunk/source/smbd/reply.c 2006-03-19 20:11:47 UTC (rev 14573) +++ trunk/source/smbd/reply.c 2006-03-19 23:32:50 UTC (rev 14574) @@ -2176,7 +2176,8 @@ * 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); @@ -2534,8 +2535,8 @@ * 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;
