diff options
author | Darrick J. Wong <djwong@kernel.org> | 2022-01-14 14:38:32 -0800 |
---|---|---|
committer | Eryu Guan <guaneryu@gmail.com> | 2022-01-16 15:02:33 +0800 |
commit | bec9f2cc9d7ad86a9bf2a602529bc20667fcfe88 (patch) | |
tree | 47bd1578c42ef4264ef09e2534986342aeeddd5f | |
parent | 479b5b5786dbf872ca0789ebb708243ca029086f (diff) | |
download | xfstests-dev-bec9f2cc9d7ad86a9bf2a602529bc20667fcfe88.tar.gz |
unwritten_sync: convert XFS_IOC_FREESP64 to ftruncate
This ioctl will be dropped soon, so port the program to use ftruncate,
which does the same thing.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
-rw-r--r-- | src/unwritten_sync.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/unwritten_sync.c b/src/unwritten_sync.c index ebdc8248bf..45ac7df970 100644 --- a/src/unwritten_sync.c +++ b/src/unwritten_sync.c @@ -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); } |