Source-Changes-HG archive

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

[src/trunk]: src/sys add a VOP_PUTPAGES method for all the filesystems that d...



details:   https://anonhg.NetBSD.org/src/rev/3d2c12e8aa37
branches:  trunk
changeset: 518822:3d2c12e8aa37
user:      chs <chs%NetBSD.org@localhost>
date:      Thu Dec 06 04:27:40 2001 +0000

description:
add a VOP_PUTPAGES method for all the filesystems that don't have pages,
just unlock the interlock.

diffstat:

 sys/coda/coda_vnops.c            |   6 ++++--
 sys/miscfs/deadfs/dead_vnops.c   |   8 +++++---
 sys/miscfs/fdesc/fdesc_vnops.c   |   8 +++++---
 sys/miscfs/fifofs/fifo.h         |   4 ++--
 sys/miscfs/fifofs/fifo_vnops.c   |  25 ++-----------------------
 sys/miscfs/genfs/genfs.h         |   5 ++---
 sys/miscfs/genfs/genfs_vnops.c   |  24 ++++++++++++++++++++++--
 sys/miscfs/kernfs/kernfs_vnops.c |   6 ++++--
 sys/miscfs/portal/portal_vnops.c |   6 ++++--
 sys/miscfs/procfs/procfs_vnops.c |   6 ++++--
 sys/miscfs/syncfs/syncfs.h       |   3 ++-
 sys/ntfs/ntfs_vnops.c            |   7 ++++---
 sys/ufs/mfs/mfs_vnops.c          |   7 ++++---
 sys/ufs/mfs/mfsnode.h            |   3 ++-
 14 files changed, 66 insertions(+), 52 deletions(-)

diffs (truncated from 413 to 300 lines):

diff -r d07e81988c6e -r 3d2c12e8aa37 sys/coda/coda_vnops.c
--- a/sys/coda/coda_vnops.c     Thu Dec 06 04:18:01 2001 +0000
+++ b/sys/coda/coda_vnops.c     Thu Dec 06 04:27:40 2001 +0000
@@ -6,7 +6,7 @@
 rmdir
 symlink
 */
-/*     $NetBSD: coda_vnops.c,v 1.29 2001/11/24 01:11:35 perry Exp $    */
+/*     $NetBSD: coda_vnops.c,v 1.30 2001/12/06 04:27:40 chs Exp $      */
 
 /*
  * 
@@ -54,7 +54,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: coda_vnops.c,v 1.29 2001/11/24 01:11:35 perry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: coda_vnops.c,v 1.30 2001/12/06 04:27:40 chs Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -2050,6 +2050,8 @@
        } */ *ap = v;
        struct vnode *vp = ap->a_vp;
 
+       simple_unlock(&vp->v_interlock);
+
        /* Check for control object. */
        if (IS_CTL_VP(vp)) {
                return(EINVAL);
diff -r d07e81988c6e -r 3d2c12e8aa37 sys/miscfs/deadfs/dead_vnops.c
--- a/sys/miscfs/deadfs/dead_vnops.c    Thu Dec 06 04:18:01 2001 +0000
+++ b/sys/miscfs/deadfs/dead_vnops.c    Thu Dec 06 04:27:40 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dead_vnops.c,v 1.31 2001/11/10 13:33:40 lukem Exp $    */
+/*     $NetBSD: dead_vnops.c,v 1.32 2001/12/06 04:27:40 chs Exp $      */
 
 /*
  * Copyright (c) 1989, 1993
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dead_vnops.c,v 1.31 2001/11/10 13:33:40 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dead_vnops.c,v 1.32 2001/12/06 04:27:40 chs Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -95,6 +95,7 @@
 #define dead_update    genfs_nullop
 #define dead_bwrite    genfs_nullop
 #define dead_revoke    genfs_nullop
+#define dead_putpages  genfs_null_putpages
 
 int    chkvnlock __P((struct vnode *));
 
@@ -145,7 +146,8 @@
        { &vop_truncate_desc, dead_truncate },          /* truncate */
        { &vop_update_desc, dead_update },              /* update */
        { &vop_bwrite_desc, dead_bwrite },              /* bwrite */
-       { (struct vnodeop_desc*)NULL, (int(*) __P((void *)))NULL }
+       { &vop_putpages_desc, dead_putpages },          /* putpages */
+       { NULL, NULL }
 };
 const struct vnodeopv_desc dead_vnodeop_opv_desc =
        { &dead_vnodeop_p, dead_vnodeop_entries };
