summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1997-10-27 13:38:07 +0000
committerAndrew Tridgell <tridge@samba.org>1997-10-27 13:38:07 +0000
commit0f15558efb26b7215540a588dfe8733e9346d407 (patch)
tree441fa3ec1aaf58f7e8a4e184243745ac749110d4
parented71534df56d0296280dbde1859597fb42002088 (diff)
downloadsamba-0f15558efb26b7215540a588dfe8733e9346d407.tar.gz
also disable read prediction in 1.9.18
-rw-r--r--source/include/local.h5
-rw-r--r--source/smbd/predict.c6
-rw-r--r--source/smbd/reply.c2
-rw-r--r--source/smbd/server.c9
4 files changed, 20 insertions, 2 deletions
diff --git a/source/include/local.h b/source/include/local.h
index a218dd8fc67..c1f1de2132b 100644
--- a/source/include/local.h
+++ b/source/include/local.h
@@ -160,4 +160,9 @@
#define OPLOCK_BREAK_TIMEOUT 30
+
+/* the read preciction code has been disabled until some problems with
+ it are worked out */
+#define USE_READ_PREDICTION 0
+
#endif
diff --git a/source/smbd/predict.c b/source/smbd/predict.c
index 7d6b2498f5a..f5f0a2102e3 100644
--- a/source/smbd/predict.c
+++ b/source/smbd/predict.c
@@ -23,6 +23,7 @@
extern int DEBUGLEVEL;
+#if USE_READ_PREDICTION
/* variables used by the read prediction module */
static int rp_fd = -1;
@@ -36,7 +37,7 @@ static int rp_timeout = 5;
static time_t rp_time = 0;
static char *rp_buffer = NULL;
static BOOL predict_skip=False;
-time_t smb_last_time=(time_t)0;
+extern time_t smb_last_time;
/****************************************************************************
handle read prediction on a file
@@ -156,3 +157,6 @@ void invalidate_read_prediction(int fd)
rp_predict_fd = -1;
}
+#else
+ void read_prediction_dummy(void) ;
+#endif
diff --git a/source/smbd/reply.c b/source/smbd/reply.c
index f437ea564de..9e261a1bd5f 100644
--- a/source/smbd/reply.c
+++ b/source/smbd/reply.c
@@ -1722,8 +1722,10 @@ int reply_readbraw(char *inbuf, char *outbuf)
int predict=0;
_smb_setlen(header,nread);
+#if USE_READ_PREDICTION
if (!Files[fnum].can_write)
predict = read_predict(fd,startpos,header+4,NULL,nread);
+#endif
if ((nread-predict) > 0)
seek_file(fnum,startpos + predict);
diff --git a/source/smbd/server.c b/source/smbd/server.c
index 9b428df44ce..88f7497ee53 100644
--- a/source/smbd/server.c
+++ b/source/smbd/server.c
@@ -48,7 +48,7 @@ extern BOOL case_preserve;
extern BOOL use_mangled_map;
extern BOOL short_case_preserve;
extern BOOL case_mangle;
-extern time_t smb_last_time;
+time_t smb_last_time=(time_t)0;
extern int smb_read_error;
@@ -1434,7 +1434,10 @@ void close_file(int fnum, BOOL normal_close)
uint32 inode = fs_p->fd_ptr->inode;
int token;
+#if USE_READ_PREDICTION
invalidate_read_prediction(fs_p->fd_ptr->fd);
+#endif
+
fs_p->open = False;
Connections[cnum].num_files_open--;
if(fs_p->wbmpx_ptr)
@@ -1972,6 +1975,7 @@ int read_file(int fnum,char *data,uint32 pos,int n)
{
int ret=0,readret;
+#if USE_READ_PREDICTION
if (!Files[fnum].can_write)
{
ret = read_predict(Files[fnum].fd_ptr->fd,pos,data,NULL,n);
@@ -1980,6 +1984,7 @@ int read_file(int fnum,char *data,uint32 pos,int n)
n -= ret;
pos += ret;
}
+#endif
#if USE_MMAP
if (Files[fnum].mmap_ptr)
@@ -4782,8 +4787,10 @@ static void process(void)
if (deadtime <= 0)
deadtime = DEFAULT_SMBD_TIMEOUT;
+#if USE_READ_PREDICTION
if (lp_readprediction())
do_read_prediction();
+#endif
errno = 0;