mfs: ditch global readahead
This commit is contained in:
parent
47aad344c3
commit
c83a90e2f1
2 changed files with 1 additions and 43 deletions
|
@ -77,10 +77,6 @@ PUBLIC int main(int argc, char *argv[])
|
||||||
fs_m_out.m_type = TRNS_ADD_ID(fs_m_out.m_type, transid);
|
fs_m_out.m_type = TRNS_ADD_ID(fs_m_out.m_type, transid);
|
||||||
}
|
}
|
||||||
reply(src, &fs_m_out);
|
reply(src, &fs_m_out);
|
||||||
|
|
||||||
if (error == OK)
|
|
||||||
read_ahead(); /* do block read ahead */
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return(OK);
|
return(OK);
|
||||||
|
|
|
@ -20,9 +20,6 @@ FORWARD _PROTOTYPE( int rw_chunk, (struct inode *rip, u64_t position,
|
||||||
|
|
||||||
PRIVATE char getdents_buf[GETDENTS_BUFSIZ];
|
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 *
|
* fs_readwrite *
|
||||||
*===========================================================================*/
|
*===========================================================================*/
|
||||||
|
@ -112,14 +109,6 @@ PUBLIC int fs_readwrite(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check to see if read-ahead is called for, and if so, set it up. */
|
|
||||||
if(rw_flag == READING && rip->i_seek == NO_SEEK &&
|
|
||||||
(unsigned int) position % block_size == 0 &&
|
|
||||||
(regular || mode_word == I_DIRECTORY)) {
|
|
||||||
rdahed_inode = rip;
|
|
||||||
rdahedpos = position;
|
|
||||||
}
|
|
||||||
|
|
||||||
rip->i_seek = NO_SEEK;
|
rip->i_seek = NO_SEEK;
|
||||||
|
|
||||||
if (rdwt_err != OK) r = rdwt_err; /* check for disk error */
|
if (rdwt_err != OK) r = rdwt_err; /* check for disk error */
|
||||||
|
@ -392,33 +381,6 @@ int index; /* index into *bp */
|
||||||
return(zone);
|
return(zone);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*===========================================================================*
|
|
||||||
* read_ahead *
|
|
||||||
*===========================================================================*/
|
|
||||||
PUBLIC void read_ahead()
|
|
||||||
{
|
|
||||||
/* Read a block into the cache before it is needed. */
|
|
||||||
unsigned int block_size;
|
|
||||||
register struct inode *rip;
|
|
||||||
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 */
|
|
||||||
if ( (b = read_map(rip, rdahedpos)) == NO_BLOCK) return; /* at EOF */
|
|
||||||
|
|
||||||
assert(rdahedpos >= 0); /* So we can safely cast it to unsigned below */
|
|
||||||
|
|
||||||
bp = rahead(rip, b, cvul64( (unsigned long) rdahedpos), block_size);
|
|
||||||
put_block(bp, PARTIAL_DATA_BLOCK);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*===========================================================================*
|
/*===========================================================================*
|
||||||
* rahead *
|
* rahead *
|
||||||
*===========================================================================*/
|
*===========================================================================*/
|
||||||
|
|
Loading…
Reference in a new issue