summaryrefslogtreecommitdiff
path: root/source3/modules/vfs_readahead.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/modules/vfs_readahead.c')
-rw-r--r--source3/modules/vfs_readahead.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/source3/modules/vfs_readahead.c b/source3/modules/vfs_readahead.c
index b3642d558f..df75814b72 100644
--- a/source3/modules/vfs_readahead.c
+++ b/source3/modules/vfs_readahead.c
@@ -35,8 +35,7 @@ struct readahead_data {
static ssize_t readahead_sendfile(struct vfs_handle_struct *handle,
int tofd,
- files_struct *fsp,
- int fromfd,
+ files_struct *fromfsp,
const DATA_BLOB *header,
SMB_OFF_T offset,
size_t count)
@@ -45,16 +44,16 @@ static ssize_t readahead_sendfile(struct vfs_handle_struct *handle,
if ( offset % rhd->off_bound == 0) {
#if defined(HAVE_LINUX_READAHEAD)
- int err = readahead(fromfd, offset, (size_t)rhd->len);
+ int err = readahead(fromfsp->fh->fd, offset, (size_t)rhd->len);
DEBUG(10,("readahead_sendfile: readahead on fd %u, offset %llu, len %u returned %d\n",
- (unsigned int)fromfd,
+ (unsigned int)fromfsp->fh->fd,
(unsigned long long)offset,
(unsigned int)rhd->len,
err ));
#elif defined(HAVE_POSIX_FADVISE)
- int err = posix_fadvise(fromfd, offset, (off_t)rhd->len, POSIX_FADV_WILLNEED);
+ int err = posix_fadvise(fromfsp->fh->fd, offset, (off_t)rhd->len, POSIX_FADV_WILLNEED);
DEBUG(10,("readahead_sendfile: posix_fadvise on fd %u, offset %llu, len %u returned %d\n",
- (unsigned int)fromfd,
+ (unsigned int)fromfsp->fh->fd,
(unsigned long long)offset,
(unsigned int)rhd->len,
err ));
@@ -67,8 +66,7 @@ static ssize_t readahead_sendfile(struct vfs_handle_struct *handle,
}
return SMB_VFS_NEXT_SENDFILE(handle,
tofd,
- fsp,
- fromfd,
+ fromfsp,
header,
offset,
count);