xfs_io: v8 add the lseek() SEEK_DATA/SEEK_HOLE support
PATCH 1/1 xfs_io: v8 add the lseek() SEEK_DATA/SEEK_HOLE support
Add the lseek SEEK_DATA/SEEK_HOLE support into xfs_io. The result from the lseek() call will be printed to the output. For example:
xfs_io> seek -hs 609k
Whence Start Result
HOLE 623616 630784
---
The "Wow! I could have had a v8"* patch * TM of Cambell's Soup Company.
Fix v7 bug by re-adding the flag mask check before calling seek_output(). Add Eric's thought to display starting offset to output - using -s flag.. Add table descriptor.
io/Makefile | 3 io/init.c | 1 io/io.h | 1 io/seek.c | 224 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ man/man8/xfs_io.8 | 39 +++++++++ 5 files changed, 267 insertions(+), 1 deletion(-)
io/Makefile +2 -1
@@ -10,7 +10,8 @@ LSRCFILES = xfs_bmap.sh xfs_freeze.sh xf HFILES = init.h io.h CFILES = init.c \ attr.c bmap.c file.c freeze.c fsync.c getrusage.c imap.c mmap.c \ - open.c parent.c pread.c prealloc.c pwrite.c shutdown.c truncate.c + open.c parent.c pread.c prealloc.c pwrite.c seek.c shutdown.c \ + truncate.c LLDLIBS = $(LIBXCMD) $(LIBHANDLE) LTDEPENDENCIES = $(LIBXCMD) $(LIBHANDLE)
io/init.c +1 -0
@@ -64,6 +64,7 @@ init_commands(void)help_init ();imap_init ();inject_init (); +seek_init ();madvise_init ();mincore_init ();mmap_init ();
io/io.h +1 -0
@@ -105,6 +105,7 @@ extern void pread_init(void);extern void prealloc_init (void );extern void pwrite_init (void );extern void quit_init (void ); +extern void seek_init (void );extern void shutdown_init (void );extern void truncate_init (void );
io/seek.c new file +224 -0
224 lines not on this page · raw message
man/man8/xfs_io.8 +39 -0
@@ -418,6 +418,45 @@ to read (in bytes) .RE .PD .TP +.TP +.BI "seek \-a | \-d | \-h [ \-r ] [ \-s ] offset" +On platforms that support the +.BR lseek (2) +.B SEEK_DATA +and +.B SEEK_HOLE +options, display the offsets of the specified segments. +.RS 1.0i +.PD 0 +.TP 0.4i +.B \-a +Display both +.B data +and +.B hole +segments starting at the specified +.B offset. +.TP +.B \-d +Display the +.B data +segment starting at the specified +.B offset. +.TP +.B \-h +Display the +.B hole +segment starting at the specified +.B offset. +.TP +.B \-r +Recursively display all the specified segments starting at the specified +.B offset. +.TP +.B \-s +Display the starting lseek(2) offset. This offset will be a calculated value when +both data and holes are displayed together or performing a recusively display. +.TP .SH MEMORY MAPPED I/O COMMANDS .TP
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Wow V8 I miss those. Looks Good.
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Thanks for the patch Mark it has been committed.
Thanks
--Rich
commit b169249b1257d2a127484896a4a4ab2faf17f747
Author: Mark Tinguely <[email protected]> Date: Fri Aug 23 17:48:23 2013 +0000
xfs_io: v8 add the lseek() SEEK_DATA/SEEK_HOLE support
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs