From: Mark Tinguely <tinguely@sgi.com>
To: Eric Sandeen <sandeen@redhat.com>
Cc: Christoph Hellwig <hch@infradead.org>, xfs-oss <xfs@oss.sgi.com>
Subject: Re: [PATCH] xfs_io: deprecate the "-F" foreign flag
Date: Thu, 08 Mar 2012 15:39:52 -0600 [thread overview]
Message-ID: <4F592728.9060706@sgi.com> (raw)
In-Reply-To: <4F2AC948.1050909@redhat.com>
On 02/02/12 11:35, Eric Sandeen wrote:
> There's no real reason to force the user to specify "-F" for non-xfs
> files, when we can just test for that after it's opened.
>
> * Remove the -F flag from usage()& man pages, but still accept it.
> * Set IO_FOREIGN when we open the file, if the fd tests as non-xfs.
>
> Signed-off-by: Eric Sandeen<sandeen@redhat.com>
> ---
> diff --git a/io/open.c b/io/open.c
> index f1a6501..97631e2 100644
> --- a/io/open.c
> +++ b/io/open.c
> @@ -163,17 +163,9 @@ openfile(
> }
> }
>
> - if (!geom)
> + if (!platform_test_xfs_fd(fd))
> return fd;
>
> - if (!platform_test_xfs_fd(fd)) {
> - fprintf(stderr, _("%s: specified file "
> - "[\"%s\"] is not on an XFS filesystem\n"),
> - progname, path);
> - close(fd);
> - return -1;
> - }
> -
> if (xfsctl(path, fd, XFS_IOC_FSGEOMETRY, geom)< 0) {
> perror("XFS_IOC_FSGEOMETRY");
> close(fd);
> @@ -282,10 +274,10 @@ open_f(
> return 0;
> }
>
> - while ((c = getopt(argc, argv, "FRacdfm:nrstx")) != EOF) {
> + while ((c = getopt(argc, argv, "Racdfm:nrstx")) != EOF) {
> switch (c) {
> case 'F':
> - flags |= IO_FOREIGN;
> + /* Ignored / deprecated now, handled automatically */
> break;
The "-F" is still in the command line open's help in open.
cxfs_io> help open
open [-acdrstx] [path] -- open the file specified by path
opens a new file in the requested mode
Example:
'open -cd /tmp/data' - creates/opens data file read-write for direct IO
Opens a file for subsequent use by all of the other xfs_io commands.
With no arguments, open uses the stat command to show the current file.
-F -- foreign filesystem file, disallow XFS-specific commands
-a -- open with the O_APPEND flag (append-only mode)
-d -- open with O_DIRECT (non-buffered IO, note alignment constraints)
-f -- open with O_CREAT (create the file if it doesn't exist)
-m -- permissions to use in case a new file is created (default 0600)
-n -- open with O_NONBLOCK
-r -- open with O_RDONLY, the default is O_RDWR
-s -- open with O_SYNC
-t -- open with O_TRUNC (truncate the file to zero length if it exists)
-R -- mark the file as a realtime XFS file immediately after opening it
Note1: usually read/write direct IO requests must be blocksize aligned;
some kernels, however, allow sectorsize alignment for direct IO.
Note2: the bmap for non-regular files can be obtained provided the file
was opened correctly (in particular, must be opened read-only).
The "F" was taken out of the command line's getopt(), so it can't be
specified. I guess either put the "F" back in the the open.c getopt() or
take it complete from the command line.
xfs_io> open -F somefile
open: invalid option -- 'F'
open [-acdrstx] [path] -- open the file specified by path
Thanks,
--Mark Tinguely
tinguely@sgi.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2012-03-08 21:39 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-02 17:35 [PATCH] xfs_io: deprecate the "-F" foreign flag Eric Sandeen
2012-02-03 15:04 ` Christoph Hellwig
2012-02-03 16:10 ` Eric Sandeen
2012-02-13 19:00 ` Christoph Hellwig
2012-02-14 17:18 ` Eric Sandeen
2012-03-08 21:39 ` Mark Tinguely [this message]
2012-03-08 22:16 ` Eric Sandeen
2012-03-08 22:20 ` [PATCH] xfs_io: allow -F in open args Eric Sandeen
2012-03-08 22:37 ` Mark Tinguely
2012-03-08 22:37 ` Eric Sandeen
2012-03-08 22:39 ` Mark Tinguely
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=4F592728.9060706@sgi.com \
--to=tinguely@sgi.com \
--cc=hch@infradead.org \
--cc=sandeen@redhat.com \
--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.