1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-27 03:21:53 +03:00

r1311: Turn on sendfile for non-oplocked files. tridge proved

this is the correct thing to do on a train in Germany :-).
Turn on sendfile by default ! It's about time.....
Jeremy.
This commit is contained in:
Jeremy Allison 2004-06-30 23:00:40 +00:00 committed by Gerald (Jerry) Carter
parent 38002bfc1c
commit ec614a8f7d
2 changed files with 11 additions and 9 deletions

View File

@ -536,7 +536,7 @@ static service sDefault = {
False, /* bUseClientDriver */ False, /* bUseClientDriver */
False, /* bDefaultDevmode */ False, /* bDefaultDevmode */
True, /* bNTAclSupport */ True, /* bNTAclSupport */
False, /* bUseSendfile */ True, /* bUseSendfile */
False, /* bProfileAcls */ False, /* bProfileAcls */
False, /* bMap_acl_inherit */ False, /* bMap_acl_inherit */
False, /* bAfs_Share */ False, /* bAfs_Share */

View File

@ -1729,12 +1729,13 @@ void send_file_readbraw(connection_struct *conn, files_struct *fsp, SMB_OFF_T st
#if defined(WITH_SENDFILE) #if defined(WITH_SENDFILE)
/* /*
* We can only use sendfile on a non-chained packet and on a file * We can only use sendfile on a non-chained packet
* that is exclusively oplocked. reply_readbraw has already checked the length. * but we can use on a non-oplocked file. tridge proved this
* on a train in Germany :-). JRA.
* reply_readbraw has already checked the length.
*/ */
if ((nread > 0) && (lp_write_cache_size(SNUM(conn)) == 0) && if ((nread > 0) && (lp_write_cache_size(SNUM(conn)) == 0) && lp_use_sendfile(SNUM(conn)) ) {
EXCLUSIVE_OPLOCK_TYPE(fsp->oplock_type) && lp_use_sendfile(SNUM(conn)) ) {
DATA_BLOB header; DATA_BLOB header;
_smb_setlen(outbuf,nread); _smb_setlen(outbuf,nread);
@ -2067,12 +2068,13 @@ int send_file_readX(connection_struct *conn, char *inbuf,char *outbuf,int length
#if defined(WITH_SENDFILE) #if defined(WITH_SENDFILE)
/* /*
* We can only use sendfile on a non-chained packet and on a file * We can only use sendfile on a non-chained packet
* that is exclusively oplocked. * but we can use on a non-oplocked file. tridge proved this
* on a train in Germany :-). JRA.
*/ */
if ((CVAL(inbuf,smb_vwv0) == 0xFF) && EXCLUSIVE_OPLOCK_TYPE(fsp->oplock_type) && if ((CVAL(inbuf,smb_vwv0) == 0xFF) && lp_use_sendfile(SNUM(conn)) &&
lp_use_sendfile(SNUM(conn)) && (lp_write_cache_size(SNUM(conn)) == 0) ) { (lp_write_cache_size(SNUM(conn)) == 0) ) {
SMB_STRUCT_STAT sbuf; SMB_STRUCT_STAT sbuf;
DATA_BLOB header; DATA_BLOB header;