do_generic_mapping_read — generic file read routine
void do_generic_mapping_read
(struct address_space * mapping, struct file_ra_state * _ra, struct file * filp, loff_t * ppos, read_descriptor_t * desc, read_actor_t actor);
address_space to be read
file's readahead state
the file to read
current file position
read_descriptor
read method
This is a generic file read routine, and uses the mapping->a_ops->readpage function for the actual low-level stuff.
This is really ugly. But the goto's actually try to clarify some of the logic when it comes to error handling etc.
Note the struct file* is only passed for the use of readpage. It may be NULL.