[PATCH] xfsprogs: stop using off64_t in platform headers

Christoph Hellwig hch at infradead.org
Thu Nov 19 17:14:18 CST 2009


Using off64_t may require special headers or compiler flags that aren't
always available, e.g. in the configure check in xfstests.  Rever to a plain
uint64_t to make apps compile as before.

While we're at it also rename the second argument of platform_discard_blocks
from end to len as that's what the BLKDISCARD ioctl excepts - we currently
always discard the whole device so it doesn't matter in practice.

Signed-off-by: Christoph Hellwig <hch at lst.de>

Index: xfsprogs-dev/include/darwin.h
===================================================================
--- xfsprogs-dev.orig/include/darwin.h	2009-11-19 23:12:05.000000000 +0000
+++ xfsprogs-dev/include/darwin.h	2009-11-19 23:12:30.000000000 +0000
@@ -155,7 +155,7 @@ typedef unsigned char	uchar_t;
 #define HAVE_FID	1
 
 static __inline__ int
-platform_discard_blocks(int fd, off64_t start, off64_t end)
+platform_discard_blocks(int fd, uint64_t start, uint64_t len)
 {
 	return 0;
 }
Index: xfsprogs-dev/include/freebsd.h
===================================================================
--- xfsprogs-dev.orig/include/freebsd.h	2009-11-19 23:12:05.000000000 +0000
+++ xfsprogs-dev/include/freebsd.h	2009-11-19 23:12:30.000000000 +0000
@@ -140,7 +140,7 @@ static __inline__ void platform_uuid_cop
 }
 
 static __inline__ int
-platform_discard_blocks(int fd, off64_t start, off64_t end)
+platform_discard_blocks(int fd, uint64_t start, uint64_t len)
 {
 	return 0;
 }
Index: xfsprogs-dev/include/irix.h
===================================================================
--- xfsprogs-dev.orig/include/irix.h	2009-11-19 23:12:05.000000000 +0000
+++ xfsprogs-dev/include/irix.h	2009-11-19 23:12:30.000000000 +0000
@@ -338,7 +338,7 @@ static __inline__ void platform_uuid_cop
 }
 
 static __inline__ int
-platform_discard_blocks(int fd, off64_t start, off64_t end)
+platform_discard_blocks(int fd, uint64_t start, uint64_t len)
 {
 	return 0;
 }
Index: xfsprogs-dev/include/linux.h
===================================================================
--- xfsprogs-dev.orig/include/linux.h	2009-11-19 23:12:04.000000000 +0000
+++ xfsprogs-dev/include/linux.h	2009-11-19 23:12:40.000000000 +0000
@@ -98,9 +98,9 @@ static __inline__ void platform_uuid_cop
 #endif
 
 static __inline__ int
-platform_discard_blocks(int fd, off64_t start, off64_t end)
+platform_discard_blocks(int fd, uint64_t start, uint64_t len)
 {
-	__uint64_t range[2] = { start, end };
+	__uint64_t range[2] = { start, len };
 
 	if (ioctl(fd, BLKDISCARD, &range) < 0)
 		return errno;




More information about the xfs mailing list