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 Pull up revision 1.7 (requested by junyoung ...



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

description:
Pull up revision 1.7 (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/common/compat_exec.c        |  22 ++++++----------------
 sys/compat/linux/common/linux_uselib.c |  12 +++++-------
 2 files changed, 11 insertions(+), 23 deletions(-)

diffs (83 lines):

diff -r 26edd8d44dae -r 7e50b3dcf59a sys/compat/common/compat_exec.c
--- a/sys/compat/common/compat_exec.c   Thu Oct 02 09:52:37 2003 +0000
+++ b/sys/compat/common/compat_exec.c   Thu Oct 02 09:52:42 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat_exec.c,v 1.5.10.1 2003/09/27 15:53:07 tron Exp $        */
+/*     $NetBSD: compat_exec.c,v 1.5.10.2 2003/10/02 09:52:42 tron Exp $        */
 
 /*
  * Copyright (c) 1993, 1994 Christopher G. Demetriou
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: compat_exec.c,v 1.5.10.1 2003/09/27 15:53:07 tron Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_exec.c,v 1.5.10.2 2003/10/02 09:52:42 tron Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -56,6 +56,7 @@
        struct exec_package *epp;
 {
        struct exec *execp = epp->ep_hdr;
+       int error;
 
        epp->ep_taddr = 0;
        epp->ep_tsize = execp->a_text;
@@ -63,20 +64,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,
diff -r 26edd8d44dae -r 7e50b3dcf59a sys/compat/linux/common/linux_uselib.c
--- a/sys/compat/linux/common/linux_uselib.c    Thu Oct 02 09:52:37 2003 +0000
+++ b/sys/compat/linux/common/linux_uselib.c    Thu Oct 02 09:52:42 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_uselib.c,v 1.6 2002/03/16 20:43:54 christos Exp $        */
+/*     $NetBSD: linux_uselib.c,v 1.6.6.1 2003/10/02 09:52:42 tron Exp $        */
 
 /*-
  * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_uselib.c,v 1.6 2002/03/16 20:43:54 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_uselib.c,v 1.6.6.1 2003/10/02 09:52:42 tron Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -136,11 +136,9 @@
        daddr = taddr + tsize;
        dsize = hdr.a_data + hdr.a_bss;
 
-       if ((hdr.a_text != 0 || hdr.a_data != 0) && vp->v_writecount != 0) {
-               vrele(vp);
-                return ETXTBSY;
-        }
-       vp->v_flag |= VTEXT;
+       error = vn_marktext(vp);
+       if (error)
+               return (error);
 
        vcset.evs_cnt = 0;
        vcset.evs_used = 0;



Home | Main Index | Thread Index | Old Index