Source-Changes-HG archive

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

[src/trunk]: src Pass off_t over the hypercall interface as int64_t to avoid ...



details:   https://anonhg.NetBSD.org/src/rev/b7513cb9ec61
branches:  trunk
changeset: 786846:b7513cb9ec61
user:      pooka <pooka%NetBSD.org@localhost>
date:      Wed May 15 14:58:24 2013 +0000

description:
Pass off_t over the hypercall interface as int64_t to avoid potential
problems in setups where off_t doesn't want to be 64bit.

I'm already excitedly waiting for 128bit off_t and _LARGE_LARGE_FILES

diffstat:

 lib/librumpuser/rumpuser.3       |   8 ++++----
 lib/librumpuser/rumpuser.c       |  10 ++++++----
 lib/librumpuser/rumpuser_bio.c   |   6 +++---
 sys/rump/include/rump/rumpuser.h |   8 ++++----
 4 files changed, 17 insertions(+), 15 deletions(-)

diffs (133 lines):

diff -r 5e18906eb189 -r b7513cb9ec61 lib/librumpuser/rumpuser.3
--- a/lib/librumpuser/rumpuser.3        Wed May 15 14:52:49 2013 +0000
+++ b/lib/librumpuser/rumpuser.3        Wed May 15 14:58:24 2013 +0000
@@ -1,4 +1,4 @@
-.\"     $NetBSD: rumpuser.3,v 1.11 2013/05/15 14:52:49 pooka Exp $
+.\"     $NetBSD: rumpuser.3,v 1.12 2013/05/15 14:58:24 pooka Exp $
 .\"
 .\" Copyright (c) 2013 Antti Kantee.  All rights reserved.
 .\"
@@ -197,7 +197,7 @@
 .Pp
 .Ft void
 .Fo rumpuser_bio
-.Fa "int fd" "int op" "void *data" "size_t dlen" "off_t off"
+.Fa "int fd" "int op" "void *data" "size_t dlen" "int64_t off"
 .Fa "rump_biodone_fn biodone" "void *donearg"
 .Fc
 .Pp
@@ -238,13 +238,13 @@
 .Ft int
 .Fo rumpuser_iovread
 .Fa "int fd" "struct rumpuser_iovec *ruiov" "size_t iovlen"
-.Fa "off_t off" "size_t *retv"
+.Fa "int64_t off" "size_t *retv"
 .Fc
 .Pp
 .Ft int
 .Fo rumpuser_iovwrite
 .Fa "int fd" "struct rumpuser_iovec *ruiov" "size_t iovlen"
-.Fa "off_t off" "size_t *retv"
+.Fa "int64_t off" "size_t *retv"
 .Fc
 .Pp
 These routines perform scatter-gather I/O which is not
diff -r 5e18906eb189 -r b7513cb9ec61 lib/librumpuser/rumpuser.c
--- a/lib/librumpuser/rumpuser.c        Wed May 15 14:52:49 2013 +0000
+++ b/lib/librumpuser/rumpuser.c        Wed May 15 14:58:24 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rumpuser.c,v 1.51 2013/05/15 14:52:49 pooka Exp $      */
+/*     $NetBSD: rumpuser.c,v 1.52 2013/05/15 14:58:24 pooka Exp $      */
 
 /*
  * Copyright (c) 2007-2010 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
 #include "rumpuser_port.h"
 
 #if !defined(lint)
-__RCSID("$NetBSD: rumpuser.c,v 1.51 2013/05/15 14:52:49 pooka Exp $");
+__RCSID("$NetBSD: rumpuser.c,v 1.52 2013/05/15 14:58:24 pooka Exp $");
 #endif /* !lint */
 
 #include <sys/ioctl.h>
@@ -332,9 +332,10 @@
  */
 int
 rumpuser_iovread(int fd, struct rumpuser_iovec *ruiov, size_t iovlen,
-       off_t off, size_t *retp)
+       int64_t roff, size_t *retp)
 {
        struct iovec *iov = (struct iovec *)ruiov;
+       off_t off = (off_t)roff;
        ssize_t nn;
        int rv;
 
@@ -364,9 +365,10 @@
 
 int
 rumpuser_iovwrite(int fd, const struct rumpuser_iovec *ruiov, size_t iovlen,
-       off_t off, size_t *retp)
+       int64_t roff, size_t *retp)
 {
        const struct iovec *iov = (const struct iovec *)ruiov;
+       off_t off = (off_t)roff;
        ssize_t nn;
        int rv;
 
diff -r 5e18906eb189 -r b7513cb9ec61 lib/librumpuser/rumpuser_bio.c
--- a/lib/librumpuser/rumpuser_bio.c    Wed May 15 14:52:49 2013 +0000
+++ b/lib/librumpuser/rumpuser_bio.c    Wed May 15 14:58:24 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rumpuser_bio.c,v 1.6 2013/05/07 15:18:35 pooka Exp $   */
+/*     $NetBSD: rumpuser_bio.c,v 1.7 2013/05/15 14:58:24 pooka Exp $   */
 
 /*-
  * Copyright (c) 2013 Antti Kantee.  All Rights Reserved.
@@ -127,7 +127,7 @@
 }
 
 void
-rumpuser_bio(int fd, int op, void *data, size_t dlen, off_t doff,
+rumpuser_bio(int fd, int op, void *data, size_t dlen, int64_t doff,
        rump_biodone_fn biodone, void *bioarg)
 {
        struct rumpuser_bio bio;
@@ -163,7 +163,7 @@
        bio.bio_op = op;
        bio.bio_data = data;
        bio.bio_dlen = dlen;
-       bio.bio_off = doff;
+       bio.bio_off = (off_t)doff;
        bio.bio_done = biodone;
        bio.bio_donearg = bioarg;
 
diff -r 5e18906eb189 -r b7513cb9ec61 sys/rump/include/rump/rumpuser.h
--- a/sys/rump/include/rump/rumpuser.h  Wed May 15 14:52:49 2013 +0000
+++ b/sys/rump/include/rump/rumpuser.h  Wed May 15 14:58:24 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rumpuser.h,v 1.105 2013/05/15 14:52:49 pooka Exp $     */
+/*     $NetBSD: rumpuser.h,v 1.106 2013/05/15 14:58:24 pooka Exp $     */
 
 /*
  * Copyright (c) 2007-2013 Antti Kantee.  All Rights Reserved.
@@ -97,7 +97,7 @@
 #define RUMPUSER_BIO_WRITE     0x02
 #define RUMPUSER_BIO_SYNC      0x04
 typedef void (*rump_biodone_fn)(void *, size_t, int);
-void rumpuser_bio(int, int, void *, size_t, off_t, rump_biodone_fn, void *);
+void rumpuser_bio(int, int, void *, size_t, int64_t, rump_biodone_fn, void *);
 
 /* this one "accidentally" matches the NetBSD kernel ... */
 struct rumpuser_iovec {
@@ -105,9 +105,9 @@
        size_t iov_len;
 };
 #define RUMPUSER_IOV_NOSEEK -1
-int rumpuser_iovread(int, struct rumpuser_iovec *, size_t, off_t, size_t *);
+int rumpuser_iovread(int, struct rumpuser_iovec *, size_t, int64_t, size_t *);
 int rumpuser_iovwrite(int, const struct rumpuser_iovec *, size_t,
-                     off_t, size_t *);
+                     int64_t, size_t *);
 
 /*
  * clock and zzz



Home | Main Index | Thread Index | Old Index