DO_MPAGE_READPAGE

Section: ()
Updated: 06 October 2005
Index Return to Main Contents

 

NAME

do_mpage_readpage - populate an address space with some pages, and  

SYNOPSIS

"SYNOPSIS"

struct bio * do_mpage_readpage (struct bio * bio, struct page * page, unsigned nr_pages, sector_t * last_block_in_bio, get_block_t get_block);  

ARGUMENTS

bio
-- undescribed --
page
-- undescribed --
nr_pages
The number of pages at *pages
last_block_in_bio
-- undescribed --
get_block
The filesystem's block mapper function.
 

DESCRIPTION

This function walks the pages and the blocks within each page, building and emitting large BIOs.

If anything unusual happens, such as:

- encountering a page which has buffers - encountering a page which has a non-hole after a hole - encountering a page with non-contiguous blocks

then this code just gives up and calls the buffer_head-based read function. It does handle a page which has holes at the end - that is a common case: the end-of-file on blocksize < PAGE_CACHE_SIZE setups.  

DESCRIPTION

This function walks the pages and the blocks within each page, building and emitting large BIOs.

If anything unusual happens, such as:

- encountering a page which has buffers - encountering a page which has a non-hole after a hole - encountering a page with non-contiguous blocks

then this code just gives up and calls the buffer_head-based read function. It does handle a page which has holes at the end - that is a common case: the end-of-file on blocksize < PAGE_CACHE_SIZE setups.  

DESCRIPTION

This function walks the pages and the blocks within each page, building and emitting large BIOs.

If anything unusual happens, such as:

- encountering a page which has buffers - encountering a page which has a non-hole after a hole - encountering a page with non-contiguous blocks

then this code just gives up and calls the buffer_head-based read function. It does handle a page which has holes at the end - that is a common case: the end-of-file on blocksize < PAGE_CACHE_SIZE setups.  

BH_BOUNDARY EXPLANATION

There is a problem. The mpage read code assembles several pages, gets all their disk mappings, and then submits them all. That's fine, but obtaining the disk mappings may require I/O. Reads of indirect blocks, for example.

So an mpage read of the first 16 blocks of an ext2 file will cause I/O to be  

SUBMITTED IN THE FOLLOWING ORDER

12 0 1 2 3 4 5 6 7 8 9 10 11 13 14 15 16 because the indirect block has to be read to get the mappings of blocks 13,14,15,16. Obviously, this impacts performance.

So what we do it to allow the filesystem's get_block function to set BH_Boundary when it maps block 11. BH_Boundary says: mapping of the block after this one will require I/O against a block which is probably close to this one. So you should push what I/O you have currently accumulated.

This all causes the disk requests to be issued in the correct order.


 

Index

NAME
SYNOPSIS
ARGUMENTS
DESCRIPTION
DESCRIPTION
DESCRIPTION
BH_BOUNDARY EXPLANATION
SUBMITTED IN THE FOLLOWING ORDER

This document was created by man2html, using the manual pages.
Time: 04:40:42 GMT, October 06, 2005