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 Don't try to change the size of non...



details:   https://anonhg.NetBSD.org/src/rev/c85071cc96f6
branches:  trunk
changeset: 760366:c85071cc96f6
user:      pooka <pooka%NetBSD.org@localhost>
date:      Tue Jan 04 00:09:43 2011 +0000

description:
Don't try to change the size of non-reg nodes or when vattr doesn't
contain a new size.

from njoly

diffstat:

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

diffs (35 lines):

diff -r 4a5907f0beb6 -r c85071cc96f6 sys/rump/librump/rumpvfs/rumpfs.c
--- a/sys/rump/librump/rumpvfs/rumpfs.c Mon Jan 03 20:51:26 2011 +0000
+++ b/sys/rump/librump/rumpvfs/rumpfs.c Tue Jan 04 00:09:43 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rumpfs.c,v 1.79 2011/01/01 19:47:22 pooka Exp $        */
+/*     $NetBSD: rumpfs.c,v 1.80 2011/01/04 00:09:43 pooka Exp $        */
 
 /*
  * Copyright (c) 2009, 2010 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.79 2011/01/01 19:47:22 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.80 2011/01/04 00:09:43 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -776,10 +776,13 @@
                struct vattr *a_vap;
                kauth_cred_t a_cred;
        } */ *ap = v;
-       struct rumpfs_node *rn = ap->a_vp->v_data;
+       struct vnode *vp = ap->a_vp;
+       struct vattr *vap = ap->a_vap;
+       struct rumpfs_node *rn = vp->v_data;
 
-       memcpy(&rn->rn_va, ap->a_vap, sizeof(struct vattr));
-       uvm_vnp_setsize(ap->a_vp, ap->a_vap->va_size);
+       memcpy(&rn->rn_va, vap, sizeof(rn->rn_va));
+       if (vp->v_type == VREG && vap->va_size != VSIZENOTSET)
+               uvm_vnp_setsize(vp, vap->va_size);
        return 0;
 }
 



Home | Main Index | Thread Index | Old Index