[PATCHSET 9/8] unwritten_sync: convert XFS_IOC_FREESP64 to ftruncate

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Darrick J. Wong <djwong@xxxxxxxxxx>

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@xxxxxxxxxx>
---
 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);
 	}



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux