Module Name: src
Committed By: pooka
Date: Sun Aug 4 11:09:55 UTC 2013
Modified Files:
src/sys/rump/librump/rumpvfs: rumpfs.c
Log Message:
Use standard file-is-valid-until-last-reference-is-dropped semantics
for file contents.
via Justin Cormack & valgrind on github
To generate a diff of this commit:
cvs rdiff -u -r1.117 -r1.118 src/sys/rump/librump/rumpvfs/rumpfs.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/rump/librump/rumpvfs/rumpfs.c
diff -u src/sys/rump/librump/rumpvfs/rumpfs.c:1.117 src/sys/rump/librump/rumpvfs/rumpfs.c:1.118
--- src/sys/rump/librump/rumpvfs/rumpfs.c:1.117 Fri Jun 14 05:54:04 2013
+++ src/sys/rump/librump/rumpvfs/rumpfs.c Sun Aug 4 11:09:55 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: rumpfs.c,v 1.117 2013/06/14 05:54:04 pooka Exp $ */
+/* $NetBSD: rumpfs.c,v 1.118 2013/08/04 11:09:55 pooka Exp $ */
/*
* Copyright (c) 2009, 2010, 2011 Antti Kantee. All Rights Reserved.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.117 2013/06/14 05:54:04 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.118 2013/08/04 11:09:55 pooka Exp $");
#include <sys/param.h>
#include <sys/atomic.h>
@@ -1079,10 +1079,6 @@ rump_vop_remove(void *v)
if (rn->rn_flags & RUMPNODE_ET_PHONE_HOST)
return EOPNOTSUPP;
- if (vp->v_type == VREG) {
- rump_hyperfree(rn->rn_data, rn->rn_dlen);
- }
-
freedir(rnd, cnp);
rn->rn_flags |= RUMPNODE_CANRECLAIM;
@@ -1668,6 +1664,11 @@ rump_vop_reclaim(void *v)
vp->v_data = NULL;
if (rn->rn_flags & RUMPNODE_CANRECLAIM) {
+ if (vp->v_type == VREG && rn->rn_data) {
+ rump_hyperfree(rn->rn_data, rn->rn_dlen);
+ rn->rn_data = NULL;
+ }
+
if (vp->v_type == VLNK)
PNBUF_PUT(rn->rn_linktarg);
if (rn->rn_hostpath)