Source-Changes-HG archive

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

[src/trunk]: src/sys/ufs/ext2fs pick up changes from ufs_balloc_range().



details:   https://anonhg.NetBSD.org/src/rev/ff3a0a1d557e
branches:  trunk
changeset: 518440:ff3a0a1d557e
user:      chs <chs%NetBSD.org@localhost>
date:      Fri Nov 30 07:06:19 2001 +0000

description:
pick up changes from ufs_balloc_range().

diffstat:

 sys/ufs/ext2fs/ext2fs_balloc.c |  34 +++++++++++++++++-----------------
 1 files changed, 17 insertions(+), 17 deletions(-)

diffs (80 lines):

diff -r dcaa92abd575 -r ff3a0a1d557e sys/ufs/ext2fs/ext2fs_balloc.c
--- a/sys/ufs/ext2fs/ext2fs_balloc.c    Fri Nov 30 07:05:53 2001 +0000
+++ b/sys/ufs/ext2fs/ext2fs_balloc.c    Fri Nov 30 07:06:19 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ext2fs_balloc.c,v 1.14 2001/11/10 17:48:02 chs Exp $   */
+/*     $NetBSD: ext2fs_balloc.c,v 1.15 2001/11/30 07:06:19 chs Exp $   */
 
 /*
  * Copyright (c) 1997 Manuel Bouyer.
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ext2fs_balloc.c,v 1.14 2001/11/10 17:48:02 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ext2fs_balloc.c,v 1.15 2001/11/30 07:06:19 chs Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_uvmhist.h"
@@ -384,7 +384,6 @@
        int flags;
 {
        off_t oldeof, eof, pagestart;
-       struct uvm_object *uobj;
        struct genfs_node *gp = VTOG(vp);
        int i, delta, error, npages;
        int bshift = vp->v_mount->mnt_fs_bshift;
@@ -396,9 +395,8 @@
                    vp, off, len, vp->v_size);
 
        error = 0;
-       uobj = &vp->v_uobj;
        oldeof = vp->v_size;
-       eof = max(oldeof, off + len);
+       eof = MAX(oldeof, off + len);
        UVMHIST_LOG(ubchist, "new eof 0x%x", eof,0,0,0);
        pgs[0] = NULL;
 
@@ -410,9 +408,9 @@
         */
 
        pagestart = trunc_page(off) & ~(bsize - 1);
-       npages = min(ppb, (round_page(eof) - pagestart) >> PAGE_SHIFT);
+       npages = MIN(ppb, (round_page(eof) - pagestart) >> PAGE_SHIFT);
        memset(pgs, 0, npages);
-       simple_lock(&uobj->vmobjlock);
+       simple_lock(&vp->v_interlock);
        error = VOP_GETPAGES(vp, pagestart, pgs, &npages, 0,
            VM_PROT_READ, 0, PGO_SYNCIO | PGO_PASTEOF);
        if (error) {
@@ -450,18 +448,20 @@
         */
 
 errout:
-       simple_lock(&uobj->vmobjlock);
+       simple_lock(&vp->v_interlock);
+       for (i = 0; i < npages; i++) {
+               pgs[i]->flags &= ~PG_RDONLY;
+               if (error) {
+                       pgs[i]->flags |= PG_RELEASED;
+               }
+       }
        if (error) {
-               (void) (uobj->pgops->pgo_put)(uobj, oldeof, pagestart + ppb,
-                   PGO_FREE);
-               simple_lock(&uobj->vmobjlock);
-       }
-       if (pgs[0] != NULL) {
-               for (i = 0; i < npages; i++) {
-                       pgs[i]->flags &= ~PG_RDONLY;
-               }
+               uvm_lock_pageq();
+               uvm_page_unbusy(pgs, npages);
+               uvm_unlock_pageq();
+       } else {
                uvm_page_unbusy(pgs, npages);
        }
-       simple_unlock(&uobj->vmobjlock);
+       simple_unlock(&vp->v_interlock);
        return (error);
 }



Home | Main Index | Thread Index | Old Index