Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Oct 2011 18:25:06 GMT
From:      John Baldwin <jhb@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 200163 for review
Message-ID:  <201110131825.p9DIP6SF023881@skunkworks.freebsd.org>

index | next in thread | raw e-mail

http://p4web.freebsd.org/@@200163?ac=10

Change 200163 by jhb@jhb_jhbbsd on 2011/10/13 18:24:01

	Fix the off_t handling in fallocate() and fadvise() to be
	big-endian friendly.

Affected files ...

.. //depot/projects/fadvise/sys/compat/freebsd32/freebsd32_misc.c#3 edit
.. //depot/projects/fadvise/sys/compat/freebsd32/syscalls.master#3 edit

Differences ...

==== //depot/projects/fadvise/sys/compat/freebsd32/freebsd32_misc.c#3 (text+ko) ====

@@ -2811,8 +2811,8 @@
 	struct posix_fallocate_args ap;
 
 	ap.fd = uap->fd;
-	ap.offset = (uap->offsetlo | ((off_t)uap->offsethi << 32));
-	ap.len = (uap->lenlo | ((off_t)uap->lenhi << 32));
+	ap.offset = PAIR32TO64(off_t, uap->offset);
+	ap.len = PAIR32TO64(off_t, uap->len);
 	return (sys_posix_fallocate(td, &ap));
 }
 
@@ -2822,8 +2822,8 @@
 	struct fadvise_args ap;
 
 	ap.fd = uap->fd;
-	ap.offset = (uap->offsetlo | ((off_t)uap->offsethi << 32));
-	ap.len = (uap->lenlo | ((off_t)uap->lenhi << 32));
+	ap.offset = PAIR32TO64(off_t, uap->offset);
+	ap.len = PAIR32TO64(off_t, uap->len);
 	ap.advice = uap->advice;
 	return (sys_fadvise(td, &ap));
 }

==== //depot/projects/fadvise/sys/compat/freebsd32/syscalls.master#3 (text+ko) ====

@@ -989,9 +989,9 @@
 				    size_t inbuflen, void *outbufp, \
 				    size_t outbuflen); }
 530	AUE_NULL	STD	{ int freebsd32_posix_fallocate(int fd,\
-				    uint32_t offsetlo, uint32_t offsethi,\
-				    uint32_t lenlo, uint32_t lenhi); }
+				    uint32_t offset1, uint32_t offset2,\
+				    uint32_t len1, uint32_t len2); }
 531	AUE_NULL	STD	{ int freebsd32_fadvise(int fd, \
-				    uint32_t offsetlo, uint32_t offsethi,\
-				    uint32_t lenlo, uint32_t lenhi, \
+				    uint32_t offset1, uint32_t offset2,\
+				    uint32_t len1, uint32_t len2, \
 				    int advice); }


help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201110131825.p9DIP6SF023881>