1 #include "file_pager.h" 2 3 /* Initialise a pager for a file with a unique file identifier and shared page 4 mapper for moderating access to loaded pages. */ 5 6 FilePager::FilePager(fileid_t fileid, PageMapper *mapper) 7 : Pager(mapper), fileid(fileid) 8 { 9 } 10 11 long FilePager::mmap(size_t position, size_t length, size_t *start_pos, size_t *end_pos, size_t *data_end) 12 { 13 /* Set the limits of the paged region. */ 14 15 Pager::mmap(position, length, start_pos, end_pos, data_end); 16 17 /* Obtain the amount of the region that is populated with file data. */ 18 19 *data_end = get_data_size() - _start; 20 21 if (*data_end > _size) 22 *data_end = _size; 23 24 return L4_EOK; 25 } 26 27 // vim: tabstop=4 expandtab shiftwidth=4