* [PATCH V2] xfsprogs: document all commands in xfs_io
2012-12-08 19:12 [PATCH] xfsprogs: document fpunch command in xfs_io Eric Sandeen
@ 2012-12-08 20:55 ` 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 ` [PATCH] xfsprogs: remove setfl from xfs_io Eric Sandeen
2 siblings, 0 replies; 4+ messages in thread
From: Eric Sandeen @ 2012-12-08 20:55 UTC (permalink / raw)
To: xfs-oss
Add missing command documentation to xfs_io(8) manpage.
fiemap, fpunch, chproj, lsproj, and setfl are all missing.
setfl seems to not work today in any case, and nothing
in xfstests uses it; I will send another patch to simply
remove it from xfs_io, as I don't think it's terribly useful,
and hasn't worked forever anyway.
Also fix references to the fallocate manpage, which is (now?)
in section 2, not section 3 of the man pages. (Since it's
a syscall, not a library function).
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
---
diff --git a/man/man8/xfs_io.8 b/man/man8/xfs_io.8
index f7c6935..33a5944 100644
--- a/man/man8/xfs_io.8
+++ b/man/man8/xfs_io.8
@@ -245,6 +245,12 @@ Prints the block mapping for the current open file. Refer to the
.BR xfs_bmap (8)
manual page for complete documentation.
.TP
+.BI "fiemap [ \-alv ] [ \-n " nx " ]"
+Prints the block mapping for the current open file using the fiemap
+ioctl. Options behave as described in the
+.BR xfs_bmap (8)
+manual page.
+.TP
.BI "extsize [ \-R | \-D ] [ " value " ]"
Display and/or modify the preferred extent size used when allocating
space for the currently open file. If the
@@ -355,17 +361,23 @@ manual page.
.BI "falloc [ \-k ]" " offset length"
Allocates reserved, unwritten space for part of a file using the
fallocate routine as described in the
-.BR fallocate (3)
+.BR fallocate (2)
manual page.
.RS 1.0i
.PD 0
.TP 0.4i
.B \-k
will set the FALLOC_FL_KEEP_SIZE flag as described in
-.BR fallocate (3).
+.BR fallocate (2).
.PD
.RE
.TP
+.BI fpunch " offset length"
+Punches (de-allocates) blocks in the file by calling fallocate with
+the FALLOC_FL_PUNCH_HOLE flag as described in the
+.BR fallocate (2)
+manual page.
+.TP
.BI truncate " offset"
Truncates the current file at the given offset using
.BR ftruncate (2).
@@ -575,6 +587,24 @@ Selected statistics from
and the XFS_IOC_FSGEOMETRY
system call on the filesystem where the current file resides.
.TP
+.BR chproj " [ " \-R | \-D " ]"
+Modifies the project identifier associated with the current path. The
+.B \-R
+option will recursively descend if the current path is a directory. The
+.B \-D
+option will also recursively descend, only setting modifying projects
+on subdirectories. See the
+.BR xfs_quota (8)
+manual page for more information about project identifiers.
+.TP
+.BR lsproj " [ " \-R | \-D " ]"
+Displays the project identifier associated with the current path. The
+.B \-R
+and
+.B \-D
+options behave as described above, in
+.B chproj.
+.TP
.BR parent " [ " \-cpv " ]"
By default this command prints out the parent inode numbers,
inode generation numbers and basenames of all the hardlinks which
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] xfstests: ensure all xfs_io commands are documented in the manpage
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 ` Eric Sandeen
2012-12-08 21:03 ` [PATCH] xfsprogs: remove setfl from xfs_io Eric Sandeen
2 siblings, 0 replies; 4+ messages in thread
From: Eric Sandeen @ 2012-12-08 20:58 UTC (permalink / raw)
To: xfs-oss
Ensure that all commands listed in "xfs_io -c help" are
documented in the xfs_io(8) manpage.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
diff --git a/293 b/293
new file mode 100755
index 0000000..e42344d
--- /dev/null
+++ b/293
@@ -0,0 +1,59 @@
+#! /bin/bash
+# FS QA Test No. 293
+#
+# Ensure all xfs_io commands are documented
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2012 Red Hat, Inc. All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-----------------------------------------------------------------------
+#
+# creator
+owner=sandeen@redhat.com
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1 # failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+ cd /
+ rm -f $tmp.*
+}
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+# real QA test starts here
+
+# Modify as appropriate.
+_supported_fs xfs
+_supported_os IRIX Linux
+
+echo "Silence is golden"
+
+for COMMAND in `$XFS_IO_PROG -c help | awk '{print $1}' | grep -v "^Use "`; do
+ man xfs_io | col -b | grep -wq $COMMAND || \
+ echo "$COMMAND not documented in the xfs_io manpage"
+done
+
+# success, all done
+status=0
+exit
diff --git a/293.out b/293.out
new file mode 100644
index 0000000..076fc05
--- /dev/null
+++ b/293.out
@@ -0,0 +1,2 @@
+QA output created by 293
+Silence is golden
diff --git a/group b/group
index 9562685..b04fb50 100644
--- a/group
+++ b/group
@@ -411,3 +411,4 @@ deprecated
290 auto rw prealloc quick ioctl
291 auto mkfs quick
292 auto quick
+293 auto quick
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH] xfsprogs: remove setfl from xfs_io
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
2 siblings, 0 replies; 4+ messages in thread
From: Eric Sandeen @ 2012-12-08 21:03 UTC (permalink / raw)
To: xfs-oss
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
^ permalink raw reply related [flat|nested] 4+ messages in thread