int mpage_readpages(struct address_space *mapping, struct list_head *pages, unsigned nr_pages, get_block_t get_block); int mpage_readpage(struct page *page, get_block_t get_block); int mpage_writepages(struct address_space *mapping, struct writeback_control *wbc, get_block_t get_block); int mpage_writepage(struct page *page, get_block_t *get_block, struct writeback_control *wbc);
The meaning of the parameters is evident from the preceding sections, the only exception being writeback_control. As discussed in Chapter 17, this is an option for fine control of the writeback operation.
Since the implementations of the four functions share much in common (their goal is always to construct a suitable bio instance for transfer to the block layer), this discussion will be confined to examining just the one specimen — mpage_readpages. The function expects nr_pages page instances as parameters passed in a linked list. mapping is the associated address space, and get_block is, as usual, invoked to find the matching block addresses.
The function iterates in a loop over all page instances:
Continue reading here: Fsmpagec
Was this article helpful?