xfs
[Top] [All Lists]

Re: [PATCH] xfsprogs: stop using off64_t in platform headers

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: [PATCH] xfsprogs: stop using off64_t in platform headers
From: Eric Sandeen <sandeen@xxxxxxxxxxx>
Date: Thu, 19 Nov 2009 18:36:03 -0600
Cc: "xfs@xxxxxxxxxxx" <xfs@xxxxxxxxxxx>
In-reply-to: <20091119231418.GA7161@xxxxxxxxxxxxx>
References: <20091119231418.GA7161@xxxxxxxxxxxxx>


On Nov 19, 2009, at 5:14 PM, Christoph Hellwig <hch@xxxxxxxxxxxxx> wrote:

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@xxxxxx>

Thanks.

Reviewed-by: Eric Sandeen <sandeen@xxxxxxxxxxx>
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;

_______________________________________________
xfs mailing list
xfs@xxxxxxxxxxx
http://oss.sgi.com/mailman/listinfo/xfs


<Prev in Thread] Current Thread [Next in Thread>