FS/XFS testing framework
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: guaneryu@gmail.com
Cc: xuyang2018.jy@fujitsu.com, Theodore Ts'o <tytso@mit.edu>,
	linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me
Subject: [PATCHSET 9/8] unwritten_sync: convert XFS_IOC_FREESP64 to ftruncate
Date: Fri, 14 Jan 2022 14:38:32 -0800	[thread overview]
Message-ID: <20220114223832.GB90398@magnolia> (raw)

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

                 reply	other threads:[~2022-01-14 22:38 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220114223832.GB90398@magnolia \
    --to=djwong@kernel.org \
    --cc=fstests@vger.kernel.org \
    --cc=guan@eryu.me \
    --cc=guaneryu@gmail.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=tytso@mit.edu \
    --cc=xuyang2018.jy@fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox