Source-Changes-HG archive

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

[src/trunk]: src/sys/miscfs/union Since union_getpages may be called with PGO...



details:   https://anonhg.NetBSD.org/src/rev/40a3d8c1f611
branches:  trunk
changeset: 509095:40a3d8c1f611
user:      enami <enami%NetBSD.org@localhost>
date:      Thu Apr 26 05:25:14 2001 +0000

description:
Since union_getpages may be called with PGO_LOCKED,
- We need to skip PGO_DONTCARE page also.
- ``npages'' returned by VOP_GETPAGES for lower vp doesn't count
  those pages in this case.  So, just loop ``npages'' times is
  insufficient.  Loop while there is real pages instead.

diffstat:

 sys/miscfs/union/union_vnops.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (25 lines):

diff -r e58b11fb34ff -r 40a3d8c1f611 sys/miscfs/union/union_vnops.c
--- a/sys/miscfs/union/union_vnops.c    Thu Apr 26 04:21:35 2001 +0000
+++ b/sys/miscfs/union/union_vnops.c    Thu Apr 26 05:25:14 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: union_vnops.c,v 1.50 2001/01/22 12:17:40 jdolecek Exp $        */
+/*     $NetBSD: union_vnops.c,v 1.51 2001/04/26 05:25:14 enami Exp $   */
 
 /*
  * Copyright (c) 1992, 1993, 1994, 1995 Jan-Simon Pendry.
@@ -2007,12 +2007,13 @@
        }
        npages = *ap->a_count;
        simple_lock(&ap->a_vp->v_uvm.u_obj.vmobjlock);
-       for (i = 0; i < npages; i++) {
+       for (i = 0; npages > 0; i++) {
                pg = ap->a_m[i];
-               if (pg == NULL) {
+               if (pg == NULL || pg == PGO_DONTCARE) {
                        continue;
                }
                pg->flags |= PG_RDONLY;
+               npages--;
        }
        simple_unlock(&ap->a_vp->v_uvm.u_obj.vmobjlock);
        return 0;



Home | Main Index | Thread Index | Old Index