xfs
[Top] [All Lists]

Re: [PATCH] xfsprogs: add fallocate command to xfs_io

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: [PATCH] xfsprogs: add fallocate command to xfs_io
From: Eric Sandeen <sandeen@xxxxxxxxxxx>
Date: Fri, 15 May 2009 17:11:24 -0500
Cc: xfs-oss <xfs@xxxxxxxxxxx>
In-reply-to: <4A0DB97F.4020201@xxxxxxxxxxx>
References: <4A077195.3070708@xxxxxxxxxxx> <20090515171324.GA14804@xxxxxxxxxxxxx> <20090515172711.GA23630@xxxxxxxxxxxxx> <4A0DB97F.4020201@xxxxxxxxxxx>
User-agent: Thunderbird 2.0.0.21 (Macintosh/20090302)
Eric Sandeen wrote:
> Christoph Hellwig wrote:
>> On Fri, May 15, 2009 at 01:13:24PM -0400, Christoph Hellwig wrote:
>>> On Sun, May 10, 2009 at 07:30:13PM -0500, Eric Sandeen wrote:
>>>> Based on Dave's earlier patch, but now we have an fallocate
>>>> glibc call... this also adds autoconf magic and a manpage 
>>>> update.
>>>>
>>>> (hopefully not too #ifdef-heavy....)
>>> Looks good to me and seems to work.
>> Actually that was spoken too fast.  On my Debian -testing system it
>> detects fallocate as available because <linux/falloc.h> exists, but the
>> glibc doesn't actually support a falloc(3) yet.  So either the detection
>> needs to be improved or we need to use the raw syscall.
> 
> Ok, I think I know how to make the detection work better, I'll fix that up.

oh, hrm.  It's already doing what I thought was sufficient but it won't
link will it:
(from m4/package_libcdev.m4)

+#
+# Check if we have a fallocate libc call (Linux)
+#
+AC_DEFUN([AC_HAVE_FALLOCATE],
+  [ AC_MSG_CHECKING([for fallocate])
+    AC_TRY_COMPILE([
+#include <linux/falloc.h>
+    ], [
+         fallocate(0, 0, 0, 0);
+    ], have_fallocate=yes
+       AC_MSG_RESULT(yes),
+       AC_MSG_RESULT(no))
+    AC_SUBST(have_fallocate)
+  ])


Instead of above does this work better?

(just change AC_TRY_COMPILE to AC_TRY_LINK)

AC_DEFUN([AC_HAVE_FALLOCATE],
  [ AC_MSG_CHECKING([for fallocate])
    AC_TRY_LINK([
#include <linux/falloc.h>
    ], [
         fallocate(0, 0, 0, 0);
    ], have_fallocate=yes
       AC_MSG_RESULT(yes),
       AC_MSG_RESULT(no))
    AC_SUBST(have_fallocate)
  ])

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