This patch adds a bit to the fsp structure to tell the network send
path whether this file data can safely be sent using the sendfile(2)
system call.
This is a useful facility for VFS authors, since sometimes a VFS
may need to present a non-file object as a file. In this case,
sendfile should not be used.
BOOL modified;
BOOL is_directory;
BOOL is_stat;
+ BOOL is_sendfile_capable;
BOOL aio_write_behind;
BOOL lockdb_clean;
BOOL initial_delete_on_close; /* Only set at NTCreateX if file was created. */
START_PROFILE(syscall_open);
result = sys_open(fname, flags, mode);
END_PROFILE(syscall_open);
+
+ if (result != -1) {
+ fsp->is_sendfile_capable = lp_use_sendfile(SNUM(handle->conn));
+ }
+
return result;
}
*/
if ( (chain_size == 0) && (nread > 0) &&
- (fsp->wcp == NULL) && lp_use_sendfile(SNUM(conn)) ) {
+ (fsp->wcp == NULL) && (fsp->is_sendfile_capable) ) {
DATA_BLOB header;
_smb_setlen(outbuf,nread);
*/
if ((chain_size == 0) && (CVAL(inbuf,smb_vwv0) == 0xFF) &&
- lp_use_sendfile(SNUM(conn)) && (fsp->wcp == NULL) ) {
+ (fsp->is_sendfile_capable) && (fsp->wcp == NULL) ) {
SMB_STRUCT_STAT sbuf;
DATA_BLOB header;