Source-Changes-HG archive

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

[src/trunk]: src/sys/miscfs/genfs don't change the loop counts; noted by mrg@



details:   https://anonhg.NetBSD.org/src/rev/bf0881fb97af
branches:  trunk
changeset: 348007:bf0881fb97af
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Sep 29 19:08:48 2016 +0000

description:
don't change the loop counts; noted by mrg@

diffstat:

 sys/miscfs/genfs/genfs_io.c |  13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r e5936afc1d0a -r bf0881fb97af sys/miscfs/genfs/genfs_io.c
--- a/sys/miscfs/genfs/genfs_io.c       Thu Sep 29 18:58:27 2016 +0000
+++ b/sys/miscfs/genfs/genfs_io.c       Thu Sep 29 19:08:48 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: genfs_io.c,v 1.62 2016/09/29 18:47:35 christos Exp $   */
+/*     $NetBSD: genfs_io.c,v 1.63 2016/09/29 19:08:48 christos Exp $   */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.62 2016/09/29 18:47:35 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.63 2016/09/29 19:08:48 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -821,10 +821,15 @@
        struct uvm_object * const uobj = &vp->v_uobj;
        kmutex_t * const slock = uobj->vmobjlock;
        off_t off;
-#define MAXPAGES (MAXPHYS / MIN_PAGE_SIZE)
        int i, error, npages, nback;
        int freeflag;
-       struct vm_page *pgs[MAXPAGES], *pg, *nextpg, *tpg, curmp, endmp;
+       /*
+        * This array is larger than it should so that it's size is constant.
+        * The right size is MAXPAGES.
+        */
+       struct vm_page *pgs[MAXPHYS / MIN_PAGE_SIZE];
+#define MAXPAGES (MAXPHYS / PAGE_SIZE)
+       struct vm_page *pg, *nextpg, *tpg, curmp, endmp;
        bool wasclean, by_list, needs_clean, yld;
        bool async = (origflags & PGO_SYNCIO) == 0;
        bool pagedaemon = curlwp == uvm.pagedaemon_lwp;



Home | Main Index | Thread Index | Old Index