Source-Changes-HG archive

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

[src/trunk]: src/sys/rump/librump/rumpvfs Use standard file-is-valid-until-la...



details:   https://anonhg.NetBSD.org/src/rev/8182669da8fa
branches:  trunk
changeset: 789026:8182669da8fa
user:      pooka <pooka%NetBSD.org@localhost>
date:      Sun Aug 04 11:09:55 2013 +0000

description:
Use standard file-is-valid-until-last-reference-is-dropped semantics
for file contents.

via Justin Cormack & valgrind on github

diffstat:

 sys/rump/librump/rumpvfs/rumpfs.c |  13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diffs (41 lines):

diff -r 377a340315aa -r 8182669da8fa sys/rump/librump/rumpvfs/rumpfs.c
--- a/sys/rump/librump/rumpvfs/rumpfs.c Sun Aug 04 11:02:02 2013 +0000
+++ b/sys/rump/librump/rumpvfs/rumpfs.c Sun Aug 04 11:09:55 2013 +0000
@@ -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 @@
        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 @@
        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)



Home | Main Index | Thread Index | Old Index