xfsprogs: stop using off64_t in platform headers
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
@@ -155,7 +155,7 @@ typedef unsigned char uchar_t;#define HAVE_FID 1static __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
@@ -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
@@ -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
@@ -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
Quoted 10 lines · Christoph Hellwig
Using
off64_tmay require special headers or compiler flags that aren't always available, e.g. in the configure check in xfstests. Rever to a plainuint64_tto make apps compile as before.While we're at it also rename the second argument of
platform_discard_blocksfrom 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 <[email protected]>
Thanks.
Quoted 63 lines
Index:
xfsprogs-dev/include/darwin.h
===================================================================
---xfsprogs-dev.orig/include/darwin.h2009-11-19 23:12:05.000000000
+0000
+++xfsprogs-dev/include/darwin.h2009-11-19 23:12:30.000000000
+0000include/darwin.h +0
-0@@ -155,7 +155,7 @@ typedef unsigned char uchar_t;#define HAVE_FID 1static
__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.h2009-11-19 23:12:05.000000000
+0000
+++xfsprogs-dev/include/freebsd.h2009-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.h2009-11-19
23:12:05.000000000 +0000
+++xfsprogs-dev/include/irix.h2009-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.h2009-11-19
23:12:04.000000000 +0000
+++xfsprogs-dev/include/linux.h2009-11-19 23:12:40.000000000
+0000(quoted diff) +0
-0@@ -98,9 +98,9 @@ static __inline__ void platform_uuid_cop #endifstatic
__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