Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-7-0]: src/sys/miscfs Pull up following revision(s) (requested by ...
details: https://anonhg.NetBSD.org/src/rev/50ce2079471e
branches: netbsd-7-0
changeset: 453874:50ce2079471e
user: martin <martin%NetBSD.org@localhost>
date: Thu Aug 29 16:15:35 2019 +0000
description:
Pull up following revision(s) (requested by hannken in ticket #1703):
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 19ce2a68f1c2 -r 50ce2079471e sys/miscfs/kernfs/kernfs_vnops.c
--- a/sys/miscfs/kernfs/kernfs_vnops.c Sat Jun 15 15:59:33 2019 +0000
+++ b/sys/miscfs/kernfs/kernfs_vnops.c Thu Aug 29 16:15:35 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kernfs_vnops.c,v 1.154 2014/07/25 08:20:52 dholland Exp $ */
+/* $NetBSD: kernfs_vnops.c,v 1.154.6.1 2019/08/29 16:15:35 martin Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kernfs_vnops.c,v 1.154 2014/07/25 08:20:52 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kernfs_vnops.c,v 1.154.6.1 2019/08/29 16:15:35 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 }
};
@@ -1171,3 +1173,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 19ce2a68f1c2 -r 50ce2079471e sys/miscfs/procfs/procfs_vnops.c
--- a/sys/miscfs/procfs/procfs_vnops.c Sat Jun 15 15:59:33 2019 +0000
+++ b/sys/miscfs/procfs/procfs_vnops.c Thu Aug 29 16:15:35 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: procfs_vnops.c,v 1.191 2014/07/27 16:47:26 hannken Exp $ */
+/* $NetBSD: procfs_vnops.c,v 1.191.4.1 2019/08/29 16:15:35 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.191 2014/07/27 16:47:26 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: procfs_vnops.c,v 1.191.4.1 2019/08/29 16:15:35 martin Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -239,6 +239,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);
@@ -286,6 +287,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 }
};
@@ -1709,6 +1711,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