unwritten_sync: convert XFS_IOC_FREESP64 to ftruncate
[xfstests-dev.git] / src / unwritten_sync.c
index ebdc8248bff7c60a7e3244fb9a01ed97b2598fa5..45ac7df9709be0b5d98c0b0be68c3f0c8809d247 100644 (file)
@@ -92,10 +92,11 @@ main(int argc, char *argv[])
 
                print_getbmapx(file, fd, 0, 0);
 
-               flock.l_whence = 0;
-               flock.l_start= 0;
-               flock.l_len = 0;
-               xfsctl(file, fd, XFS_IOC_FREESP64, &flock);
+               if (ftruncate(fd, 0)) {
+                       perror("ftruncate");
+                       exit(1);
+               }
+
                print_getbmapx(file, fd, 0, 0);
                close(fd);
        }