From 8189ac85e98ecbde309e760b90f929a0832b1dc9 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Thu, 3 Feb 2011 14:42:46 +0000 Subject: [PATCH] Eliminate unnecessary page hold_count checks. These checks predate r90944, which introduced a general mechanism for handling the freeing of held pages. Reviewed by: kib@ --- sys/kern/uipc_syscalls.c | 3 +-- sys/kern/vfs_bio.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c index ce83a9380eaa..958c8079caf9 100644 --- a/sys/kern/uipc_syscalls.c +++ b/sys/kern/uipc_syscalls.c @@ -2115,8 +2115,7 @@ kern_sendfile(struct thread *td, struct sendfile_args *uap, * then free it. */ if (pg->wire_count == 0 && pg->valid == 0 && - pg->busy == 0 && !(pg->oflags & VPO_BUSY) && - pg->hold_count == 0) + pg->busy == 0 && !(pg->oflags & VPO_BUSY)) vm_page_free(pg); vm_page_unlock(pg); VM_OBJECT_UNLOCK(obj); diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index b1e278d13979..b81e2f887ee2 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -1647,8 +1647,7 @@ vfs_vmio_release(struct buf *bp) * no valid data. We also free the page if the * buffer was used for direct I/O */ - if ((bp->b_flags & B_ASYNC) == 0 && !m->valid && - m->hold_count == 0) { + if ((bp->b_flags & B_ASYNC) == 0 && !m->valid) { vm_page_free(m); } else if (bp->b_flags & B_DIRECT) { vm_page_try_to_free(m);