Source-Changes-HG archive

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

[src/netbsd-9]: src/sys/miscfs Pull up following revision(s) (requested by ha...



details:   https://anonhg.NetBSD.org/src/rev/c36adda6daa9
branches:  netbsd-9
changeset: 962896:c36adda6daa9
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Sep 01 11:02:27 2019 +0000

description:
Pull up following revision(s) (requested by hannken in ticket #132):
        sys/miscfs/kernfs/kernfs_vnops.c: revision 1.161
        sys/miscfs/procfs/procfs_vnops.c: revision 1.207
Add missing operation VOP_GETPAGES() returning EFAULT.
Without this operation posix_fadvise(..., POSIX_FADV_WILLNEED)
would leave the v_interlock held.
Observed by maxv@

diffstat:

 sys/miscfs/kernfs/kernfs_vnops.c |  26 ++++++++++++++++++++++++--
 sys/miscfs/procfs/procfs_vnops.c |  26 ++++++++++++++++++++++++--
 2 files changed, 48 insertions(+), 4 deletions(-)

diffs (119 lines):

diff -r 3e8dd3f14994 -r c36adda6daa9 sys/miscfs/kernfs/kernfs_vnops.c
--- a/sys/miscfs/kernfs/kernfs_vnops.c  Sun Sep 01 11:00:31 2019 +0000
+++ b/sys/miscfs/kernfs/kernfs_vnops.c  Sun Sep 01 11:02:27 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kernfs_vnops.c,v 1.160 2018/09/03 16:29:35 riastradh Exp $     */
+/*     $NetBSD: kernfs_vnops.c,v 1.160.4.1 2019/09/01 11:02:27 martin Exp $    */
 
 /*
  * Copyright (c) 1992, 1993
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kernfs_vnops.c,v 1.160 2018/09/03 16:29:35 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kernfs_vnops.c,v 1.160.4.1 2019/09/01 11:02:27 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -172,6 +172,7 @@
 int    kernfs_pathconf(void *);
 #define        kernfs_advlock  genfs_einval
 #define        kernfs_bwrite   genfs_eopnotsupp
+int    kernfs_getpages(void *);
 #define        kernfs_putpages genfs_putpages
 
 static int     kernfs_xread(struct kernfs_node *, int, char **,
@@ -219,6 +220,7 @@
        { &vop_pathconf_desc, kernfs_pathconf },        /* pathconf */
        { &vop_advlock_desc, kernfs_advlock },          /* advlock */
        { &vop_bwrite_desc, kernfs_bwrite },            /* bwrite */
+       { &vop_getpages_desc, kernfs_getpages },        /* getpages */
        { &vop_putpages_desc, kernfs_putpages },        /* putpages */
        { NULL, NULL }
 };
@@ -1169,3 +1171,23 @@
        VOP_ABORTOP(ap->a_dvp, ap->a_cnp);
        return (EROFS);
 }
+ 
+int
+kernfs_getpages(void *v)
+{
+       struct vop_getpages_args /* {
+               struct vnode *a_vp;
+               voff_t a_offset;
+               struct vm_page **a_m;
+               int *a_count;
+               int a_centeridx;
+               vm_prot_t a_access_type;
+               int a_advice;
+               int a_flags;
+       } */ *ap = v;
+
+       if ((ap->a_flags & PGO_LOCKED) == 0)
+               mutex_exit(ap->a_vp->v_interlock);
+
+       return (EFAULT);
+}
diff -r 3e8dd3f14994 -r c36adda6daa9 sys/miscfs/procfs/procfs_vnops.c
--- a/sys/miscfs/procfs/procfs_vnops.c  Sun Sep 01 11:00:31 2019 +0000
+++ b/sys/miscfs/procfs/procfs_vnops.c  Sun Sep 01 11:02:27 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: procfs_vnops.c,v 1.206 2019/03/30 23:28:30 christos Exp $      */
+/*     $NetBSD: procfs_vnops.c,v 1.206.4.1 2019/09/01 11:02:27 martin Exp $    */
 
 /*-
  * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -105,7 +105,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: procfs_vnops.c,v 1.206 2019/03/30 23:28:30 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: procfs_vnops.c,v 1.206.4.1 2019/09/01 11:02:27 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -243,6 +243,7 @@
 #define        procfs_islocked genfs_islocked
 #define        procfs_advlock  genfs_einval
 #define        procfs_bwrite   genfs_eopnotsupp
+int    procfs_getpages(void *);
 #define procfs_putpages        genfs_null_putpages
 
 static int atoi(const char *, size_t);
@@ -291,6 +292,7 @@
        { &vop_islocked_desc, procfs_islocked },        /* islocked */
        { &vop_pathconf_desc, procfs_pathconf },        /* pathconf */
        { &vop_advlock_desc, procfs_advlock },          /* advlock */
+       { &vop_getpages_desc, procfs_getpages },        /* getpages */
        { &vop_putpages_desc, procfs_putpages },        /* putpages */
        { NULL, NULL }
 };
@@ -1719,6 +1721,26 @@
        return error;
 }
 
+int
+procfs_getpages(void *v)
+{
+       struct vop_getpages_args /* {
+               struct vnode *a_vp;
+               voff_t a_offset;
+               struct vm_page **a_m;
+               int *a_count;
+               int a_centeridx;
+               vm_prot_t a_access_type;
+               int a_advice;
+               int a_flags;
+       } */ *ap = v;
+
+       if ((ap->a_flags & PGO_LOCKED) == 0)
+               mutex_exit(ap->a_vp->v_interlock);
+
+       return (EFAULT);
+}
+
 /*
  * convert decimal ascii to int
  */



Home | Main Index | Thread Index | Old Index