9 * mmap a preallocated file and write to a set of offsets
10 * in it. We'll check to see if the underlying extents are
11 * converted correctly on writeback.
13 int main(int argc, char **argv) {
16 struct xfs_flock64 space;
20 fprintf(stderr, "%s <count> <file [file...]>\n", argv[0]);
25 o = strtoull(argv[1], NULL, 0);
31 for(i = 2; i < argc; i++) {
33 fd = open(argv[i], O_RDWR|O_CREAT|O_LARGEFILE, 0666);
39 if(ftruncate64(fd, o) < 0) {
40 perror("ftruncate64");
44 space.l_whence = SEEK_SET;
48 if(ioctl(fd, XFS_IOC_RESVSP64, &space)) {
53 buf = mmap(NULL, (int)o, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
54 if(buf == MAP_FAILED) {