]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
mkfs: add discard support
authorChristoph Hellwig <hch@lst.de>
Tue, 13 Oct 2009 22:28:52 +0000 (00:28 +0200)
committerhch@lst.de <Christoph Hellwig>
Tue, 13 Oct 2009 22:28:52 +0000 (00:28 +0200)
commitad136b3382919e93cc692b54f735fad8b35e88fe
treed3721e9275877712e63ee1c66edfa99d259a5b86
parente4da994184266c7f89da03a86a3f52dde478137b
mkfs: add discard support

Call the BLKDISCARD ioctl to mark the whole disk as unused before creating
a new filesystem.  This will allow SSDs, Arrays with thin provisioning support
and virtual machines to make smarter allocation decisions.

Add a new -K option to prevent mkfs from discarding blocks to aid
trouble-shooting or specialized requirements.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: Andi Kleen <andi@firstfloor.org>
include/darwin.h
include/freebsd.h
include/irix.h
include/linux.h
man/man8/mkfs.xfs.8
mkfs/xfs_mkfs.c