summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_sendfile.c18
-rw-r--r--sys/kern/vfs_bio.c2
2 files changed, 10 insertions, 10 deletions
diff --git a/sys/kern/kern_sendfile.c b/sys/kern/kern_sendfile.c
index 973e476..aafa697 100644
--- a/sys/kern/kern_sendfile.c
+++ b/sys/kern/kern_sendfile.c
@@ -308,7 +308,7 @@ sendfile_swapin(vm_object_t obj, struct sf_io *sfio, off_t off, off_t len,
int npages, int rhpages, int flags)
{
vm_page_t *pa = sfio->pa;
- int nios;
+ int grabbed, nios;
nios = 0;
flags = (flags & SF_NODISKIO) ? VM_ALLOC_NOWAIT : 0;
@@ -318,14 +318,14 @@ sendfile_swapin(vm_object_t obj, struct sf_io *sfio, off_t off, off_t len,
* only required pages. Readahead pages are dealt with later.
*/
VM_OBJECT_WLOCK(obj);
- for (int i = 0; i < npages; i++) {
- pa[i] = vm_page_grab(obj, OFF_TO_IDX(vmoff(i, off)),
- VM_ALLOC_WIRED | VM_ALLOC_NORMAL | flags);
- if (pa[i] == NULL) {
- npages = i;
- rhpages = 0;
- break;
- }
+
+ grabbed = vm_page_grab_pages(obj, OFF_TO_IDX(off),
+ VM_ALLOC_NORMAL | VM_ALLOC_WIRED | flags, pa, npages);
+ if (grabbed < npages) {
+ for (int i = grabbed; i < npages; i++)
+ pa[i] = NULL;
+ npages = grabbed;
+ rhpages = 0;
}
for (int i = 0; i < npages;) {
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c
index 317a81a..890dd31 100644
--- a/sys/kern/vfs_bio.c
+++ b/sys/kern/vfs_bio.c
@@ -2727,7 +2727,7 @@ vfs_vmio_extend(struct buf *bp, int desiredpages, int size)
* deadlocks once allocbuf() is called after
* pages are vfs_busy_pages().
*/
- vm_page_grab_pages(obj,
+ (void)vm_page_grab_pages(obj,
OFF_TO_IDX(bp->b_offset) + bp->b_npages,
VM_ALLOC_SYSTEM | VM_ALLOC_IGN_SBUSY |
VM_ALLOC_NOBUSY | VM_ALLOC_WIRED,
OpenPOWER on IntegriCloud