Imported reiserfsprogs-3.6.9
This commit is contained in:
1 parent
99c89460c3
commit
cccefa4d84
86 files changed
+13393
-6954
No files matched your search
@@ -1,6 +1,6 @@
|
||||
sbin_PROGRAMS = debugreiserfs unpack
|
||||
|
||||
debugreiserfs_SOURCES = debugreiserfs.c pack.c stat.c corruption.c scan.c recover.c journal.c
|
||||
debugreiserfs_SOURCES = debugreiserfs.c pack.c stat.c corruption.c scan.c recover.c
|
||||
unpack_SOURCES = unpack.c pack.c debugreiserfs.h
|
||||
man_MANS = debugreiserfs.8
|
||||
EXTRA_DIST = $(man_MANS)
|
||||
|
||||
+315
-215
@@ -1,6 +1,8 @@
|
||||
# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
|
||||
# Makefile.in generated by automake 1.7.2 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
|
||||
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
|
||||
# Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
@@ -10,174 +12,233 @@
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
SHELL = @SHELL@
|
||||
@SET_MAKE@
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
bindir = @bindir@
|
||||
sbindir = @sbindir@
|
||||
libexecdir = @libexecdir@
|
||||
datadir = @datadir@
|
||||
sysconfdir = @sysconfdir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
localstatedir = @localstatedir@
|
||||
libdir = @libdir@
|
||||
infodir = @infodir@
|
||||
mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
|
||||
DESTDIR =
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
|
||||
top_builddir = ..
|
||||
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
transform = @program_transform_name@
|
||||
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMDEP_FALSE = @AMDEP_FALSE@
|
||||
AMDEP_TRUE = @AMDEP_TRUE@
|
||||
AMTAR = @AMTAR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
RANLIB = @RANLIB@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_RANLIB = @ac_ct_RANLIB@
|
||||
ac_ct_STRIP = @ac_ct_STRIP@
|
||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||
am__include = @am__include@
|
||||
am__quote = @am__quote@
|
||||
bindir = @bindir@
|
||||
build_alias = @build_alias@
|
||||
datadir = @datadir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host_alias = @host_alias@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
oldincludedir = @oldincludedir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
sbindir = @sbindir@
|
||||
|
||||
sharedstatedir = @sharedstatedir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
sbin_PROGRAMS = debugreiserfs unpack
|
||||
|
||||
debugreiserfs_SOURCES = debugreiserfs.c pack.c stat.c corruption.c scan.c recover.c journal.c
|
||||
debugreiserfs_SOURCES = debugreiserfs.c pack.c stat.c corruption.c scan.c recover.c
|
||||
unpack_SOURCES = unpack.c pack.c debugreiserfs.h
|
||||
man_MANS = debugreiserfs.8
|
||||
EXTRA_DIST = $(man_MANS)
|
||||
|
||||
LDADD = $(top_srcdir)/lib/libmisc.a $(top_srcdir)/reiserfscore/libcore.a
|
||||
subdir = debugreiserfs
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = ../include/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
PROGRAMS = $(sbin_PROGRAMS)
|
||||
CONFIG_HEADER = $(top_builddir)/include/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
sbin_PROGRAMS = debugreiserfs$(EXEEXT) unpack$(EXEEXT)
|
||||
PROGRAMS = $(sbin_PROGRAMS)
|
||||
|
||||
|
||||
DEFS = @DEFS@ -I. -I$(srcdir) -I../include
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBS = @LIBS@
|
||||
debugreiserfs_OBJECTS = debugreiserfs.o pack.o stat.o corruption.o \
|
||||
scan.o recover.o journal.o
|
||||
am_debugreiserfs_OBJECTS = debugreiserfs.$(OBJEXT) pack.$(OBJEXT) \
|
||||
stat.$(OBJEXT) corruption.$(OBJEXT) scan.$(OBJEXT) \
|
||||
recover.$(OBJEXT)
|
||||
debugreiserfs_OBJECTS = $(am_debugreiserfs_OBJECTS)
|
||||
debugreiserfs_LDADD = $(LDADD)
|
||||
debugreiserfs_DEPENDENCIES = $(top_srcdir)/lib/libmisc.a \
|
||||
$(top_srcdir)/reiserfscore/libcore.a
|
||||
debugreiserfs_LDFLAGS =
|
||||
unpack_OBJECTS = unpack.o pack.o
|
||||
debugreiserfs_DEPENDENCIES = $(top_srcdir)/lib/libmisc.a \
|
||||
$(top_srcdir)/reiserfscore/libcore.a
|
||||
debugreiserfs_LDFLAGS =
|
||||
am_unpack_OBJECTS = unpack.$(OBJEXT) pack.$(OBJEXT)
|
||||
unpack_OBJECTS = $(am_unpack_OBJECTS)
|
||||
unpack_LDADD = $(LDADD)
|
||||
unpack_DEPENDENCIES = $(top_srcdir)/lib/libmisc.a \
|
||||
$(top_srcdir)/reiserfscore/libcore.a
|
||||
unpack_LDFLAGS =
|
||||
CFLAGS = @CFLAGS@
|
||||
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
unpack_DEPENDENCIES = $(top_srcdir)/lib/libmisc.a \
|
||||
$(top_srcdir)/reiserfscore/libcore.a
|
||||
unpack_LDFLAGS =
|
||||
|
||||
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include
|
||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/corruption.Po \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/debugreiserfs.Po ./$(DEPDIR)/pack.Po \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/recover.Po ./$(DEPDIR)/scan.Po \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/stat.Po ./$(DEPDIR)/unpack.Po
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
CCLD = $(CC)
|
||||
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
|
||||
man8dir = $(mandir)/man8
|
||||
MANS = $(man_MANS)
|
||||
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
DIST_SOURCES = $(debugreiserfs_SOURCES) $(unpack_SOURCES)
|
||||
|
||||
NROFF = nroff
|
||||
DIST_COMMON = Makefile.am Makefile.in
|
||||
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
TAR = tar
|
||||
GZIP_ENV = --best
|
||||
MANS = $(man_MANS)
|
||||
DIST_COMMON = Makefile.am Makefile.in
|
||||
SOURCES = $(debugreiserfs_SOURCES) $(unpack_SOURCES)
|
||||
OBJECTS = $(debugreiserfs_OBJECTS) $(unpack_OBJECTS)
|
||||
|
||||
all: all-redirect
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .S .c .o .s
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps debugreiserfs/Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
|
||||
mostlyclean-sbinPROGRAMS:
|
||||
|
||||
clean-sbinPROGRAMS:
|
||||
-test -z "$(sbin_PROGRAMS)" || rm -f $(sbin_PROGRAMS)
|
||||
|
||||
distclean-sbinPROGRAMS:
|
||||
|
||||
maintainer-clean-sbinPROGRAMS:
|
||||
|
||||
.SUFFIXES: .c .o .obj
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu debugreiserfs/Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
|
||||
sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
|
||||
install-sbinPROGRAMS: $(sbin_PROGRAMS)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(mkinstalldirs) $(DESTDIR)$(sbindir)
|
||||
@list='$(sbin_PROGRAMS)'; for p in $$list; do \
|
||||
if test -f $$p; then \
|
||||
echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(sbindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
|
||||
$(INSTALL_PROGRAM) $$p $(DESTDIR)$(sbindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
|
||||
p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
|
||||
if test -f $$p \
|
||||
; then \
|
||||
f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
|
||||
echo " $(INSTALL_PROGRAM_ENV) $(sbinPROGRAMS_INSTALL) $$p $(DESTDIR)$(sbindir)/$$f"; \
|
||||
$(INSTALL_PROGRAM_ENV) $(sbinPROGRAMS_INSTALL) $$p $(DESTDIR)$(sbindir)/$$f || exit 1; \
|
||||
else :; fi; \
|
||||
done
|
||||
|
||||
uninstall-sbinPROGRAMS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
list='$(sbin_PROGRAMS)'; for p in $$list; do \
|
||||
rm -f $(DESTDIR)$(sbindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
|
||||
@list='$(sbin_PROGRAMS)'; for p in $$list; do \
|
||||
f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
|
||||
echo " rm -f $(DESTDIR)$(sbindir)/$$f"; \
|
||||
rm -f $(DESTDIR)$(sbindir)/$$f; \
|
||||
done
|
||||
|
||||
.c.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
.s.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
.S.o:
|
||||
$(COMPILE) -c $<
|
||||
clean-sbinPROGRAMS:
|
||||
-test -z "$(sbin_PROGRAMS)" || rm -f $(sbin_PROGRAMS)
|
||||
debugreiserfs$(EXEEXT): $(debugreiserfs_OBJECTS) $(debugreiserfs_DEPENDENCIES)
|
||||
@rm -f debugreiserfs$(EXEEXT)
|
||||
$(LINK) $(debugreiserfs_LDFLAGS) $(debugreiserfs_OBJECTS) $(debugreiserfs_LDADD) $(LIBS)
|
||||
unpack$(EXEEXT): $(unpack_OBJECTS) $(unpack_DEPENDENCIES)
|
||||
@rm -f unpack$(EXEEXT)
|
||||
$(LINK) $(unpack_LDFLAGS) $(unpack_OBJECTS) $(unpack_LDADD) $(LIBS)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.o core *.core
|
||||
|
||||
clean-compile:
|
||||
-rm -f *.$(OBJEXT) core *.core
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
maintainer-clean-compile:
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/corruption.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debugreiserfs.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pack.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/recover.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scan.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unpack.Po@am__quote@
|
||||
|
||||
debugreiserfs: $(debugreiserfs_OBJECTS) $(debugreiserfs_DEPENDENCIES)
|
||||
@rm -f debugreiserfs
|
||||
$(LINK) $(debugreiserfs_LDFLAGS) $(debugreiserfs_OBJECTS) $(debugreiserfs_LDADD) $(LIBS)
|
||||
distclean-depend:
|
||||
-rm -rf ./$(DEPDIR)
|
||||
|
||||
unpack: $(unpack_OBJECTS) $(unpack_DEPENDENCIES)
|
||||
@rm -f unpack
|
||||
$(LINK) $(unpack_LDFLAGS) $(unpack_OBJECTS) $(unpack_LDADD) $(LIBS)
|
||||
.c.o:
|
||||
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
|
||||
@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
|
||||
@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
|
||||
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
|
||||
@am__fastdepCC_TRUE@ fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
|
||||
|
||||
install-man8:
|
||||
.c.obj:
|
||||
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
|
||||
@am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \
|
||||
@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
|
||||
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
|
||||
@am__fastdepCC_TRUE@ fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`
|
||||
uninstall-info-am:
|
||||
|
||||
man8dir = $(mandir)/man8
|
||||
install-man8: $(man8_MANS) $(man_MANS)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(mkinstalldirs) $(DESTDIR)$(man8dir)
|
||||
@list='$(man8_MANS)'; \
|
||||
l2='$(man_MANS)'; for i in $$l2; do \
|
||||
@list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \
|
||||
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
|
||||
for i in $$l2; do \
|
||||
case "$$i" in \
|
||||
*.8*) list="$$list $$i" ;; \
|
||||
esac; \
|
||||
@@ -186,173 +247,212 @@ install-man8:
|
||||
if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
|
||||
else file=$$i; fi; \
|
||||
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
|
||||
case "$$ext" in \
|
||||
8*) ;; \
|
||||
*) ext='8' ;; \
|
||||
esac; \
|
||||
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
|
||||
inst=`echo $$inst | sed -e 's/^.*\///'`; \
|
||||
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
|
||||
echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man8dir)/$$inst"; \
|
||||
$(INSTALL_DATA) $$file $(DESTDIR)$(man8dir)/$$inst; \
|
||||
done
|
||||
|
||||
uninstall-man8:
|
||||
@list='$(man8_MANS)'; \
|
||||
l2='$(man_MANS)'; for i in $$l2; do \
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \
|
||||
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
|
||||
for i in $$l2; do \
|
||||
case "$$i" in \
|
||||
*.8*) list="$$list $$i" ;; \
|
||||
esac; \
|
||||
done; \
|
||||
for i in $$list; do \
|
||||
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
|
||||
case "$$ext" in \
|
||||
8*) ;; \
|
||||
*) ext='8' ;; \
|
||||
esac; \
|
||||
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
|
||||
inst=`echo $$inst | sed -e 's/^.*\///'`; \
|
||||
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
|
||||
echo " rm -f $(DESTDIR)$(man8dir)/$$inst"; \
|
||||
rm -f $(DESTDIR)$(man8dir)/$$inst; \
|
||||
done
|
||||
install-man: $(MANS)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(MAKE) $(AM_MAKEFLAGS) install-man8
|
||||
uninstall-man:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
$(MAKE) $(AM_MAKEFLAGS) uninstall-man8
|
||||
|
||||
ETAGS = etags
|
||||
ETAGSFLAGS =
|
||||
|
||||
CTAGS = ctags
|
||||
CTAGSFLAGS =
|
||||
|
||||
tags: TAGS
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS)'; \
|
||||
unique=`for i in $$list; do echo $$i; done | \
|
||||
awk ' { files[$$0] = 1; } \
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
here=`pwd` && cd $(srcdir) \
|
||||
&& mkid -f$$here/ID $$unique $(LISP)
|
||||
mkid -fID $$unique
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS)'; \
|
||||
unique=`for i in $$list; do echo $$i; done | \
|
||||
awk ' { files[$$0] = 1; } \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
|
||||
|| (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
|
||||
test -z "$(ETAGS_ARGS)$$tags$$unique" \
|
||||
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
mostlyclean-tags:
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
clean-tags:
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
maintainer-clean-tags:
|
||||
|
||||
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
|
||||
subdir = debugreiserfs
|
||||
top_distdir = ..
|
||||
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@for file in $(DISTFILES); do \
|
||||
d=$(srcdir); \
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
|
||||
list='$(DISTFILES)'; for file in $$list; do \
|
||||
case $$file in \
|
||||
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
|
||||
esac; \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
|
||||
dir="/$$dir"; \
|
||||
$(mkinstalldirs) "$(distdir)$$dir"; \
|
||||
else \
|
||||
dir=''; \
|
||||
fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
cp -pr $$d/$$file $(distdir)/$$file; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file || :; \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
corruption.o: corruption.c debugreiserfs.h ../include/io.h \
|
||||
../include/misc.h ../include/swab.h ../include/reiserfs_lib.h \
|
||||
../include/reiserfs_fs.h ../include/config.h ../version.h
|
||||
debugreiserfs.o: debugreiserfs.c debugreiserfs.h ../include/io.h \
|
||||
../include/misc.h ../include/swab.h ../include/reiserfs_lib.h \
|
||||
../include/reiserfs_fs.h ../include/config.h ../version.h
|
||||
journal.o: journal.c debugreiserfs.h ../include/io.h ../include/misc.h \
|
||||
../include/swab.h ../include/reiserfs_lib.h \
|
||||
../include/reiserfs_fs.h ../include/config.h ../version.h
|
||||
pack.o: pack.c debugreiserfs.h ../include/io.h ../include/misc.h \
|
||||
../include/swab.h ../include/reiserfs_lib.h \
|
||||
../include/reiserfs_fs.h ../include/config.h ../version.h
|
||||
recover.o: recover.c debugreiserfs.h ../include/io.h ../include/misc.h \
|
||||
../include/swab.h ../include/reiserfs_lib.h \
|
||||
../include/reiserfs_fs.h ../include/config.h ../version.h
|
||||
scan.o: scan.c debugreiserfs.h ../include/io.h ../include/misc.h \
|
||||
../include/swab.h ../include/reiserfs_lib.h \
|
||||
../include/reiserfs_fs.h ../include/config.h ../version.h
|
||||
stat.o: stat.c debugreiserfs.h ../include/io.h ../include/misc.h \
|
||||
../include/swab.h ../include/reiserfs_lib.h \
|
||||
../include/reiserfs_fs.h ../include/config.h ../version.h
|
||||
unpack.o: unpack.c debugreiserfs.h ../include/io.h ../include/misc.h \
|
||||
../include/swab.h ../include/reiserfs_lib.h \
|
||||
../include/reiserfs_fs.h ../include/config.h ../version.h
|
||||
|
||||
info-am:
|
||||
info: info-am
|
||||
dvi-am:
|
||||
dvi: dvi-am
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
installcheck-am:
|
||||
installcheck: installcheck-am
|
||||
install-exec-am: install-sbinPROGRAMS
|
||||
install-exec: install-exec-am
|
||||
all-am: Makefile $(PROGRAMS) $(MANS)
|
||||
|
||||
install-data-am: install-man
|
||||
installdirs:
|
||||
$(mkinstalldirs) $(DESTDIR)$(sbindir) $(DESTDIR)$(man8dir)
|
||||
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
install: install-am
|
||||
uninstall-am: uninstall-sbinPROGRAMS uninstall-man
|
||||
uninstall: uninstall-am
|
||||
all-am: Makefile $(PROGRAMS) $(MANS)
|
||||
all-redirect: all-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
|
||||
installdirs:
|
||||
$(mkinstalldirs) $(DESTDIR)$(sbindir) $(DESTDIR)$(mandir)/man8
|
||||
|
||||
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-rm -f Makefile $(CONFIG_CLEAN_FILES)
|
||||
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
|
||||
|
||||
maintainer-clean-generic:
|
||||
mostlyclean-am: mostlyclean-sbinPROGRAMS mostlyclean-compile \
|
||||
mostlyclean-tags mostlyclean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
clean-am: clean-sbinPROGRAMS clean-compile clean-tags clean-generic \
|
||||
mostlyclean-am
|
||||
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
distclean-am: distclean-sbinPROGRAMS distclean-compile distclean-tags \
|
||||
distclean-generic clean-am
|
||||
clean-am: clean-generic clean-sbinPROGRAMS mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
|
||||
maintainer-clean-am: maintainer-clean-sbinPROGRAMS \
|
||||
maintainer-clean-compile maintainer-clean-tags \
|
||||
maintainer-clean-generic distclean-am
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
distclean-am: clean-am distclean-compile distclean-depend \
|
||||
distclean-generic distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am: install-man
|
||||
|
||||
install-exec-am: install-sbinPROGRAMS
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-man: install-man8
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
|
||||
.PHONY: mostlyclean-sbinPROGRAMS distclean-sbinPROGRAMS \
|
||||
clean-sbinPROGRAMS maintainer-clean-sbinPROGRAMS uninstall-sbinPROGRAMS \
|
||||
install-sbinPROGRAMS mostlyclean-compile distclean-compile \
|
||||
clean-compile maintainer-clean-compile install-man8 uninstall-man8 \
|
||||
install-man uninstall-man tags mostlyclean-tags distclean-tags \
|
||||
clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \
|
||||
check-am installcheck-am installcheck install-exec-am install-exec \
|
||||
install-data-am install-data install-am install uninstall-am uninstall \
|
||||
all-redirect all-am all installdirs mostlyclean-generic \
|
||||
distclean-generic clean-generic maintainer-clean-generic clean \
|
||||
mostlyclean distclean maintainer-clean
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-info-am uninstall-man uninstall-sbinPROGRAMS
|
||||
|
||||
uninstall-man: uninstall-man8
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
|
||||
clean-sbinPROGRAMS ctags distclean distclean-compile \
|
||||
distclean-depend distclean-generic distclean-tags distdir dvi \
|
||||
dvi-am info info-am install install-am install-data \
|
||||
install-data-am install-exec install-exec-am install-info \
|
||||
install-info-am install-man install-man8 install-sbinPROGRAMS \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
||||
mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
|
||||
tags uninstall uninstall-am uninstall-info-am uninstall-man \
|
||||
uninstall-man8 uninstall-sbinPROGRAMS
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
|
||||
+1097
-277
File diff suppressed because it is too large.
Load diff
@@ -1,7 +1,7 @@
|
||||
.\" -*- nroff -*-
|
||||
.\" Copyright 1996-2002 Hans Reiser.
|
||||
.\" Copyright 1996-2003 Hans Reiser.
|
||||
.\"
|
||||
.TH DEBUGREISERFS 8 "January 2002" "Reiserfsprogs 3.6.4"
|
||||
.TH DEBUGREISERFS 8 "April 2003" "Reiserfsprogs 3.6.9"
|
||||
.SH NAME
|
||||
debugreiserfs
|
||||
.SH SYNOPSIS
|
||||
@@ -20,7 +20,7 @@ debugreiserfs
|
||||
.I device
|
||||
.SH DESCRIPTION
|
||||
It helps sometimes to solve problems with reiserfs filesystems. Being
|
||||
called w/o options it prints super block of reiserfs filesystem found
|
||||
called without options it prints super block of reiserfs filesystem found
|
||||
on the \fIdevice\fR.
|
||||
.TP
|
||||
.I device
|
||||
@@ -76,7 +76,7 @@ Suppress showing speed of progress when
|
||||
.\" -s or
|
||||
-p is in use
|
||||
.SH AUTHOR
|
||||
This version of \fBdebugreiserfs\fR has been written by Hans Reiser <reiser@idiom.com>.
|
||||
This version of \fBdebugreiserfs\fR has been written by Hans Reiser <reiser@namesys.com>.
|
||||
.SH BUGS
|
||||
There are probably few of them. Please, report bugs to ReiserFS mail-list <reiserfs-list@namesys.com>.
|
||||
.SH SEE ALSO
|
||||
|
||||
+474
-331
File diff suppressed because it is too large.
Load diff
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright 2000-2002 by Hans Reiser, licensing governed by reiserfs/README
|
||||
* Copyright 2000-2003 by Hans Reiser, licensing governed by
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
#define _GNU_SOURCE
|
||||
@@ -30,17 +31,21 @@ extern reiserfs_filsys_t * fs;
|
||||
*/
|
||||
#define DO_DUMP 1 /* not a real dump, just printing to stdout contents of
|
||||
tree nodes */
|
||||
#define DO_CORRUPT 2 /* used to make filesystem corruption and then test fsck */
|
||||
#define DO_SCAN 3
|
||||
#define DO_RECOVER 4
|
||||
#define DO_TEST 6
|
||||
#define DO_PACK 7 /* -p extract meta data of reiserfs filesystem */
|
||||
#define DO_STAT 8
|
||||
#define DO_SCAN_FOR_NAME 9 /* -n */
|
||||
#define DO_LOOK_FOR_NAME 10 /* -N */
|
||||
#define DO_SCAN_JOURNAL 11 /* -J */
|
||||
#define DO_EXTRACT_BADBLOCKS 12
|
||||
#define DO_FILE_MAP 13
|
||||
#define DO_CORRUPT_ONE 2 /* used to make filesystem corruption and then test fsck */
|
||||
#define DO_CORRUPT_FILE 3 /* used to make filesystem corruption and then test fsck, the list of corruption is set on the file */
|
||||
#define DO_RANDOM_CORRUPTION 4
|
||||
#define DO_SCAN 5
|
||||
#define DO_RECOVER 6
|
||||
#define DO_TEST 7
|
||||
#define DO_PACK 8 /* -p extract meta data of reiserfs filesystem */
|
||||
#define DO_STAT 9
|
||||
#define DO_SCAN_FOR_NAME 10 /* -n */
|
||||
#define DO_LOOK_FOR_NAME 11 /* -N */
|
||||
#define DO_SCAN_JOURNAL 12 /* -J */
|
||||
#define DO_EXTRACT_BADBLOCKS 13
|
||||
#define DO_FILE_MAP 14
|
||||
#define DO_ZERO_BITMAP 15
|
||||
|
||||
|
||||
|
||||
/*first bits are in reiserfs_fs.b*/
|
||||
@@ -210,13 +215,13 @@ sent_bytes += 8;\
|
||||
|
||||
|
||||
struct debugreiserfs_data {
|
||||
int mode; /* DO_DUMP | DO_PACK | DO_CORRUPT... */
|
||||
int mode; /* DO_DUMP | DO_PACK | DO_CORRUPT_ONE... */
|
||||
#define USED_BLOCKS 1
|
||||
#define EXTERN_BITMAP 2
|
||||
#define ALL_BLOCKS 3
|
||||
#define UNUSED_BLOCKS 4
|
||||
|
||||
int scan_area; /* for -p, -s and -n */
|
||||
int scan_area; /* for -p, -s and -n */
|
||||
char * input_bitmap; /* when ->scan_area is set to EXTERN_BITMAP */
|
||||
reiserfs_bitmap_t * bitmap; /* bitmap is read from ->input_bitmap */
|
||||
unsigned long block; /* set by -B. this is a must for -C, option for -p and -d */
|
||||
@@ -228,6 +233,10 @@ struct debugreiserfs_data {
|
||||
|
||||
unsigned long options; /* -q only yet*/
|
||||
int JJ;
|
||||
/* log file name and handle */
|
||||
char * log_file_name;
|
||||
FILE * log ;
|
||||
|
||||
};
|
||||
|
||||
#define data(fs) ((struct debugreiserfs_data *)((fs)->fs_vp))
|
||||
@@ -249,7 +258,10 @@ struct debugreiserfs_data {
|
||||
void do_stat (reiserfs_filsys_t * fs);
|
||||
|
||||
/* corruption.c */
|
||||
void do_corrupt_one_block (reiserfs_filsys_t * fs);
|
||||
void do_corrupt_one_block (reiserfs_filsys_t * fs, char * fline);
|
||||
void do_leaves_corruption (reiserfs_filsys_t * fs, unsigned long nr_leaves_cr);
|
||||
void do_bitmap_corruption (reiserfs_filsys_t * fs);
|
||||
void do_fs_random_corrupt (reiserfs_filsys_t * fs);
|
||||
|
||||
/* recover.c */
|
||||
void do_recover (reiserfs_filsys_t * fs);
|
||||
@@ -269,4 +281,15 @@ struct saved_item {
|
||||
struct saved_item * si_next; /* list of items having the same key */
|
||||
};
|
||||
|
||||
/*
|
||||
Local variables:
|
||||
c-indentation-style: "K&R"
|
||||
mode-name: "LC"
|
||||
c-basic-offset: 4
|
||||
tab-width: 4
|
||||
fill-column: 80
|
||||
End:
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@@ -1,196 +0,0 @@
|
||||
/*
|
||||
* Copyright 2002 Hans Reiser
|
||||
*/
|
||||
|
||||
#include "debugreiserfs.h"
|
||||
|
||||
|
||||
extern unsigned long * badblocks;
|
||||
extern int badblocks_nr;
|
||||
|
||||
#if 0
|
||||
static void look_in_transaction (reiserfs_filsys_t * fs,
|
||||
reiserfs_trans_t * trans)
|
||||
{
|
||||
struct buffer_head * d_bh, * c_bh, * logged, * in_place;
|
||||
struct reiserfs_journal_desc * desc;
|
||||
struct reiserfs_journal_commit * commit;
|
||||
int i, j;
|
||||
int who;
|
||||
|
||||
|
||||
d_bh = bread (fs->fs_dev, trans->desc_blocknr, fs->fs_blocksize);
|
||||
if (!d_bh) {
|
||||
reiserfs_warning (stdout, "reading descriptor block %lu failed\n",
|
||||
trans->desc_blocknr);
|
||||
return;
|
||||
}
|
||||
|
||||
c_bh = bread (fs->fs_dev, trans->commit_blocknr, fs->fs_blocksize);
|
||||
if (!c_bh) {
|
||||
reiserfs_warning (stdout, "reading commit block %lu failed\n",
|
||||
trans->commit_blocknr);
|
||||
brelse (d_bh);
|
||||
return;
|
||||
}
|
||||
|
||||
// desc = (struct reiserfs_journal_desc *)(d_bh->b_data);
|
||||
// commit = (struct reiserfs_journal_commit *)(c_bh->b_data);
|
||||
|
||||
reiserfs_warning (stdout, "Transaction %lu\n", trans->trans_id);
|
||||
|
||||
for (i = 0; i < badblocks_nr; i ++) {
|
||||
for (j = 0; j < get_jd_len (d_bh); j ++) {
|
||||
if ((j < JOURNAL_TRANS_HALF && badblocks [i] == le32_to_cpu (desc->j2_realblock[j])) ||
|
||||
(j >= JOURNAL_TRANS_HALF && badblocks [i] == le32_to_cpu (commit->j3_realblock[j - JOURNAL_TRANS_HALF]))) {
|
||||
reiserfs_warning (stdout,
|
||||
"\tblock %lu is logged in it (block of journal area %lu - ",
|
||||
badblocks [i], d_bh->b_blocknr + j + 1);
|
||||
|
||||
logged = 0;
|
||||
in_place = 0;
|
||||
|
||||
logged = bread (fs->fs_dev, d_bh->b_blocknr + j + 1, fs->fs_blocksize);
|
||||
in_place = bread (fs->fs_dev, badblocks [i], fs->fs_blocksize);
|
||||
if (!logged || !in_place) {
|
||||
reiserfs_warning (stdout, "Could not read blocks\n");
|
||||
brelse (logged);
|
||||
brelse (in_place);
|
||||
continue;
|
||||
}
|
||||
|
||||
who = who_is_this (logged->b_data, logged->b_size);
|
||||
if (who != THE_LEAF && who != HAS_IH_ARRAY) {
|
||||
brelse (logged);
|
||||
brelse (in_place);
|
||||
continue;
|
||||
}
|
||||
|
||||
reiserfs_warning (stdout, "%s\n", which_block (who));
|
||||
if (data (fs)->JJ > 1) {
|
||||
/* overwrite in-place block with a logged version */
|
||||
if (who_is_this (in_place->b_data, in_place->b_size) == THE_LEAF)
|
||||
reiserfs_warning (stderr, "Block %d is leaf already, skip it\n",
|
||||
in_place->b_blocknr);
|
||||
else {
|
||||
memcpy (in_place->b_data, logged->b_data, fs->fs_blocksize);
|
||||
mark_buffer_dirty (in_place);
|
||||
bwrite (in_place);
|
||||
if (input_bitmap (fs))
|
||||
reiserfs_bitmap_set_bit (input_bitmap (fs), in_place->b_blocknr);
|
||||
}
|
||||
}
|
||||
|
||||
brelse (logged);
|
||||
brelse (in_place);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
brelse (d_bh);
|
||||
brelse (c_bh);
|
||||
}
|
||||
|
||||
/* go through all transactions in the journal to check whether block is there */
|
||||
static void find_in_journal (reiserfs_filsys_t * fs)
|
||||
{
|
||||
for_each_transaction (fs, look_in_transaction);
|
||||
}
|
||||
#endif
|
||||
|
||||
#define BLOCK_IN_Q 12762
|
||||
|
||||
static void check_block_9555 (reiserfs_filsys_t * fs, reiserfs_trans_t * trans,
|
||||
int index,
|
||||
unsigned long in_journal, unsigned long in_place)
|
||||
{
|
||||
struct buffer_head * bh;
|
||||
|
||||
|
||||
if (in_place == 17) {
|
||||
/* read block of journal which contains block 17 abd check whether bit
|
||||
BLOCK_IN_Q is set */
|
||||
bh = bread (fs->fs_journal_dev, in_journal, fs->fs_blocksize);
|
||||
if (!bh) {
|
||||
reiserfs_warning (stderr, "could not read block %lu (of journal area)\n",
|
||||
in_journal);
|
||||
return;
|
||||
}
|
||||
|
||||
if (test_bit (BLOCK_IN_Q, bh->b_data))
|
||||
reiserfs_warning (stdout, "trans %lu, pos %d - block 17: block %d is marked used in it\n",
|
||||
trans->trans_id, index, BLOCK_IN_Q);
|
||||
else
|
||||
reiserfs_warning (stdout, "trans %lu, pos %d - block 17: block %d is marked free in it\n",
|
||||
trans->trans_id, index, BLOCK_IN_Q);
|
||||
brelse (bh);
|
||||
}
|
||||
|
||||
if (in_place == BLOCK_IN_Q) {
|
||||
reiserfs_warning (stdout, "trans %lu, block %d is logged at pos %d\n",
|
||||
trans->trans_id, BLOCK_IN_Q, index);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* remove when the problem is found */
|
||||
static void check_transaction (reiserfs_filsys_t * fs, reiserfs_trans_t * trans)
|
||||
{
|
||||
for_each_block (fs, trans, check_block_9555);
|
||||
}
|
||||
|
||||
|
||||
void scan_journal (reiserfs_filsys_t * fs)
|
||||
{
|
||||
for_each_transaction (fs, check_transaction);
|
||||
}
|
||||
|
||||
|
||||
|
||||
#if 0
|
||||
/* read block numbers from stdin, look for them in the journal, and (if -JJ is
|
||||
given) write then "in-place" amd mark overwritten blocks used in the bitmap
|
||||
specified with -b */
|
||||
void scan_journal (reiserfs_filsys_t * fs)
|
||||
{
|
||||
char * str = 0;
|
||||
size_t n = 0;
|
||||
|
||||
|
||||
/* store all blocks which come from stdin */
|
||||
while (1) {
|
||||
if (getline (&str, &n, stdin) == -1)
|
||||
break;
|
||||
if (!strcmp (str, "\n"))
|
||||
break;
|
||||
str [strlen (str) - 1] = 0;
|
||||
|
||||
badblocks = realloc (badblocks, (badblocks_nr + 1) * 4);
|
||||
if (!badblocks)
|
||||
reiserfs_panic ("realloc failed");
|
||||
badblocks [badblocks_nr ++] = atol (str);
|
||||
|
||||
free (str);
|
||||
str = 0;
|
||||
n = 0;
|
||||
}
|
||||
|
||||
if (data (fs)->JJ > 1)
|
||||
reiserfs_reopen (fs, O_RDWR);
|
||||
reiserfs_warning (stdout, "%d blocks given\n", badblocks_nr); fflush (stdout);
|
||||
find_in_journal (fs);
|
||||
|
||||
if (data (fs)->JJ > 1 && input_bitmap (fs)) {
|
||||
FILE * fp;
|
||||
|
||||
fp = fopen (input_bitmap_file_name (fs), "w+");
|
||||
if (!fp) {
|
||||
reiserfs_warning (stderr, "reiserfs_bitmap_save: could not save bitmap in %s: %m",
|
||||
input_bitmap_file_name (fs));
|
||||
return;
|
||||
}
|
||||
reiserfs_bitmap_save (fp, input_bitmap (fs));
|
||||
fclose (fp);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
+10
-97
@@ -1,6 +1,6 @@
|
||||
|
||||
/*
|
||||
* Copyright 2000-2002 by Hans Reiser, licensing governed by reiserfs/README
|
||||
* Copyright 2000-2003 by Hans Reiser, licensing governed by
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
#include "debugreiserfs.h"
|
||||
@@ -147,7 +147,7 @@ static int should_pack_indirect (__u32 * ind_item, int unfm_num)
|
||||
static void pack_indirect (struct packed_item * pi, struct buffer_head * bh,
|
||||
struct item_head * ih)
|
||||
{
|
||||
int i;
|
||||
unsigned int i;
|
||||
__u32 * ind_item;
|
||||
__u16 len;
|
||||
|
||||
@@ -305,14 +305,14 @@ static void pack_stat_data (struct packed_item * pi, struct buffer_head * bh,
|
||||
set_pi_mask (pi, get_pi_mask (pi) | NLINK_BITS_32);
|
||||
nlink32 = sd->sd_nlink;
|
||||
} else {
|
||||
/* This is required to deal w/ big endian systems */
|
||||
/* This is required to deal with big endian systems */
|
||||
nlink16 = cpu_to_le16 ((__u16)sd_v2_nlink (sd));
|
||||
}
|
||||
if (sd_v2_size (sd) > 0xffffffff) {
|
||||
set_pi_mask (pi, get_pi_mask (pi) | SIZE_BITS_64);
|
||||
size64 = sd->sd_size;
|
||||
} else {
|
||||
/* This is required to deal w/ big endian systems */
|
||||
/* This is required to deal with big endian systems */
|
||||
size32 = cpu_to_le32 ((__u32)sd_v2_size (sd));
|
||||
}
|
||||
|
||||
@@ -561,11 +561,11 @@ static void send_block (reiserfs_filsys_t * fs, struct buffer_head * bh, int sen
|
||||
/* super block, journal, bitmaps */
|
||||
static void pack_frozen_data (reiserfs_filsys_t * fs)
|
||||
{
|
||||
int i;
|
||||
struct buffer_head * bh;
|
||||
unsigned long block;
|
||||
__u16 magic16;
|
||||
int sent_journal_start_magic = 0;
|
||||
unsigned int i;
|
||||
|
||||
if (is_reiserfs_jr_magic_string(fs->fs_ondisk_sb) &&
|
||||
get_jp_journal_dev(sb_jp(fs->fs_ondisk_sb)) &&
|
||||
@@ -646,12 +646,12 @@ static void pack_frozen_data (reiserfs_filsys_t * fs)
|
||||
/* pack all "not data blocks" and correct leaf */
|
||||
void pack_partition (reiserfs_filsys_t * fs)
|
||||
{
|
||||
int i;
|
||||
struct buffer_head * bh;
|
||||
__u32 magic32;
|
||||
__u16 blocksize;
|
||||
__u16 magic16;
|
||||
unsigned long done = 0, total;
|
||||
unsigned int i;
|
||||
|
||||
|
||||
magic32 = REISERFS_SUPER_MAGIC;
|
||||
@@ -724,6 +724,9 @@ void pack_one_block (reiserfs_filsys_t * fs, unsigned long block)
|
||||
|
||||
bh = bread (fs->fs_dev, block, fs->fs_blocksize);
|
||||
|
||||
if (!bh)
|
||||
return;
|
||||
|
||||
if (who_is_this (bh->b_data, bh->b_size) == THE_LEAF)
|
||||
pack_leaf (fs, bh);
|
||||
else
|
||||
@@ -738,93 +741,3 @@ void pack_one_block (reiserfs_filsys_t * fs, unsigned long block)
|
||||
fprintf (stderr, "Done\n");
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
//
|
||||
// this test program has two modes: 'pack file blocknr'
|
||||
// and 'unpack file'
|
||||
// in the first mode blocknr-th 4k block of the 'file' will be packed out to stdout
|
||||
// the the second mode standard input will be converted to the reiserfs leaf on 'file'
|
||||
//
|
||||
static int do_unpack (char * file)
|
||||
{
|
||||
char * buf;
|
||||
int fd;
|
||||
|
||||
fd = open (file, O_RDONLY);
|
||||
if (fd == -1) {
|
||||
perror ("open failed");
|
||||
return 0;
|
||||
}
|
||||
|
||||
buf = malloc (4096);
|
||||
if (!buf) {
|
||||
perror ("malloc failed");
|
||||
return 0;
|
||||
}
|
||||
|
||||
fread (buf, 4096, 1, stdin);
|
||||
if (!feof (stdin)) {
|
||||
printf ("fread returned not eof\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
unpack_leaf (buf, fd);
|
||||
|
||||
free (buf);
|
||||
close (fd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int do_pack (char * file, unsigned long block)
|
||||
{
|
||||
int fd;
|
||||
struct buffer_head * bh;
|
||||
char * buf;
|
||||
int len;
|
||||
|
||||
fprintf (stderr, "dumping block %d of the \"%s\"\n", block, file);
|
||||
|
||||
fd = open (file, O_RDONLY);
|
||||
if (fd == -1) {
|
||||
perror ("open failed");
|
||||
return 0;
|
||||
}
|
||||
|
||||
bh = bread (fd, block, 4096);
|
||||
if (!bh) {
|
||||
fprintf (stderr, "bread failed\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (who_is_this (bh->b_data, bh->b_size) != THE_LEAF) {
|
||||
fprintf (stderr, "block %d is not a leaf\n", block);
|
||||
return 0;
|
||||
}
|
||||
|
||||
len = pack_leaf (bh, buf);
|
||||
fwrite (buf, len, 1, stdout);
|
||||
|
||||
free (buf);
|
||||
close (fd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int main (int argc, char ** argv)
|
||||
{
|
||||
if (argc == 3 && !strcmp (argv[1], "unpack"))
|
||||
return do_unpack (argv[2]);
|
||||
|
||||
if (argc == 4 && !strcmp (argv[1], "pack"))
|
||||
return do_pack (argv[2], atoi (argv[3]));
|
||||
|
||||
fprintf (stderr, "Usage: \n\t%s pack filename block\nor\n"
|
||||
"\t%s unpack filename\n", argv[0], argv[0]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* 0 */
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright 2000-2002 by Hans Reiser, licensing governed by reiserfs/README
|
||||
* Copyright 2000-2003 by Hans Reiser, licensing governed by
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
#include "debugreiserfs.h"
|
||||
@@ -264,7 +265,8 @@ static void recover_items(FILE *fp, reiserfs_filsys_t * fs, FILE *target_file) {
|
||||
int size = sizeof(struct saved_item) - sizeof(struct saved_item *);
|
||||
struct saved_item *map = NULL;
|
||||
__u32 map_size = 0;
|
||||
int i, start = 0, j;
|
||||
int start = 0;
|
||||
unsigned int i, j;
|
||||
__u64 offset = 0, length;
|
||||
long int result = 0;
|
||||
unsigned long unfm_ptr;
|
||||
@@ -285,7 +287,7 @@ static void recover_items(FILE *fp, reiserfs_filsys_t * fs, FILE *target_file) {
|
||||
if (i == map_size / sizeof(struct saved_item)) {
|
||||
if (start != -1) {
|
||||
reiserfs_print_item(stdout, bh, B_N_PITEM_HEAD (bh, (cur - 1)->si_item_num));
|
||||
result = get_answer((long int)i - start) + start;
|
||||
result = get_answer(i - start) + start;
|
||||
} else {
|
||||
result = i - 1;
|
||||
}
|
||||
|
||||
+41
-38
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright 2000-2002 by Hans Reiser, licensing governed by reiserfs/README
|
||||
* Copyright 2000-2003 by Hans Reiser, licensing governed by
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
#include "debugreiserfs.h"
|
||||
@@ -169,7 +170,7 @@ static void add_name (struct saved_name * name, struct saved_name * name_in)
|
||||
/* take each name matching to a given pattern, */
|
||||
static void scan_for_name (struct buffer_head * bh)
|
||||
{
|
||||
int i, j;
|
||||
int i, j, i_num;
|
||||
struct item_head * ih;
|
||||
struct reiserfs_de_head * deh;
|
||||
int namelen;
|
||||
@@ -181,7 +182,8 @@ static void scan_for_name (struct buffer_head * bh)
|
||||
int ih_entry_count = 0;
|
||||
|
||||
ih = B_N_PITEM_HEAD (bh, 0);
|
||||
for (i = 0; i < B_NR_ITEMS (bh); i ++, ih ++) {
|
||||
i_num = leaf_item_number_estimate(bh);
|
||||
for (i = 0; i < i_num; i ++, ih ++) {
|
||||
if (!is_direntry_ih (ih))
|
||||
continue;
|
||||
if (is_it_bad_item (fs, ih, B_I_PITEM (bh, ih), 0, 1))
|
||||
@@ -254,14 +256,15 @@ static void scan_for_name (struct buffer_head * bh)
|
||||
item in the sorted list of items of a file */
|
||||
static void scan_items (struct buffer_head * bh)
|
||||
{
|
||||
int i;
|
||||
int i, i_num;
|
||||
struct item_head * ih;
|
||||
struct saved_name * name_in_store;
|
||||
void * res;
|
||||
|
||||
|
||||
ih = B_N_PITEM_HEAD (bh, 0);
|
||||
for (i = 0; i < B_NR_ITEMS (bh); i ++, ih ++) {
|
||||
i_num = leaf_item_number_estimate(bh);
|
||||
for (i = 0; i < i_num; i ++, ih ++) {
|
||||
res = tfind (&ih->ih_key, &key_index, comp_pointed);
|
||||
if (!res)
|
||||
/* there were no names pointing to this key */
|
||||
@@ -340,7 +343,7 @@ static void do_append (struct item_head * ih, void * data)
|
||||
{
|
||||
int i;
|
||||
int padd;
|
||||
loff_t off = get_offset (&ih->ih_key);
|
||||
unsigned long long off = get_offset (&ih->ih_key);
|
||||
|
||||
if (is_indirect_ih (ih)) {
|
||||
|
||||
@@ -354,8 +357,7 @@ static void do_append (struct item_head * ih, void * data)
|
||||
map.head_len += (padd + I_UNFM_NUM (ih));
|
||||
|
||||
} else if (is_direct_ih (ih)) {
|
||||
int tail_start;
|
||||
int skip;
|
||||
unsigned int tail_start, skip;
|
||||
|
||||
// find correct tail first
|
||||
tail_start = (off & ~(fs->fs_blocksize - 1)) + 1;
|
||||
@@ -391,18 +393,18 @@ static void do_append (struct item_head * ih, void * data)
|
||||
// map contains
|
||||
static void do_overwrite (struct item_head * ih, void * data)
|
||||
{
|
||||
int skip; // now may bytes/pointers to skip
|
||||
int to_compare;
|
||||
int to_append;
|
||||
loff_t off = get_offset (&ih->ih_key);
|
||||
char * p;
|
||||
unsigned long long off, skip;
|
||||
int to_compare, to_append;
|
||||
struct item_head tmp_ih;
|
||||
char * p;
|
||||
|
||||
off = get_offset (&ih->ih_key);
|
||||
|
||||
if (is_indirect_ih (ih)) {
|
||||
|
||||
skip = (off - 1) / fs->fs_blocksize;
|
||||
to_compare = (map.head_len - skip > I_UNFM_NUM (ih)) ? I_UNFM_NUM (ih) :
|
||||
(map.head_len - skip);
|
||||
to_compare = (map.head_len - skip > I_UNFM_NUM (ih)) ?
|
||||
I_UNFM_NUM (ih) : (map.head_len - skip);
|
||||
to_append = I_UNFM_NUM (ih) - to_compare;
|
||||
|
||||
p = (char *)map.head + skip * 4;
|
||||
@@ -418,7 +420,7 @@ static void do_overwrite (struct item_head * ih, void * data)
|
||||
}
|
||||
|
||||
} else if (is_direct_ih (ih)) {
|
||||
int tail_start;
|
||||
unsigned int tail_start;
|
||||
int i;
|
||||
|
||||
// find correct tail first
|
||||
@@ -652,12 +654,16 @@ void print_map(reiserfs_filsys_t * fs) {
|
||||
|
||||
print_items(fp, fs);
|
||||
|
||||
if (fp != stdin)
|
||||
if (fp != stdin) {
|
||||
fclose (fp);
|
||||
fp = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static FILE *fp = 0;
|
||||
FILE * log_to;
|
||||
|
||||
static void save_items(const void *nodep, VISIT value, int level) {
|
||||
struct saved_item *item;
|
||||
|
||||
@@ -683,7 +689,7 @@ static void make_map(const void *nodep, VISIT value, int level) {
|
||||
if (value == leaf || value == postorder) {
|
||||
while (name) {
|
||||
asprintf(&file_name, "%s.%d", map_file(fs), ++nr);
|
||||
reiserfs_warning (stdout, "%d - (%d): [%K]:\"%s\": stored in the %s\n",
|
||||
reiserfs_warning (log_to, "%d - (%d): [%K]:\"%s\": stored in the %s\n",
|
||||
nr, name->count, &name->parent_dirid, name->name, file_name);
|
||||
|
||||
if (fp == 0) {
|
||||
@@ -697,6 +703,7 @@ static void make_map(const void *nodep, VISIT value, int level) {
|
||||
|
||||
name = name->name_next;
|
||||
fclose(fp);
|
||||
fp = NULL;
|
||||
free(file_name);
|
||||
}
|
||||
}
|
||||
@@ -800,25 +807,23 @@ static void look_for_name (reiserfs_filsys_t * fs)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
FILE * log;
|
||||
|
||||
static void scan_for_key (struct buffer_head * bh, struct key * key)
|
||||
{
|
||||
int i, j;
|
||||
int i, j, i_num;
|
||||
struct item_head * ih;
|
||||
struct reiserfs_de_head * deh;
|
||||
int min_entry_size = 1;
|
||||
int ih_entry_count = 0;
|
||||
|
||||
|
||||
ih = B_N_PITEM_HEAD (bh, 0);
|
||||
for (i = 0; i < B_NR_ITEMS (bh); i ++, ih ++) {
|
||||
if ((get_key_dirid (&ih->ih_key) == get_key_dirid (key) ||
|
||||
(int)get_key_dirid (key) == -1) &&
|
||||
(get_key_objectid (&ih->ih_key) == get_key_objectid (key) ||
|
||||
(int)get_key_objectid (key) == -1)) {
|
||||
reiserfs_warning (log, "%d-th item of block %lu is item of file %K: %H\n",
|
||||
i_num = leaf_item_number_estimate(bh);
|
||||
for (i = 0; i < i_num; i ++, ih ++) {
|
||||
if ((get_key_dirid(&ih->ih_key) == get_key_dirid(key) ||
|
||||
get_key_dirid(key) == ~0ul) &&
|
||||
(get_key_objectid(&ih->ih_key) == get_key_objectid(key) ||
|
||||
get_key_objectid(key) == ~0ul))
|
||||
{
|
||||
reiserfs_warning(log_to, "%d-th item of block %lu is item of file %K: %H\n",
|
||||
i, bh->b_blocknr, key, ih);
|
||||
}
|
||||
if (!is_direntry_ih (ih))
|
||||
@@ -835,7 +840,7 @@ static void scan_for_key (struct buffer_head * bh, struct key * key)
|
||||
for (j = 0; j < ih_entry_count; j ++, deh ++) {
|
||||
if ((get_deh_dirid (deh) == get_key_dirid (key) || (int)get_key_dirid (key) == -1) &&
|
||||
(get_deh_objectid (deh) == get_key_objectid (key) || (int)get_key_objectid (key) == -1)) {
|
||||
reiserfs_warning (log, "dir item %d (%H) of block %lu has "
|
||||
reiserfs_warning (log_to, "dir item %d (%H) of block %lu has "
|
||||
"entry (%d-th) %.*s pointing to %K\n",
|
||||
i, ih, bh->b_blocknr, j,
|
||||
name_in_entry_length (ih, deh, j), name_in_entry (deh, j), key);
|
||||
@@ -857,12 +862,6 @@ void do_scan (reiserfs_filsys_t * fs)
|
||||
struct key key = {0, 0, };
|
||||
unsigned long done, total;
|
||||
|
||||
|
||||
if (debug_mode (fs) == DO_SCAN_JOURNAL) {
|
||||
scan_journal (fs);
|
||||
return;
|
||||
}
|
||||
|
||||
if (debug_mode (fs) == DO_LOOK_FOR_NAME) {
|
||||
/* look for a file in using tree algorithms */
|
||||
look_for_name (fs);
|
||||
@@ -879,7 +878,7 @@ void do_scan (reiserfs_filsys_t * fs)
|
||||
|
||||
total = reiserfs_bitmap_ones (input_bitmap (fs));
|
||||
|
||||
log = fopen ("scan.log", "w+");
|
||||
log_to = fopen ("scan.log", "w+");
|
||||
printf ("Log file 'scan.log' is opened\n");
|
||||
|
||||
if (debug_mode (fs) == DO_SCAN_FOR_NAME) {
|
||||
@@ -928,6 +927,7 @@ void do_scan (reiserfs_filsys_t * fs)
|
||||
reiserfs_bitmap_clear_bit (input_bitmap (fs), i);
|
||||
break;
|
||||
case THE_LEAF:
|
||||
case HAS_IH_ARRAY:
|
||||
if (debug_mode (fs) == DO_SCAN_FOR_NAME) {
|
||||
scan_for_name (bh);
|
||||
} else if (get_key_dirid (&key)) {
|
||||
@@ -959,6 +959,8 @@ void do_scan (reiserfs_filsys_t * fs)
|
||||
total = reiserfs_bitmap_ones (input_bitmap (fs));
|
||||
printf ("%ld bits set in bitmap\n", total);
|
||||
for (i = 0; i < get_sb_block_count (fs->fs_ondisk_sb); i ++) {
|
||||
int type;
|
||||
|
||||
if (!reiserfs_bitmap_test_bit (input_bitmap (fs), i))
|
||||
continue;
|
||||
bh = bread (fs->fs_dev, i, fs->fs_blocksize);
|
||||
@@ -966,7 +968,8 @@ void do_scan (reiserfs_filsys_t * fs)
|
||||
printf ("could not read block %lu\n", i);
|
||||
continue;
|
||||
}
|
||||
if (who_is_this (bh->b_data, bh->b_size) != THE_LEAF) {
|
||||
type = who_is_this (bh->b_data, bh->b_size);
|
||||
if (type != THE_LEAF && type != HAS_IH_ARRAY) {
|
||||
brelse (bh);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright 2002 by Hans Reiser, licensing governed by reiserfs/README
|
||||
* Copyright 2002-2003 by Hans Reiser, licensing governed by
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
#include "debugreiserfs.h"
|
||||
@@ -114,14 +115,15 @@ static int is_unique_item (struct obstack * ostack, void ** tree, void * ih)
|
||||
|
||||
static void stat1_the_leaf (reiserfs_filsys_t * fs, struct buffer_head * bh)
|
||||
{
|
||||
int i;
|
||||
int i, i_num;
|
||||
struct item_head * ih;
|
||||
int is_there_unique_item;
|
||||
|
||||
|
||||
ih = B_N_PITEM_HEAD (bh, 0);
|
||||
is_there_unique_item = 0;
|
||||
for (i = 0; i < get_blkh_nr_items (B_BLK_HEAD (bh)); i ++, ih ++) {
|
||||
i_num = leaf_item_number_estimate(bh);
|
||||
for (i = 0; i < i_num; i ++, ih ++) {
|
||||
/* count all items */
|
||||
fs_stat.all ++;
|
||||
|
||||
@@ -140,7 +142,7 @@ static void stat1_the_leaf (reiserfs_filsys_t * fs, struct buffer_head * bh)
|
||||
} else {
|
||||
ih = B_N_PITEM_HEAD (bh, 0);
|
||||
/* node contains at least one unique item. We will put it in, count items of each type */
|
||||
for (i = 0; i < get_blkh_nr_items (B_BLK_HEAD (bh)); i ++, ih ++) {
|
||||
for (i = 0; i < i_num; i ++, ih ++) {
|
||||
fs_stat.items [get_type (&ih->ih_key)] ++;
|
||||
}
|
||||
}
|
||||
@@ -178,10 +180,6 @@ void do_stat (reiserfs_filsys_t * fs)
|
||||
return;
|
||||
*/
|
||||
|
||||
|
||||
|
||||
total = reiserfs_bitmap_ones (input_bitmap (fs));
|
||||
|
||||
/* pass 0 of stating */
|
||||
total = reiserfs_bitmap_ones (input_bitmap (fs));
|
||||
done = 0;
|
||||
@@ -197,7 +195,7 @@ void do_stat (reiserfs_filsys_t * fs)
|
||||
continue;
|
||||
}
|
||||
type = who_is_this (bh->b_data, bh->b_size);
|
||||
if (type != THE_LEAF) {
|
||||
if (type != THE_LEAF && type != HAS_IH_ARRAY) {
|
||||
reiserfs_bitmap_clear_bit (input_bitmap (fs), i);
|
||||
brelse (bh);
|
||||
continue;
|
||||
|
||||
+14
-8
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright 2000-2002 by Hans Reiser, licensing governed by reiserfs/README
|
||||
* Copyright 2000-2003 by Hans Reiser, licensing governed by
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
#include "debugreiserfs.h"
|
||||
@@ -88,8 +89,8 @@ static void unpack_direntry (struct packed_item * pi, struct buffer_head * bh,
|
||||
int location;
|
||||
char * item;
|
||||
|
||||
if (!hash_func)
|
||||
die ("unpack_direntry: hash function is not set");
|
||||
/* if (!hash_func)
|
||||
die ("unpack_direntry: hash function is not set");*/
|
||||
|
||||
if (!(get_pi_mask(pi) & IH_FREE_SPACE))
|
||||
die ("ih_entry_count must be packed for directory items");
|
||||
@@ -126,7 +127,7 @@ static void unpack_direntry (struct packed_item * pi, struct buffer_head * bh,
|
||||
else if (*(item + location) == '.' && *(item + location + 1) == '.' && namelen == 2)
|
||||
/* old or new ".." */
|
||||
set_deh_offset (deh, DOT_DOT_OFFSET);
|
||||
else
|
||||
else if (hash_func)
|
||||
set_deh_offset (deh, GET_HASH_VALUE (hash_func (item + location,
|
||||
namelen)));
|
||||
if (mask & HAS_GEN_COUNTER) {
|
||||
@@ -488,7 +489,7 @@ static void unpack_unformatted_bitmap (int dev, int blocksize)
|
||||
// read packed reiserfs partition metadata from stdin
|
||||
void unpack_partition (int fd, int jfd)
|
||||
{
|
||||
__u32 magic32;
|
||||
__u32 magic32, position;
|
||||
__u16 magic16;
|
||||
__u16 blocksize;
|
||||
int dev = fd;
|
||||
@@ -562,13 +563,18 @@ void unpack_partition (int fd, int jfd)
|
||||
break;
|
||||
|
||||
case END_MAGIC:
|
||||
break;
|
||||
goto out;
|
||||
|
||||
default:
|
||||
die ("unpack_partition: bad magic found - %x", magic16 & 0xff);
|
||||
position = ftell(stdin);
|
||||
if (position == ~0ul)
|
||||
die ("unpack_partition: bad magic found - %x", magic16 & 0xff);
|
||||
else
|
||||
die ("unpack_partition: bad magic found - %x, position %lu",
|
||||
magic16 & 0xff, ftell(stdin));
|
||||
}
|
||||
}
|
||||
|
||||
out:
|
||||
fprintf (stderr, "Unpacked %d leaves, %d full blocks\n", leaves, full);
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user