From: Avi Kivity Date: Sun, 19 Jun 2016 17:57:40 +0000 (+0300) Subject: ApplXFS extent allocation size hint X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=42868c787519ece00a14a19fd957015672d409c7;p=users%2Fhch%2Ffsqual.git ApplXFS extent allocation size hint --- 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);