#include <minix/vfsif.h>
-EXTERN off_t rdahedpos; /* position to read ahead */
-EXTERN struct inode *rdahed_inode; /* pointer to inode to read ahead */
-
/* The following variables are used for returning results to the caller. */
EXTERN int err_code; /* temporary storage for error number */
EXTERN int rdwt_err; /* status of last disk i/o request */
PRIVATE char getdents_buf[GETDENTS_BUFSIZ];
+PRIVATE off_t rdahedpos; /* position to read ahead */
+PRIVATE struct inode *rdahed_inode; /* pointer to inode to read ahead */
+
/*===========================================================================*
* fs_readwrite *
*===========================================================================*/
nrbytes = (size_t) fs_m_in.REQ_NBYTES;
rdwt_err = OK; /* set to EIO if disk error occurs */
-
+
if (rw_flag == WRITING && !block_spec) {
/* Check in advance to see if file will grow too big. */
if (position > (off_t) (rip->i_sp->s_max_size - nrbytes))
(regular || mode_word == I_DIRECTORY)) {
rdahed_inode = rip;
rdahedpos = position;
- }
+ }
rip->i_seek = NO_SEEK;
struct buf *bp;
block_t b;
+ if(!rdahed_inode)
+ return;
+
rip = rdahed_inode; /* pointer to inode to read ahead from */
block_size = get_block_size(rip->i_dev);
rdahed_inode = NULL; /* turn off read ahead */