RFC xfs_io: hook up statx
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest2 patches 3 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | xfs_io: move stat functions to new fileio/ io/ io/ +1 more | +191 | 0 replies | |
| 2/2 | xfs_io: hook up statxio/ io/ io/ +2 more | +471 | 2 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH RFC 0/2] xfs_io: hook up statx
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> statxstx_mask: 0xfffstx_blksize: 4096stx_attributes: 0x70stx_nlink: 1stx_uid: 0stx_gid: 0stx_mode: 0100644stx_ino: 99stx_size: 0stx_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: 676550238stx_rdev_major: 0stx_rdev_minor: 0stx_dev_major: 7stx_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