All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: xfs mailing list <xfs@oss.sgi.com>
Subject: [PATCH] xfsprogs: allow xfs_freeze to work on non-xfs filesystems
Date: Wed, 14 Jan 2009 17:05:24 -0600	[thread overview]
Message-ID: <496E6FB4.8070300@sandeen.net> (raw)

allow xfs_freeze to freeze "foreign" filesystems

Now that the freeze ioctl has been elevated to the VFS,
let's let xfs_io and xfs_freeze freeze other filesystems
as well - add the CMD_FOREIGN_OK flag to freeze & thaw.

I think the worst that will happen on older kernels is that
the command will fail with ENOSYS or EINVAL....

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
---

diff --git a/io/freeze.c b/io/freeze.c
index 334b0cf..08f4d47 100644
--- a/io/freeze.c
+++ b/io/freeze.c
@@ -66,14 +66,14 @@ freeze_init(void)
 	freeze_cmd.cfunc = freeze_f;
 	freeze_cmd.argmin = 0;
 	freeze_cmd.argmax = 0;
-	freeze_cmd.flags = CMD_NOMAP_OK;
+	freeze_cmd.flags = CMD_NOMAP_OK | CMD_FOREIGN_OK;
 	freeze_cmd.oneline = _("freeze filesystem of current file");
 
 	thaw_cmd.name = _("thaw");
 	thaw_cmd.cfunc = thaw_f;
 	thaw_cmd.argmin = 0;
 	thaw_cmd.argmax = 0;
-	thaw_cmd.flags = CMD_NOMAP_OK;
+	thaw_cmd.flags = CMD_NOMAP_OK | CMD_FOREIGN_OK;
 	thaw_cmd.oneline = _("unfreeze filesystem of current file");
 
 	if (expert) {
diff --git a/io/xfs_freeze.sh b/io/xfs_freeze.sh
index 0aeeae6..45e20d2 100644
--- a/io/xfs_freeze.sh
+++ b/io/xfs_freeze.sh
@@ -33,11 +33,11 @@ if [ "$1" = "" ]; then
 fi
 
 if $FREEZE ; then
-	$DIRNAME/xfs_io -r -p xfs_freeze -x -c "freeze" "$1"
+	$DIRNAME/xfs_io -F -r -p xfs_freeze -x -c "freeze" "$1"
 	status=$?
 	[ $status -ne 0 ] && exit $status
 elif $THAW ; then
-	$DIRNAME/xfs_io -r -p xfs_freeze -x -c "thaw" "$1"
+	$DIRNAME/xfs_io -F -r -p xfs_freeze -x -c "thaw" "$1"
 	status=$?
 	[ $status -ne 0 ] && exit $status
 else


_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

             reply	other threads:[~2009-01-14 23:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-14 23:05 Eric Sandeen [this message]
2009-01-15 10:48 ` [PATCH] xfsprogs: allow xfs_freeze to work on non-xfs filesystems Bill O'Donnell
2009-01-18 17:58 ` Christoph Hellwig
2009-01-18 19:28   ` Eric Sandeen

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=496E6FB4.8070300@sandeen.net \
    --to=sandeen@sandeen.net \
    --cc=xfs@oss.sgi.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.