public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: xfs-oss <xfs@oss.sgi.com>
Subject: [PATCH] xfsprogs: remove setfl from xfs_io
Date: Sat, 08 Dec 2012 15:03:10 -0600	[thread overview]
Message-ID: <50C3AB0E.3050006@sandeen.net> (raw)
In-Reply-To: <50C39123.6050303@sandeen.net>

Doesn't seem to have worked for ages, and is (therefore)
apparently not ever used:

xfs_io> setfl
xfs_io> help setfl
setfl [-adx] -- set/clear append/direct flags on the open file
xfs_io> setfl -a
bad argument count 1 to setfl, expected 0 arguments
xfs_io> setfl -d
bad argument count 1 to setfl, expected 0 arguments
xfs_io> setfl
xfs_io> 

At best, it seems intended to toggle the flag state, but
gives no feedback about current state.  -x is in help but
not implemented, etc.

Just remove it.

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

diff --git a/io/open.c b/io/open.c
index 46538ba..cc677e6 100644
--- a/io/open.c
+++ b/io/open.c
@@ -25,7 +25,6 @@
 static cmdinfo_t open_cmd;
 static cmdinfo_t stat_cmd;
 static cmdinfo_t close_cmd;
-static cmdinfo_t setfl_cmd;
 static cmdinfo_t statfs_cmd;
 static cmdinfo_t chproj_cmd;
 static cmdinfo_t lsproj_cmd;
@@ -668,45 +667,6 @@ extsize_f(
 }
 
 static int
-setfl_f(
-	int			argc,
-	char			**argv)
-{
-	int			c, flags;
-
-	flags = fcntl(file->fd, F_GETFL, 0);
-	if (flags < 0) {
-		perror("fcntl(F_GETFL)");
-		return 0;
-	}
-
-	while ((c = getopt(argc, argv, "ad")) != EOF) {
-		switch (c) {
-		case 'a':
-			if (flags & O_APPEND)
-				flags |= O_APPEND;
-			else
-				flags &= ~O_APPEND;
-			break;
-		case 'd':
-			if (flags & O_DIRECT)
-				flags |= O_DIRECT;
-			else
-				flags &= ~O_DIRECT;
-			break;
-		default:
-			printf(_("invalid setfl argument -- '%c'\n"), c);
-			return 0;
-		}
-	}
-
-	if (fcntl(file->fd, F_SETFL, flags)  < 0)
-		perror("fcntl(F_SETFL)");
-
-	return 0;
-}
-
-static int
 statfs_f(
 	int			argc,
 	char			**argv)
@@ -791,13 +751,6 @@ open_init(void)
 	close_cmd.flags = CMD_NOMAP_OK | CMD_FOREIGN_OK;
 	close_cmd.oneline = _("close the current open file");
 
-	setfl_cmd.name = "setfl";
-	setfl_cmd.cfunc = setfl_f;
-	setfl_cmd.args = _("[-adx]");
-	setfl_cmd.flags = CMD_NOMAP_OK | CMD_FOREIGN_OK;
-	setfl_cmd.oneline =
-		_("set/clear append/direct flags on the open file");
-
 	statfs_cmd.name = "statfs";
 	statfs_cmd.cfunc = statfs_f;
 	statfs_cmd.flags = CMD_NOMAP_OK | CMD_FOREIGN_OK;
@@ -837,7 +790,6 @@ open_init(void)
 	add_command(&open_cmd);
 	add_command(&stat_cmd);
 	add_command(&close_cmd);
-	add_command(&setfl_cmd);
 	add_command(&statfs_cmd);
 	add_command(&chproj_cmd);
 	add_command(&lsproj_cmd);

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

      parent reply	other threads:[~2012-12-08 21:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-08 19:12 [PATCH] xfsprogs: document fpunch command in xfs_io Eric Sandeen
2012-12-08 20:55 ` [PATCH V2] xfsprogs: document all commands " Eric Sandeen
2012-12-08 20:58 ` [PATCH] xfstests: ensure all xfs_io commands are documented in the manpage Eric Sandeen
2012-12-08 21:03 ` Eric Sandeen [this message]

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=50C3AB0E.3050006@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox