summaryrefslogtreecommitdiff
path: root/source3/modules
diff options
context:
space:
mode:
Diffstat (limited to 'source3/modules')
-rw-r--r--source3/modules/vfs_cacheprime.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/source3/modules/vfs_cacheprime.c b/source3/modules/vfs_cacheprime.c
index 15c8167a07..be934f6bd6 100644
--- a/source3/modules/vfs_cacheprime.c
+++ b/source3/modules/vfs_cacheprime.c
@@ -48,7 +48,6 @@ static void * g_readbuf = NULL;
static bool prime_cache(
struct vfs_handle_struct * handle,
files_struct * fsp,
- int fd,
SMB_OFF_T offset,
size_t count)
{
@@ -75,7 +74,7 @@ static bool prime_cache(
MODULE, (long long)g_readsz, (long long)*last,
fsp->fsp_name));
- nread = sys_pread(fd, g_readbuf, g_readsz, *last);
+ nread = sys_pread(fsp->fh->fd, g_readbuf, g_readsz, *last);
if (nread < 0) {
*last = -1;
return False;
@@ -131,7 +130,7 @@ static ssize_t cprime_sendfile(
size_t count)
{
if (g_readbuf && offset == 0) {
- prime_cache(handle, fromfsp, fromfsp->fh->fd, offset, count);
+ prime_cache(handle, fromfsp, offset, count);
}
return SMB_VFS_NEXT_SENDFILE(handle, tofd, fromfsp,
@@ -148,7 +147,7 @@ static ssize_t cprime_read(
offset = SMB_VFS_LSEEK(fsp, 0, SEEK_CUR);
if (offset >= 0 && g_readbuf) {
- prime_cache(handle, fsp, fsp->fh->fd, offset, count);
+ prime_cache(handle, fsp, offset, count);
SMB_VFS_LSEEK(fsp, offset, SEEK_SET);
}
@@ -163,7 +162,7 @@ static ssize_t cprime_pread(
SMB_OFF_T offset)
{
if (g_readbuf) {
- prime_cache(handle, fsp, fsp->fh->fd, offset, count);
+ prime_cache(handle, fsp, offset, count);
}
return SMB_VFS_NEXT_PREAD(handle, fsp, data, count, offset);