xfs
[Top] [All Lists]

Re: [patch] rudimetary fallocate support for xfs_io

To: David Chinner <dgc@xxxxxxx>
Subject: Re: [patch] rudimetary fallocate support for xfs_io
From: Nathan Scott <nscott@xxxxxxxxxx>
Date: Thu, 22 May 2008 16:39:01 +1000
Cc: xfs-dev <xfs-dev@xxxxxxx>, xfs-oss <xfs@xxxxxxxxxxx>
In-reply-to: <20080522061029.GO173056135@sgi.com>
Organization: Aconex
References: <20080522061029.GO173056135@sgi.com>
Reply-to: nscott@xxxxxxxxxx
Sender: xfs-bounce@xxxxxxxxxxx
On Thu, 2008-05-22 at 16:10 +1000, David Chinner wrote:
> 
> +#if defined(__i386__)
> +#define __NR_fallocate 324
> +#elif defined(__x86_64__)
> +#define __NR_fallocate 285
> +#elif defined(__ia64__)
> +#define __NR_fallocate 1303
> +#endif
> +
> +static int
> +fallocate(int fd, int cmd, off64_t start, off64_t len)
> +{
> +       return syscall(__NR_fallocate, fd, cmd, start, len);
> +}

This will cause xfsprogs build breakage on any architecture
other than the above three; check out the approach taken in
xfs-cmds/attr/libattr/syscalls.c to avoid this (give ENOSYS
for the unknown archs).

cheers.

-- 
Nathan


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