objective: vnode.h doesn't include uvm_extern.h anymore.
followup changes: include uvm_extern.h or lock.h where necessary.
ok and help from deraadt
-/* $OpenBSD: autoconf.c,v 1.40 2013/11/19 09:00:43 mpi Exp $ */
+/* $OpenBSD: autoconf.c,v 1.41 2014/12/16 18:30:03 tedu Exp $ */
/* $NetBSD: autoconf.c,v 1.1 2003/04/26 18:39:26 fvdl Exp $ */
/*-
#include <machine/pte.h>
#include <machine/cpu.h>
+#include <machine/cpufunc.h>
#include <machine/biosvar.h>
#include <dev/cons.h>
-/* $OpenBSD: vm_machdep.c,v 1.79 2014/11/16 12:30:57 deraadt Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.80 2014/12/16 18:30:03 tedu Exp $ */
/*
* Copyright (c) 1999-2004 Michael Shalayeff
#include <sys/core.h>
#include <sys/pool.h>
+#include <uvm/uvm_extern.h>
+
#include <machine/cpufunc.h>
#include <machine/fpu.h>
#include <machine/pmap.h>
#include <machine/pcb.h>
-#include <uvm/uvm_extern.h>
-
extern struct pool hppa_fppl;
/*
-/* $OpenBSD: linux_machdep.c,v 1.45 2014/03/26 05:23:42 guenther Exp $ */
+/* $OpenBSD: linux_machdep.c,v 1.46 2014/12/16 18:30:03 tedu Exp $ */
/* $NetBSD: linux_machdep.c,v 1.29 1996/05/03 19:42:11 christos Exp $ */
/*
#include <sys/mbuf.h>
#include <sys/msgbuf.h>
#include <sys/mount.h>
-#include <sys/vnode.h>
#include <sys/device.h>
#include <sys/sysctl.h>
#include <sys/syscallargs.h>
#include <sys/filedesc.h>
+#include <uvm/uvm_extern.h>
+
#include <compat/linux/linux_types.h>
#include <compat/linux/linux_signal.h>
#include <compat/linux/linux_syscallargs.h>
-/* $OpenBSD: vm_machdep.c,v 1.30 2014/11/16 12:30:58 deraadt Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.31 2014/12/16 18:30:03 tedu Exp $ */
/*
* Copyright (c) 1988 University of Utah.
* Copyright (c) 1992, 1993
#include <sys/exec.h>
#include <sys/signalvar.h>
+#include <uvm/uvm_extern.h>
#include <machine/cpu.h>
#include <mips64/mips_cpu.h>
-/* $OpenBSD: compat_util.c,v 1.13 2014/07/12 18:50:00 tedu Exp $ */
+/* $OpenBSD: compat_util.c,v 1.14 2014/12/16 18:30:03 tedu Exp $ */
/* $NetBSD: compat_util.c,v 1.4 1996/03/14 19:31:45 christos Exp $ */
/*
#include <sys/malloc.h>
#include <sys/vnode.h>
+#include <uvm/uvm_extern.h>
+
#include <compat/common/compat_util.h>
/*
-/* $OpenBSD: diskmap.c,v 1.8 2014/07/12 18:48:17 tedu Exp $ */
+/* $OpenBSD: diskmap.c,v 1.9 2014/12/16 18:30:03 tedu Exp $ */
/*
* Copyright (c) 2009, 2010 Joel Sing <jsing@openbsd.org>
#include <sys/disklabel.h>
#include <sys/file.h>
#include <sys/filedesc.h>
+#include <sys/lock.h>
#include <sys/malloc.h>
#include <sys/namei.h>
#include <sys/proc.h>
-/* $OpenBSD: bktr_core.c,v 1.33 2014/05/04 20:09:15 sf Exp $ */
+/* $OpenBSD: bktr_core.c,v 1.34 2014/12/16 18:30:03 tedu Exp $ */
/* $FreeBSD: src/sys/dev/bktr/bktr_core.c,v 1.114 2000/10/31 13:09:56 roger Exp $ */
/*
#include <sys/vnode.h>
#include <sys/stdint.h> /* uintptr_t */
+#include <uvm/uvm_extern.h>
+
#include <dev/rndvar.h>
#include <dev/ic/bt8xx.h>
#include <dev/pci/bktr/bktr_reg.h>
-/* $OpenBSD: softraid.c,v 1.344 2014/11/18 02:37:30 tedu Exp $ */
+/* $OpenBSD: softraid.c,v 1.345 2014/12/16 18:30:03 tedu Exp $ */
/*
* Copyright (c) 2007, 2008, 2009 Marco Peereboom <marco@peereboom.us>
* Copyright (c) 2008 Chris Kuethe <ckuethe@openbsd.org>
#include <sys/kthread.h>
#include <sys/dkio.h>
+#include <uvm/uvm_extern.h>
+
#include <crypto/cryptodev.h>
#include <scsi/scsi_all.h>
-/* $OpenBSD: video.c,v 1.33 2014/10/18 08:01:34 armani Exp $ */
+/* $OpenBSD: video.c,v 1.34 2014/12/16 18:30:03 tedu Exp $ */
/*
* Copyright (c) 2008 Robert Nagy <robert@openbsd.org>
#include <dev/video_if.h>
#include <dev/videovar.h>
+#include <uvm/uvm_extern.h>
+
#ifdef VIDEO_DEBUG
#define DPRINTF(x) do { printf x; } while (0)
#else
-/* $OpenBSD: cd9660_bmap.c,v 1.7 2013/06/11 16:42:15 deraadt Exp $ */
+/* $OpenBSD: cd9660_bmap.c,v 1.8 2014/12/16 18:30:03 tedu Exp $ */
/* $NetBSD: cd9660_bmap.c,v 1.7 1997/01/24 00:27:29 cgd Exp $ */
/*-
#include <sys/buf.h>
#include <sys/file.h>
#include <sys/vnode.h>
+#include <sys/lock.h>
#include <sys/mount.h>
#include <isofs/cd9660/iso.h>
-/* $OpenBSD: cd9660_lookup.c,v 1.21 2014/07/12 18:50:00 tedu Exp $ */
+/* $OpenBSD: cd9660_lookup.c,v 1.22 2014/12/16 18:30:03 tedu Exp $ */
/* $NetBSD: cd9660_lookup.c,v 1.18 1997/05/08 16:19:59 mycroft Exp $ */
/*-
#include <sys/buf.h>
#include <sys/file.h>
#include <sys/vnode.h>
+#include <sys/lock.h>
#include <sys/mount.h>
#include <sys/systm.h>
#include <sys/malloc.h>
-/* $OpenBSD: cd9660_node.c,v 1.26 2014/11/18 10:42:15 dlg Exp $ */
+/* $OpenBSD: cd9660_node.c,v 1.27 2014/12/16 18:30:03 tedu Exp $ */
/* $NetBSD: cd9660_node.c,v 1.17 1997/05/05 07:13:57 mycroft Exp $ */
/*-
#include <sys/file.h>
#include <sys/buf.h>
#include <sys/vnode.h>
+#include <sys/lock.h>
#include <sys/namei.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
-/* $OpenBSD: cd9660_rrip.c,v 1.11 2013/05/30 17:35:01 guenther Exp $ */
+/* $OpenBSD: cd9660_rrip.c,v 1.12 2014/12/16 18:30:03 tedu Exp $ */
/* $NetBSD: cd9660_rrip.c,v 1.17 1997/01/24 00:27:32 cgd Exp $ */
/*-
#include <sys/buf.h>
#include <sys/file.h>
#include <sys/vnode.h>
+#include <sys/lock.h>
#include <sys/mount.h>
#include <sys/kernel.h>
#include <sys/stat.h>
#include <sys/types.h>
-
#include <sys/time.h>
#include <isofs/cd9660/iso.h>
-/* $OpenBSD: cd9660_vfsops.c,v 1.68 2014/07/12 18:50:00 tedu Exp $ */
+/* $OpenBSD: cd9660_vfsops.c,v 1.69 2014/12/16 18:30:03 tedu Exp $ */
/* $NetBSD: cd9660_vfsops.c,v 1.26 1997/06/13 15:38:58 pk Exp $ */
/*-
#include <sys/proc.h>
#include <sys/kernel.h>
#include <sys/vnode.h>
+#include <sys/lock.h>
#include <sys/specdev.h>
#include <sys/mount.h>
#include <sys/buf.h>
-/* $OpenBSD: cd9660_vnops.c,v 1.68 2014/11/03 21:28:35 tedu Exp $ */
+/* $OpenBSD: cd9660_vnops.c,v 1.69 2014/12/16 18:30:03 tedu Exp $ */
/* $NetBSD: cd9660_vnops.c,v 1.42 1997/10/16 23:56:57 christos Exp $ */
/*-
#include <sys/conf.h>
#include <sys/mount.h>
#include <sys/vnode.h>
+#include <sys/lock.h>
#include <sys/malloc.h>
#include <sys/pool.h>
#include <sys/dirent.h>
-/* $OpenBSD: udf_subr.c,v 1.24 2014/11/18 10:42:15 dlg Exp $ */
+/* $OpenBSD: udf_subr.c,v 1.25 2014/12/16 18:30:03 tedu Exp $ */
/*
* Copyright (c) 2006, Miodrag Vallat
#include <sys/stat.h>
#include <sys/mount.h>
#include <sys/vnode.h>
+#include <sys/lock.h>
#include <sys/dirent.h>
#include <sys/disklabel.h>
-/* $OpenBSD: udf_vfsops.c,v 1.43 2014/11/18 10:42:15 dlg Exp $ */
+/* $OpenBSD: udf_vfsops.c,v 1.44 2014/12/16 18:30:03 tedu Exp $ */
/*
* Copyright (c) 2001, 2002 Scott Long <scottl@freebsd.org>
#include <sys/lock.h>
#include <sys/queue.h>
#include <sys/vnode.h>
+#include <sys/lock.h>
#include <sys/endian.h>
#include <sys/specdev.h>
-/* $OpenBSD: udf_vnops.c,v 1.57 2014/11/18 10:42:15 dlg Exp $ */
+/* $OpenBSD: udf_vnops.c,v 1.58 2014/12/16 18:30:03 tedu Exp $ */
/*
* Copyright (c) 2001, 2002 Scott Long <scottl@freebsd.org>
#include <sys/lock.h>
#include <sys/mount.h>
#include <sys/vnode.h>
+#include <sys/lock.h>
#include <sys/dirent.h>
#include <sys/queue.h>
#include <sys/endian.h>
-/* $OpenBSD: exec_elf.c,v 1.106 2014/11/16 12:31:00 deraadt Exp $ */
+/* $OpenBSD: exec_elf.c,v 1.107 2014/12/16 18:30:03 tedu Exp $ */
/*
* Copyright (c) 1996 Per Fogelstrom
#include <sys/mman.h>
+#include <uvm/uvm_extern.h>
+
#include <machine/reg.h>
#include <machine/exec.h>
-/* $OpenBSD: exec_script.c,v 1.33 2014/11/19 21:19:15 tedu Exp $ */
+/* $OpenBSD: exec_script.c,v 1.34 2014/12/16 18:30:03 tedu Exp $ */
/* $NetBSD: exec_script.c,v 1.13 1996/02/04 02:15:06 christos Exp $ */
/*
#include <sys/malloc.h>
#include <sys/pool.h>
#include <sys/vnode.h>
+#include <sys/lock.h>
#include <sys/namei.h>
#include <sys/file.h>
#include <sys/filedesc.h>
-/* $OpenBSD: exec_subr.c,v 1.44 2014/12/15 02:24:23 guenther Exp $ */
+/* $OpenBSD: exec_subr.c,v 1.45 2014/12/16 18:30:03 tedu Exp $ */
/* $NetBSD: exec_subr.c,v 1.9 1994/12/04 03:10:42 mycroft Exp $ */
/*
#include <sys/mman.h>
#include <sys/resourcevar.h>
+#include <uvm/uvm_extern.h>
+
#ifdef DEBUG
/*
* new_vmcmd():
-/* $OpenBSD: init_main.c,v 1.227 2014/12/15 02:24:23 guenther Exp $ */
+/* $OpenBSD: init_main.c,v 1.228 2014/12/16 18:30:03 tedu Exp $ */
/* $NetBSD: init_main.c,v 1.84.4.1 1996/06/02 09:08:06 mrg Exp $ */
/*
#include <sys/syscall.h>
#include <sys/syscallargs.h>
+#include <uvm/uvm_extern.h>
+
#include <dev/rndvar.h>
#include <ufs/ufs/quota.h>
-/* $OpenBSD: kern_descrip.c,v 1.113 2014/08/31 01:42:36 guenther Exp $ */
+/* $OpenBSD: kern_descrip.c,v 1.114 2014/12/16 18:30:03 tedu Exp $ */
/* $NetBSD: kern_descrip.c,v 1.42 1996/03/30 22:24:38 christos Exp $ */
/*
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <sys/fcntl.h>
+#include <sys/lock.h>
#include <sys/malloc.h>
#include <sys/syslog.h>
#include <sys/ucred.h>
-/* $OpenBSD: kern_exec.c,v 1.151 2014/12/15 02:24:23 guenther Exp $ */
+/* $OpenBSD: kern_exec.c,v 1.152 2014/12/16 18:30:04 tedu Exp $ */
/* $NetBSD: kern_exec.c,v 1.75 1996/02/09 18:59:28 christos Exp $ */
/*-
#include <sys/syscallargs.h>
+#include <uvm/uvm_extern.h>
+
#include <machine/reg.h>
#ifdef __HAVE_MD_TCB
-/* $OpenBSD: kern_exit.c,v 1.147 2014/07/12 18:43:32 tedu Exp $ */
+/* $OpenBSD: kern_exit.c,v 1.148 2014/12/16 18:30:04 tedu Exp $ */
/* $NetBSD: kern_exit.c,v 1.39 1996/04/22 01:38:25 christos Exp $ */
/*
#include <sys/mount.h>
#include <sys/syscallargs.h>
+#include <uvm/uvm_extern.h>
+
/*
* exit --
* Death of process.
-/* $OpenBSD: kern_ktrace.c,v 1.71 2014/12/10 02:44:47 tedu Exp $ */
+/* $OpenBSD: kern_ktrace.c,v 1.72 2014/12/16 18:30:04 tedu Exp $ */
/* $NetBSD: kern_ktrace.c,v 1.23 1996/02/09 18:59:36 christos Exp $ */
/*
#include <sys/file.h>
#include <sys/namei.h>
#include <sys/vnode.h>
+#include <sys/lock.h>
#include <sys/ktrace.h>
#include <sys/malloc.h>
#include <sys/syslog.h>
-/* $OpenBSD: kern_sig.c,v 1.175 2014/11/16 05:42:21 guenther Exp $ */
+/* $OpenBSD: kern_sig.c,v 1.176 2014/12/16 18:30:04 tedu Exp $ */
/* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */
/*
#include <sys/mount.h>
#include <sys/syscallargs.h>
+#include <uvm/uvm_extern.h>
+
int filt_sigattach(struct knote *kn);
void filt_sigdetach(struct knote *kn);
int filt_signal(struct knote *kn, long hint);
-/* $OpenBSD: spec_vnops.c,v 1.80 2014/11/03 21:28:35 tedu Exp $ */
+/* $OpenBSD: spec_vnops.c,v 1.81 2014/12/16 18:30:04 tedu Exp $ */
/* $NetBSD: spec_vnops.c,v 1.29 1996/04/22 01:42:38 christos Exp $ */
/*
#include <sys/mount.h>
#include <sys/namei.h>
#include <sys/vnode.h>
+#include <sys/lock.h>
#include <sys/stat.h>
#include <sys/errno.h>
#include <sys/ioctl.h>
-/* $OpenBSD: subr_disk.c,v 1.173 2014/11/03 21:00:27 tedu Exp $ */
+/* $OpenBSD: subr_disk.c,v 1.174 2014/12/16 18:30:04 tedu Exp $ */
/* $NetBSD: subr_disk.c,v 1.17 1996/03/16 23:17:08 christos Exp $ */
/*
}
printf(": ");
s = splhigh();
- cnpollc(TRUE);
+ cnpollc(1);
len = getsn(buf, sizeof(buf));
- cnpollc(FALSE);
+ cnpollc(0);
splx(s);
if (strcmp(buf, "exit") == 0)
reboot(exitflags);
rootdv->dv_class == DV_DISK ? "b" : "");
printf(": ");
s = splhigh();
- cnpollc(TRUE);
+ cnpollc(1);
len = getsn(buf, sizeof(buf));
- cnpollc(FALSE);
+ cnpollc(0);
splx(s);
if (strcmp(buf, "exit") == 0)
reboot(exitflags);
-/* $OpenBSD: tty.c,v 1.117 2014/12/10 02:44:47 tedu Exp $ */
+/* $OpenBSD: tty.c,v 1.118 2014/12/16 18:30:04 tedu Exp $ */
/* $NetBSD: tty.c,v 1.68.4.2 1996/06/06 16:04:52 thorpej Exp $ */
/*-
#include <sys/namei.h>
+#include <uvm/uvm_extern.h>
+
#include <dev/rndvar.h>
#include "pty.h"
-/* $OpenBSD: tty_tty.c,v 1.12 2011/10/06 09:14:35 mikeb Exp $ */
+/* $OpenBSD: tty_tty.c,v 1.13 2014/12/16 18:30:04 tedu Exp $ */
/* $NetBSD: tty_tty.c,v 1.13 1996/03/30 22:24:46 christos Exp $ */
/*-
#include <sys/proc.h>
#include <sys/tty.h>
#include <sys/vnode.h>
+#include <sys/lock.h>
#include <sys/file.h>
#include <sys/conf.h>
-/* $OpenBSD: vfs_bio.c,v 1.164 2014/12/11 14:33:48 jmc Exp $ */
+/* $OpenBSD: vfs_bio.c,v 1.165 2014/12/16 18:30:04 tedu Exp $ */
/* $NetBSD: vfs_bio.c,v 1.44 1996/06/11 11:15:36 pk Exp $ */
/*
#include <sys/hibernate.h>
#endif /* HIBERNATE */
+#include <uvm/uvm_extern.h>
+
int nobuffers;
int needbuffer;
struct bio_ops bioops;
-/* $OpenBSD: vfs_cache.c,v 1.38 2014/12/10 02:44:47 tedu Exp $ */
+/* $OpenBSD: vfs_cache.c,v 1.39 2014/12/16 18:30:04 tedu Exp $ */
/* $NetBSD: vfs_cache.c,v 1.13 1996/02/04 02:18:09 christos Exp $ */
/*
#include <sys/time.h>
#include <sys/mount.h>
#include <sys/vnode.h>
+#include <sys/lock.h>
#include <sys/namei.h>
#include <sys/errno.h>
#include <sys/malloc.h>
-/* $OpenBSD: vfs_getcwd.c,v 1.23 2014/11/03 03:08:00 deraadt Exp $ */
+/* $OpenBSD: vfs_getcwd.c,v 1.24 2014/12/16 18:30:04 tedu Exp $ */
/* $NetBSD: vfs_getcwd.c,v 1.3.2.3 1999/07/11 10:24:09 sommerfeld Exp $ */
/*
#include <sys/kernel.h>
#include <sys/file.h>
#include <sys/stat.h>
+#include <sys/lock.h>
#include <sys/vnode.h>
#include <sys/mount.h>
#include <sys/proc.h>
-/* $OpenBSD: vfs_lookup.c,v 1.49 2014/12/10 02:44:47 tedu Exp $ */
+/* $OpenBSD: vfs_lookup.c,v 1.50 2014/12/16 18:30:04 tedu Exp $ */
/* $NetBSD: vfs_lookup.c,v 1.17 1996/02/09 19:00:59 christos Exp $ */
/*
#include <sys/time.h>
#include <sys/namei.h>
#include <sys/vnode.h>
+#include <sys/lock.h>
#include <sys/mount.h>
#include <sys/errno.h>
#include <sys/malloc.h>
-/* $OpenBSD: vfs_subr.c,v 1.224 2014/12/10 02:44:47 tedu Exp $ */
+/* $OpenBSD: vfs_subr.c,v 1.225 2014/12/16 18:30:04 tedu Exp $ */
/* $NetBSD: vfs_subr.c,v 1.53 1996/04/22 01:39:13 christos Exp $ */
/*
#include <netinet/in.h>
+#include <uvm/uvm_extern.h>
+#include <uvm/uvm_vnode.h>
+
#include "softraid.h"
void sr_shutdown(void);
#endif
struct pool vnode_pool;
+struct pool uvm_vnode_pool;
static int rb_buf_compare(struct buf *b1, struct buf *b2);
RB_GENERATE(buf_rb_bufs, buf, b_rbbufs, rb_buf_compare);
maxvnodes = 2 * desiredvnodes;
pool_init(&vnode_pool, sizeof(struct vnode), 0, 0, 0, "vnodes",
&pool_allocator_nointr);
+ pool_init(&uvm_vnode_pool, sizeof(struct uvm_vnode), 0, 0, 0, "uvmvnodes",
+ &pool_allocator_nointr);
TAILQ_INIT(&vnode_hold_list);
TAILQ_INIT(&vnode_free_list);
TAILQ_INIT(&mountlist);
((TAILQ_FIRST(listhd = &vnode_hold_list) == NULL) || toggle))) {
splx(s);
vp = pool_get(&vnode_pool, PR_WAITOK | PR_ZERO);
+ vp->v_uvm = pool_get(&uvm_vnode_pool, PR_WAITOK | PR_ZERO);
+ vp->v_uvm->u_vnode = vp;
RB_INIT(&vp->v_bufs_tree);
RB_INIT(&vp->v_nc_tree);
TAILQ_INIT(&vp->v_cache_dst);
-/* $OpenBSD: vfs_sync.c,v 1.52 2014/09/09 07:07:39 blambert Exp $ */
+/* $OpenBSD: vfs_sync.c,v 1.53 2014/12/16 18:30:04 tedu Exp $ */
/*
* Portions of this code are:
#include <sys/proc.h>
#include <sys/mount.h>
#include <sys/vnode.h>
+#include <sys/lock.h>
#include <sys/buf.h>
#include <sys/malloc.h>
-/* $OpenBSD: vfs_syscalls.c,v 1.215 2014/12/08 20:56:11 guenther Exp $ */
+/* $OpenBSD: vfs_syscalls.c,v 1.216 2014/12/16 18:30:04 tedu Exp $ */
/* $NetBSD: vfs_syscalls.c,v 1.71 1996/04/23 10:29:02 mycroft Exp $ */
/*
#include <sys/sysctl.h>
#include <sys/file.h>
#include <sys/stat.h>
+#include <sys/lock.h>
#include <sys/vnode.h>
#include <sys/mount.h>
#include <sys/proc.h>
-/* $OpenBSD: vfs_vnops.c,v 1.79 2014/11/03 21:28:35 tedu Exp $ */
+/* $OpenBSD: vfs_vnops.c,v 1.80 2014/12/16 18:30:04 tedu Exp $ */
/* $NetBSD: vfs_vnops.c,v 1.20 1996/02/04 02:18:41 christos Exp $ */
/*
#include <sys/signalvar.h>
#include <sys/mount.h>
#include <sys/namei.h>
+#include <sys/lock.h>
#include <sys/vnode.h>
#include <sys/ioctl.h>
#include <sys/tty.h>
-/* $OpenBSD: dead_vnops.c,v 1.27 2014/09/14 14:17:26 jsg Exp $ */
+/* $OpenBSD: dead_vnops.c,v 1.28 2014/12/16 18:30:04 tedu Exp $ */
/* $NetBSD: dead_vnops.c,v 1.16 1996/02/13 13:12:48 mycroft Exp $ */
/*
#include <sys/systm.h>
#include <sys/time.h>
#include <sys/vnode.h>
+#include <sys/lock.h>
#include <sys/errno.h>
#include <sys/namei.h>
#include <sys/buf.h>
-/* $OpenBSD: fifo_vnops.c,v 1.43 2014/11/03 21:28:35 tedu Exp $ */
+/* $OpenBSD: fifo_vnops.c,v 1.44 2014/12/16 18:30:04 tedu Exp $ */
/* $NetBSD: fifo_vnops.c,v 1.18 1996/03/16 23:52:42 christos Exp $ */
/*
#include <sys/time.h>
#include <sys/namei.h>
#include <sys/vnode.h>
+#include <sys/lock.h>
#include <sys/socket.h>
#include <sys/socketvar.h>
#include <sys/stat.h>
-/* $OpenBSD: fuse_lookup.c,v 1.9 2014/03/18 08:51:53 mpi Exp $ */
+/* $OpenBSD: fuse_lookup.c,v 1.10 2014/12/16 18:30:04 tedu Exp $ */
/*
* Copyright (c) 2012-2013 Sylvestre Gallon <ccna.syl@gmail.com>
*
#include <sys/namei.h>
#include <sys/statvfs.h>
#include <sys/vnode.h>
+#include <sys/lock.h>
#include <sys/fusebuf.h>
#include "fusefs_node.h"
-/* $OpenBSD: fuse_vfsops.c,v 1.12 2014/10/03 18:53:13 tedu Exp $ */
+/* $OpenBSD: fuse_vfsops.c,v 1.13 2014/12/16 18:30:04 tedu Exp $ */
/*
* Copyright (c) 2012-2013 Sylvestre Gallon <ccna.syl@gmail.com>
*
*/
#include <sys/param.h>
+#include <sys/systm.h>
#include <sys/file.h>
#include <sys/filedesc.h>
#include <sys/malloc.h>
-/* $OpenBSD: fuse_vnops.c,v 1.20 2014/08/10 09:23:06 jsg Exp $ */
+/* $OpenBSD: fuse_vnops.c,v 1.21 2014/12/16 18:30:04 tedu Exp $ */
/*
* Copyright (c) 2012-2013 Sylvestre Gallon <ccna.syl@gmail.com>
*
#include <sys/specdev.h>
#include <sys/statvfs.h>
#include <sys/vnode.h>
+#include <sys/lock.h>
#include <sys/fusebuf.h>
#include "fusefs_node.h"
-/* $OpenBSD: msdosfs_conv.c,v 1.17 2014/04/21 15:35:02 krw Exp $ */
+/* $OpenBSD: msdosfs_conv.c,v 1.18 2014/12/16 18:30:04 tedu Exp $ */
/* $NetBSD: msdosfs_conv.c,v 1.24 1997/10/17 11:23:54 ws Exp $ */
/*-
#include <sys/kernel.h> /* defines tz */
#include <sys/dirent.h>
#include <sys/vnode.h>
+#include <sys/lock.h>
/*
* MSDOSFS include files.
-/* $OpenBSD: msdosfs_denode.c,v 1.51 2014/11/18 10:42:15 dlg Exp $ */
+/* $OpenBSD: msdosfs_denode.c,v 1.52 2014/12/16 18:30:04 tedu Exp $ */
/* $NetBSD: msdosfs_denode.c,v 1.23 1997/10/17 11:23:58 ws Exp $ */
/*-
#include <sys/malloc.h>
#include <sys/buf.h>
#include <sys/vnode.h>
+#include <sys/lock.h>
#include <sys/kernel.h> /* defines "time" */
#include <sys/dirent.h>
#include <sys/namei.h>
-/* $OpenBSD: msdosfs_fat.c,v 1.25 2014/06/18 17:24:46 tobias Exp $ */
+/* $OpenBSD: msdosfs_fat.c,v 1.26 2014/12/16 18:30:04 tedu Exp $ */
/* $NetBSD: msdosfs_fat.c,v 1.26 1997/10/17 11:24:02 ws Exp $ */
/*-
#include <sys/namei.h>
#include <sys/mount.h> /* to define statfs structure */
#include <sys/vnode.h> /* to define vattr structure */
+#include <sys/lock.h>
#include <sys/errno.h>
#include <sys/dirent.h>
-/* $OpenBSD: msdosfs_lookup.c,v 1.26 2013/06/11 16:42:16 deraadt Exp $ */
+/* $OpenBSD: msdosfs_lookup.c,v 1.27 2014/12/16 18:30:04 tedu Exp $ */
/* $NetBSD: msdosfs_lookup.c,v 1.34 1997/10/18 22:12:27 ws Exp $ */
/*-
#include <sys/namei.h>
#include <sys/buf.h>
#include <sys/vnode.h>
+#include <sys/lock.h>
#include <sys/mount.h>
#include <sys/dirent.h>
-/* $OpenBSD: msdosfs_vfsops.c,v 1.69 2014/12/09 07:05:06 doug Exp $ */
+/* $OpenBSD: msdosfs_vfsops.c,v 1.70 2014/12/16 18:30:04 tedu Exp $ */
/* $NetBSD: msdosfs_vfsops.c,v 1.48 1997/10/18 02:54:57 briggs Exp $ */
/*-
#include <sys/proc.h>
#include <sys/kernel.h>
#include <sys/vnode.h>
+#include <sys/lock.h>
#include <sys/specdev.h> /* XXX */ /* defines v_rdev */
#include <sys/mount.h>
#include <sys/buf.h>
-/* $OpenBSD: msdosfs_vnops.c,v 1.96 2014/11/03 21:28:35 tedu Exp $ */
+/* $OpenBSD: msdosfs_vnops.c,v 1.97 2014/12/16 18:30:04 tedu Exp $ */
/* $NetBSD: msdosfs_vnops.c,v 1.63 1997/10/17 11:24:19 ws Exp $ */
/*-
#include <sys/proc.h>
#include <sys/mount.h>
#include <sys/vnode.h>
+#include <sys/lock.h>
#include <sys/signalvar.h>
#include <sys/specdev.h> /* XXX */ /* defines v_rdev */
#include <sys/malloc.h>
-/* $OpenBSD: bpf.c,v 1.112 2014/12/02 18:11:56 tedu Exp $ */
+/* $OpenBSD: bpf.c,v 1.113 2014/12/16 18:30:04 tedu Exp $ */
/* $NetBSD: bpf.c,v 1.33 1997/02/21 23:59:35 thorpej Exp $ */
/*
#include "bpfilter.h"
#include <sys/param.h>
+#include <sys/systm.h>
#include <sys/mbuf.h>
#include <sys/proc.h>
#include <sys/signalvar.h>
-/* $OpenBSD: nfs_node.c,v 1.58 2014/11/15 00:03:12 tedu Exp $ */
+/* $OpenBSD: nfs_node.c,v 1.59 2014/12/16 18:30:04 tedu Exp $ */
/* $NetBSD: nfs_node.c,v 1.16 1996/02/18 11:53:42 fvdl Exp $ */
/*
#include <sys/mount.h>
#include <sys/namei.h>
#include <sys/vnode.h>
+#include <sys/lock.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/pool.h>
-/* $OpenBSD: nfs_serv.c,v 1.100 2014/11/18 02:22:33 tedu Exp $ */
+/* $OpenBSD: nfs_serv.c,v 1.101 2014/12/16 18:30:04 tedu Exp $ */
/* $NetBSD: nfs_serv.c,v 1.34 1997/05/12 23:37:12 fvdl Exp $ */
/*
#include <sys/file.h>
#include <sys/namei.h>
#include <sys/vnode.h>
+#include <sys/lock.h>
#include <sys/mount.h>
#include <sys/socket.h>
#include <sys/socketvar.h>
-/* $OpenBSD: nfs_vfsops.c,v 1.103 2014/11/15 00:03:12 tedu Exp $ */
+/* $OpenBSD: nfs_vfsops.c,v 1.104 2014/12/16 18:30:04 tedu Exp $ */
/* $NetBSD: nfs_vfsops.c,v 1.46.4.1 1996/05/25 22:40:35 fvdl Exp $ */
/*
#include <sys/proc.h>
#include <sys/namei.h>
#include <sys/vnode.h>
+#include <sys/lock.h>
#include <sys/kernel.h>
#include <sys/mount.h>
#include <sys/swap.h>
-/* $OpenBSD: nfs_vnops.c,v 1.157 2014/12/03 04:16:58 tedu Exp $ */
+/* $OpenBSD: nfs_vnops.c,v 1.158 2014/12/16 18:30:04 tedu Exp $ */
/* $NetBSD: nfs_vnops.c,v 1.62.4.1 1996/07/08 20:26:52 jtc Exp $ */
/*
#include <sys/conf.h>
#include <sys/namei.h>
#include <sys/vnode.h>
+#include <sys/lock.h>
#include <sys/dirent.h>
#include <sys/fcntl.h>
#include <sys/lockf.h>
-/* $OpenBSD: st.c,v 1.127 2014/09/14 14:17:26 jsg Exp $ */
+/* $OpenBSD: st.c,v 1.128 2014/12/16 18:30:04 tedu Exp $ */
/* $NetBSD: st.c,v 1.71 1997/02/21 23:03:49 thorpej Exp $ */
/*
if (st->blksize)
st->flags |= ST_FIXEDBLOCKS;
} else {
- if ((error = st_decide_mode(st, FALSE)) != 0)
+ if ((error = st_decide_mode(st, 0)) != 0)
goto done;
}
if ((error = st_mode_select(st, 0)) != 0) {
if (!(st->flags & ST_MOUNTED))
return;
SC_DEBUG(sc_link, SDEV_DB1, ("unmounting\n"));
- st_check_eod(st, FALSE, &nmarks, SCSI_IGNORE_NOT_READY);
+ st_check_eod(st, 0, &nmarks, SCSI_IGNORE_NOT_READY);
if (rewind)
st_rewind(st, 0, SCSI_IGNORE_NOT_READY);
scsi_prevent(sc_link, PR_ALLOW,
case MTBSF: /* backward space file */
number = -number;
case MTFSF: /* forward space file */
- error = st_check_eod(st, FALSE, &nmarks, flags);
+ error = st_check_eod(st, 0, &nmarks, flags);
if (!error)
error = st_space(st, number - nmarks,
SP_FILEMARKS, flags);
case MTBSR: /* backward space record */
number = -number;
case MTFSR: /* forward space record */
- error = st_check_eod(st, TRUE, &nmarks, flags);
+ error = st_check_eod(st, 1, &nmarks, flags);
if (!error)
error = st_space(st, number, SP_BLKS, flags);
break;
error = st_load(st, LD_LOAD, flags);
break;
case MTEOM: /* forward space to end of media */
- error = st_check_eod(st, FALSE, &nmarks, flags);
+ error = st_check_eod(st, 0, &nmarks, flags);
if (!error)
error = st_space(st, 1, SP_EOM, flags);
break;
st->media_eom = -1;
if (type != LD_LOAD) {
- error = st_check_eod(st, FALSE, &nmarks, flags);
+ error = st_check_eod(st, 0, &nmarks, flags);
if (error)
return (error);
}
struct scsi_xfer *xs;
int error, nmarks;
- error = st_check_eod(st, FALSE, &nmarks, flags);
+ error = st_check_eod(st, 0, &nmarks, flags);
if (error)
return (error);
st->flags &= ~ST_PER_ACTION;
-/* $OpenBSD: vnode.h,v 1.127 2014/11/19 18:04:54 tedu Exp $ */
+/* $OpenBSD: vnode.h,v 1.128 2014/12/16 18:30:04 tedu Exp $ */
/* $NetBSD: vnode.h,v 1.38 1996/02/29 20:59:05 cgd Exp $ */
/*
#include <sys/selinfo.h>
#include <sys/tree.h>
-#include <uvm/uvm_extern.h>
-#include <uvm/uvm_vnode.h>
-
/*
* The vnode is the focus of all file activity in UNIX. There is a
* unique vnode allocated for each active file, each current directory,
RB_HEAD(buf_rb_bufs, buf);
RB_HEAD(namecache_rb_cache, namecache);
+struct uvm_vnode;
struct vnode {
- struct uvm_vnode v_uvm; /* uvm data */
+ struct uvm_vnode *v_uvm; /* uvm data */
struct vops *v_op; /* vnode operations vector */
enum vtype v_type; /* vnode type */
enum vtagtype v_tag; /* type of underlying data */
int softdep_fsync(struct vnode *);
int getvnode(struct filedesc *, int, struct file **);
+/* uvm */
+void uvm_vnp_setsize(struct vnode *, off_t);
+void uvm_vnp_sync(struct mount *);
+void uvm_vnp_terminate(struct vnode *);
+int uvm_vnp_uncache(struct vnode *);
+
+
#endif /* _KERNEL */
#endif /* _SYS_VNODE_H_ */
-/* $OpenBSD: tmpfs.h,v 1.5 2013/12/14 18:01:52 espie Exp $ */
+/* $OpenBSD: tmpfs.h,v 1.6 2014/12/16 18:30:04 tedu Exp $ */
/* $NetBSD: tmpfs.h,v 1.45 2011/09/27 01:10:43 christos Exp $ */
/*
#include <sys/stdint.h>
#include <sys/rwlock.h>
+#include <uvm/uvm_extern.h>
+
/*
* Internal representation of a tmpfs directory entry.
*
-/* $OpenBSD: uvm_extern.h,v 1.126 2014/12/15 02:24:23 guenther Exp $ */
+/* $OpenBSD: uvm_extern.h,v 1.127 2014/12/16 18:30:04 tedu Exp $ */
/* $NetBSD: uvm_extern.h,v 1.57 2001/03/09 01:02:12 chs Exp $ */
/*
struct uvm_coredump_state *), void *);
void uvm_grow(struct proc *, vaddr_t);
void uvm_deallocate(vm_map_t, vaddr_t, vsize_t);
-void uvm_vnp_setsize(struct vnode *, voff_t);
-void uvm_vnp_sync(struct mount *);
-void uvm_vnp_terminate(struct vnode *);
-boolean_t uvm_vnp_uncache(struct vnode *);
struct uvm_object *uvn_attach(struct vnode *, vm_prot_t);
void uvm_pagezero_thread(void *);
void kmeminit_nkmempages(void);
-/* $OpenBSD: uvm_mmap.c,v 1.102 2014/12/15 02:24:23 guenther Exp $ */
+/* $OpenBSD: uvm_mmap.c,v 1.103 2014/12/16 18:30:04 tedu Exp $ */
/* $NetBSD: uvm_mmap.c,v 1.49 2001/02/18 21:19:08 chs Exp $ */
/*
if (fd >= 0) {
if ((error = getvnode(p->p_fd, fd, &fp)) != 0)
return (error);
- uobj = &((struct vnode *)fp->f_data)->v_uvm.u_obj;
+ uobj = &((struct vnode *)fp->f_data)->v_uvm->u_obj;
uoff = SCARG(uap, pos);
} else {
fp = NULL;
-/* $OpenBSD: uvm_vnode.c,v 1.85 2014/11/16 12:31:01 deraadt Exp $ */
+/* $OpenBSD: uvm_vnode.c,v 1.86 2014/12/16 18:30:04 tedu Exp $ */
/* $NetBSD: uvm_vnode.c,v 1.36 2000/11/24 20:34:01 chs Exp $ */
/*
struct uvm_object *
uvn_attach(struct vnode *vp, vm_prot_t accessprot)
{
- struct uvm_vnode *uvn = &vp->v_uvm;
+ struct uvm_vnode *uvn = vp->v_uvm;
struct vattr vattr;
int oldflags, result;
struct partinfo pi;
/* get other pointers ... */
uvn = (struct uvm_vnode *) uobj;
- vp = (struct vnode *) uobj;
+ vp = uvn->u_vnode;
/*
* clear VTEXT flag now that there are no mappings left (VTEXT is used
void
uvm_vnp_terminate(struct vnode *vp)
{
- struct uvm_vnode *uvn = &vp->v_uvm;
+ struct uvm_vnode *uvn = vp->v_uvm;
int oldflags;
/* check if it is valid */
/* init values */
waitf = (flags & PGO_SYNCIO) ? M_WAITOK : M_NOWAIT;
- vn = (struct vnode *) uvn;
+ vn = uvn->u_vnode;
file_offset = pps[0]->offset;
/* check for sync'ing I/O. */
* vn_writechk: if VTEXT vnode and can't uncache return "text busy"
*/
-boolean_t
+int
uvm_vnp_uncache(struct vnode *vp)
{
- struct uvm_vnode *uvn = &vp->v_uvm;
+ struct uvm_vnode *uvn = vp->v_uvm;
/* lock uvn part of the vnode and check if we need to do anything */
*/
void
-uvm_vnp_setsize(struct vnode *vp, voff_t newsize)
+uvm_vnp_setsize(struct vnode *vp, off_t newsize)
{
- struct uvm_vnode *uvn = &vp->v_uvm;
+ struct uvm_vnode *uvn = vp->v_uvm;
/* lock uvn and check for valid object, and if valid: do it! */
if (uvn->u_flags & UVM_VNODE_VALID) {
*/
SIMPLEQ_INIT(&uvn_sync_q);
LIST_FOREACH(uvn, &uvn_wlist, u_wlist) {
- vp = (struct vnode *)uvn;
+ vp = uvn->u_vnode;
if (mp && vp->v_mount != mp)
continue;
-/* $OpenBSD: uvm_vnode.h,v 1.13 2014/06/29 22:56:31 deraadt Exp $ */
+/* $OpenBSD: uvm_vnode.h,v 1.14 2014/12/16 18:30:04 tedu Exp $ */
/* $NetBSD: uvm_vnode.h,v 1.9 2000/03/26 20:54:48 kleink Exp $ */
/*
*/
/*
- * the uvm_vnode structure. put at the top of the vnode data structure.
- * this allows:
- * (struct vnode *) == (struct uvm_vnode *) == (struct uvm_object *)
+ * the uvm_vnode structure.
*/
+struct vnode;
+
struct uvm_vnode {
struct uvm_object u_obj; /* the actual VM object */
+ struct vnode *u_vnode; /* pointer back to vnode */
int u_flags; /* flags */
int u_nio; /* number of running I/O requests */
voff_t u_size; /* size of object */