Skip to contentSkip to conversation

xfsprogs: stop using off64_t in platform headers

PATCH In review Christoph Hellwig 2 participants 2 messages Nov 19, 2009 – Nov 20, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfsprogs: stop using off64_t in platform headers

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.

include/darwin.h +1 -1
Index: xfsprogs-dev/include/darwin.h
===================================================================
@@ -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;
 }
include/freebsd.h +1 -1
Index: xfsprogs-dev/include/freebsd.h
===================================================================
@@ -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;
 }
include/irix.h +1 -1
Index: xfsprogs-dev/include/irix.h
===================================================================
@@ -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;
 }
include/linux.h +2 -2
Index: xfsprogs-dev/include/linux.h
===================================================================
@@ -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;

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Christoph Hellwig

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.

Thanks.

Quoted 63 lines

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

include/darwin.h +0 -0
@@ -155,7 +155,7 @@ typedef unsigned char    uchar_t;
 #define HAVE_FID    1
 

static __inline__ int

(quoted diff) +1 -1
-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

(quoted diff) +0 -0
@@ -140,7 +140,7 @@ static __inline__ void platform_uuid_cop
 }
 

static __inline__ int

(quoted diff) +1 -1
-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

(quoted diff) +0 -0
@@ -338,7 +338,7 @@ static __inline__ void platform_uuid_cop
 }
 

static __inline__ int

(quoted diff) +1 -1
-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

(quoted diff) +0 -0
@@ -98,9 +98,9 @@ static __inline__ void platform_uuid_cop
 #endif
 

static __inline__ int

(quoted diff) +1 -1
-platform_discard_blocks(int fd, off64_t start, off64_t end)
+platform_discard_blocks(int fd, uint64_t start, uint64_t len)

{

include/linux.h +1 -1
-    __uint64_t range[2] = { start, end };
+    __uint64_t range[2] = { start, len };
 
   if (ioctl(fd, BLKDISCARD, &range) < 0)
       return errno;
Quoted 5 lines

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs