From 42868c787519ece00a14a19fd957015672d409c7 Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Sun, 19 Jun 2016 20:57:40 +0300 Subject: [PATCH] ApplXFS extent allocation size hint --- fsqual.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fsqual.cc b/fsqual.cc index 803a18a..f742e44 100644 --- a/fsqual.cc +++ b/fsqual.cc @@ -17,6 +17,8 @@ #include #include #include +#define min min /* prevent xfs.h from defining min() as a macro */ +#include template typename std::result_of::type @@ -90,6 +92,11 @@ void run_test(std::function func) { io_setup(128, &ioctx); auto fname = "fsqual.tmp"; int fd = open(fname, O_CREAT|O_EXCL|O_RDWR|O_DIRECT, 0600); + fsxattr attr = {}; + attr.fsx_xflags |= XFS_XFLAG_EXTSIZE; + attr.fsx_extsize = 32 << 20; // 32MB + // Ignore error; may be !xfs, and just a hint anyway + ::ioctl(fd, XFS_IOC_FSSETXATTR, &attr); unlink(fname); func(ioctx, fd); close(fd); -- 2.49.0