summaryrefslogtreecommitdiff
path: root/source3/smbd/reply.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-06-30 23:00:40 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:52:05 -0500
commita003d0e5d258572aa135ccbbc91882df68c1b51b (patch)
treeaf77dc6df7228aa2b1f7cefff4d939aa365fbf7b /source3/smbd/reply.c
parent57c07e27853442e95e19c7f746ef1f4681bda48a (diff)
downloadsamba-a003d0e5d258572aa135ccbbc91882df68c1b51b.tar.gz
samba-a003d0e5d258572aa135ccbbc91882df68c1b51b.tar.bz2
samba-a003d0e5d258572aa135ccbbc91882df68c1b51b.zip
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 used to be commit ec614a8f7d158b57f5981c1515962aca3c3e6ef4)
Diffstat (limited to 'source3/smbd/reply.c')
-rw-r--r--source3/smbd/reply.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 6c20b97c4e..71efb793af 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -1729,12 +1729,13 @@ void send_file_readbraw(connection_struct *conn, files_struct *fsp, SMB_OFF_T st
#if defined(WITH_SENDFILE)
/*
- * We can only use sendfile on a non-chained packet and on a file
- * that is exclusively oplocked. reply_readbraw has already checked the length.
+ * We can only use sendfile on a non-chained packet
+ * 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) &&
- EXCLUSIVE_OPLOCK_TYPE(fsp->oplock_type) && lp_use_sendfile(SNUM(conn)) ) {
+ if ((nread > 0) && (lp_write_cache_size(SNUM(conn)) == 0) && lp_use_sendfile(SNUM(conn)) ) {
DATA_BLOB header;
_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)
/*
- * We can only use sendfile on a non-chained packet and on a file
- * that is exclusively oplocked.
+ * We can only use sendfile on a non-chained packet
+ * 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) &&
- lp_use_sendfile(SNUM(conn)) && (lp_write_cache_size(SNUM(conn)) == 0) ) {
+ if ((CVAL(inbuf,smb_vwv0) == 0xFF) && lp_use_sendfile(SNUM(conn)) &&
+ (lp_write_cache_size(SNUM(conn)) == 0) ) {
SMB_STRUCT_STAT sbuf;
DATA_BLOB header;