From: Eric Sandeen <sandeen@redhat.com>
To: linux-xfs <linux-xfs@vger.kernel.org>
Cc: David Howells <dhowells@redhat.com>,
Andreas Dilger <adilger@dilger.ca>,
Christoph Hellwig <hch@infradead.org>
Subject: [PATCH RFC 0/2] xfs_io: hook up statx
Date: Tue, 21 Mar 2017 14:59:21 -0400 [thread overview]
Message-ID: <0bc83cf4-a927-e78e-9bfb-7f3fa91303eb@redhat.com> (raw)
These 2 patches are a first pass to add a statx command
to xfs_io in hopes that it will aid creation of xfstests
statx regression tests.
xfs_io> help statx
statx [-O | -m mask][-FDLAP] -- extended information about the currently open file
Display extended file status.
Options:
-m mask -- Specify the field mask for the statx call (default STATX_ALL)
-A -- Suppress terminal automount traversal
-D -- Don't sync attributes with the server
-F -- Force the attributes to be sync'd with the server
-L -- Follow symlinks (statx link target)
-O -- Remove basic stats (STATX_BASIC_STATS) from default mask
-P -- pretty-print results similar to stat(1)
xfs_io> statx
stx_mask: 0xfff
stx_blksize: 4096
stx_attributes: 0x70
stx_nlink: 1
stx_uid: 0
stx_gid: 0
stx_mode: 0100644
stx_ino: 99
stx_size: 0
stx_blocks: 0
stx_atime.tv_sec: 1490109633
stx_atime.tv_nsec: 676550238
stx_btime.tv_sec: 1490109633
stx_btime.tv_nsec: 675550234
stx_ctime.tv_sec: 1490109725
stx_ctime.tv_nsec: 69966839
stx_mtime.tv_sec: 1490109633
stx_mtime.tv_nsec: 676550238
stx_rdev_major: 0
stx_rdev_minor: 0
stx_dev_major: 7
stx_dev_minor: 0
patch 2 is a bit of a hack for now; it hardcodes the 64-bit x86
syscall nr, and includes a whole header full of statx
#defines.
I'm not sure if we want to provide those under #ifndef,
or just require new kernel headers & test for them w/
autoconf. I'll clean it up one way or another.
It also lifts a fair bit from David's samples/statx/test-statx.c;
a lot of that is pretty-printing that we don't do for xfs_io's
standard stat command, so maybe it should get dropped from this
patch for code brevity.
Another interesting limitation of all of the xfs_io stat
variants is that they currently can't stat any file that
they can't open, which may or may not be a limitation that
we care about....
Anyway - thoughts on whether this is enough of an interface
to facilitate testing, and whether we should accommodate old
headers would be appreciated, and I'll get it cleaned up &
send a V2.
-Eric
next reply other threads:[~2017-03-21 18:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-21 18:59 Eric Sandeen [this message]
2017-03-21 19:02 ` [PATCH RFC 1/2] xfs_io: move stat functions to new file Eric Sandeen
2017-03-21 19:03 ` [PATCH RFC 2/2] xfs_io: hook up statx Eric Sandeen
2017-03-21 21:49 ` Darrick J. Wong
2017-03-22 5:28 ` Darrick J. Wong
2017-03-21 19:09 ` [PATCH RFC 0/2] " 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=0bc83cf4-a927-e78e-9bfb-7f3fa91303eb@redhat.com \
--to=sandeen@redhat.com \
--cc=adilger@dilger.ca \
--cc=dhowells@redhat.com \
--cc=hch@infradead.org \
--cc=linux-xfs@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).