* [PATCHSET 9/8] unwritten_sync: convert XFS_IOC_FREESP64 to ftruncate
@ 2022-01-14 22:38 Darrick J. Wong
0 siblings, 0 replies; only message in thread
From: Darrick J. Wong @ 2022-01-14 22:38 UTC (permalink / raw)
To: guaneryu; +Cc: xuyang2018.jy, Theodore Ts'o, linux-xfs, fstests, guan
From: Darrick J. Wong <djwong@kernel.org>
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>
---
src/unwritten_sync.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/unwritten_sync.c b/src/unwritten_sync.c
index ebdc8248..45ac7df9 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);
}
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2022-01-14 22:38 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-14 22:38 [PATCHSET 9/8] unwritten_sync: convert XFS_IOC_FREESP64 to ftruncate Darrick J. Wong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox