xfs
[Top] [All Lists]

Re: [PATCH] mkfs: add discard support

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: [PATCH] mkfs: add discard support
From: Nathan Scott <nscott@xxxxxxxxxx>
Date: Wed, 7 Oct 2009 06:24:33 +1100 (EST)
Cc: xfs@xxxxxxxxxxx
In-reply-to: <1235789111.21721254856913943.JavaMail.root@xxxxxxxxxxxxxxxxxx>
----- "Christoph Hellwig" <hch@xxxxxxxxxxxxx> wrote:

> Index: xfsprogs-dev/mkfs/xfs_mkfs.c
> ===================================================================
> --- xfsprogs-dev.orig/mkfs/xfs_mkfs.c 2009-10-06 18:02:34.000000000
> +0000
> +++ xfsprogs-dev/mkfs/xfs_mkfs.c      2009-10-06 18:03:55.000000000 +0000
> @@ -605,6 +605,29 @@ done:
>       free(buf);
>  }
>  
> +#ifdef __linux__
> +
> +#ifndef BLKDISCARD
> +#define BLKDISCARD   _IO(0x12,119)
> +#endif

It might be a bit cleaner to add this in with the existing platform-
specific code in libxfs/linux.c (or perhaps include/platform_defs.h)
with wrappers for the other platforms, rather than putting it directly
in mkfs like this?  repair may want to use this someday too, I guess.

cheers.

-- 
Nathan

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