debugfs: add the ability to manipulate the extent tree directly
This commit adds the functionality which had previously only been in
the tst_extents command to debugfs. The debugfs command extent_open
will open extent tree of a particular inode, and enables a series of
commands which will allow the user to interact with the extent tree
directly. Once the extent tree is closed via extent_open(), these
additional commands will be disabled again.
This commit exports two new functions from lib/ext2fs/extent.c which
had previously been statically defined: ext2fs_extent_node_split() and
ext2fs_extent_goto2().
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
diff --git a/debugfs/Makefile.in b/debugfs/Makefile.in
index 7e71c3f..42868a3 100644
--- a/debugfs/Makefile.in
+++ b/debugfs/Makefile.in
@@ -18,16 +18,16 @@
DEBUG_OBJS= debug_cmds.o debugfs.o util.o ncheck.o icheck.o ls.o \
lsdel.o dump.o set_fields.o logdump.o htree.o unused.o e2freefrag.o \
- filefrag.o
+ filefrag.o extent_cmds.o extent_inode.o
RO_DEBUG_OBJS= ro_debug_cmds.o ro_debugfs.o util.o ncheck.o icheck.o ls.o \
- lsdel.o logdump.o htree.o e2freefrag.o filefrag.o
+ lsdel.o logdump.o htree.o e2freefrag.o filefrag.o extent_inode.o
SRCS= debug_cmds.c $(srcdir)/debugfs.c $(srcdir)/util.c $(srcdir)/ls.c \
$(srcdir)/ncheck.c $(srcdir)/icheck.c $(srcdir)/lsdel.c \
$(srcdir)/dump.c $(srcdir)/set_fields.c ${srcdir}/logdump.c \
$(srcdir)/htree.c $(srcdir)/unused.c ${srcdir}/../misc/e2freefrag.c \
- $(srcdir)/filefrag.c
+ $(srcdir)/filefrag.c $(srcdir)/extent_inode.c
LIBS= $(LIBEXT2FS) $(LIBE2P) $(LIBSS) $(LIBCOM_ERR) $(LIBBLKID) \
$(LIBUUID)
@@ -52,6 +52,10 @@
$(E) " MK_CMDS $@"
$(Q) $(MK_CMDS) $(srcdir)/debug_cmds.ct
+extent_cmds.c extent_cmds.h: extent_cmds.ct
+ $(E) " MK_CMDS $@"
+ $(Q) $(MK_CMDS) $(srcdir)/extent_cmds.ct
+
ro_debug_cmds.c ro_debug_cmds.h: ro_debug_cmds.ct
$(E) " MK_CMDS $@"
$(Q) $(MK_CMDS) $(srcdir)/ro_debug_cmds.ct
@@ -102,7 +106,7 @@
clean:
$(RM) -f $(PROGS) debugfs.8 \#* *.s *.o *.a *~ debug_cmds.c \
- ro_debug_cmds.c core rdebugfs
+ extent_cmds.c ro_debug_cmds.c core rdebugfs
mostlyclean: clean
distclean: clean