summaryrefslogtreecommitdiffstats
path: root/sys/kern/imgact_elf.c
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2002-08-04 10:29:36 +0000
committerjeff <jeff@FreeBSD.org>2002-08-04 10:29:36 +0000
commit02517b6731ab2da44ce9b49260429744cf0114d5 (patch)
treee889f56910bf98cbee3be239655a9e4bbb928b2e /sys/kern/imgact_elf.c
parenta03ca02ee99a255a2c14a75ff8eb488960b13ea7 (diff)
downloadFreeBSD-src-02517b6731ab2da44ce9b49260429744cf0114d5.zip
FreeBSD-src-02517b6731ab2da44ce9b49260429744cf0114d5.tar.gz
- Replace v_flag with v_iflag and v_vflag
- v_vflag is protected by the vnode lock and is used when synchronization with VOP calls is needed. - v_iflag is protected by interlock and is used for dealing with vnode management issues. These flags include X/O LOCK, FREE, DOOMED, etc. - All accesses to v_iflag and v_vflag have either been locked or marked with mp_fixme's. - Many ASSERT_VOP_LOCKED calls have been added where the locking was not clear. - Many functions in vfs_subr.c were restructured to provide for stronger locking. Idea stolen from: BSD/OS
Diffstat (limited to 'sys/kern/imgact_elf.c')
-rw-r--r--sys/kern/imgact_elf.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c
index 1b35000..92e86af 100644
--- a/sys/kern/imgact_elf.c
+++ b/sys/kern/imgact_elf.c
@@ -500,10 +500,11 @@ __elfN(load_file)(struct proc *p, const char *file, u_long *addr,
error = exec_map_first_page(imgp);
/*
* Also make certain that the interpreter stays the same, so set
- * its VTEXT flag, too.
+ * its VV_TEXT flag, too.
*/
if (error == 0)
- nd->ni_vp->v_flag |= VTEXT;
+ nd->ni_vp->v_vflag |= VV_TEXT;
+
VOP_GETVOBJECT(nd->ni_vp, &imgp->object);
vm_object_reference(imgp->object);
@@ -628,10 +629,11 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp)
* VTEXT now since from here on out, there are places we can have
* a context switch. Better safe than sorry; I really don't want
* the file to change while it's being loaded.
+ *
+ * XXX We can't really set this flag safely without the vnode lock.
*/
- mtx_lock(&imgp->vp->v_interlock);
- imgp->vp->v_flag |= VTEXT;
- mtx_unlock(&imgp->vp->v_interlock);
+ mp_fixme("This needs the vnode lock to be safe.");
+ imgp->vp->v_vflag |= VV_TEXT;
if ((error = exec_extract_strings(imgp)) != 0)
goto fail;
OpenPOWER on IntegriCloud