Source-Changes-HG archive

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

[src/netbsd-1-6]: src/sys/compat/linux/common Pull up revision 1.50 (requeste...



details:   https://anonhg.NetBSD.org/src/rev/26edd8d44dae
branches:  netbsd-1-6
changeset: 530779:26edd8d44dae
user:      tron <tron%NetBSD.org@localhost>
date:      Thu Oct 02 09:52:37 2003 +0000

description:
Pull up revision 1.50 (requested by junyoung in ticket #1488):
count executable image pages as executable for vm-usage purposes.
also, always do the VTEXT vs. v_writecount mutual exclusion
(which we previously skipped if the text or data segment was empty).

diffstat:

 sys/compat/linux/common/linux_exec_aout.c |  22 ++++++----------------
 1 files changed, 6 insertions(+), 16 deletions(-)

diffs (50 lines):

diff -r f3977ac8e7e4 -r 26edd8d44dae sys/compat/linux/common/linux_exec_aout.c
--- a/sys/compat/linux/common/linux_exec_aout.c Thu Oct 02 09:52:22 2003 +0000
+++ b/sys/compat/linux/common/linux_exec_aout.c Thu Oct 02 09:52:37 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_exec_aout.c,v 1.47.10.1 2003/09/27 15:52:49 tron Exp $   */
+/*     $NetBSD: linux_exec_aout.c,v 1.47.10.2 2003/10/02 09:52:37 tron Exp $   */
 
 /*-
  * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_exec_aout.c,v 1.47.10.1 2003/09/27 15:52:49 tron Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_exec_aout.c,v 1.47.10.2 2003/10/02 09:52:37 tron Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -295,6 +295,7 @@
        struct exec_package *epp;
 {
        struct exec *execp = epp->ep_hdr;
+       int error;
 
        epp->ep_taddr = LINUX_N_TXTADDR(*execp, QMAGIC);
        epp->ep_tsize = execp->a_text;
@@ -302,20 +303,9 @@
        epp->ep_dsize = execp->a_data + execp->a_bss;
        epp->ep_entry = execp->a_entry;
 
-       /*
-        * check if vnode is in open for writing, because we want to
-        * demand-page out of it.  if it is, don't do it, for various
-        * reasons
-        */
-       if ((execp->a_text != 0 || execp->a_data != 0) &&
-           epp->ep_vp->v_writecount != 0) {
-#ifdef DIAGNOSTIC
-               if (epp->ep_vp->v_flag & VTEXT)
-                       panic("exec: a VTEXT vnode has writecount != 0");
-#endif
-               return ETXTBSY;
-       }
-       epp->ep_vp->v_flag |= VTEXT;
+       error = vn_marktext(epp->ep_vp);
+       if (error)
+               return (error);
 
        /* set up command for text segment */
        NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_pagedvn, execp->a_text,



Home | Main Index | Thread Index | Old Index