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 Report correct file size + deal wit...



details:   https://anonhg.NetBSD.org/src/rev/7219e2be5f62
branches:  trunk
changeset: 760251:7219e2be5f62
user:      pooka <pooka%NetBSD.org@localhost>
date:      Sat Jan 01 19:47:22 2011 +0000

description:
Report correct file size + deal with ftruncate() and O_APPEND.

diffstat:

 sys/rump/librump/rumpvfs/rumpfs.c |  15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diffs (51 lines):

diff -r bf8c5e023562 -r 7219e2be5f62 sys/rump/librump/rumpvfs/rumpfs.c
--- a/sys/rump/librump/rumpvfs/rumpfs.c Sat Jan 01 16:56:18 2011 +0000
+++ b/sys/rump/librump/rumpvfs/rumpfs.c Sat Jan 01 19:47:22 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rumpfs.c,v 1.78 2010/12/18 08:20:12 pooka Exp $        */
+/*     $NetBSD: rumpfs.c,v 1.79 2011/01/01 19:47:22 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.78 2010/12/18 08:20:12 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.79 2011/01/01 19:47:22 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -759,9 +759,12 @@
                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 rumpfs_node *rn = vp->v_data;
+       struct vattr *vap = ap->a_vap;
 
-       memcpy(ap->a_vap, &rn->rn_va, sizeof(struct vattr));
+       memcpy(vap, &rn->rn_va, sizeof(struct vattr));
+       vap->va_size = vp->v_size;
        return 0;
 }
 
@@ -776,6 +779,7 @@
        struct rumpfs_node *rn = ap->a_vp->v_data;
 
        memcpy(&rn->rn_va, ap->a_vap, sizeof(struct vattr));
+       uvm_vnp_setsize(ap->a_vp, ap->a_vap->va_size);
        return 0;
 }
 
@@ -1212,6 +1216,9 @@
        int error = 0;
        bool allocd = false;
 
+       if (ap->a_ioflag & IO_APPEND)
+               uio->uio_offset = vp->v_size;
+
        /* consult et? */
        if (rn->rn_flags & RUMPNODE_ET_PHONE_HOST)
                return etwrite(rn, uio);



Home | Main Index | Thread Index | Old Index