mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-22 23:04:43 +00:00
orangefs: copy Orangefs-sized blocks into the pagecache if possible.
->readpage looks in file->private_data to try and find out how the userspace program set "count" in read(2) or with "dd bs=" or whatever. ->readpage uses "count" and inode->i_size to calculate how much data Orangefs should deposit in the Orangefs shared buffer, and remembers which slot the data is in. After copying data from the Orangefs shared buffer slot into "the page", readpage tries to increment through the pagecache index and fill as many pages as it can from the extra data in the shared buffer. Hopefully these extra pages will soon be needed by the vfs, and they'll be in the pagecache already. Signed-off-by: Mike Marshall <hubcap@omnibond.com> Signed-off-by: Martin Brandenburg <martin@omnibond.com>
This commit is contained in:
parent
4077a0f25b
commit
dd59a6475c
5 changed files with 156 additions and 15 deletions
|
@ -538,3 +538,16 @@ int orangefs_bufmap_copy_to_iovec(struct iov_iter *iter,
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void orangefs_bufmap_page_fill(void *page_to,
|
||||
int buffer_index,
|
||||
int slot_index)
|
||||
{
|
||||
struct orangefs_bufmap_desc *from;
|
||||
void *page_from;
|
||||
|
||||
from = &__orangefs_bufmap->desc_array[buffer_index];
|
||||
page_from = kmap_atomic(from->page_array[slot_index]);
|
||||
memcpy(page_to, page_from, PAGE_SIZE);
|
||||
kunmap_atomic(page_from);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue