diff options
author | alc <alc@FreeBSD.org> | 2009-06-07 19:38:26 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2009-06-07 19:38:26 +0000 |
commit | 919e3cbf2805715b8fefeab48237aaec49b8b9e9 (patch) | |
tree | 68d74e068916a4fdd1a70c4eef2639718f803b20 /sys | |
parent | 46d6a0d647524867f373c3528b384fdaef93bd07 (diff) | |
download | FreeBSD-src-919e3cbf2805715b8fefeab48237aaec49b8b9e9.zip FreeBSD-src-919e3cbf2805715b8fefeab48237aaec49b8b9e9.tar.gz |
Eliminate unnecessary obfuscation when testing a page's valid bits.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/kern_exec.c | 2 | ||||
-rw-r--r-- | sys/kern/vfs_cluster.c | 6 | ||||
-rw-r--r-- | sys/vm/vm_fault.c | 7 | ||||
-rw-r--r-- | sys/vm/vm_glue.c | 2 | ||||
-rw-r--r-- | sys/vm/vm_map.c | 2 |
5 files changed, 8 insertions, 11 deletions
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 2eec5e9..4e66c95 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -927,7 +927,7 @@ exec_map_first_page(imgp) } #endif ma[0] = vm_page_grab(object, 0, VM_ALLOC_NORMAL | VM_ALLOC_RETRY); - if ((ma[0]->valid & VM_PAGE_BITS_ALL) != VM_PAGE_BITS_ALL) { + if (ma[0]->valid != VM_PAGE_BITS_ALL) { initial_pagein = VM_INITIAL_PAGEIN; if (initial_pagein > object->size) initial_pagein = object->size; diff --git a/sys/kern/vfs_cluster.c b/sys/kern/vfs_cluster.c index a74c272..34af452 100644 --- a/sys/kern/vfs_cluster.c +++ b/sys/kern/vfs_cluster.c @@ -455,7 +455,7 @@ cluster_rbuild(vp, filesize, lbn, blkno, size, run, fbp) bp->b_pages[bp->b_npages] = m; bp->b_npages++; } - if ((m->valid & VM_PAGE_BITS_ALL) == VM_PAGE_BITS_ALL) + if (m->valid == VM_PAGE_BITS_ALL) tbp->b_pages[j] = bogus_page; } VM_OBJECT_UNLOCK(tbp->b_bufobj->bo_object); @@ -482,10 +482,8 @@ cluster_rbuild(vp, filesize, lbn, blkno, size, run, fbp) VM_OBJECT_LOCK(bp->b_bufobj->bo_object); for (j = 0; j < bp->b_npages; j++) { VM_OBJECT_LOCK_ASSERT(bp->b_pages[j]->object, MA_OWNED); - if ((bp->b_pages[j]->valid & VM_PAGE_BITS_ALL) == - VM_PAGE_BITS_ALL) { + if (bp->b_pages[j]->valid == VM_PAGE_BITS_ALL) bp->b_pages[j] = bogus_page; - } } VM_OBJECT_UNLOCK(bp->b_bufobj->bo_object); if (bp->b_bufsize > bp->b_kvasize) diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c index 3a21616..74b0df4 100644 --- a/sys/vm/vm_fault.c +++ b/sys/vm/vm_fault.c @@ -394,7 +394,7 @@ RetryFault:; * found the page ). */ vm_page_busy(fs.m); - if (((fs.m->valid & VM_PAGE_BITS_ALL) != VM_PAGE_BITS_ALL) && + if (fs.m->valid != VM_PAGE_BITS_ALL && fs.m->object != kernel_object && fs.m->object != kmem_object) { goto readrest; } @@ -433,7 +433,7 @@ RetryFault:; unlock_and_deallocate(&fs); VM_WAITPFAULT; goto RetryFault; - } else if ((fs.m->valid & VM_PAGE_BITS_ALL) == VM_PAGE_BITS_ALL) + } else if (fs.m->valid == VM_PAGE_BITS_ALL) break; } @@ -1024,9 +1024,8 @@ vm_fault_prefault(pmap_t pmap, vm_offset_t addra, vm_map_entry_t entry) VM_OBJECT_UNLOCK(lobject); break; } - if (((m->valid & VM_PAGE_BITS_ALL) == VM_PAGE_BITS_ALL) && + if (m->valid == VM_PAGE_BITS_ALL && (m->flags & PG_FICTITIOUS) == 0) { - vm_page_lock_queues(); pmap_enter_quick(pmap, addr, m, entry->protection); vm_page_unlock_queues(); diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c index b9a9ae7..9e43a3f 100644 --- a/sys/vm/vm_glue.c +++ b/sys/vm/vm_glue.c @@ -253,7 +253,7 @@ vm_imgact_hold_page(vm_object_t object, vm_ooffset_t offset) VM_OBJECT_LOCK(object); pindex = OFF_TO_IDX(offset); m = vm_page_grab(object, pindex, VM_ALLOC_NORMAL | VM_ALLOC_RETRY); - if ((m->valid & VM_PAGE_BITS_ALL) != VM_PAGE_BITS_ALL) { + if (m->valid != VM_PAGE_BITS_ALL) { ma[0] = m; rv = vm_pager_get_pages(object, ma, 1, 0); m = vm_page_lookup(object, pindex); diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index 32fdfde..bd8a09a 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -1683,7 +1683,7 @@ vm_map_pmap_enter(vm_map_t map, vm_offset_t addr, vm_prot_t prot, psize = tmpidx; break; } - if ((p->valid & VM_PAGE_BITS_ALL) == VM_PAGE_BITS_ALL) { + if (p->valid == VM_PAGE_BITS_ALL) { if (p_start == NULL) { start = addr + ptoa(tmpidx); p_start = p; |