diff -r d07e81988c6e -r 3d2c12e8aa37 sys/miscfs/fdesc/fdesc_vnops.c
--- a/sys/miscfs/fdesc/fdesc_vnops.c    Thu Dec 06 04:18:01 2001 +0000
+++ b/sys/miscfs/fdesc/fdesc_vnops.c    Thu Dec 06 04:27:40 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fdesc_vnops.c,v 1.66 2001/11/15 09:48:21 lukem Exp $   */
+/*     $NetBSD: fdesc_vnops.c,v 1.67 2001/12/06 04:27:41 chs Exp $     */
 
 /*
  * Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fdesc_vnops.c,v 1.66 2001/11/15 09:48:21 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdesc_vnops.c,v 1.67 2001/12/06 04:27:41 chs Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -130,6 +130,7 @@
 #define        fdesc_update    genfs_nullop
 #define        fdesc_bwrite    genfs_eopnotsupp
 #define fdesc_revoke   genfs_revoke
+#define fdesc_putpages genfs_null_putpages
 
 static int fdesc_attr __P((int, struct vattr *, struct ucred *, struct proc *));
 
@@ -178,7 +179,8 @@
        { &vop_truncate_desc, fdesc_truncate },         /* truncate */
        { &vop_update_desc, fdesc_update },             /* update */
        { &vop_bwrite_desc, fdesc_bwrite },             /* bwrite */
-       { (struct vnodeop_desc*)NULL, (int(*) __P((void *)))NULL }
+       { &vop_putpages_desc, fdesc_putpages },         /* putpages */
+       { NULL, NULL }
 };
 
 const struct vnodeopv_desc fdesc_vnodeop_opv_desc =
diff -r d07e81988c6e -r 3d2c12e8aa37 sys/miscfs/fifofs/fifo.h
--- a/sys/miscfs/fifofs/fifo.h  Thu Dec 06 04:18:01 2001 +0000
+++ b/sys/miscfs/fifofs/fifo.h  Thu Dec 06 04:27:40 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fifo.h,v 1.17 2001/09/22 22:35:18 sommerfeld Exp $     */
+/*     $NetBSD: fifo.h,v 1.18 2001/12/06 04:27:41 chs Exp $    */
 
 /*
  * Copyright (c) 1991, 1993
@@ -81,7 +81,7 @@
 #define fifo_truncate  genfs_nullop
 #define fifo_update    genfs_nullop
 #define fifo_bwrite    genfs_nullop
-int    fifo_putpages   __P((void *));
+#define        fifo_putpages   genfs_null_putpages
 
 void   fifo_printinfo __P((struct vnode *));
 
diff -r d07e81988c6e -r 3d2c12e8aa37 sys/miscfs/fifofs/fifo_vnops.c
--- a/sys/miscfs/fifofs/fifo_vnops.c    Thu Dec 06 04:18:01 2001 +0000
+++ b/sys/miscfs/fifofs/fifo_vnops.c    Thu Dec 06 04:27:40 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fifo_vnops.c,v 1.32 2001/11/10 13:33:41 lukem Exp $    */
+/*     $NetBSD: fifo_vnops.c,v 1.33 2001/12/06 04:27:41 chs Exp $      */
 
 /*
  * Copyright (c) 1990, 1993, 1995
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fifo_vnops.c,v 1.32 2001/11/10 13:33:41 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fifo_vnops.c,v 1.33 2001/12/06 04:27:41 chs Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -509,24 +509,3 @@
        }
        /* NOTREACHED */
 }
-
-/*
- * Dummy putpages routine.
- */
-
-int
-fifo_putpages(void *v)
-{
-       struct vop_putpages_args /* {
-               struct vnode *a_vp;
-               voff_t a_offlo;
-               voff_t a_offhi;
-               int a_flags;
-       } */ *ap = v;
-       struct vnode *vp = ap->a_vp;
-       struct uvm_object *uobj = &vp->v_uobj;
-
-       KASSERT(uobj->uo_npages == 0);
-       simple_unlock(&uobj->vmobjlock);
-       return (0);
-}
diff -r d07e81988c6e -r 3d2c12e8aa37 sys/miscfs/genfs/genfs.h
--- a/sys/miscfs/genfs/genfs.h  Thu Dec 06 04:18:01 2001 +0000
+++ b/sys/miscfs/genfs/genfs.h  Thu Dec 06 04:27:40 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: genfs.h,v 1.13 2001/09/15 20:36:38 chs Exp $   */
+/*     $NetBSD: genfs.h,v 1.14 2001/12/06 04:27:41 chs Exp $   */
 
 int    genfs_badop             __P((void *));
 int    genfs_nullop            __P((void *));
@@ -25,5 +25,4 @@
 int    genfs_mmap              __P((void *));
 int    genfs_getpages          __P((void *));
 int    genfs_putpages          __P((void *));
-int    genfs_mmap              __P((void *));
-int    genfs_munmap            __P((void *));
+int    genfs_null_putpages     __P((void *));
diff -r d07e81988c6e -r 3d2c12e8aa37 sys/miscfs/genfs/genfs_vnops.c
--- a/sys/miscfs/genfs/genfs_vnops.c    Thu Dec 06 04:18:01 2001 +0000
+++ b/sys/miscfs/genfs/genfs_vnops.c    Thu Dec 06 04:27:40 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: genfs_vnops.c,v 1.41 2001/11/30 15:18:39 christos Exp $        */
+/*     $NetBSD: genfs_vnops.c,v 1.42 2001/12/06 04:27:41 chs Exp $     */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: genfs_vnops.c,v 1.41 2001/11/30 15:18:39 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfs_vnops.c,v 1.42 2001/12/06 04:27:41 chs Exp $");
 
 #include "opt_nfsserver.h"
 
