diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2001-11-15 06:22:31 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2001-11-15 06:22:31 +0000 |
commit | ce070c7054f4f778763aa8d668f1f92ae896ed05 (patch) | |
tree | 7ab7f3ae0de51dededd5a4bc865ded5cb72182ad | |
parent | 19713aecd94bdccec26003f193cc82be3dd363c0 (diff) |
New function vn_marktext - mark a vnode as executing a text image.
Use where VTEXT was set in vnode flags before. Doesn't do anything else (yet).
-rw-r--r-- | sys/compat/common/compat_exec.c | 4 | ||||
-rw-r--r-- | sys/compat/hpux/hpux_exec.c | 4 | ||||
-rw-r--r-- | sys/compat/ibcs2/ibcs2_exec.c | 4 | ||||
-rw-r--r-- | sys/compat/linux/linux_exec.c | 6 | ||||
-rw-r--r-- | sys/compat/m68k4k/m68k4k_exec.c | 4 | ||||
-rw-r--r-- | sys/compat/sunos/sunos_exec.c | 4 | ||||
-rw-r--r-- | sys/kern/exec_aout.c | 4 | ||||
-rw-r--r-- | sys/kern/exec_ecoff.c | 4 | ||||
-rw-r--r-- | sys/kern/exec_elf.c | 4 | ||||
-rw-r--r-- | sys/kern/vfs_vnops.c | 12 | ||||
-rw-r--r-- | sys/sys/vnode.h | 3 |
11 files changed, 32 insertions, 21 deletions
diff --git a/sys/compat/common/compat_exec.c b/sys/compat/common/compat_exec.c index d22b2eace7c..75b147db891 100644 --- a/sys/compat/common/compat_exec.c +++ b/sys/compat/common/compat_exec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: compat_exec.c,v 1.6 2001/11/06 19:53:17 miod Exp $ */ +/* $OpenBSD: compat_exec.c,v 1.7 2001/11/15 06:22:29 art Exp $ */ /* $NetBSD: compat_exec.c,v 1.1 1996/05/18 15:52:21 christos Exp $ */ /* @@ -75,7 +75,7 @@ exec_aout_prep_oldzmagic(p, epp) #endif return ETXTBSY; } - epp->ep_vp->v_flag |= VTEXT; + vn_marktext(epp->ep_vp); /* set up command for text segment */ NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_pagedvn, execp->a_text, diff --git a/sys/compat/hpux/hpux_exec.c b/sys/compat/hpux/hpux_exec.c index ed8d7bd2f2d..b73826dd406 100644 --- a/sys/compat/hpux/hpux_exec.c +++ b/sys/compat/hpux/hpux_exec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hpux_exec.c,v 1.13 2001/11/06 19:53:17 miod Exp $ */ +/* $OpenBSD: hpux_exec.c,v 1.14 2001/11/15 06:22:29 art Exp $ */ /* $NetBSD: hpux_exec.c,v 1.8 1997/03/16 10:14:44 thorpej Exp $ */ /* @@ -192,7 +192,7 @@ exec_hpux_prep_zmagic(p, epp) if ((execp->ha_text != 0 || execp->ha_data != 0) && epp->ep_vp->v_writecount != 0) return (ETXTBSY); - epp->ep_vp->v_flag |= VTEXT; + vn_marktext(epp->ep_vp); /* * HP-UX ZMAGIC executables need to have their segment diff --git a/sys/compat/ibcs2/ibcs2_exec.c b/sys/compat/ibcs2/ibcs2_exec.c index 128cba7df4e..64497eb85cf 100644 --- a/sys/compat/ibcs2/ibcs2_exec.c +++ b/sys/compat/ibcs2/ibcs2_exec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ibcs2_exec.c,v 1.11 2001/11/06 19:53:17 miod Exp $ */ +/* $OpenBSD: ibcs2_exec.c,v 1.12 2001/11/15 06:22:29 art Exp $ */ /* $NetBSD: ibcs2_exec.c,v 1.12 1996/10/12 02:13:52 thorpej Exp $ */ /* @@ -368,7 +368,7 @@ n */ #endif return ETXTBSY; } - epp->ep_vp->v_flag |= VTEXT; + vn_marktext(epp->ep_vp); #endif /* DPRINTF(("VMCMD: addr %x size %d offset %d\n", epp->ep_taddr, diff --git a/sys/compat/linux/linux_exec.c b/sys/compat/linux/linux_exec.c index b4b527827f9..c05e8e0999e 100644 --- a/sys/compat/linux/linux_exec.c +++ b/sys/compat/linux/linux_exec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: linux_exec.c,v 1.18 2001/11/06 19:53:17 miod Exp $ */ +/* $OpenBSD: linux_exec.c,v 1.19 2001/11/15 06:22:30 art Exp $ */ /* $NetBSD: linux_exec.c,v 1.13 1996/04/05 00:01:10 christos Exp $ */ /* @@ -354,7 +354,7 @@ exec_linux_aout_prep_qmagic(p, epp) #endif return (ETXTBSY); } - epp->ep_vp->v_flag |= VTEXT; + vn_marktext(epp->ep_vp); /* set up command for text segment */ NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_pagedvn, execp->a_text, @@ -474,7 +474,7 @@ linux_sys_uselib(p, v, retval) vrele(vp); return (ETXTBSY); } - vp->v_flag |= VTEXT; + vn_marktext(vp); VMCMDSET_INIT(&vcset); diff --git a/sys/compat/m68k4k/m68k4k_exec.c b/sys/compat/m68k4k/m68k4k_exec.c index f4563945c21..30dfeb6b1fd 100644 --- a/sys/compat/m68k4k/m68k4k_exec.c +++ b/sys/compat/m68k4k/m68k4k_exec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: m68k4k_exec.c,v 1.4 2001/11/06 19:53:17 miod Exp $ */ +/* $OpenBSD: m68k4k_exec.c,v 1.5 2001/11/15 06:22:30 art Exp $ */ /* $NetBSD: m68k4k_exec.c,v 1.1 1996/09/10 22:01:20 thorpej Exp $ */ /* @@ -154,7 +154,7 @@ exec_m68k4k_prep_zmagic(p, epp) #endif return ETXTBSY; } - epp->ep_vp->v_flag |= VTEXT; + vn_marktext(epp->ep_vp); /* set up command for text segment */ NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_pagedvn, execp->a_text, diff --git a/sys/compat/sunos/sunos_exec.c b/sys/compat/sunos/sunos_exec.c index a975051308f..d7cbe05453a 100644 --- a/sys/compat/sunos/sunos_exec.c +++ b/sys/compat/sunos/sunos_exec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sunos_exec.c,v 1.14 2001/11/06 19:53:17 miod Exp $ */ +/* $OpenBSD: sunos_exec.c,v 1.15 2001/11/15 06:22:30 art Exp $ */ /* $NetBSD: sunos_exec.c,v 1.11 1996/05/05 12:01:47 briggs Exp $ */ /* @@ -175,7 +175,7 @@ sunos_exec_aout_prep_zmagic(p, epp) #endif return ETXTBSY; } - epp->ep_vp->v_flag |= VTEXT; + vn_marktext(epp->ep_vp); /* set up command for text segment */ NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_pagedvn, execp->a_text, diff --git a/sys/kern/exec_aout.c b/sys/kern/exec_aout.c index 202ee8f3af8..1ef6f5b3d62 100644 --- a/sys/kern/exec_aout.c +++ b/sys/kern/exec_aout.c @@ -1,4 +1,4 @@ -/* $OpenBSD: exec_aout.c,v 1.6 2001/11/06 19:53:20 miod Exp $ */ +/* $OpenBSD: exec_aout.c,v 1.7 2001/11/15 06:22:30 art Exp $ */ /* $NetBSD: exec_aout.c,v 1.14 1996/02/04 02:15:01 christos Exp $ */ /* @@ -129,7 +129,7 @@ exec_aout_prep_zmagic(p, epp) #endif return ETXTBSY; } - epp->ep_vp->v_flag |= VTEXT; + vn_marktext(epp->ep_vp); /* set up command for text segment */ NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_pagedvn, execp->a_text, diff --git a/sys/kern/exec_ecoff.c b/sys/kern/exec_ecoff.c index 5e0d343adff..d7f7dac6115 100644 --- a/sys/kern/exec_ecoff.c +++ b/sys/kern/exec_ecoff.c @@ -1,4 +1,4 @@ -/* $OpenBSD: exec_ecoff.c,v 1.8 2001/11/06 19:53:20 miod Exp $ */ +/* $OpenBSD: exec_ecoff.c,v 1.9 2001/11/15 06:22:30 art Exp $ */ /* $NetBSD: exec_ecoff.c,v 1.8 1996/05/19 20:36:06 jonathan Exp $ */ /* @@ -198,7 +198,7 @@ exec_ecoff_prep_zmagic(p, epp) #endif return ETXTBSY; } - epp->ep_vp->v_flag |= VTEXT; + vn_marktext(epp->ep_vp); /* set up command for text segment */ NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_pagedvn, eap->tsize, diff --git a/sys/kern/exec_elf.c b/sys/kern/exec_elf.c index 889b150ce29..2ef35faab22 100644 --- a/sys/kern/exec_elf.c +++ b/sys/kern/exec_elf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: exec_elf.c,v 1.36 2001/11/06 19:53:20 miod Exp $ */ +/* $OpenBSD: exec_elf.c,v 1.37 2001/11/15 06:22:30 art Exp $ */ /* * Copyright (c) 1996 Per Fogelstrom @@ -636,7 +636,7 @@ native: #endif free((char *)ph, M_TEMP); - epp->ep_vp->v_flag |= VTEXT; + vn_marktext(epp->ep_vp); return (exec_setup_stack(p, epp)); bad: diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index a6a4971a36b..ee5eb0baee2 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_vnops.c,v 1.34 2001/11/06 19:53:20 miod Exp $ */ +/* $OpenBSD: vfs_vnops.c,v 1.35 2001/11/15 06:22:30 art Exp $ */ /* $NetBSD: vfs_vnops.c,v 1.20 1996/02/04 02:18:41 christos Exp $ */ /* @@ -208,6 +208,16 @@ vn_writechk(vp) } /* + * Mark a vnode as being the text image of a running process. + */ +void +vn_marktext(vp) + struct vnode *vp; +{ + vp->v_flag |= VTEXT; +} + +/* * Vnode close call */ int diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index 9205aabd9f1..64a90990d0e 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vnode.h,v 1.40 2001/11/06 19:53:21 miod Exp $ */ +/* $OpenBSD: vnode.h,v 1.41 2001/11/15 06:22:30 art Exp $ */ /* $NetBSD: vnode.h,v 1.38 1996/02/29 20:59:05 cgd Exp $ */ /* @@ -449,6 +449,7 @@ int vop_generic_kqfilter __P((void *)); int vn_stat __P((struct vnode *vp, struct stat *sb, struct proc *p)); int vn_statfile __P((struct file *fp, struct stat *sb, struct proc *p)); int vn_writechk __P((struct vnode *vp)); +void vn_marktext __P((struct vnode *vp)); void vn_syncer_add_to_worklist __P((struct vnode *vp, int delay)); void sched_sync __P((struct proc *)); |