Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/miscfs/genfs Stylistic change; introduce new local varia...



details:   https://anonhg.NetBSD.org/src/rev/55659704ffe6
branches:  trunk
changeset: 526555:55659704ffe6
user:      enami <enami%NetBSD.org@localhost>
date:      Mon May 06 00:18:15 2002 +0000

description:
Stylistic change; introduce new local variable and use it instead of
sprinkling different expression to test if we're pagedaemon.

diffstat:

 sys/miscfs/genfs/genfs_vnops.c |  13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diffs (56 lines):

diff -r e8abd6598187 -r 55659704ffe6 sys/miscfs/genfs/genfs_vnops.c
--- a/sys/miscfs/genfs/genfs_vnops.c    Mon May 06 00:07:51 2002 +0000
+++ b/sys/miscfs/genfs/genfs_vnops.c    Mon May 06 00:18:15 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: genfs_vnops.c,v 1.55 2002/04/26 03:57:31 enami Exp $   */
+/*     $NetBSD: genfs_vnops.c,v 1.56 2002/05/06 00:18:15 enami Exp $   */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: genfs_vnops.c,v 1.55 2002/04/26 03:57:31 enami Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfs_vnops.c,v 1.56 2002/05/06 00:18:15 enami Exp $");
 
 #include "opt_nfsserver.h"
 
@@ -997,6 +997,7 @@
        struct vm_page *pgs[n], *pg, *nextpg, *tpg, curmp, endmp;
        boolean_t wasclean, by_list, needs_clean, yield;
        boolean_t async = (flags & PGO_SYNCIO) == 0;
+       boolean_t pagedaemon = curproc == uvm.pagedaemon_proc;
        UVMHIST_FUNC("genfs_putpages"); UVMHIST_CALLED(ubchist);
 
        KASSERT(flags & (PGO_CLEANIT|PGO_FREE|PGO_DEACTIVATE));
@@ -1037,7 +1038,7 @@
         * current last page.
         */
 
-       freeflag = (curproc == uvm.pagedaemon_proc) ? PG_PAGEOUT : PG_RELEASED;
+       freeflag = pagedaemon ? PG_PAGEOUT : PG_RELEASED;
        curmp.uobject = uobj;
        curmp.offset = (voff_t)-1;
        curmp.flags = PG_BUSY;
@@ -1087,9 +1088,9 @@
                 */
 
                yield = (curproc->p_cpu->ci_schedstate.spc_flags &
-                   SPCF_SHOULDYIELD) && curproc != uvm.pagedaemon_proc;
+                   SPCF_SHOULDYIELD) && !pagedaemon;
                if (pg->flags & PG_BUSY || yield) {
-                       KASSERT(curproc != uvm.pagedaemon_proc);
+                       KASSERT(!pagedaemon);
                        UVMHIST_LOG(ubchist, "busy %p", pg,0,0,0);
                        if (by_list) {
                                TAILQ_INSERT_BEFORE(pg, &curmp, listq);
@@ -1205,7 +1206,7 @@
                                pmap_page_protect(tpg, VM_PROT_NONE);
                                if (tpg->flags & PG_BUSY) {
                                        tpg->flags |= freeflag;
-                                       if (freeflag == PG_PAGEOUT) {
+                                       if (pagedaemon) {
                                                uvmexp.paging++;
                                                uvm_pagedequeue(tpg);
                                        }



Home | Main Index | Thread Index | Old Index