@@ -1427,6 +1427,26 @@
        return error;
 }
 
+/*
+ * VOP_PUTPAGES() for vnodes which never have pages.
+ */
+
+int
+genfs_null_putpages(void *v)
+{
+       struct vop_putpages_args /* {
+               struct vnode *a_vp;
+               voff_t a_offlo;
+               voff_t a_offhi;
+               int a_flags;
+       } */ *ap = v;
+       struct vnode *vp = ap->a_vp;
+
+       KASSERT(vp->v_uobj.uo_npages == 0);
+       simple_unlock(&vp->v_interlock);
+       return (0);
+}
+
 void
 genfs_node_init(struct vnode *vp, struct genfs_ops *ops)
 {
diff -r d07e81988c6e -r 3d2c12e8aa37 sys/miscfs/kernfs/kernfs_vnops.c
--- a/sys/miscfs/kernfs/kernfs_vnops.c  Thu Dec 06 04:18:01 2001 +0000
+++ b/sys/miscfs/kernfs/kernfs_vnops.c  Thu Dec 06 04:27:40 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kernfs_vnops.c,v 1.78 2001/11/15 09:48:22 lukem Exp $  */
+/*     $NetBSD: kernfs_vnops.c,v 1.79 2001/12/06 04:27:42 chs Exp $    */
 
 /*
  * Copyright (c) 1992, 1993
@@ -43,7 +43,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kernfs_vnops.c,v 1.78 2001/11/15 09:48:22 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kernfs_vnops.c,v 1.79 2001/12/06 04:27:42 chs Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -143,6 +143,7 @@
 #define        kernfs_truncate genfs_eopnotsupp
 #define        kernfs_update   genfs_nullop
 #define        kernfs_bwrite   genfs_eopnotsupp
+#define        kernfs_putpages genfs_putpages
 
 int    kernfs_xread __P((const struct kern_target *, int, char **, int));
 int    kernfs_xwrite __P((const struct kern_target *, char *, int));
@@ -191,6 +192,7 @@
        { &vop_truncate_desc, kernfs_truncate },        /* truncate */
        { &vop_update_desc, kernfs_update },            /* update */
        { &vop_bwrite_desc, kernfs_bwrite },            /* bwrite */
+       { &vop_putpages_desc, kernfs_putpages },        /* putpages */
        { NULL, NULL }
 };
 const struct vnodeopv_desc kernfs_vnodeop_opv_desc =
diff -r d07e81988c6e -r 3d2c12e8aa37 sys/miscfs/portal/portal_vnops.c
--- a/sys/miscfs/portal/portal_vnops.c  Thu Dec 06 04:18:01 2001 +0000
+++ b/sys/miscfs/portal/portal_vnops.c  Thu Dec 06 04:27:40 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: portal_vnops.c,v 1.40 2001/11/15 09:48:23 lukem Exp $  */
+/*     $NetBSD: portal_vnops.c,v 1.41 2001/12/06 04:27:42 chs Exp $    */
 
 /*
  * Copyright (c) 1992, 1993
@@ -44,7 +44,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: portal_vnops.c,v 1.40 2001/11/15 09:48:23 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: portal_vnops.c,v 1.41 2001/12/06 04:27:42 chs Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -114,6 +114,7 @@
 #define        portal_truncate genfs_eopnotsupp
 #define        portal_update   genfs_eopnotsupp
 #define        portal_bwrite   genfs_eopnotsupp
+#define        portal_putpages genfs_null_putpages
 
 int (**portal_vnodeop_p) __P((void *));
 const struct vnodeopv_entry_desc portal_vnodeop_entries[] = {
@@ -159,6 +160,7 @@
        { &vop_truncate_desc, portal_truncate },        /* truncate */
        { &vop_update_desc, portal_update },            /* update */
        { &vop_bwrite_desc, portal_bwrite },            /* bwrite */
+       { &vop_putpages_desc, portal_putpages },        /* putpages */
        { NULL, NULL }
 };
 const struct vnodeopv_desc portal_vnodeop_opv_desc =
diff -r d07e81988c6e -r 3d2c12e8aa37 sys/miscfs/procfs/procfs_vnops.c
--- a/sys/miscfs/procfs/procfs_vnops.c  Thu Dec 06 04:18:01 2001 +0000
+++ b/sys/miscfs/procfs/procfs_vnops.c  Thu Dec 06 04:27:40 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: procfs_vnops.c,v 1.86 2001/12/05 00:58:06 thorpej Exp $        */
+/*     $NetBSD: procfs_vnops.c,v 1.87 2001/12/06 04:27:42 chs Exp $    */
 
 /*



Home | Main Index | Thread Index | Old Index