}
if(page_ix == 0) {
- offset = ((lof_t) pp->index) << PAGE_CACHE_SHIFT;
+ offset = page_offset(pp);
auio->uio_offset = offset;
base_index = pp->index;
}
ClearPageError(pp);
- /* If the page is past the end of the file, skip it */
- isize = (i_size_read(fp->f_mapping->host) - 1) >> PAGE_CACHE_SHIFT;
- if(pp->index > isize) {
- if (PageLocked(pp))
- UnlockPage(pp);
- return 0;
- }
/* receiver frees */
auio = osi_Alloc(sizeof(uio_t));
iovecp = osi_Alloc(sizeof(struct iovec));
/* address can be NULL, because we overwrite it with 'pp', below */
- setup_uio(auio, iovecp, NULL, (pp->index << PAGE_CACHE_SHIFT),
+ setup_uio(auio, iovecp, NULL, page_offset(pp),
PAGE_SIZE, UIO_READ, AFS_UIOSYS);
/* save the page for background map */
int f_flags = 0;
buffer = kmap(pp) + offset;
- base = (((loff_t) pp->index) << PAGE_CACHE_SHIFT) + offset;
+ base = page_offset(pp) + offset;
credp = crref();
afs_maybe_lock_kernel();