summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>1999-04-04 05:46:40 +0000
committerTim Potter <tpot@samba.org>1999-04-04 05:46:40 +0000
commit5bdddf2462f23a8752a547e8adb61944d7899f42 (patch)
treea40c2cd3d8c9d825f3494acef45ee232156d30c8 /source3/smbd
parentd4ba8a3fb31698603cb2da740a0e434dd43eb48e (diff)
downloadsamba-5bdddf2462f23a8752a547e8adb61944d7899f42.tar.gz
samba-5bdddf2462f23a8752a547e8adb61944d7899f42.tar.bz2
samba-5bdddf2462f23a8752a547e8adb61944d7899f42.zip
Use VFS operations for file I/O.
Pass files_struct and connection_struct to read_predict() and do_read_prediction() functions, respectively. (This used to be commit 6479abc5b985981f571cb1ee16a0dbb843fcd270)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/predict.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/source3/smbd/predict.c b/source3/smbd/predict.c
index 5f015139cf..f51e54a568 100644
--- a/source3/smbd/predict.c
+++ b/source3/smbd/predict.c
@@ -42,7 +42,7 @@ extern time_t smb_last_time;
/****************************************************************************
handle read prediction on a file
****************************************************************************/
-ssize_t read_predict(int fd,SMB_OFF_T offset,char *buf,char **ptr,size_t num)
+ssize_t read_predict(files_struct *fsp, int fd,SMB_OFF_T offset,char *buf,char **ptr,size_t num)
{
ssize_t ret = 0;
ssize_t possible = rp_length - (offset - rp_offset);
@@ -70,7 +70,7 @@ ssize_t read_predict(int fd,SMB_OFF_T offset,char *buf,char **ptr,size_t num)
/* Find the end of the file - ensure we don't
read predict beyond it. */
- if(sys_fstat(fd,&rp_stat) < 0)
+ if(fsp->conn->vfs_ops.fstat(fd,&rp_stat) < 0)
{
DEBUG(0,("read-prediction failed on fstat. Error was %s\n", strerror(errno)));
predict_skip = True;
@@ -95,7 +95,7 @@ ssize_t read_predict(int fd,SMB_OFF_T offset,char *buf,char **ptr,size_t num)
/****************************************************************************
pre-read some data
****************************************************************************/
-void do_read_prediction(void)
+void do_read_prediction(connection_struct *conn)
{
static size_t readsize = 0;
@@ -134,13 +134,13 @@ void do_read_prediction(void)
}
}
- if (sys_lseek(rp_fd,rp_offset,SEEK_SET) != rp_offset) {
+ if (conn->vfs_ops.lseek(rp_fd,rp_offset,SEEK_SET) != rp_offset) {
rp_fd = -1;
rp_predict_fd = -1;
return;
}
- rp_length = read(rp_fd,rp_buffer,rp_predict_length);
+ rp_length = conn->vfs_ops.read(rp_fd,rp_buffer,rp_predict_length);
rp_time = time(NULL);
if (rp_length < 0)
rp_length = 0;