nilfs2: add read ahead mode to nilfs_btnode_submit_block
This adds mode argument to nilfs_btnode_submit_block() function and allows it to issue a read-ahead request. An optional submit_ptr argument is also added to store the actual block address for which bio is sent. submit_ptr is used for a series of read-ahead requests, and helps to decide if each requested block is continous to the previous one on disk. Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
This commit is contained in:
@@ -71,9 +71,10 @@ static int nilfs_btree_get_block(const struct nilfs_bmap *btree, __u64 ptr,
|
||||
{
|
||||
struct address_space *btnc = &NILFS_BMAP_I(btree)->i_btnode_cache;
|
||||
struct buffer_head *bh;
|
||||
sector_t pbn = 0;
|
||||
int err;
|
||||
|
||||
err = nilfs_btnode_submit_block(btnc, ptr, 0, bhp);
|
||||
err = nilfs_btnode_submit_block(btnc, ptr, pbn, READ, bhp, &pbn);
|
||||
if (err)
|
||||
return err == -EEXIST ? 0 : err;
|
||||
|
||||
|
Reference in New Issue
Block a user