Skip to contentSkip to conversation

Xfsprogs: add fiemap command to xfs_io

PATCH New Josef Bacik 1 participant 1 message Nov 10, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Xfsprogs: add fiemap command to xfs_io

When trying to add a test for hole punching I noticed that the "bmap" command only works on XFS, which makes testing hole punching on other fs's kind of difficult. To fix this I've added an fiemap command that works almost exactly like bmap. It is formatted similarly and takes similar flags, the only thing thats different is obviously it doesn't spit out AG info and it doesn't make finding prealloc space optional. This is my first foray into all of this stuff so a good hard look would be appreciated. I tested it with a few different files to make sure bmap and fiemap both looked the same. Thanks,

---
 io/Makefile |    3 +-
 io/fiemap.c |  342 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 io/init.c   |    1 +
 3 files changed, 345 insertions(+), 1 deletions(-)
 create mode 100644 io/fiemap.c
io/Makefile +2 -1
index fc98166..ea772f4 100644
@@ -10,7 +10,8 @@ LSRCFILES = xfs_bmap.sh xfs_freeze.sh xfs_mkfile.sh
 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 shutdown.c truncate.c \
+	fiemap.c
 
 LLDLIBS = $(LIBXCMD) $(LIBHANDLE)
 LTDEPENDENCIES = $(LIBXCMD) $(LIBHANDLE)
io/fiemap.c new file +342 -0

342 lines not on this page · raw message

io/init.c +1 -0
index f8fc25d..a166ad1 100644
@@ -71,6 +71,7 @@ init_commands(void)
 	parent_init();
 	pread_init();
 	prealloc_init();
+	fiemap_init();
 	pwrite_init();
 	quit_init();
 	resblks_init();
Signature · 6 lines
1.6.6.1

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs