Imported reiserfsprogs-3.6.18
This commit is contained in:
1 parent
18057cdad6
commit
3078c83c48
64 files changed
+6508
-1071
No files matched your search
@@ -79,9 +79,9 @@ for much of the previous version 3 work, and is paying for Chris and Jeff to do
|
||||
V3 maintenance. Reiserfs integration in their distro is consistently solid, and
|
||||
they were key to our becoming widely used.
|
||||
|
||||
Lycos (www.lycos.com) has a support contract with us that consistently comes in
|
||||
just when we would otherwise miss payroll, and that they keep doubling every
|
||||
year. Much thanks to them.
|
||||
Lycos Europe (www.lycos-europe.com) had a support contract with us that
|
||||
consistently came in just when we would otherwise have missed payroll, and that
|
||||
they kept doubling every year. Much thanks to them.
|
||||
|
||||
Many persons came to www.namesys.com/support.html, and got a question answered
|
||||
for $25, or just gave us a small donation there.
|
||||
|
||||
@@ -1,3 +1,46 @@
|
||||
2004-08-03
|
||||
3.6.18 release.
|
||||
2004-06-18
|
||||
Make the oid map code endian safe.
|
||||
2004-05-27
|
||||
Syncing host & journal devices after replaing every transaction.
|
||||
2004-05-26
|
||||
Do not left uninitialized fields in item headers before insertion.
|
||||
2004-05-25
|
||||
Fixes in unaligned access to unformatted block pointers.
|
||||
2004-05-24
|
||||
Make reiserfsck to handle suse's block allocator changes correctly.
|
||||
2004-05-04
|
||||
3.6.17 release.
|
||||
2004-04-30
|
||||
a few minor bugs were fixed:
|
||||
- mark changed leaves as dirty;
|
||||
- overflow at the huge hole insertion.
|
||||
2004-04-05
|
||||
man pages were rewritten.
|
||||
2004-03-22
|
||||
move 'unpack' program to 'debugreiserfs -u'.
|
||||
2004-03-18
|
||||
3.6.14 & 3.6.15-pre1 releases.
|
||||
2004-03-16
|
||||
reiserfsprogs
|
||||
a few bugs were fixed:
|
||||
in the journal replay code;
|
||||
in the balancing code when removing items from broken leaves;
|
||||
in the mount entry detection code with mtab handling.
|
||||
2004-03-04
|
||||
reiserfsprogs
|
||||
a fix for the cross compiling when generating include/credits.h
|
||||
2004-02-27
|
||||
reiserfsprogs
|
||||
a bug in the spec file was fixed.
|
||||
2004-02-26
|
||||
reiserfsck
|
||||
a bug with setting the file size limit was fixed.
|
||||
2004-02-17
|
||||
reiserfsprogs
|
||||
make bynaries to be 'position independent' when dynamically
|
||||
linked to libc.
|
||||
2004-02-17
|
||||
3.6.13 release.
|
||||
2004-02-13
|
||||
|
||||
+37
-17
@@ -1,7 +1,7 @@
|
||||
# Makefile.in generated by automake 1.7.2 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.7.6 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
|
||||
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
|
||||
# Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
@@ -35,6 +35,7 @@ POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
host_triplet = @host@
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMDEP_FALSE = @AMDEP_FALSE@
|
||||
AMDEP_TRUE = @AMDEP_TRUE@
|
||||
@@ -63,7 +64,11 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAINT = @MAINT@
|
||||
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
|
||||
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
@@ -85,12 +90,21 @@ ac_ct_STRIP = @ac_ct_STRIP@
|
||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
datadir = @datadir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
@@ -125,8 +139,8 @@ RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \
|
||||
installdirs-recursive install-recursive uninstall-recursive \
|
||||
check-recursive installcheck-recursive
|
||||
DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL Makefile.am \
|
||||
Makefile.in NEWS aclocal.m4 configure configure.in depcomp \
|
||||
install-sh missing mkinstalldirs
|
||||
Makefile.in NEWS aclocal.m4 config.guess config.sub configure \
|
||||
configure.in depcomp install-sh missing mkinstalldirs
|
||||
DIST_SUBDIRS = $(SUBDIRS)
|
||||
all: all-recursive
|
||||
|
||||
@@ -134,18 +148,18 @@ all: all-recursive
|
||||
|
||||
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
|
||||
configure.lineno
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)
|
||||
|
||||
$(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
$(SHELL) ./config.status --recheck
|
||||
$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
|
||||
$(srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
|
||||
cd $(srcdir) && $(AUTOCONF)
|
||||
|
||||
$(ACLOCAL_M4): configure.in
|
||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in
|
||||
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
|
||||
uninstall-info-am:
|
||||
|
||||
@@ -229,9 +243,15 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
if (etags --etags-include --version) >/dev/null 2>&1; then \
|
||||
include_option=--etags-include; \
|
||||
else \
|
||||
include_option=--include; \
|
||||
fi; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
|
||||
test -f $$subdir/TAGS && \
|
||||
tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
|
||||
fi; \
|
||||
done; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
@@ -345,12 +365,12 @@ distcheck: dist
|
||||
$(am__remove_distdir)
|
||||
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf -
|
||||
chmod -R a-w $(distdir); chmod a+w $(distdir)
|
||||
mkdir $(distdir)/=build
|
||||
mkdir $(distdir)/=inst
|
||||
mkdir $(distdir)/_build
|
||||
mkdir $(distdir)/_inst
|
||||
chmod a-w $(distdir)
|
||||
dc_install_base=`$(am__cd) $(distdir)/=inst && pwd` \
|
||||
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
|
||||
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
|
||||
&& cd $(distdir)/=build \
|
||||
&& cd $(distdir)/_build \
|
||||
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
|
||||
$(DISTCHECK_CONFIGURE_FLAGS) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) \
|
||||
@@ -377,7 +397,7 @@ distcheck: dist
|
||||
@echo "$(distdir).tar.gz is ready for distribution" | \
|
||||
sed 'h;s/./=/g;p;x;p;x'
|
||||
distuninstallcheck:
|
||||
cd $(distuninstallcheck_dir) \
|
||||
@cd $(distuninstallcheck_dir) \
|
||||
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
|
||||
|| { echo "ERROR: files left after uninstall:" ; \
|
||||
if test -n "$(DESTDIR)"; then \
|
||||
@@ -386,11 +406,11 @@ distuninstallcheck:
|
||||
$(distuninstallcheck_listfiles) ; \
|
||||
exit 1; } >&2
|
||||
distcleancheck: distclean
|
||||
if test '$(srcdir)' = . ; then \
|
||||
@if test '$(srcdir)' = . ; then \
|
||||
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
|
||||
exit 1 ; \
|
||||
fi
|
||||
test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|
||||
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|
||||
|| { echo "ERROR: files left in build directory after distclean:" ; \
|
||||
$(distcleancheck_listfiles) ; \
|
||||
exit 1; } >&2
|
||||
@@ -452,7 +472,7 @@ installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-recursive
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
-rm -rf autom4te.cache
|
||||
-rm -rf $(top_srcdir)/autom4te.cache
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-recursive
|
||||
|
||||
Vendored
+129
-40
@@ -1,4 +1,4 @@
|
||||
# generated automatically by aclocal 1.7.2 -*- Autoconf -*-
|
||||
# generated automatically by aclocal 1.7.6 -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
|
||||
# Free Software Foundation, Inc.
|
||||
@@ -16,7 +16,7 @@
|
||||
# This macro actually does too much some checks are only needed if
|
||||
# your package does certain things. But this isn't really a big deal.
|
||||
|
||||
# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
|
||||
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
|
||||
# Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
@@ -34,14 +34,7 @@
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
# 02111-1307, USA.
|
||||
|
||||
# serial 8
|
||||
|
||||
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
|
||||
# written in clear, in which case automake, when reading aclocal.m4,
|
||||
# will think it sees a *use*, and therefore will trigger all it's
|
||||
# C support machinery. Also note that it means that autoscan, seeing
|
||||
# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
|
||||
|
||||
# serial 10
|
||||
|
||||
AC_PREREQ([2.54])
|
||||
|
||||
@@ -86,8 +79,8 @@ m4_ifval([$2],
|
||||
AC_SUBST([PACKAGE], [$1])dnl
|
||||
AC_SUBST([VERSION], [$2])],
|
||||
[_AM_SET_OPTIONS([$1])dnl
|
||||
AC_SUBST([PACKAGE], [AC_PACKAGE_TARNAME])dnl
|
||||
AC_SUBST([VERSION], [AC_PACKAGE_VERSION])])dnl
|
||||
AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
|
||||
AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
|
||||
|
||||
_AM_IF_OPTION([no-define],,
|
||||
[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
|
||||
@@ -108,6 +101,7 @@ AM_PROG_INSTALL_STRIP
|
||||
# some platforms.
|
||||
AC_REQUIRE([AC_PROG_AWK])dnl
|
||||
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
|
||||
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
|
||||
|
||||
_AM_IF_OPTION([no-dependencies],,
|
||||
[AC_PROVIDE_IFELSE([AC_PROG_CC],
|
||||
@@ -130,7 +124,16 @@ AC_PROVIDE_IFELSE([AC_PROG_CXX],
|
||||
# loop where config.status creates the headers, so we can generate
|
||||
# our stamp files there.
|
||||
AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
|
||||
[_am_stamp_count=`expr ${_am_stamp_count-0} + 1`
|
||||
[# Compute $1's index in $config_headers.
|
||||
_am_stamp_count=1
|
||||
for _am_header in $config_headers :; do
|
||||
case $_am_header in
|
||||
$1 | $1:* )
|
||||
break ;;
|
||||
* )
|
||||
_am_stamp_count=`expr $_am_stamp_count + 1` ;;
|
||||
esac
|
||||
done
|
||||
echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
|
||||
|
||||
# Copyright 2002 Free Software Foundation, Inc.
|
||||
@@ -160,7 +163,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"])
|
||||
# Call AM_AUTOMAKE_VERSION so it can be traced.
|
||||
# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
|
||||
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
|
||||
[AM_AUTOMAKE_VERSION([1.7.2])])
|
||||
[AM_AUTOMAKE_VERSION([1.7.6])])
|
||||
|
||||
# Helper functions for option handling. -*- Autoconf -*-
|
||||
|
||||
@@ -446,9 +449,42 @@ fi
|
||||
INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
|
||||
AC_SUBST([INSTALL_STRIP_PROGRAM])])
|
||||
|
||||
# serial 4 -*- Autoconf -*-
|
||||
# -*- Autoconf -*-
|
||||
# Copyright (C) 2003 Free Software Foundation, Inc.
|
||||
|
||||
# Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
# 02111-1307, USA.
|
||||
|
||||
# serial 1
|
||||
|
||||
# Check whether the underlying file-system supports filenames
|
||||
# with a leading dot. For instance MS-DOS doesn't.
|
||||
AC_DEFUN([AM_SET_LEADING_DOT],
|
||||
[rm -rf .tst 2>/dev/null
|
||||
mkdir .tst 2>/dev/null
|
||||
if test -d .tst; then
|
||||
am__leading_dot=.
|
||||
else
|
||||
am__leading_dot=_
|
||||
fi
|
||||
rmdir .tst 2>/dev/null
|
||||
AC_SUBST([am__leading_dot])])
|
||||
|
||||
# serial 5 -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -509,18 +545,32 @@ AC_CACHE_CHECK([dependency style of $depcc],
|
||||
# using a relative directory.
|
||||
cp "$am_depcomp" conftest.dir
|
||||
cd conftest.dir
|
||||
# We will build objects and dependencies in a subdirectory because
|
||||
# it helps to detect inapplicable dependency modes. For instance
|
||||
# both Tru64's cc and ICC support -MD to output dependencies as a
|
||||
# side effect of compilation, but ICC will put the dependencies in
|
||||
# the current directory while Tru64 will put them in the object
|
||||
# directory.
|
||||
mkdir sub
|
||||
|
||||
am_cv_$1_dependencies_compiler_type=none
|
||||
if test "$am_compiler_list" = ""; then
|
||||
am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
|
||||
fi
|
||||
for depmode in $am_compiler_list; do
|
||||
# Setup a source with many dependencies, because some compilers
|
||||
# like to wrap large dependency lists on column 80 (with \), and
|
||||
# we should not choose a depcomp mode which is confused by this.
|
||||
#
|
||||
# We need to recreate these files for each test, as the compiler may
|
||||
# overwrite some of them when testing with obscure command lines.
|
||||
# This happens at least with the AIX C compiler.
|
||||
echo '#include "conftest.h"' > conftest.c
|
||||
echo 'int i;' > conftest.h
|
||||
echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf
|
||||
: > sub/conftest.c
|
||||
for i in 1 2 3 4 5 6; do
|
||||
echo '#include "conftst'$i'.h"' >> sub/conftest.c
|
||||
: > sub/conftst$i.h
|
||||
done
|
||||
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
|
||||
|
||||
case $depmode in
|
||||
nosideeffect)
|
||||
@@ -538,13 +588,20 @@ AC_CACHE_CHECK([dependency style of $depcc],
|
||||
# mode. It turns out that the SunPro C++ compiler does not properly
|
||||
# handle `-M -o', and we need to detect this.
|
||||
if depmode=$depmode \
|
||||
source=conftest.c object=conftest.o \
|
||||
depfile=conftest.Po tmpdepfile=conftest.TPo \
|
||||
$SHELL ./depcomp $depcc -c -o conftest.o conftest.c >/dev/null 2>&1 &&
|
||||
grep conftest.h conftest.Po > /dev/null 2>&1 &&
|
||||
source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
|
||||
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
|
||||
$SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
|
||||
>/dev/null 2>conftest.err &&
|
||||
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
|
||||
grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
|
||||
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
|
||||
am_cv_$1_dependencies_compiler_type=$depmode
|
||||
break
|
||||
# icc doesn't choke on unknown options, it will just issue warnings
|
||||
# (even with -Werror). So we grep stderr for any message
|
||||
# that says an option was ignored.
|
||||
if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else
|
||||
am_cv_$1_dependencies_compiler_type=$depmode
|
||||
break
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
@@ -566,16 +623,8 @@ AM_CONDITIONAL([am__fastdep$1], [
|
||||
# Choose a directory name for dependency files.
|
||||
# This macro is AC_REQUIREd in _AM_DEPENDENCIES
|
||||
AC_DEFUN([AM_SET_DEPDIR],
|
||||
[rm -f .deps 2>/dev/null
|
||||
mkdir .deps 2>/dev/null
|
||||
if test -d .deps; then
|
||||
DEPDIR=.deps
|
||||
else
|
||||
# MS-DOS does not allow filenames that begin with a dot.
|
||||
DEPDIR=_deps
|
||||
fi
|
||||
rmdir .deps 2>/dev/null
|
||||
AC_SUBST([DEPDIR])
|
||||
[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
|
||||
AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
|
||||
])
|
||||
|
||||
|
||||
@@ -679,7 +728,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
|
||||
|
||||
# Check to see how 'make' treats includes. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 2001, 2002 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -704,8 +753,9 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
|
||||
AC_DEFUN([AM_MAKE_INCLUDE],
|
||||
[am_make=${MAKE-make}
|
||||
cat > confinc << 'END'
|
||||
doit:
|
||||
am__doit:
|
||||
@echo done
|
||||
.PHONY: am__doit
|
||||
END
|
||||
# If we don't find an include directive, just comment out the code.
|
||||
AC_MSG_CHECKING([for style of include used by $am_make])
|
||||
@@ -733,9 +783,9 @@ if test "$am__include" = "#"; then
|
||||
_am_result=BSD
|
||||
fi
|
||||
fi
|
||||
AC_SUBST(am__include)
|
||||
AC_SUBST(am__quote)
|
||||
AC_MSG_RESULT($_am_result)
|
||||
AC_SUBST([am__include])
|
||||
AC_SUBST([am__quote])
|
||||
AC_MSG_RESULT([$_am_result])
|
||||
rm -f confinc confmf
|
||||
])
|
||||
|
||||
@@ -783,6 +833,45 @@ AC_CONFIG_COMMANDS_PRE(
|
||||
Usually this means the macro was only invoked conditionally.])
|
||||
fi])])
|
||||
|
||||
# Add --enable-maintainer-mode option to configure.
|
||||
# From Jim Meyering
|
||||
|
||||
# Copyright 1996, 1998, 2000, 2001, 2002 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
# 02111-1307, USA.
|
||||
|
||||
# serial 2
|
||||
|
||||
AC_DEFUN([AM_MAINTAINER_MODE],
|
||||
[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
|
||||
dnl maintainer-mode is disabled by default
|
||||
AC_ARG_ENABLE(maintainer-mode,
|
||||
[ --enable-maintainer-mode enable make rules and dependencies not useful
|
||||
(and sometimes confusing) to the casual installer],
|
||||
USE_MAINTAINER_MODE=$enableval,
|
||||
USE_MAINTAINER_MODE=no)
|
||||
AC_MSG_RESULT([$USE_MAINTAINER_MODE])
|
||||
AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
|
||||
MAINT=$MAINTAINER_MODE_TRUE
|
||||
AC_SUBST(MAINT)dnl
|
||||
]
|
||||
)
|
||||
|
||||
AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
|
||||
|
||||
# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*-
|
||||
|
||||
# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
|
||||
|
||||
+1417
File diff suppressed because it is too large.
Load diff
+1501
File diff suppressed because it is too large.
Load diff
+121
-69
@@ -1,9 +1,13 @@
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
AC_INIT(version.h)
|
||||
AC_CANONICAL_HOST
|
||||
AC_PREREQ(2.50)
|
||||
|
||||
AH_TEMPLATE([HAVE_LIBUUID], [Define for enable libuuid using.])
|
||||
AH_TEMPLATE([ENABLE_DEBUG], [Define for enable debug info.])
|
||||
|
||||
AM_INIT_AUTOMAKE(reiserfsprogs, 3.6.13)
|
||||
AM_INIT_AUTOMAKE(reiserfsprogs, 3.6.18)
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
dnl We install in /sbin, the utils are to be available on boot
|
||||
dnl AC_PREFIX(/)
|
||||
@@ -13,16 +17,14 @@ AM_CONFIG_HEADER(include/config.h)
|
||||
AC_SUBST(sbindir)
|
||||
|
||||
PRESET_CFLAGS=$CFLAGS
|
||||
AC_PROG_CC
|
||||
if test "x" = "x$PRESET_CFLAGS"; then
|
||||
CFLAGS="${RPM_OPT_FLAGS} $CFLAGS -Wall"
|
||||
fi
|
||||
|
||||
dnl Checks for programs.
|
||||
AC_PROG_CC
|
||||
AC_PROG_AWK
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_LN_S
|
||||
AC_PROG_MAKE_SET
|
||||
AC_PROG_RANLIB
|
||||
dnl AC_PROG_AWK
|
||||
dnl AC_PROG_INSTALL
|
||||
dnl AC_PROG_LN_S
|
||||
|
||||
dnl Checks for libraries.
|
||||
|
||||
@@ -34,6 +36,7 @@ AC_SUBST(UUID_LIBS)
|
||||
dnl Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS(fcntl.h limits.h malloc.h sys/ioctl.h unistd.h uuid/uuid.h)
|
||||
AC_HEADER_MAJOR
|
||||
|
||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_C_CONST
|
||||
@@ -41,12 +44,69 @@ AC_C_INLINE
|
||||
AC_TYPE_SIZE_T
|
||||
AC_STRUCT_ST_RDEV
|
||||
|
||||
AC_ARG_ENABLE(debug, [ --enable-debug enable extra checks],
|
||||
enable_debug=yes,
|
||||
enable_debug=no
|
||||
)
|
||||
|
||||
dnl Check for the compiler pic option.
|
||||
AC_CACHE_CHECK([whether -fPIC works], [pic], [
|
||||
saved_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="-fPIC -DPIC"
|
||||
AC_TRY_COMPILE(, , [pic=yes], [pic=no])
|
||||
CPPFLAGS="$saved_CPPFLAGS"
|
||||
])
|
||||
|
||||
# Checking for compiler warning options
|
||||
AC_CACHE_CHECK([whether -Wuninitialized works], [uninitialized], [
|
||||
saved_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="-O1 -Wuninitialized"
|
||||
AC_TRY_COMPILE(, , [uninitialized=yes], [uninitialized=no])
|
||||
CPPFLAGS="$saved_CPPFLAGS"
|
||||
])
|
||||
|
||||
AC_CACHE_CHECK([whether -Wno-unused-parameter works], [no_unused_parameter], [
|
||||
saved_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="-Wno-unused-parameter"
|
||||
AC_TRY_COMPILE(, , [no_unused_parameter=yes], [no_unused_parameter=no])
|
||||
CPPFLAGS="$saved_CPPFLAGS"
|
||||
])
|
||||
|
||||
AC_CACHE_CHECK([whether -Wredundant-decls works], [redundant_decls], [
|
||||
saved_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="-Wredundant-decls"
|
||||
AC_TRY_COMPILE(, , [redundant_decls=yes], [redundant_decls=no])
|
||||
CPPFLAGS="$saved_CPPFLAGS"
|
||||
])
|
||||
|
||||
# Check for large file
|
||||
AC_SYS_LARGEFILE
|
||||
|
||||
if test -z "${ac_cv_sys_file_offset_bits}"; then
|
||||
AC_MSG_WARN(Can't detect right _FILE_OFFSET_BITS. Will be forced to 64bit.)
|
||||
ac_cv_sys_file_offset_bits=64
|
||||
fi
|
||||
|
||||
AC_CHECK_SIZEOF(off_t, 64, [
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
])
|
||||
|
||||
AC_CHECK_SIZEOF(blkcnt_t, 64, [
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
])
|
||||
|
||||
dnl Checks for library functions.
|
||||
AC_PROG_GCC_TRADITIONAL
|
||||
AC_FUNC_MEMCMP
|
||||
AC_FUNC_STRFTIME
|
||||
AC_FUNC_VPRINTF
|
||||
AC_CHECK_FUNCS(strerror strstr strtol)
|
||||
AC_CHECK_FUNCS(strerror strstr strtol register_printf_function statfs getmntent\
|
||||
hasmntopt memset time uname)
|
||||
|
||||
|
||||
dnl Never enable this. It is for debugging only
|
||||
AC_ARG_ENABLE(io-failure-emulation,
|
||||
@@ -57,78 +117,70 @@ AC_ARG_ENABLE(io-failure-emulation,
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN(AC_PREPARE_CREDITS,
|
||||
[
|
||||
credits="./CREDITS"
|
||||
AC_MSG_CHECKING(for $credits)
|
||||
if test -r $credits ; then
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_MSG_ERROR(Missing file $credits)
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(for CREDITS)
|
||||
$AWK ['
|
||||
BEGIN {in_header = 1; start = 2; count = 0}
|
||||
|
||||
AC_TRY_RUN([
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
|
||||
int main (void) {
|
||||
FILE *fin, *fout;
|
||||
char *line = NULL;
|
||||
unsigned int len = 0;
|
||||
int start, count;
|
||||
|
||||
if ((fin = fopen("CREDITS", "r")) == NULL) {
|
||||
fprintf(stderr, "Error occured while openning the file 'CREDITS': "
|
||||
"%s.\n", strerror(errno));
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ((fout = fopen("include/credits.h", "w")) == NULL) {
|
||||
fprintf(stderr, "Error occured while openning the file 'credits.h': "
|
||||
"%s.\n", strerror(errno));
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Replicate the header. */
|
||||
while (getline(&line, &len, fin) != -1) {
|
||||
fprintf(fout, line);
|
||||
|
||||
if (!strcmp(line, "\n"))
|
||||
break;
|
||||
}
|
||||
|
||||
fprintf(fout, "char *credits[] = {\n");
|
||||
|
||||
start = 2; count = 0;
|
||||
|
||||
while (getline(&line, &len, fin) != -1) {
|
||||
if (!strcmp(line, "\n") || strlen(line) < 1) {
|
||||
{
|
||||
if (in_header) {
|
||||
print $0
|
||||
if ($0 == "") {
|
||||
in_header = 0;
|
||||
printf "char *credits[] = {\n"
|
||||
}
|
||||
} else {
|
||||
if (($0 == "") || (length($0) < 1)) {
|
||||
start = 1;
|
||||
count++;
|
||||
} else {
|
||||
if (!start)
|
||||
fprintf(fout, "\\t\\\\\\n");
|
||||
printf "\t\\\n"
|
||||
else if (start == 1)
|
||||
fprintf(fout, ",\n\n");
|
||||
|
||||
line[strlen(line) - 1] = 0;
|
||||
fprintf(fout, "\t\"%s\\\n\"", line);
|
||||
printf ",\n\n"
|
||||
printf "\t\"" $0 "\\n\""
|
||||
start = 0;
|
||||
}
|
||||
}
|
||||
|
||||
fprintf(fout, "\n};\n");
|
||||
fprintf(fout, "#define CREDITS_COUNT %d\n", count);
|
||||
|
||||
free(line);
|
||||
fclose(fin);
|
||||
fclose(fout);
|
||||
|
||||
return 0;
|
||||
}
|
||||
], AC_MSG_RESULT(yes), AC_MSG_RESULT(no) ; exit,
|
||||
[echo $ac_n "cross compiling; assumed OK... $ac_c"]
|
||||
)])
|
||||
END { print "\n};\n#define CREDITS_COUNT " count }
|
||||
'] $credits > include/credits.h
|
||||
|
||||
AC_PREPARE_CREDITS()
|
||||
if test x$enable_debug = xyes; then
|
||||
if test "x" = "x$PRESET_CFLAGS"; then
|
||||
CFLAGS="-g -Wall"
|
||||
fi
|
||||
|
||||
if test x$no_unused_parameter = xyes; then
|
||||
CFLAGS="$CFLAGS -Wno-unused-parameter"
|
||||
else
|
||||
CFLAGS="$CFLAGS -Wno-unused"
|
||||
fi
|
||||
|
||||
if test x$redundant_decls = xyes; then
|
||||
CFLAGS="$CFLAGS -Wredundant-decls"
|
||||
fi
|
||||
|
||||
if test x$uninitialized = xyes; then
|
||||
CFLAGS="$CFLAGS -Wuninitialized -O1"
|
||||
else
|
||||
CFLAGS="$CFLAGS -O2"
|
||||
fi
|
||||
else
|
||||
if test "x" = "x$PRESET_CFLAGS"; then
|
||||
CFLAGS="-g -Wall -O2"
|
||||
fi
|
||||
fi
|
||||
|
||||
if test x$pic = xyes; then
|
||||
CFLAGS="$CFLAGS -fPIC -DPIC"
|
||||
fi
|
||||
|
||||
AC_OUTPUT(
|
||||
include/Makefile
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
sbin_PROGRAMS = debugreiserfs unpack
|
||||
sbin_PROGRAMS = debugreiserfs
|
||||
|
||||
debugreiserfs_SOURCES = debugreiserfs.c pack.c stat.c corruption.c scan.c recover.c
|
||||
unpack_SOURCES = unpack.c pack.c debugreiserfs.h
|
||||
debugreiserfs_SOURCES = debugreiserfs.c pack.c unpack.c stat.c corruption.c scan.c recover.c debugreiserfs.h
|
||||
man_MANS = debugreiserfs.8
|
||||
EXTRA_DIST = $(man_MANS)
|
||||
|
||||
|
||||
+28
-24
@@ -1,7 +1,7 @@
|
||||
# Makefile.in generated by automake 1.7.2 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.7.6 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
|
||||
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
|
||||
# Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
@@ -35,6 +35,7 @@ POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
host_triplet = @host@
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMDEP_FALSE = @AMDEP_FALSE@
|
||||
AMDEP_TRUE = @AMDEP_TRUE@
|
||||
@@ -63,7 +64,11 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAINT = @MAINT@
|
||||
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
|
||||
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
@@ -85,12 +90,21 @@ ac_ct_STRIP = @ac_ct_STRIP@
|
||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
datadir = @datadir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
@@ -105,35 +119,29 @@ sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
sbin_PROGRAMS = debugreiserfs unpack
|
||||
sbin_PROGRAMS = debugreiserfs
|
||||
|
||||
debugreiserfs_SOURCES = debugreiserfs.c pack.c stat.c corruption.c scan.c recover.c
|
||||
unpack_SOURCES = unpack.c pack.c debugreiserfs.h
|
||||
debugreiserfs_SOURCES = debugreiserfs.c pack.c unpack.c stat.c corruption.c scan.c recover.c debugreiserfs.h
|
||||
man_MANS = debugreiserfs.8
|
||||
EXTRA_DIST = $(man_MANS)
|
||||
|
||||
LDADD = $(top_srcdir)/lib/libmisc.a $(top_srcdir)/reiserfscore/libcore.a
|
||||
subdir = debugreiserfs
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = $(top_builddir)/include/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
sbin_PROGRAMS = debugreiserfs$(EXEEXT) unpack$(EXEEXT)
|
||||
sbin_PROGRAMS = debugreiserfs$(EXEEXT)
|
||||
PROGRAMS = $(sbin_PROGRAMS)
|
||||
|
||||
am_debugreiserfs_OBJECTS = debugreiserfs.$(OBJEXT) pack.$(OBJEXT) \
|
||||
stat.$(OBJEXT) corruption.$(OBJEXT) scan.$(OBJEXT) \
|
||||
recover.$(OBJEXT)
|
||||
unpack.$(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 =
|
||||
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 =
|
||||
|
||||
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include
|
||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||
@@ -146,21 +154,21 @@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
CCLD = $(CC)
|
||||
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
DIST_SOURCES = $(debugreiserfs_SOURCES) $(unpack_SOURCES)
|
||||
DIST_SOURCES = $(debugreiserfs_SOURCES)
|
||||
|
||||
NROFF = nroff
|
||||
MANS = $(man_MANS)
|
||||
DIST_COMMON = Makefile.am Makefile.in
|
||||
SOURCES = $(debugreiserfs_SOURCES) $(unpack_SOURCES)
|
||||
SOURCES = $(debugreiserfs_SOURCES)
|
||||
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .o .obj
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu debugreiserfs/Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
Makefile: @MAINTAINER_MODE_TRUE@ $(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)
|
||||
@@ -189,9 +197,6 @@ clean-sbinPROGRAMS:
|
||||
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 *.$(OBJEXT) core *.core
|
||||
@@ -213,7 +218,7 @@ distclean-depend:
|
||||
.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@ then mv -f "$(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@
|
||||
@@ -224,7 +229,7 @@ distclean-depend:
|
||||
.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@ then mv -f "$(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@
|
||||
@@ -371,7 +376,6 @@ all-am: Makefile $(PROGRAMS) $(MANS)
|
||||
|
||||
installdirs:
|
||||
$(mkinstalldirs) $(DESTDIR)$(sbindir) $(DESTDIR)$(man8dir)
|
||||
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
*/
|
||||
|
||||
#include "debugreiserfs.h"
|
||||
#include <time.h>
|
||||
|
||||
extern struct reiserfs_fsstat g_stat_info;
|
||||
|
||||
@@ -488,7 +489,8 @@ void do_one_corruption_in_one_block (reiserfs_filsys_t * fs,
|
||||
"not so many unfm ptrs in it\n");
|
||||
return;
|
||||
}
|
||||
* ((__u32 *)B_I_PITEM (bh, ih) + pos_in_item) = get_sb_block_count (fs->fs_ondisk_sb) + 100;
|
||||
d32_put((__u32 *)B_I_PITEM (bh, ih), pos_in_item,
|
||||
get_sb_block_count (fs->fs_ondisk_sb) + 100);
|
||||
break;
|
||||
|
||||
case 'D': /* delete item */
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
.\" -*- nroff -*-
|
||||
.\" Copyright 1996-2004 Hans Reiser.
|
||||
.\"
|
||||
.TH DEBUGREISERFS 8 "February 2004" "Reiserfsprogs 3.6.13"
|
||||
.TH DEBUGREISERFS 8 "February 2004" "Reiserfsprogs 3.6.18"
|
||||
.SH NAME
|
||||
debugreiserfs \- debugging tool for the ReiserFS filesystem
|
||||
debugreiserfs \- The debugging tool for the ReiserFS filesystem.
|
||||
.SH SYNOPSIS
|
||||
.B debugreiserfs
|
||||
[
|
||||
.B -dDJmoqpS
|
||||
.B -dDJmoqpuSV
|
||||
] [
|
||||
.B -j \fIdevice
|
||||
] [
|
||||
@@ -21,69 +21,77 @@ debugreiserfs \- debugging tool for the ReiserFS filesystem
|
||||
.\" ] [
|
||||
.I device
|
||||
.SH DESCRIPTION
|
||||
It helps sometimes to solve problems with reiserfs filesystems. Being
|
||||
called without options it prints super block of reiserfs filesystem found
|
||||
\fBdebugreiserfs\fR sometimes helps to solve problems with reiserfs filesystems.
|
||||
When run without options it prints the super block of the ReiserFS filesystem found
|
||||
on the \fIdevice\fR.
|
||||
.TP
|
||||
.I device
|
||||
is the special file corresponding to the device (e.g /dev/hdXX for
|
||||
IDE disk partition or /dev/sdXX for SCSI disk partition).
|
||||
an IDE disk partition or /dev/sdXX for a SCSI disk partition).
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
\fB-j\fR \fIdevice\fR
|
||||
print contents of journal. Also with the option -p it allows to pack
|
||||
journal into archive with other metadata
|
||||
prints the contents of the journal. The option -p allows it to pack the journal
|
||||
with other metadata into the archive.
|
||||
.TP
|
||||
\fB-J\fR
|
||||
print journal header.
|
||||
prints the journal header.
|
||||
.TP
|
||||
.B -d
|
||||
print formatted nodes of the internal tree of the filesystem
|
||||
prints the formatted nodes of the internal tree of the filesystem.
|
||||
.TP
|
||||
.B -D
|
||||
print formatted nodes of all used blocks of the filesystem
|
||||
prints the formatted nodes of all used blocks of the filesystem.
|
||||
.TP
|
||||
.B -m
|
||||
print contents of bitmap (not very useful)
|
||||
prints the contents of the bitmap (slightly useful).
|
||||
.TP
|
||||
.B -o
|
||||
print objectid map (not very useful)
|
||||
prints the objectid map (slightly useful).
|
||||
.TP
|
||||
\fB-B\fR \fIfile\fR
|
||||
extract the filesystem list of bad blocks to the specified file.
|
||||
takes the list of bad blocks stored in the internal ReiserFS tree and translates it
|
||||
into an ascii list written to the specified file.
|
||||
.TP
|
||||
\fB-1\fR \fIblocknumber\fR
|
||||
print specified block of the filesystem
|
||||
prints the specified block of the filesystem.
|
||||
.TP
|
||||
.\" \fB-s
|
||||
.\" scans the partition and prints a line when any kind of reiserfs
|
||||
.\" formatted nodes found. Can be used to find specific key in the filesystem.
|
||||
.\" .TP
|
||||
.B -p
|
||||
Makes \fBdebugreiserfs\fR to find filesystem metadata This option
|
||||
exists to help reiserfsck debugging. If reiserfsck fails - you may
|
||||
extract filesystem metadata with \fBdebugreiserfs\fR -p
|
||||
/dev/xxx |gzip -c > xxx.gz. We download that data and make the
|
||||
filesystem similar to your with gunzip -c xxx.gz | unpack /dev/xxx
|
||||
(unpack is included into reiserfsprogs package). This usually allows
|
||||
to reproduce and debug the problem quickly. When data file is not too
|
||||
large.
|
||||
extracts the filesystem's metadata with \fBdebugreiserfs\fR -p /dev/xxx | gzip -c >
|
||||
xxx.gz. None of your data are packed unless a filesystem corruption presents when
|
||||
the whole block having this corruption is packed. You send us the output, and we use
|
||||
it to create a filesystem with the same strucure as yours using \fBdebugreiserfs -u\fR.
|
||||
When the data file is not too large, this usually allows us to quickly reproduce
|
||||
and debug the problem.
|
||||
.TP
|
||||
.B -u
|
||||
builds the ReiserFS filesystem image with gunzip -c xxx.gz | \fBdebugreiserfs\fR
|
||||
-u /dev/image of the previously packed metadata with \fBdebugreiserfs -p\fR. The
|
||||
result image is not the same as the original filesystem, because mostly only metadata
|
||||
were packed with \fBdebugreiserfs -p\fR, but the filesystem structure is completely
|
||||
recreated.
|
||||
.TP
|
||||
.B -S
|
||||
When -S is not specified -p
|
||||
.\" and -s
|
||||
deals with blocks marked used in the
|
||||
filesystem bitmap. With this option set they will work with whole
|
||||
device.
|
||||
deals with blocks marked used in the filesystem bitmap only. With this option
|
||||
set \fBdebugreiserfs\fR will work with the entire device.
|
||||
.TP
|
||||
.B -q
|
||||
Suppress showing speed of progress when
|
||||
When
|
||||
.\" -s or
|
||||
-p is in use
|
||||
-p is in use, suppress showing the speed of progress.
|
||||
.SH AUTHOR
|
||||
This version of \fBdebugreiserfs\fR has been written by Hans Reiser <reiser@namesys.com>.
|
||||
This version of \fBdebugreiserfs\fR has been written by Vitaly Fertman
|
||||
<vitaly@namesys.com>.
|
||||
.SH BUGS
|
||||
There are probably few of them. Please, report bugs to ReiserFS mail-list <reiserfs-list@namesys.com>.
|
||||
Please report bugs to the ReiserFS developers <reiserfs-dev@namesys.com>, providing
|
||||
as much information as possible--your hardware, kernel, patches, settings, all printed
|
||||
messages; check the syslog file for any related information.
|
||||
.SH SEE ALSO
|
||||
.BR reiserfsck (8),
|
||||
.BR mkreiserfs (8)
|
||||
@@ -16,11 +16,13 @@ Options:\n\
|
||||
-m\t\tprint bitmap blocks\n\
|
||||
-o\t\tprint objectid map\n\n\
|
||||
-J\t\tprint journal header\n\
|
||||
-j journal_device\n\t\tprint journal\n\
|
||||
-j filename\n\t\tprint journal located on the device 'filename'\n\
|
||||
\t\tstores the journal in the specified file 'filename.\n\
|
||||
-p\t\tsend filesystem metadata to stdout\n\
|
||||
-u\t\tread stdin and unpack the metadata\n\
|
||||
-S\t\thandle all blocks, not only used\n\
|
||||
-1 block\tblock to print\n\
|
||||
-q\t\tno speed info (for -p, -s and -n)\n\
|
||||
-q\t\tno speed info\n\
|
||||
-V\t\tprint version and exit\n\n", argv[0]);\
|
||||
exit (16);\
|
||||
}
|
||||
@@ -29,18 +31,29 @@ Options:\n\
|
||||
|
||||
Undocumented options:
|
||||
-a map_file\n\tstore to the file the map of file. Is used with -n, -N, -r, -f\n
|
||||
-f creates a file map.\n
|
||||
-S\t\tgo through whole device when running -p, -s or -n\n\
|
||||
-U\t\tgo through unused blocks only when running -p, -s or -n\n\
|
||||
-f \tprints the file map specified by -a.\n
|
||||
-n name\n\stcan device for specific name in reiserfs directories\n\
|
||||
-N \tscan tree for specific key in reiserfs directories\n\
|
||||
-k \tscan device either for specific key or for any metadata\n\
|
||||
-r name\n\trecovers the file spacified by -a to the 'name' file.\n\
|
||||
|
||||
-S\t\tgo through whole device when running -p, -k or -n\n\
|
||||
-U\t\tgo through unused blocks only when running -p, -k or -n\n\
|
||||
-D\t\tprint blocks details scanning the device, not the tree as -d does\n\
|
||||
-b bitmap_file\n\t\trunning -p, -s or -n read blocks marked in this bitmap only\n\
|
||||
-n\tscan device for specific name in reiserfs directories\n\
|
||||
-N\tscan tree for specific key in reiserfs directories\n\
|
||||
-s\tscan device either for specific key or for any metadata\n\
|
||||
-b bitmap_file\n\t\trunning -p, -k or -n read blocks marked in this bitmap only\n\
|
||||
-C\tallow to change reiserfs metadata\n\
|
||||
-r\tprint map file content.\n\
|
||||
-J\tsearch block numbers in the journal\n\
|
||||
-t\tstat the device\n\
|
||||
-v\tverboes unpack, prints the block number of every block being unpacked\n\
|
||||
|
||||
To build a map of a file blocks by name:
|
||||
debugreiserfs device -a mapfile -n filename
|
||||
|
||||
To build a map of a file blocks by key:
|
||||
debugreiserfs device -a mapfile -k
|
||||
|
||||
To extract some:
|
||||
debugreiserfs device -a mapfile -r filename > backup
|
||||
*/
|
||||
|
||||
#if 1
|
||||
@@ -98,11 +111,9 @@ static void print_disk_tree (reiserfs_filsys_t * fs, unsigned long block_nr)
|
||||
for (i = 0; i < count; i++, ih++) {
|
||||
if (is_indirect_ih(ih)) {
|
||||
__u32 * ind_item = (__u32 *)B_I_PITEM (bh, ih);
|
||||
__u32 unfm_ptr;
|
||||
|
||||
for (j = 0; j < (int)I_UNFM_NUM (ih); j ++) {
|
||||
unfm_ptr = le32_to_cpu (ind_item [j]);
|
||||
if (unfm_ptr) {
|
||||
if (d32_get (ind_item, j)) {
|
||||
g_stat_info.nr_unformatted += 1;
|
||||
}
|
||||
}
|
||||
@@ -229,7 +240,7 @@ static char * parse_options (struct debugreiserfs_data * data, int argc, char *
|
||||
else
|
||||
program_name = argv[ 0 ];
|
||||
|
||||
while ((c = getopt (argc, argv, "a:b:C:F:SU1:psn:Nfr:dDomj:JqtZl:LVB:")) != EOF) {
|
||||
while ((c = getopt (argc, argv, "a:b:C:F:SU1:pkn:Nfr:dDomj:JqtZl:LVB:uv")) != EOF) {
|
||||
switch (c) {
|
||||
case 'a': /* -r will read this, -n and -N will write to it */
|
||||
asprintf (&data->map_file, "%s", optarg);
|
||||
@@ -237,18 +248,18 @@ static char * parse_options (struct debugreiserfs_data * data, int argc, char *
|
||||
|
||||
case 'b':
|
||||
/* will load bitmap from a file and read only blocks
|
||||
marked in it. This is for -p and -s */
|
||||
marked in it. This is for -p and -k */
|
||||
asprintf (&data->input_bitmap, "%s", optarg);
|
||||
data->scan_area = EXTERN_BITMAP;
|
||||
break;
|
||||
|
||||
case 'S':
|
||||
/* have debugreiserfs -p or -s to read all the device */
|
||||
/* have debugreiserfs -p or -k to read all the device */
|
||||
data->scan_area = ALL_BLOCKS;
|
||||
break;
|
||||
|
||||
case 'U':
|
||||
/* have debugreiserfs -p or -s to read unused blocks only */
|
||||
/* have debugreiserfs -p or -k to read unused blocks only */
|
||||
data->scan_area = UNUSED_BLOCKS;
|
||||
break;
|
||||
|
||||
@@ -277,11 +288,15 @@ static char * parse_options (struct debugreiserfs_data * data, int argc, char *
|
||||
data->mode = DO_PACK;
|
||||
break;
|
||||
|
||||
case 'u':
|
||||
data->mode = DO_UNPACK;
|
||||
break;
|
||||
|
||||
case 't':
|
||||
data->mode = DO_STAT;
|
||||
break;
|
||||
|
||||
case 's':
|
||||
case 'k':
|
||||
/* read the device and print reiserfs blocks which contain defined key */
|
||||
data->mode = DO_SCAN;
|
||||
break;
|
||||
@@ -366,6 +381,9 @@ static char * parse_options (struct debugreiserfs_data * data, int argc, char *
|
||||
case 'V':
|
||||
data->mode = DO_NOTHING;
|
||||
break;
|
||||
case 'v':
|
||||
data->options |= BE_VERBOSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -527,8 +545,8 @@ static void callback_badblock_print(reiserfs_filsys_t *fs,
|
||||
tmp_ih = get_ih(badblock_path);
|
||||
ind_item = (__u32 *)get_item(badblock_path);
|
||||
|
||||
for (i = 0; i < I_UNFM_NUM(tmp_ih); i++, ind_item++)
|
||||
fprintf (fd, "%u\n", le32_to_cpu (*ind_item));
|
||||
for (i = 0; i < I_UNFM_NUM(tmp_ih); i++)
|
||||
fprintf (fd, "%u\n", d32_get (ind_item, i));
|
||||
|
||||
pathrelse (badblock_path);
|
||||
}
|
||||
@@ -639,6 +657,12 @@ int main (int argc, char * argv[])
|
||||
data = getmem (sizeof (struct debugreiserfs_data));
|
||||
file_name = parse_options (data, argc, argv);
|
||||
|
||||
if (data->mode == DO_UNPACK) {
|
||||
do_unpack(file_name, data->journal_device_name,
|
||||
data->input_bitmap, data->options & BE_VERBOSE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
fs = reiserfs_open (file_name, O_RDONLY, &error, data, 0);
|
||||
|
||||
if (no_reiserfs_found (fs)) {
|
||||
|
||||
@@ -2,27 +2,21 @@
|
||||
* Copyright 2000-2004 by Hans Reiser, licensing governed by
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
#define _GNU_SOURCE
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <time.h>
|
||||
#include <malloc.h>
|
||||
#include <sys/types.h>
|
||||
#include <asm/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#ifndef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#include "io.h"
|
||||
#include "misc.h"
|
||||
#include "reiserfs_lib.h"
|
||||
#include "../include/config.h"
|
||||
|
||||
#include "../version.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
extern reiserfs_filsys_t * fs;
|
||||
|
||||
|
||||
@@ -38,14 +32,15 @@ extern reiserfs_filsys_t * fs;
|
||||
#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
|
||||
#define DO_NOTHING 16
|
||||
#define DO_UNPACK 9 /* -u create the fs by the givem metadata */
|
||||
#define DO_STAT 10
|
||||
#define DO_SCAN_FOR_NAME 11 /* -n */
|
||||
#define DO_LOOK_FOR_NAME 12 /* -N */
|
||||
#define DO_SCAN_JOURNAL 13 /* -J */
|
||||
#define DO_EXTRACT_BADBLOCKS 14
|
||||
#define DO_FILE_MAP 15
|
||||
#define DO_ZERO_BITMAP 16
|
||||
#define DO_NOTHING 17
|
||||
|
||||
|
||||
/*first bits are in reiserfs_fs.b*/
|
||||
@@ -54,6 +49,7 @@ extern reiserfs_filsys_t * fs;
|
||||
#define PRINT_BITMAP 0x40
|
||||
#define PRINT_OBJECTID_MAP 0x80
|
||||
#define BE_QUIET 0x100
|
||||
#define BE_VERBOSE 0x200
|
||||
|
||||
/* these moved to reiserfs_fs.h */
|
||||
//#define PRINT_TREE_DETAILS
|
||||
@@ -272,13 +268,16 @@ void do_scan (reiserfs_filsys_t * fs);
|
||||
/* journal.c */
|
||||
void scan_journal (reiserfs_filsys_t * fs);
|
||||
|
||||
/* unpack.c */
|
||||
extern int do_unpack(char *host, char *j_filename, char *filename, int verbose);
|
||||
|
||||
void print_map(reiserfs_filsys_t * fs);
|
||||
|
||||
struct saved_item {
|
||||
struct item_head si_ih;
|
||||
unsigned long si_block;
|
||||
int si_item_num;
|
||||
struct saved_item * si_next; /* list of items having the same key */
|
||||
int si_item_num, si_entry_pos;
|
||||
struct saved_item *si_next; /* list of items having the same key */
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
@@ -114,7 +114,7 @@ static void pack_direct (struct packed_item * pi, struct buffer_head * bh,
|
||||
set_pi_mask (pi, get_pi_mask (pi) | IH_FREE_SPACE);
|
||||
|
||||
if (get_pi_mask(pi) & SAFE_LINK)
|
||||
set_key_dirid(&ih->ih_key, le32_to_cpu(*(__u32 *)B_I_PITEM (bh, ih)) );
|
||||
set_key_dirid(&ih->ih_key, d32_get((__u32 *)B_I_PITEM (bh, ih), 0) );
|
||||
|
||||
/* send key components which are to be sent */
|
||||
pack_ih (pi, ih);
|
||||
@@ -127,8 +127,9 @@ static int should_pack_indirect (__u32 * ind_item, int unfm_num)
|
||||
int i, len;
|
||||
|
||||
for (i = 1, len = 1; i < unfm_num; i ++) {
|
||||
if ((ind_item [i] == 0 && ind_item [i - 1] == 0) || /* hole continues */
|
||||
le32_to_cpu (ind_item [i]) == le32_to_cpu (ind_item [i - 1]) + 1) { /* subsequent blocks */
|
||||
if ((d32_get(ind_item, i) == 0 && d32_get(ind_item, i - 1) == 0) ||
|
||||
d32_get(ind_item, i) == d32_get(ind_item, i - 1) + 1)
|
||||
{
|
||||
len ++;
|
||||
if (len > 2)
|
||||
return 1;
|
||||
@@ -161,7 +162,7 @@ static void pack_indirect (struct packed_item * pi, struct buffer_head * bh,
|
||||
|
||||
|
||||
if (get_pi_mask(pi) & SAFE_LINK)
|
||||
set_key_dirid(&ih->ih_key, le32_to_cpu(*ind_item) );
|
||||
set_key_dirid(&ih->ih_key, d32_get(ind_item, 0));
|
||||
|
||||
pack_ih (pi, ih);
|
||||
|
||||
@@ -177,12 +178,13 @@ static void pack_indirect (struct packed_item * pi, struct buffer_head * bh,
|
||||
fwrite32 (&ind_item [0]);
|
||||
|
||||
for (i = 1, len = 1; i < I_UNFM_NUM (ih); i ++) {
|
||||
if ((ind_item [i] == 0 && ind_item [i - 1] == 0) || /* hole continues */
|
||||
ind_item [i] == ind_item[ i - 1] + 1) { /* subsequent blocks */
|
||||
if ((d32_get(ind_item, i) == 0 && d32_get(ind_item, i - 1) == 0) ||
|
||||
d32_get(ind_item, i) == d32_get(ind_item, i - 1) + 1)
|
||||
{
|
||||
len ++;
|
||||
} else {
|
||||
fwrite_le16 (&len);
|
||||
fwrite32 (&ind_item[i]);
|
||||
fwrite32 ((char *)(ind_item + i));
|
||||
len = 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -265,7 +265,7 @@ 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 start = 0;
|
||||
int start = -1;
|
||||
unsigned int i, j;
|
||||
__u64 offset = 0, length;
|
||||
long int result = 0;
|
||||
@@ -293,7 +293,7 @@ static void recover_items(FILE *fp, reiserfs_filsys_t * fs, FILE *target_file) {
|
||||
}
|
||||
|
||||
start = -1;
|
||||
} else if (is_direntry_ih(&(cur - 1)->si_ih)) {
|
||||
} else if (is_direntry_ih(&(cur - 1)->si_ih) || is_stat_data_ih(&(cur - 1)->si_ih)) {
|
||||
brelse(bh);
|
||||
continue;
|
||||
} else {
|
||||
@@ -339,7 +339,7 @@ static void recover_items(FILE *fp, reiserfs_filsys_t * fs, FILE *target_file) {
|
||||
fwrite(B_I_PITEM(bh, ih), (map + result)->si_ih.ih2_item_len, 1, target_file);
|
||||
} else if (is_indirect_ih(ih)) {
|
||||
for (j = 0; j < I_UNFM_NUM (ih); j ++) {
|
||||
unfm_ptr = le32_to_cpu (((__u32 *)B_I_PITEM(bh, ih))[j]);
|
||||
unfm_ptr = d32_get((__u32 *)B_I_PITEM(bh, ih), j);
|
||||
if (!unfm_ptr) {
|
||||
fseek(target_file, fs->fs_blocksize, SEEK_CUR);
|
||||
continue;
|
||||
|
||||
+163
-75
@@ -51,7 +51,7 @@ struct saved_name {
|
||||
|
||||
/* attach item to every name in the list */
|
||||
static void store_item (struct saved_name * name, struct buffer_head * bh,
|
||||
struct item_head * ih)
|
||||
struct item_head * ih, int pos)
|
||||
{
|
||||
struct saved_item * new;
|
||||
void * vp;
|
||||
@@ -62,6 +62,7 @@ static void store_item (struct saved_name * name, struct buffer_head * bh,
|
||||
new->si_block = bh->b_blocknr;
|
||||
new->si_item_num = ih - B_N_PITEM_HEAD (bh, 0);
|
||||
new->si_next = 0;
|
||||
new->si_entry_pos = pos;
|
||||
|
||||
vp = tfind (new, &name->items, comp_keys);
|
||||
if (vp) {
|
||||
@@ -122,8 +123,10 @@ static int name_found (struct saved_name * name, struct saved_name ** name_in)
|
||||
cur = *name_in;
|
||||
while (cur) {
|
||||
if (!not_of_one_file (&name->dirid, &cur->dirid) &&
|
||||
!not_of_one_file (&name->parent_dirid, &cur->parent_dirid)) {
|
||||
!not_of_one_file (&name->parent_dirid, &cur->parent_dirid))
|
||||
{
|
||||
cur->count ++;
|
||||
*name_in = cur;
|
||||
return 1;
|
||||
}
|
||||
cur = cur->name_next;
|
||||
@@ -251,12 +254,86 @@ static void scan_for_name (struct buffer_head * bh)
|
||||
return;
|
||||
}
|
||||
|
||||
static struct saved_name *scan_for_key(struct key *key) {
|
||||
char *name;
|
||||
struct saved_name * new, *name_in;
|
||||
|
||||
asprintf (&name, "%u_%u", get_key_dirid (key), get_key_objectid (key));
|
||||
new = obstack_alloc (&name_store, sizeof (struct saved_name) + strlen(name));
|
||||
|
||||
/* pointed object */
|
||||
new->dirid = get_key_dirid (key);
|
||||
new->objectid = get_key_objectid (key);
|
||||
|
||||
/* pointer to first name which points the same key */
|
||||
new->first_name = 0;
|
||||
|
||||
/* where this name is from */
|
||||
|
||||
new->parent_dirid = 0;
|
||||
new->parent_objectid = 0;
|
||||
new->block = 0;
|
||||
new->count = 1;
|
||||
new->items = 0;
|
||||
|
||||
/* name */
|
||||
new->name_len = strlen(name);
|
||||
memcpy (new->name, name, new->name_len);
|
||||
new->name [new->name_len] = 0;
|
||||
new->name_next = 0;
|
||||
|
||||
free(name);
|
||||
|
||||
if (name_found (new, &name_in)) {
|
||||
/* there was already exactly this name */
|
||||
obstack_free (&name_store, new);
|
||||
return name_in;
|
||||
}
|
||||
|
||||
saved_names ++;
|
||||
add_name (new, name_in);
|
||||
|
||||
return new;
|
||||
}
|
||||
|
||||
static int comp_token_key(struct buffer_head *bh, struct item_head *ih, struct key *key) {
|
||||
struct reiserfs_de_head * deh;
|
||||
int j, ih_entry_count = 0;
|
||||
int min_entry_size = 1;
|
||||
|
||||
if ((get_key_dirid(&ih->ih_key) == get_key_dirid(key) ||
|
||||
get_key_dirid(key) == ~(__u32)0) &&
|
||||
(get_key_objectid(&ih->ih_key) == get_key_objectid(key) ||
|
||||
get_key_objectid(key) == ~(__u32)0))
|
||||
return -1;
|
||||
|
||||
if (!is_direntry_ih (ih))
|
||||
return 0;
|
||||
|
||||
deh = B_I_DEH (bh, ih);
|
||||
|
||||
if ( (get_ih_entry_count (ih) > (get_ih_item_len(ih) / (DEH_SIZE + min_entry_size))) ||
|
||||
(get_ih_entry_count (ih) == 0))
|
||||
ih_entry_count = get_ih_item_len(ih) / (DEH_SIZE + min_entry_size);
|
||||
else
|
||||
ih_entry_count = get_ih_entry_count (ih);
|
||||
|
||||
|
||||
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))
|
||||
{
|
||||
return j;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* take every item, look for its key in the key index, if it is found - store
|
||||
item in the sorted list of items of a file */
|
||||
static void scan_items (struct buffer_head * bh)
|
||||
{
|
||||
int i, i_num;
|
||||
static void scan_items (struct buffer_head * bh, struct key *key) {
|
||||
int i, i_num, pos;
|
||||
struct item_head * ih;
|
||||
struct saved_name * name_in_store;
|
||||
void * res;
|
||||
@@ -265,15 +342,21 @@ static void scan_items (struct buffer_head * bh)
|
||||
ih = B_N_PITEM_HEAD (bh, 0);
|
||||
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 */
|
||||
continue;
|
||||
if (key) {
|
||||
if (!(pos = comp_token_key(bh, ih, key)))
|
||||
continue;
|
||||
|
||||
/* name pointing to this key found */
|
||||
name_in_store = *(struct saved_name **)res;
|
||||
name_in_store = scan_for_key(&ih->ih_key);
|
||||
} else {
|
||||
if (!(res = tfind (&ih->ih_key, &key_index, comp_pointed)))
|
||||
continue;
|
||||
|
||||
store_item (name_in_store, bh, ih);
|
||||
/* name pointing to this key found */
|
||||
name_in_store = *(struct saved_name **)res;
|
||||
pos = -1;
|
||||
}
|
||||
|
||||
store_item (name_in_store, bh, ih, pos);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -674,7 +757,21 @@ static void save_items(const void *nodep, VISIT value, int level) {
|
||||
item = *(struct saved_item **)nodep;
|
||||
|
||||
while (item) {
|
||||
fwrite(item, sizeof(struct saved_item) - sizeof(struct saved_item *), 1, fp);
|
||||
if (fp) {
|
||||
fwrite(item, sizeof(struct saved_item) - sizeof(struct saved_item *), 1, fp);
|
||||
} else {
|
||||
if (is_direntry_ih (&item->si_ih) && item->si_entry_pos != -1) {
|
||||
reiserfs_warning(log_to, "block %lu, item %d (%H): entry %d\n",
|
||||
item->si_block, item->si_item_num,
|
||||
&item->si_ih, item->si_entry_pos);
|
||||
} else {
|
||||
reiserfs_warning(log_to, "block %lu, item %d belongs to file %K: %H\n",
|
||||
item->si_block, item->si_item_num, &item->si_ih.ih_key,
|
||||
&item->si_ih);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
item = item->si_next;
|
||||
}
|
||||
}
|
||||
@@ -688,23 +785,27 @@ 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 (log_to, "%d - (%d): [%K]:\"%s\": stored in the %s\n",
|
||||
nr, name->count, &name->parent_dirid, name->name, file_name);
|
||||
|
||||
if (fp == 0) {
|
||||
fp = fopen (file_name, "w+");
|
||||
if (!fp)
|
||||
reiserfs_panic ("could open %s: %m", file_name);
|
||||
if (map_file(fs)) {
|
||||
asprintf(&file_name, "%s.%d", map_file(fs), ++nr);
|
||||
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) {
|
||||
fp = fopen (file_name, "w+");
|
||||
if (!fp)
|
||||
reiserfs_panic ("could open %s: %m", file_name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (name->items)
|
||||
twalk (name->items, save_items);
|
||||
|
||||
name = name->name_next;
|
||||
fclose(fp);
|
||||
fp = NULL;
|
||||
free(file_name);
|
||||
if (fp) {
|
||||
fclose(fp);
|
||||
fp = NULL;
|
||||
free(file_name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -807,6 +908,7 @@ static void look_for_name (reiserfs_filsys_t * fs)
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void scan_for_key (struct buffer_head * bh, struct key * key)
|
||||
{
|
||||
int i, j, i_num;
|
||||
@@ -849,8 +951,7 @@ static void scan_for_key (struct buffer_head * bh, struct key * key)
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
void do_scan (reiserfs_filsys_t * fs)
|
||||
{
|
||||
@@ -900,48 +1001,24 @@ void do_scan (reiserfs_filsys_t * fs)
|
||||
reiserfs_warning (stderr, "looking for (%K)\n", &key);
|
||||
}
|
||||
|
||||
done = 0;
|
||||
for (i = 0; i < get_sb_block_count (fs->fs_ondisk_sb); i ++) {
|
||||
if (!reiserfs_bitmap_test_bit (input_bitmap (fs), i))
|
||||
continue;
|
||||
bh = bread (fs->fs_dev, i, fs->fs_blocksize);
|
||||
if (!bh) {
|
||||
printf ("could not read block %lu\n", i);
|
||||
continue;
|
||||
}
|
||||
type = who_is_this (bh->b_data, bh->b_size);
|
||||
switch (type) {
|
||||
case THE_JDESC:
|
||||
if (!get_key_dirid (&key))
|
||||
printf ("block %lu is journal descriptor\n", i);
|
||||
reiserfs_bitmap_clear_bit (input_bitmap (fs), i);
|
||||
break;
|
||||
case THE_SUPER:
|
||||
if (!get_key_dirid (&key))
|
||||
printf ("block %lu is reiserfs super block\n", i);
|
||||
reiserfs_bitmap_clear_bit (input_bitmap (fs), i);
|
||||
break;
|
||||
case THE_INTERNAL:
|
||||
if (!get_key_dirid (&key))
|
||||
printf ("block %lu is reiserfs internal node\n", i);
|
||||
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)) {
|
||||
scan_for_key (bh, &key);
|
||||
} else {
|
||||
printf ("block %lu is reiserfs leaf node\n", i);
|
||||
if (debug_mode (fs) == DO_SCAN_FOR_NAME) {
|
||||
done = 0;
|
||||
for (i = 0; i < get_sb_block_count (fs->fs_ondisk_sb); i ++) {
|
||||
if (!reiserfs_bitmap_test_bit (input_bitmap (fs), i))
|
||||
continue;
|
||||
bh = bread (fs->fs_dev, i, fs->fs_blocksize);
|
||||
if (!bh) {
|
||||
printf ("could not read block %lu\n", i);
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
reiserfs_bitmap_clear_bit (input_bitmap (fs), i);
|
||||
break;
|
||||
type = who_is_this (bh->b_data, bh->b_size);
|
||||
if (type == THE_LEAF || type == HAS_IH_ARRAY)
|
||||
scan_for_name (bh);
|
||||
else
|
||||
reiserfs_bitmap_clear_bit (input_bitmap (fs), i);
|
||||
brelse (bh);
|
||||
print_how_far (stderr, &done, total, 1, be_quiet (fs));
|
||||
}
|
||||
brelse (bh);
|
||||
print_how_far (stderr, &done, total, 1, be_quiet (fs));
|
||||
}
|
||||
|
||||
fprintf (stderr, "\n");
|
||||
@@ -951,9 +1028,6 @@ void do_scan (reiserfs_filsys_t * fs)
|
||||
fflush (stderr);
|
||||
|
||||
|
||||
if (debug_mode (fs) != DO_SCAN_FOR_NAME)
|
||||
return;
|
||||
|
||||
/* step 2: */
|
||||
done = 0;
|
||||
total = reiserfs_bitmap_ones (input_bitmap (fs));
|
||||
@@ -969,13 +1043,27 @@ void do_scan (reiserfs_filsys_t * fs)
|
||||
continue;
|
||||
}
|
||||
type = who_is_this (bh->b_data, bh->b_size);
|
||||
if (type != THE_LEAF && type != HAS_IH_ARRAY) {
|
||||
brelse (bh);
|
||||
continue;
|
||||
switch (type) {
|
||||
case THE_JDESC:
|
||||
if (!get_key_dirid (&key))
|
||||
printf ("block %lu is journal descriptor\n", i);
|
||||
break;
|
||||
case THE_SUPER:
|
||||
if (!get_key_dirid (&key))
|
||||
printf ("block %lu is reiserfs super block\n", i);
|
||||
break;
|
||||
case THE_INTERNAL:
|
||||
if (!get_key_dirid (&key))
|
||||
printf ("block %lu is reiserfs internal node\n", i);
|
||||
break;
|
||||
case THE_LEAF:
|
||||
case HAS_IH_ARRAY:
|
||||
scan_items (bh, (debug_mode (fs) == DO_SCAN_FOR_NAME ? NULL : &key));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
scan_items (bh);
|
||||
|
||||
brelse (bh);
|
||||
print_how_far (stderr, &done, total, 1, be_quiet (fs));
|
||||
}
|
||||
|
||||
+20
-36
@@ -9,8 +9,8 @@
|
||||
|
||||
#define print_usage_and_exit() die ("Usage: %s [-v] [-b filename] device\n\
|
||||
-v prints blocks number of every block unpacked\n\
|
||||
-b filename makes unpack to save bitmap of blocks unpacked\n\
|
||||
-j filename makes unpack to store journal in specified file\n", argv[0]);
|
||||
-b filename saves bitmap of blocks unpacked to filename\n\
|
||||
-j filename stores journal in the filename\n", argv[0]);
|
||||
|
||||
|
||||
/* when super block gets unpacked for the first time - create a bitmap
|
||||
@@ -235,7 +235,7 @@ static void unpack_indirect (struct packed_item * pi, struct buffer_head * bh,
|
||||
ind_item = (__u32 *)B_I_PITEM (bh, ih);
|
||||
|
||||
if (get_pi_mask(pi) & SAFE_LINK) {
|
||||
*ind_item = cpu_to_le32(get_key_dirid(&ih->ih_key));
|
||||
d32_put(ind_item, 0, get_key_dirid(&ih->ih_key));
|
||||
set_key_dirid(&ih->ih_key, (__u32)-1);
|
||||
return;
|
||||
}
|
||||
@@ -250,12 +250,12 @@ static void unpack_indirect (struct packed_item * pi, struct buffer_head * bh,
|
||||
__u32 base;
|
||||
fread32 (ind_item);
|
||||
fread_le16 (&v16);
|
||||
base = le32_to_cpu(ind_item[0]);
|
||||
base = d32_get(ind_item, 0);
|
||||
for (i = 1; i < v16; i ++) {
|
||||
if (ind_item[0] != 0)
|
||||
ind_item [i] = cpu_to_le32(base + i);
|
||||
if (base != 0)
|
||||
d32_put(ind_item, i, base + i);
|
||||
else
|
||||
ind_item [i] = 0;
|
||||
d32_put(ind_item, i, 0);
|
||||
}
|
||||
ind_item += i;
|
||||
}
|
||||
@@ -274,7 +274,7 @@ static void unpack_direct (struct packed_item * pi, struct buffer_head * bh,
|
||||
set_ih_entry_count (ih, 0xffff);
|
||||
|
||||
if (get_pi_mask(pi) & SAFE_LINK) {
|
||||
*d_item = cpu_to_le32(get_key_dirid(&ih->ih_key));
|
||||
d32_put(d_item, 0, get_key_dirid(&ih->ih_key));
|
||||
set_key_dirid(&ih->ih_key, (__u32)-1);
|
||||
} else {
|
||||
memset (d_item, 'a', get_pi_item_len(pi));
|
||||
@@ -583,43 +583,27 @@ out:
|
||||
}
|
||||
|
||||
|
||||
int main (int argc, char ** argv)
|
||||
{
|
||||
int do_unpack(char *host, char *j_filename, char *filename, int verbose) {
|
||||
int fd, fdj = -2;
|
||||
int c;
|
||||
char * j_filename;
|
||||
char * filename = ".bitmap";
|
||||
struct rlimit lim = {0xffffffff, 0xffffffff};
|
||||
|
||||
print_banner ("unpack");
|
||||
struct rlimit lim = {RLIM_INFINITY, RLIM_INFINITY};
|
||||
|
||||
if (filename == NULL)
|
||||
filename = ".bitmap";
|
||||
|
||||
if (j_filename)
|
||||
Default_journal = 0;
|
||||
|
||||
/* with this 2.4.0-test9's file_write does not send SIGXFSZ */
|
||||
if (setrlimit (RLIMIT_FSIZE, &lim)) {
|
||||
fprintf (stderr, "sertlimit failed: %m\n");
|
||||
}
|
||||
|
||||
while ((c = getopt (argc, argv, "vb:j:")) != EOF) {
|
||||
switch (c) {
|
||||
case 'v':
|
||||
verbose = 1;
|
||||
break;
|
||||
case 'b':
|
||||
asprintf (&filename, "%s", optarg);
|
||||
break;
|
||||
case 'j':
|
||||
Default_journal = 0;
|
||||
asprintf (&j_filename, "%s", optarg);
|
||||
break;
|
||||
}
|
||||
if (misc_device_mounted(host) > 0) {
|
||||
fprintf(stderr, "%s seems mounted, umount it first\n", host);
|
||||
return 0;
|
||||
}
|
||||
if (optind != argc - 1)
|
||||
/* only one non-option argument is permitted */
|
||||
print_usage_and_exit();
|
||||
|
||||
if (misc_device_mounted(argv[optind]) > 0)
|
||||
reiserfs_panic ("%s seems mounted, umount it first\n", argv[optind]);
|
||||
|
||||
fd = open (argv[optind], O_RDWR | O_LARGEFILE);
|
||||
fd = open (host, O_RDWR | O_LARGEFILE);
|
||||
if (fd == -1) {
|
||||
perror ("open failed");
|
||||
return 0;
|
||||
|
||||
@@ -206,6 +206,44 @@ aix)
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
icc)
|
||||
# Intel's C compiler understands `-MD -MF file'. However on
|
||||
# icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
|
||||
# ICC 7.0 will fill foo.d with something like
|
||||
# foo.o: sub/foo.c
|
||||
# foo.o: sub/foo.h
|
||||
# which is wrong. We want:
|
||||
# sub/foo.o: sub/foo.c
|
||||
# sub/foo.o: sub/foo.h
|
||||
# sub/foo.c:
|
||||
# sub/foo.h:
|
||||
# ICC 7.1 will output
|
||||
# foo.o: sub/foo.c sub/foo.h
|
||||
# and will wrap long lines using \ :
|
||||
# foo.o: sub/foo.c ... \
|
||||
# sub/foo.h ... \
|
||||
# ...
|
||||
|
||||
"$@" -MD -MF "$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
# Each line is of the form `foo.o: dependent.h',
|
||||
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
|
||||
# Do two passes, one to just change these to
|
||||
# `$object: dependent.h' and one to simply `dependent.h:'.
|
||||
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
|
||||
# Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
# correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
|
||||
sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
tru64)
|
||||
# The Tru64 compiler uses -MD to generate dependencies as a side
|
||||
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
|
||||
@@ -265,9 +303,7 @@ dashmstdout)
|
||||
shift
|
||||
fi
|
||||
|
||||
# Remove `-o $object'. We will use -o /dev/null later,
|
||||
# however we can't do the remplacement now because
|
||||
# `-o $object' might simply not be used
|
||||
# Remove `-o $object'.
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
@@ -287,7 +323,11 @@ dashmstdout)
|
||||
done
|
||||
|
||||
test -z "$dashmflag" && dashmflag=-M
|
||||
"$@" -o /dev/null $dashmflag | sed 's:^[^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
|
||||
# Require at least two characters before searching for `:'
|
||||
# in the target name. This is to cope with DOS-style filenames:
|
||||
# a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
|
||||
"$@" $dashmflag |
|
||||
sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
cat < "$tmpdepfile" > "$depfile"
|
||||
tr ' ' '
|
||||
@@ -306,6 +346,13 @@ dashXmstdout)
|
||||
|
||||
makedepend)
|
||||
"$@" || exit $?
|
||||
# Remove any Libtool call
|
||||
if test "$libtool" = yes; then
|
||||
while test $1 != '--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
# X makedepend
|
||||
shift
|
||||
cleared=no
|
||||
@@ -318,7 +365,9 @@ makedepend)
|
||||
case "$arg" in
|
||||
-D*|-I*)
|
||||
set fnord "$@" "$arg"; shift ;;
|
||||
-*)
|
||||
# Strip any option that makedepend may not understand. Remove
|
||||
# the object too, otherwise makedepend will parse it as a source file.
|
||||
-*|$object)
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"; shift ;;
|
||||
|
||||
+21
-7
@@ -1,7 +1,7 @@
|
||||
# Makefile.in generated by automake 1.7.2 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.7.6 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
|
||||
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
|
||||
# Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
@@ -35,6 +35,7 @@ POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
host_triplet = @host@
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMDEP_FALSE = @AMDEP_FALSE@
|
||||
AMDEP_TRUE = @AMDEP_TRUE@
|
||||
@@ -63,7 +64,11 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAINT = @MAINT@
|
||||
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
|
||||
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
@@ -85,12 +90,21 @@ ac_ct_STRIP = @ac_ct_STRIP@
|
||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
datadir = @datadir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
@@ -117,6 +131,7 @@ EXTRA_DIST = $(man_MANS)
|
||||
|
||||
reiserfsck_LDADD = $(top_srcdir)/lib/libmisc.a $(top_srcdir)/reiserfscore/libcore.a
|
||||
subdir = fsck
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = $(top_builddir)/include/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
@@ -161,10 +176,10 @@ all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .o .obj
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu fsck/Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
Makefile: @MAINTAINER_MODE_TRUE@ $(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)
|
||||
@@ -222,7 +237,7 @@ distclean-depend:
|
||||
.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@ then mv -f "$(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@
|
||||
@@ -233,7 +248,7 @@ distclean-depend:
|
||||
.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@ then mv -f "$(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@
|
||||
@@ -380,7 +395,6 @@ all-am: Makefile $(PROGRAMS) $(MANS)
|
||||
|
||||
installdirs:
|
||||
$(mkinstalldirs) $(DESTDIR)$(sbindir) $(DESTDIR)$(man8dir)
|
||||
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
|
||||
+92
-26
@@ -5,6 +5,7 @@
|
||||
|
||||
#include "fsck.h"
|
||||
|
||||
#if 0
|
||||
struct check_relocated {
|
||||
__u32 old_dir_id;
|
||||
__u32 old_objectid;
|
||||
@@ -82,6 +83,8 @@ void clear_relocated_list() {
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
@@ -351,12 +354,11 @@ static int bad_stat_data (reiserfs_filsys_t * fs,
|
||||
|
||||
if (id_map_mark(proper_id_map (fs), objectid)) {
|
||||
fsck_log ("bad_stat_data: The objectid (%lu) is shared by at least two "
|
||||
"files\n", objectid);
|
||||
|
||||
if (fsck_mode (fs) == FSCK_FIX_FIXABLE)
|
||||
to_be_relocated (&ih->ih_key);
|
||||
|
||||
"files. Can be fixed with --rebuild-tree only.\n", objectid);
|
||||
#if 0
|
||||
to_be_relocated (&ih->ih_key);
|
||||
// one_more_corruption (fs, FIXABLE);
|
||||
#endif
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -392,11 +394,11 @@ static int bad_direct_item (reiserfs_filsys_t * fs,
|
||||
|
||||
inline void handle_one_pointer (reiserfs_filsys_t * fs,
|
||||
struct buffer_head * bh,
|
||||
__u32 * ptr)
|
||||
__u32 * item, int offset)
|
||||
{
|
||||
if (fsck_mode (fs) == FSCK_FIX_FIXABLE) {
|
||||
fsck_log (" - zeroed");
|
||||
*ptr = 0;
|
||||
d32_put (item, offset, 0);
|
||||
mark_buffer_dirty (bh);
|
||||
} else {
|
||||
one_more_corruption (fs, FIXABLE);
|
||||
@@ -421,7 +423,7 @@ static int bad_badblocks_item (reiserfs_filsys_t * fs, struct buffer_head * bh,
|
||||
return 0;
|
||||
|
||||
for (i = 0; i < I_UNFM_NUM (ih); i ++) {
|
||||
if (!le32_to_cpu (ind [i])) {
|
||||
if (!d32_get (ind, i)) {
|
||||
/* fsck_log ("%s: block %lu: badblocks item (%H) has zero pointer.",
|
||||
__FUNCTION__, bh->b_blocknr, ih);
|
||||
|
||||
@@ -435,14 +437,14 @@ static int bad_badblocks_item (reiserfs_filsys_t * fs, struct buffer_head * bh,
|
||||
}
|
||||
|
||||
/* check list of badblocks pointers */
|
||||
if (le32_to_cpu (ind [i]) >= get_sb_block_count (fs->fs_ondisk_sb)) {
|
||||
if (d32_get (ind, i) >= get_sb_block_count (fs->fs_ondisk_sb)) {
|
||||
fsck_log ("%s: badblock pointer (block %lu) points out of disk spase (%lu)",
|
||||
__FUNCTION__, bh->b_blocknr, le32_to_cpu (ind [i]));
|
||||
handle_one_pointer (fs, bh, &ind[i]);
|
||||
__FUNCTION__, bh->b_blocknr, d32_get (ind, i));
|
||||
handle_one_pointer (fs, bh, ind, i);
|
||||
fsck_log ("\n");
|
||||
}
|
||||
|
||||
if (did_we_meet_it (le32_to_cpu (ind [i]))) {
|
||||
if (did_we_meet_it (d32_get (ind, i))) {
|
||||
/* it can be
|
||||
1. not_data_block
|
||||
delete pointer
|
||||
@@ -450,23 +452,23 @@ static int bad_badblocks_item (reiserfs_filsys_t * fs, struct buffer_head * bh,
|
||||
advice to run fix-fixable if there is no fatal errors
|
||||
with list of badblocks, say that it could fix it. */
|
||||
|
||||
if (not_data_block (fs, le32_to_cpu (ind [i]))) {
|
||||
if (not_data_block (fs, d32_get (ind, i))) {
|
||||
fsck_log ("%s: badblock pointer (block %lu) points on fs metadata (%lu)",
|
||||
__FUNCTION__, bh->b_blocknr, le32_to_cpu (ind [i]));
|
||||
handle_one_pointer (fs, bh, &ind[i]);
|
||||
__FUNCTION__, bh->b_blocknr, d32_get (ind, i));
|
||||
handle_one_pointer (fs, bh, ind, i);
|
||||
fsck_log ("\n");
|
||||
} else {
|
||||
one_more_corruption(fs, FIXABLE);
|
||||
fsck_log ("%s: badblock pointer (block %lu) points to a block (%lu) "
|
||||
"which is in the tree already. Use badblock option (-B) to"
|
||||
" fix the problem\n", __FUNCTION__, bh->b_blocknr,
|
||||
le32_to_cpu(ind[i]));
|
||||
d32_get (ind, i));
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
we_met_it(le32_to_cpu(ind[i]));
|
||||
we_met_it(d32_get(ind, i));
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -488,33 +490,31 @@ static int bad_indirect_item (reiserfs_filsys_t * fs, struct buffer_head * bh,
|
||||
}
|
||||
|
||||
for (i = 0; i < I_UNFM_NUM (ih); i ++) {
|
||||
// __u32 unfm_ptr;
|
||||
|
||||
fsck_check_stat (fs)->unfm_pointers ++;
|
||||
// unfm_ptr = le32_to_cpu (ind [i]);
|
||||
if (!le32_to_cpu (ind [i])) {
|
||||
if (!d32_get (ind, i)) {
|
||||
fsck_check_stat (fs)->zero_unfm_pointers ++;
|
||||
continue;
|
||||
}
|
||||
|
||||
/* check unformatted node pointer and mark it used in the
|
||||
control bitmap */
|
||||
if (bad_block_number (fs, le32_to_cpu (ind [i]))) {
|
||||
if (bad_block_number (fs, d32_get (ind, i))) {
|
||||
fsck_log ("%s: block %lu: The item %k has the bad pointer (%d) to "
|
||||
"the block (%lu)", __FUNCTION__, bh->b_blocknr,
|
||||
&ih->ih_key, i, le32_to_cpu (ind [i]));
|
||||
&ih->ih_key, i, d32_get (ind, i));
|
||||
|
||||
handle_one_pointer (fs, bh, &ind[i]);
|
||||
handle_one_pointer (fs, bh, ind, i);
|
||||
fsck_log ("\n");
|
||||
continue;
|
||||
}
|
||||
|
||||
if (got_already (fs, le32_to_cpu (ind [i]))) {
|
||||
if (got_already (fs, d32_get (ind, i))) {
|
||||
fsck_log ("%s: block %lu: The item (%H) has the bad pointer (%d) "
|
||||
"to the block (%lu), which is in tree already",
|
||||
__FUNCTION__, bh->b_blocknr, ih, i, le32_to_cpu(ind[i]));
|
||||
__FUNCTION__, bh->b_blocknr, ih, i, d32_get (ind, i));
|
||||
|
||||
handle_one_pointer (fs, bh, &ind [i]);
|
||||
handle_one_pointer (fs, bh, ind, i);
|
||||
fsck_log ("\n");
|
||||
continue;
|
||||
}
|
||||
@@ -856,6 +856,72 @@ static inline int h_to_level (reiserfs_filsys_t * fs, int h)
|
||||
return get_sb_tree_height (fs->fs_ondisk_sb) - h - 1;
|
||||
}
|
||||
|
||||
#if 0
|
||||
int dc_fix(struct buffer_head *bh, int pos, __u32 block) {
|
||||
if (!bh || !bh->b_data)
|
||||
return -1;
|
||||
|
||||
if (B_NR_ITEMS(bh) < pos)
|
||||
return -1;
|
||||
|
||||
set_dc_child_blocknr(B_N_CHILD(bh,pos), block);
|
||||
|
||||
mark_buffer_dirty(bh);
|
||||
bwrite(bh);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Removes @N-th key and @(N+1) pointer. */
|
||||
int internal_remove(struct buffer_head *bh, int pos) {
|
||||
char *delete;
|
||||
__u32 nr;
|
||||
|
||||
if (!bh || !bh->b_data)
|
||||
return -1;
|
||||
|
||||
if (B_NR_ITEMS(bh) < pos)
|
||||
return -1;
|
||||
|
||||
delete = (char *)B_N_CHILD(bh, pos + 2);
|
||||
memmove(delete - DC_SIZE, delete,
|
||||
bh->b_size - (delete - bh->b_data));
|
||||
|
||||
delete = (char *)B_N_PDELIM_KEY(bh, pos + 1);
|
||||
memmove(delete - KEY_SIZE, delete,
|
||||
bh->b_size - (delete - bh->b_data));
|
||||
|
||||
nr = B_NR_ITEMS(bh) - 1;
|
||||
|
||||
set_blkh_nr_items(B_BLK_HEAD(bh), nr);
|
||||
set_blkh_free_space(B_BLK_HEAD(bh), bh->b_size -
|
||||
(BLKH_SIZE + KEY_SIZE * nr + DC_SIZE * (nr + 1)));
|
||||
|
||||
mark_buffer_dirty(bh);
|
||||
bwrite(bh);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int leaf_fix_key_oid(struct buffer_head *bh, int pos, __u32 oid) {
|
||||
struct item_head * ih;
|
||||
|
||||
|
||||
if (!bh || !bh->b_data)
|
||||
return -1;
|
||||
|
||||
if (B_NR_ITEMS(bh) < pos)
|
||||
return -1;
|
||||
|
||||
ih = B_N_PITEM_HEAD (bh, pos);
|
||||
set_key_objectid(&ih->ih_key, oid);
|
||||
|
||||
mark_buffer_dirty(bh);
|
||||
bwrite(bh);
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* bh must be formatted node. blk_level must be tree_height - h + 1 */
|
||||
static int bad_node (reiserfs_filsys_t * fs, struct buffer_head ** path, int h)
|
||||
|
||||
+10
-18
@@ -5,24 +5,19 @@
|
||||
|
||||
#define _GNU_SOURCE
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <asm/types.h>
|
||||
#include <sys/vfs.h>
|
||||
#include <errno.h>
|
||||
#include <time.h>
|
||||
#include <asm/types.h>
|
||||
#include <assert.h>
|
||||
#ifndef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#include "io.h"
|
||||
#include "misc.h"
|
||||
#include "reiserfs_lib.h"
|
||||
|
||||
#include "../include/config.h"
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <time.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "../version.h"
|
||||
|
||||
/* main.c */
|
||||
@@ -210,9 +205,11 @@ void do_clean_attributes (reiserfs_filsys_t * fs);
|
||||
int bad_pair (reiserfs_filsys_t *, struct buffer_head * bh, int i);
|
||||
int bad_leaf_2 (reiserfs_filsys_t *, struct buffer_head * bh);
|
||||
|
||||
#if 0
|
||||
extern int should_be_relocated (struct key * key);
|
||||
extern void to_be_relocated (struct key * key);
|
||||
extern void clear_relocated_list(void);
|
||||
#endif
|
||||
|
||||
/* ustree.c */
|
||||
void reiserfsck_paste_into_item (struct path * path, const char * body, int size);
|
||||
@@ -231,10 +228,6 @@ typedef int do_after_read_t (reiserfs_filsys_t *, struct buffer_head **, int h);
|
||||
typedef int do_on_full_path_t (reiserfs_filsys_t *, struct buffer_head **, int);
|
||||
void pass_through_tree (reiserfs_filsys_t *, do_after_read_t, do_on_full_path_t, int depth);
|
||||
|
||||
//int comp_keys_3 (void * key1, void * key2);
|
||||
//int comp_dir_entries (void * key1, void * key2);
|
||||
|
||||
|
||||
/* bitmap.c */
|
||||
int reiserfsck_reiserfs_new_blocknrs (reiserfs_filsys_t * fs,
|
||||
unsigned long * pblocknrs,
|
||||
@@ -250,7 +243,6 @@ int is_block_uninsertable (unsigned long block);
|
||||
|
||||
/* objectid.c */
|
||||
int comp_ids(const void *p1, const void *p2);
|
||||
int is_objectid_used (reiserfs_filsys_t *, __u32 objectid);
|
||||
|
||||
typedef struct id_map {
|
||||
void **index;
|
||||
|
||||
+9
-13
@@ -7,6 +7,7 @@
|
||||
#include <getopt.h>
|
||||
#include <sys/resource.h>
|
||||
#include <sys/mman.h>
|
||||
#include <signal.h>
|
||||
|
||||
extern int screen_width;
|
||||
extern int screen_savebuffer_len;
|
||||
@@ -334,7 +335,7 @@ void warn_what_will_be_done (char * file_name, struct fsck_data * data)
|
||||
{
|
||||
FILE * warn_to;
|
||||
|
||||
warn_to = (data->progress ?: stderr);
|
||||
warn_to = (data->progress ? data->progress : stderr);
|
||||
|
||||
if (data->mode == FSCK_REBUILD)
|
||||
reiserfs_warning (warn_to, REBUILD_WARNING, file_name);
|
||||
@@ -412,7 +413,7 @@ void warn_what_will_be_done (char * file_name, struct fsck_data * data)
|
||||
|
||||
reiserfs_warning (warn_to, "Will put log info to '%s'\n",
|
||||
(data->log == stdout) ? "stdout" :
|
||||
(data->log_file_name ? : "fsck.run"));
|
||||
(data->log_file_name ? data->log_file_name : "fsck.run"));
|
||||
|
||||
if (!(data->options & OPT_YES) && !user_confirmed (warn_to, "\nDo you want to "
|
||||
"run this program?[N/Yes] (note need to type Yes if you do):", "Yes\n"))
|
||||
@@ -801,11 +802,6 @@ static void prepare_fs_for_check(reiserfs_filsys_t * fs) {
|
||||
|
||||
fsck_progress ("Filesystem seems mounted read-only. Skipping journal "
|
||||
"replay.\n");
|
||||
|
||||
if (fsck_mode (fs) == FSCK_FIX_FIXABLE) {
|
||||
fsck_progress ("--fix-fixable ignored\n");
|
||||
fsck_mode (fs) = FSCK_CHECK;
|
||||
}
|
||||
} else if (!fsck_skip_journal (fs)) {
|
||||
if (reiserfs_journal_params_check(fs)) {
|
||||
reiserfs_close (fs);
|
||||
@@ -1115,7 +1111,7 @@ static void check_fs (reiserfs_filsys_t * fs)
|
||||
reiserfs_close (fs);
|
||||
close_rollback_file ();
|
||||
|
||||
clear_relocated_list();
|
||||
//clear_relocated_list();
|
||||
|
||||
time (&t);
|
||||
fsck_progress ("###########\n"
|
||||
@@ -1190,10 +1186,10 @@ int main (int argc, char * argv [])
|
||||
{
|
||||
char * file_name;
|
||||
struct fsck_data * data;
|
||||
struct rlimit rlim = {0xffffffff, 0xffffffff};
|
||||
struct rlimit rlim = {RLIM_INFINITY, RLIM_INFINITY};
|
||||
char *width;
|
||||
int retval;
|
||||
int errno;
|
||||
int error;
|
||||
|
||||
width = getenv("COLUMNS");
|
||||
if ( width )
|
||||
@@ -1257,14 +1253,14 @@ int main (int argc, char * argv [])
|
||||
if (open_devices_for_rollback (file_name, data) == -1)
|
||||
exit(EXIT_OPER);
|
||||
} else {
|
||||
fs = reiserfs_open (file_name, O_RDONLY, &errno, data,
|
||||
fs = reiserfs_open (file_name, O_RDONLY, &error, data,
|
||||
data->mode != FSCK_SB);
|
||||
|
||||
if (data->mode != FSCK_SB) {
|
||||
if (no_reiserfs_found (fs)) {
|
||||
if (errno) {
|
||||
if (error) {
|
||||
die ("Failed to open the device '%s': %s\n\n",
|
||||
file_name, strerror(errno));
|
||||
file_name, strerror(error));
|
||||
} else {
|
||||
die ("Failed to open the filesystem.\n\n"
|
||||
"If the partition table has not been changed, and the partition is\n"
|
||||
|
||||
+9
-5
@@ -263,7 +263,10 @@ static int verify_directory_item (reiserfs_filsys_t * fs, struct buffer_head * b
|
||||
|
||||
if ( (get_ih_entry_count (ih) > (get_ih_item_len(ih) / (DEH_SIZE + min_entry_size))) ||
|
||||
(get_ih_entry_count (ih) == 0))
|
||||
{
|
||||
set_ih_entry_count (ih, (int)get_ih_item_len(ih) / (DEH_SIZE + min_entry_size));
|
||||
mark_buffer_dirty (bh);
|
||||
}
|
||||
|
||||
if (get_ih_entry_count (ih) == 0) {
|
||||
delete_item (fs, bh, item_num);
|
||||
@@ -561,7 +564,8 @@ static int is_wrong_short_key (struct key * key) {
|
||||
if (get_key_dirid (key) == 0 || get_key_objectid (key) == 0 || get_key_objectid (key) == 1 ||
|
||||
get_key_dirid (key) == ~(__u32)0 || get_key_objectid (key) == ~(__u32)0 ||
|
||||
get_key_dirid (key) == get_key_objectid (key) ||
|
||||
(get_key_dirid (key) == 1 && get_key_objectid (key) != 2) ||
|
||||
/* the alloc=packing_groups used to allow dirid = 1
|
||||
(get_key_dirid (key) == 1 && get_key_objectid (key) != 2) || */
|
||||
(get_key_dirid (key) != 1 && get_key_objectid (key) == 2) )
|
||||
return 1;
|
||||
|
||||
@@ -1285,7 +1289,7 @@ static void pass0_correct_leaf (reiserfs_filsys_t * fs,
|
||||
*/
|
||||
ind_item = (__u32 *)B_I_PITEM (bh, ih);
|
||||
for (j = 0; j < (int)I_UNFM_NUM (ih); j ++) {
|
||||
unfm_ptr = le32_to_cpu (ind_item [j]);
|
||||
unfm_ptr = d32_get (ind_item, j);
|
||||
if (!unfm_ptr)
|
||||
continue;
|
||||
#if 0
|
||||
@@ -1309,7 +1313,7 @@ static void pass0_correct_leaf (reiserfs_filsys_t * fs,
|
||||
fsck_log ("pass0: %d-th pointer (%lu) in item %k (leaf block %lu) is wrong\n",
|
||||
j, unfm_ptr, &ih->ih_key, bh->b_blocknr);
|
||||
*/
|
||||
ind_item [j] = 0;
|
||||
d32_put(ind_item, j, 0);
|
||||
dirty = 1;
|
||||
continue;
|
||||
}
|
||||
@@ -1436,10 +1440,10 @@ static int is_bad_indirect (struct item_head * ih, char * item, int dev, int blo
|
||||
for (i = 0; i < I_UNFM_NUM (ih); i ++) {
|
||||
__u32 * ind = (__u32 *)item;
|
||||
|
||||
if (le32_to_cpu (ind[i]) >= blocks) {
|
||||
if (d32_get (ind, i) >= blocks) {
|
||||
bad ++;
|
||||
fsck_log ("is_bad_indirect: %d-th pointer of item %H looks bad (%lu)\n",
|
||||
i, ih, le32_to_cpu (ind [i]));
|
||||
i, ih, d32_get (ind, i));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
+5
-6
@@ -4,7 +4,6 @@
|
||||
*/
|
||||
|
||||
#include "fsck.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
reiserfs_bitmap_t * bad_unfm_in_tree_once_bitmap;
|
||||
|
||||
@@ -106,7 +105,7 @@ static void indirect_in_tree (struct buffer_head * bh,
|
||||
unp = (__u32 *)B_I_PITEM (bh, ih);
|
||||
|
||||
for (i = 0; i < I_UNFM_NUM (ih); i ++) {
|
||||
unfm_ptr = le32_to_cpu (unp[i]);
|
||||
unfm_ptr = d32_get (unp, i);
|
||||
if (unfm_ptr == 0)
|
||||
continue;
|
||||
if ((ret = still_bad_unfm_ptr_1 (unfm_ptr)))
|
||||
@@ -395,8 +394,8 @@ static void pass1_correct_leaf (reiserfs_filsys_t * fs,
|
||||
/* correct indirect items */
|
||||
ind_item = (__u32 *)B_I_PITEM (bh, ih);
|
||||
|
||||
for (j = 0; j < I_UNFM_NUM (ih); j ++, ind_item ++) {
|
||||
unfm_ptr = le32_to_cpu (*ind_item);
|
||||
for (j = 0; j < I_UNFM_NUM (ih); j ++) {
|
||||
unfm_ptr = d32_get (ind_item, j);
|
||||
|
||||
if (!unfm_ptr)
|
||||
continue;
|
||||
@@ -410,7 +409,7 @@ static void pass1_correct_leaf (reiserfs_filsys_t * fs,
|
||||
/* 1. zero slots pointing to a leaf */
|
||||
if (is_used_leaf (unfm_ptr)) {
|
||||
dirty ++;
|
||||
*ind_item = 0;
|
||||
d32_put (ind_item, j, 0);
|
||||
pass_1_stat (fs)->pointed_leaves ++;
|
||||
continue;
|
||||
}
|
||||
@@ -425,7 +424,7 @@ static void pass1_correct_leaf (reiserfs_filsys_t * fs,
|
||||
else {
|
||||
/* Yes, we have seen this pointer already, zero other pointers to it. */
|
||||
dirty ++;
|
||||
*ind_item = 0;
|
||||
d32_put (ind_item, j, 0);
|
||||
pass_1_stat (fs)->non_unique_pointers ++;
|
||||
continue;
|
||||
}
|
||||
|
||||
+36
-25
@@ -1,9 +1,9 @@
|
||||
.\" -*- nroff -*-
|
||||
.\" Copyright 1996-2004 Hans Reiser.
|
||||
.\"
|
||||
.TH REISERFSCK 8 "February 2004" "Reiserfsprogs-3.6.13"
|
||||
.TH REISERFSCK 8 "February 2004" "Reiserfsprogs-3.6.18"
|
||||
.SH NAME
|
||||
reiserfsck \- checking tool for the ReiserFS filesystem
|
||||
reiserfsck \- The checking tool for the ReiserFS filesystem.
|
||||
.SH SYNOPSIS
|
||||
.B reiserfsck
|
||||
[ \fB-afprVy\fR ]
|
||||
@@ -28,20 +28,24 @@ reiserfsck \- checking tool for the ReiserFS filesystem
|
||||
any necessary transactions, and either checks or repairs the file system.
|
||||
.TP
|
||||
.I device
|
||||
is the special file corresponding to the device or partition (e.g /dev/hdXX
|
||||
for IDE disk partition or /dev/sdXX for SCSI disk partition).
|
||||
is the special file corresponding to a device or to a partition (e.g
|
||||
/dev/hdXX for an IDE disk partition or /dev/sdXX for a SCSI disk partition).
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.B --rebuild-sb
|
||||
This option recovers the superblock on a Reiserfs partition. Normally you
|
||||
only need this option if mount reports "read_super_block: can't find
|
||||
a reiserfs file system" and you are sure that a Reiserfs file system is
|
||||
there.
|
||||
there. But remember that if you have used some partition editor program and
|
||||
now you cannot find a filesystem, probably something has gone wrong while
|
||||
repartitioning and the start of the partition has been changed. If so,
|
||||
instead of rebuilding the super block on a wrong place you should find the
|
||||
correct start of the partition first.
|
||||
.TP
|
||||
.B --check
|
||||
This default action checks file system consistency and reports but
|
||||
This default action checks filesystem consistency and reports, but
|
||||
does not repair any corruption that it finds. This option may be
|
||||
used on a read-only file system mount.
|
||||
used on a read-only file system mount.
|
||||
.TP
|
||||
.B --fix-fixable
|
||||
This option recovers certain kinds of corruption that do not require
|
||||
@@ -63,7 +67,12 @@ filesystem will be left in the unmountable state to avoid subsequent
|
||||
data corruptions.
|
||||
.TP
|
||||
.B --clean-attributes
|
||||
This option cleans reserved fields of Stat-Data items.
|
||||
This option cleans reserved fields of Stat-Data items. There were days when
|
||||
there were no extended attributes in reiserfs. When they were implemented old
|
||||
partitions needed to be cleaned first -- reiserfs code in the kernel did not
|
||||
care about not used fields in its strutures. Thus if you have used one of the
|
||||
old (pre-attrbutes) kernels with a ReiserFS filesystem and you want to use
|
||||
extented attribues there, you should clean the filesystem first.
|
||||
.TP
|
||||
.B \fB--journal \fIdevice \fR, \fB-j \fIdevice \fR
|
||||
This option supplies the device name of the current file system journal.
|
||||
@@ -79,18 +88,18 @@ This option causes \fBreiserfsck\fR to correct file sizes that
|
||||
are larger than the offset of the last discovered byte. This
|
||||
implies that holes at the end of a file will be removed. File
|
||||
sizes that are smaller than the offset of the last discovered
|
||||
byte are corrected by --fix-fixable.
|
||||
byte are corrected by \fB--fix-fixable\fR.
|
||||
.TP
|
||||
\fB--badblocks \fIfile\fR, \fB-B \fI file\fR
|
||||
This option sets the badblock list to be the list of blocks specified in
|
||||
the given `file`. The filesystem badblock list is cleared before the new
|
||||
list is added. Can be used with \fB--fix-fixable\fR to fix the list of
|
||||
badblocks (see debugreiserfs -B) and must be given with \fB--rebuild-tree\fR
|
||||
option every time if the block device has bad blocks.
|
||||
list is added. It can be used with \fB--fix-fixable\fR to fix the list of
|
||||
badblocks (see \fBdebugreiserfs -B\fR). If the device has bad blocks, every
|
||||
time it must be given with the \fB--rebuild-tree\fR option.
|
||||
.TP
|
||||
\fB--logfile \fIfile\fR, \fB-l \fI file\fR
|
||||
This option causes \fBreiserfsck\fR to report any corruption it finds
|
||||
to the specified log file rather than stderr.
|
||||
to the specified log file rather than to stderr.
|
||||
.TP
|
||||
.B --nolog, -n
|
||||
This option prevents \fBreiserfsck\fR from reporting any kinds of corruption.
|
||||
@@ -100,24 +109,24 @@ This option prevents \fBreiserfsck\fR from reporting its rate of progress.
|
||||
.TP
|
||||
.B --yes, -y
|
||||
This option inhibits \fBreiserfsck\fR from asking you for confirmation after
|
||||
telling you what it is going to do, assuming yes. For safety, it does not
|
||||
work with the \fB--rebuild-tree\fR option.
|
||||
telling you what it is going to do. It will assuem you confirm. For safety,
|
||||
it does not work with the \fB--rebuild-tree\fR option.
|
||||
.TP
|
||||
\fB-a\fR, \fB-p\fR
|
||||
These options are usually passed by fsck -A during the automatic checking
|
||||
of those partitions listed in /etc/fstab. These options cause \fBreiserfsck\fR
|
||||
to print some information about the specified file system, check if error
|
||||
flags in the superblock are set and do some light-weight checks. If these
|
||||
to print some information about the specified filesystem, to check if error
|
||||
flags in the superblock are set and to do some light-weight checks. If these
|
||||
checks reveal a corruption or the flag indicating a (possibly fixable)
|
||||
corruption is found set in the superblock, then \fBreiserfsck\fR switches
|
||||
to the fix-fixable mode. If the flag indicating a fatal corruption is found
|
||||
set in the superblock, then \fBreiserfsck\fR finishes with an error.
|
||||
.TP
|
||||
.B -V
|
||||
This option prints the reiserfsprogs version and exit.
|
||||
This option prints the reiserfsprogs version and then exit.
|
||||
.TP
|
||||
\fB-r\fR, \fB-f\fR
|
||||
These options are ignored.
|
||||
These options are not yet operational and therefore are ignored.
|
||||
.SH EXPERT OPTIONS
|
||||
DO NOT USE THESE OPTIONS UNLESS YOU KNOW WHAT YOU ARE DOING.
|
||||
WE ARE NOT RESPONSIBLE IF YOU LOSE DATA AS A RESULT OF THESE
|
||||
@@ -130,9 +139,9 @@ the main data device. NOTE: after this operation you must use \fBreiserfstune\fR
|
||||
to specify a new journal device.
|
||||
.TP
|
||||
.B --scan-whole-partition, -S
|
||||
This option causes \fB--rebuild-tree\fR to scan the whole partition, not only
|
||||
used space on the partition.
|
||||
.SH EXAMPLE OF USING
|
||||
This option causes \fB--rebuild-tree\fR to scan the whole partition but not only
|
||||
the used space on the partition.
|
||||
.SH AN EXAMPLE OF USING reiserfsck
|
||||
1. You think something may be wrong with a reiserfs partition on /dev/hda1
|
||||
or you would just like to perform a periodic disk check.
|
||||
|
||||
@@ -154,7 +163,8 @@ the whole partition before proceeding. Then run \fBreiserfsck --rebuild-tree
|
||||
|
||||
6. If the \fBreiserfsck --rebuild-tree\fR step fails or does not recover what
|
||||
you expected, please submit this as a bug report. Try to provide as much
|
||||
information as possible and we will try to help solve the problem.
|
||||
information as possible including your platform and Linux kernel version. We
|
||||
will try to help solve the problem.
|
||||
.SH EXIT CODES
|
||||
\fBreiserfsck\fR uses the following exit codes:
|
||||
.br
|
||||
@@ -179,8 +189,9 @@ information as possible and we will try to help solve the problem.
|
||||
.SH AUTHOR
|
||||
This version of \fBreiserfsck\fR has been written by Vitaly Fertman <vitaly@namesys.com>.
|
||||
.SH BUGS
|
||||
There are likely to be some bugs. Please report bugs to the ReiserFS mail-list
|
||||
<reiserfs-list@namesys.com>.
|
||||
Please report bugs to the ReiserFS developers <reiserfs-dev@namesys.com>, providing
|
||||
as much information as possible--your hardware, kernel, patches, settings, all printed
|
||||
messages, the logfile; check the syslog file for any related information.
|
||||
.SH TODO
|
||||
Faster recovering, signal handling.
|
||||
.SH SEE ALSO
|
||||
|
||||
@@ -398,6 +398,7 @@ static int check_semantic_pass (struct key * key, struct key * parent, int dot_d
|
||||
/* It seems quite difficult to relocate objects on fix-fixable -
|
||||
* rewrite_file calls reiserfs_file_write which can convert tails
|
||||
* to unfm, plus unreachable, was_tail flags, etc. */
|
||||
#if 0
|
||||
if ((/* relocate = */ should_be_relocated(&ih->ih_key))) {
|
||||
/*
|
||||
if (fsck_mode(fs) == FSCK_CHECK)
|
||||
@@ -405,6 +406,7 @@ static int check_semantic_pass (struct key * key, struct key * parent, int dot_d
|
||||
*/
|
||||
one_more_corruption(fs, FATAL);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (fix_obviously_wrong_sd_mode (&path)) {
|
||||
one_more_corruption (fs, FIXABLE);
|
||||
@@ -699,7 +701,7 @@ int check_safe_links ()
|
||||
reiserfs_panic ("Safe Link %k cannot be of the size %d",
|
||||
&tmp_ih->ih_key, get_ih_item_len (tmp_ih));
|
||||
|
||||
set_key_dirid(&key, le32_to_cpu(*(__u32 *)get_item(&safe_link_path)));
|
||||
set_key_dirid(&key, d32_get((__u32 *)get_item(&safe_link_path), 0));
|
||||
set_key_objectid(&key, get_key_objectid(&tmp_ih->ih_key));
|
||||
if ((rkey = reiserfs_next_key(&safe_link_path)) == NULL)
|
||||
set_key_dirid (&safe_link_key, 0);
|
||||
@@ -715,7 +717,7 @@ int check_safe_links ()
|
||||
} else if (fsck_mode(fs) == FSCK_FIX_FIXABLE) {
|
||||
fsck_log ("Invalid safe link %k: cannot find the pointed object (%K) - "
|
||||
"safe link was deleted\n", &tmp_ih->ih_key, &key);
|
||||
*(__u32 *)get_item(&safe_link_path) = (__u32)0;
|
||||
d32_put((__u32 *)get_item(&safe_link_path), 0, 0);
|
||||
pathrelse (&path);
|
||||
reiserfsck_delete_item (&safe_link_path, 0);
|
||||
continue;
|
||||
@@ -732,7 +734,7 @@ int check_safe_links ()
|
||||
} else if (fsck_mode(fs) == FSCK_FIX_FIXABLE) {
|
||||
fsck_log ("Invalid 'truncate' safe link %k, cannot happen for "
|
||||
"a directory (%K) - safe link was deleted\n", &tmp_ih->ih_key, &key);
|
||||
*(__u32 *)get_item(&safe_link_path) = (__u32)0;
|
||||
d32_put((__u32 *)get_item(&safe_link_path), 0, 0);
|
||||
pathrelse (&path);
|
||||
reiserfsck_delete_item (&safe_link_path, 0);
|
||||
continue;
|
||||
|
||||
@@ -174,7 +174,7 @@ int wrong_st_blocks (struct key * key, __u32 * blocks, __u32 sd_blocks, __u16 mo
|
||||
if (S_ISREG (mode) || S_ISLNK (mode) || S_ISDIR (mode)) {
|
||||
if (*blocks != sd_blocks) {
|
||||
fsck_log ("vpf-10680: The %s %K has the wrong block count in the StatData "
|
||||
"(%u)%s(%u)\n", S_ISDIR (mode) ? "directory" : "file", key, sd_blocks,
|
||||
"(%u)%s(%u)\n", S_ISDIR (mode) ? "directory" : S_ISREG (mode) ? "file" : "link", key, sd_blocks,
|
||||
fsck_mode(fs) == FSCK_CHECK ? ", should be " : " - corrected to ", *blocks);
|
||||
ret = 1;
|
||||
}
|
||||
|
||||
+2
-4
@@ -4,8 +4,6 @@
|
||||
*/
|
||||
|
||||
#include "fsck.h"
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
|
||||
#if defined(HAVE_LIBUUID) && defined(HAVE_UUID_UUID_H)
|
||||
# include <uuid/uuid.h>
|
||||
@@ -190,7 +188,7 @@ void rebuild_sb (reiserfs_filsys_t * fs, char * filename, struct fsck_data * dat
|
||||
|
||||
char * answer = 0;
|
||||
size_t n = 0;
|
||||
struct stat64 stat_buf;
|
||||
struct stat stat_buf;
|
||||
int retval, exit_code = EXIT_OK;
|
||||
|
||||
#if defined(HAVE_LIBUUID) && defined(HAVE_UUID_UUID_H)
|
||||
@@ -574,7 +572,7 @@ void rebuild_sb (reiserfs_filsys_t * fs, char * filename, struct fsck_data * dat
|
||||
/* Check that specified non-standard journal device exists. */
|
||||
|
||||
journal_dev_name = fsck_data (fs)->journal_dev_name;
|
||||
retval = stat64(journal_dev_name, &stat_buf);
|
||||
retval = stat(journal_dev_name, &stat_buf);
|
||||
|
||||
if (retval == -1)
|
||||
reiserfs_exit (EXIT_USER, "rebuild_sb: error while detecting the "
|
||||
|
||||
+30
-29
@@ -36,7 +36,6 @@ static unsigned long indirect_to_direct (struct path * path, __u64 len, int syml
|
||||
struct buffer_head * unfm_bh = 0;
|
||||
struct item_head ins_ih;
|
||||
char * buf;
|
||||
__u32 * indirect;
|
||||
char bad_drct[fs->fs_blocksize];
|
||||
|
||||
/* direct item to insert */
|
||||
@@ -53,8 +52,7 @@ static unsigned long indirect_to_direct (struct path * path, __u64 len, int syml
|
||||
TYPE_DIRECT);
|
||||
|
||||
// we do not know what length this item should be
|
||||
indirect = get_item (path);
|
||||
unfm_ptr = le32_to_cpu (indirect [I_UNFM_NUM (ih) - 1]);
|
||||
unfm_ptr = d32_get ((__u32 *)get_item (path), I_UNFM_NUM (ih) - 1);
|
||||
if (unfm_ptr && (unfm_bh = bread (bh->b_dev, unfm_ptr, bh->b_size))) {
|
||||
/* we can read the block */
|
||||
buf = unfm_bh->b_data;
|
||||
@@ -302,7 +300,7 @@ int are_file_items_correct (struct item_head * sd_ih, void * sd, __u64 * size, _
|
||||
for (i = 0; i < I_UNFM_NUM (ih); i ++) {
|
||||
__u32 * ind = (__u32 *)get_item(&path);
|
||||
|
||||
if (ind[i] != 0)
|
||||
if (d32_get(ind, i) != 0)
|
||||
*blocks += (fs->fs_blocksize >> 9);
|
||||
}
|
||||
} else if (get_type (&ih->ih_key) == TYPE_DIRECT) {
|
||||
@@ -332,7 +330,7 @@ int are_file_items_correct (struct item_head * sd_ih, void * sd, __u64 * size, _
|
||||
/* DEBUG message.
|
||||
fsck_log ("are_file_items_correct: The indirect item is converted back to direct %K\n", &ih->ih_key);
|
||||
*/
|
||||
if (ind [I_UNFM_NUM (ih) - 1] == 0)
|
||||
if (d32_get(ind, I_UNFM_NUM (ih) - 1) == 0)
|
||||
*blocks += (fs->fs_blocksize >> 9);
|
||||
|
||||
/* path is released here. */
|
||||
@@ -536,10 +534,10 @@ static int create_first_item_of_file (struct item_head * ih, char * item, struct
|
||||
copy_key (&(indih.ih_key), &(ih->ih_key));
|
||||
set_ih_item_len (&indih, UNFM_P_SIZE);
|
||||
|
||||
set_ih_free_space (&indih, 0);
|
||||
if (get_offset (&ih->ih_key) > fs->fs_blocksize) {
|
||||
/* insert indirect item containing 0 unfm pointer */
|
||||
unfm_ptr = 0;
|
||||
set_ih_free_space (&indih, 0);
|
||||
retval = 0;
|
||||
} else {
|
||||
if (is_direct_ih (ih)) {
|
||||
@@ -551,9 +549,10 @@ static int create_first_item_of_file (struct item_head * ih, char * item, struct
|
||||
unfm_ptr = cpu_to_le32 (unbh->b_blocknr);
|
||||
memcpy (unbh->b_data + get_offset (&ih->ih_key) - 1, item, len);
|
||||
|
||||
set_ih_free_space (&indih, fs->fs_blocksize - len - (get_offset (&ih->ih_key) - 1));
|
||||
set_ih_free_space (&indih, fs->fs_blocksize -
|
||||
len - (get_offset (&ih->ih_key) - 1));
|
||||
|
||||
mark_ih_was_tail (&indih);
|
||||
|
||||
mark_buffer_dirty (unbh);
|
||||
mark_buffer_uptodate (unbh, 1);
|
||||
brelse (unbh);
|
||||
@@ -569,10 +568,10 @@ static int create_first_item_of_file (struct item_head * ih, char * item, struct
|
||||
|
||||
if (!was_in_tree) {
|
||||
for (i = 0; i < I_UNFM_NUM (ih); i++) {
|
||||
if (still_bad_unfm_ptr_2 (le32_to_cpu (ni[i])))
|
||||
if (still_bad_unfm_ptr_2 (d32_get(ni, i)))
|
||||
reiserfs_panic ("create_first_item_of_file: The file %K has a pointer to the bad block (%u)",
|
||||
&ih->ih_key, le32_to_cpu (unfm_ptr));
|
||||
mark_block_used (le32_to_cpu (ni[i]), 0);
|
||||
&ih->ih_key, d32_get(ni, i));
|
||||
mark_block_used (d32_get(ni, i), 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -604,6 +603,7 @@ static unsigned long block_to_start (struct path * path)
|
||||
{
|
||||
struct buffer_head * bh;
|
||||
struct item_head * ih;
|
||||
__u32 blk;
|
||||
|
||||
bh = PATH_PLAST_BUFFER (path);
|
||||
ih = PATH_PITEM_HEAD (path);
|
||||
@@ -611,7 +611,8 @@ static unsigned long block_to_start (struct path * path)
|
||||
return bh->b_blocknr;
|
||||
|
||||
ih --;
|
||||
return (B_I_POS_UNFM_POINTER (bh, ih, I_UNFM_NUM (ih) - 1)) ?: bh->b_blocknr;
|
||||
blk = d32_get((__u32 *)B_I_PITEM(bh, ih), I_UNFM_NUM (ih) - 1);
|
||||
return (blk ? blk : bh->b_blocknr);
|
||||
}
|
||||
|
||||
|
||||
@@ -637,7 +638,7 @@ static void direct2indirect2 (unsigned long unfm, struct path * path)
|
||||
die ("direct2indirect: can not find first part of tail");
|
||||
}
|
||||
|
||||
unbh = reiserfsck_get_new_buffer (le32_to_cpu (unfm) ? le32_to_cpu (unfm) : block_to_start (path));
|
||||
unbh = reiserfsck_get_new_buffer (unfm ? unfm : block_to_start (path));
|
||||
memset (unbh->b_data, 0, unbh->b_size);
|
||||
|
||||
/* delete parts of tail coping their contents to new buffer */
|
||||
@@ -717,7 +718,7 @@ static int append_to_unformatted_node (struct item_head * comingih, struct item_
|
||||
int zero_number;
|
||||
|
||||
bh = PATH_PLAST_BUFFER (path);
|
||||
unfm_ptr = le32_to_cpu (B_I_POS_UNFM_POINTER (bh, ih, I_UNFM_NUM (ih) - 1));
|
||||
unfm_ptr = d32_get ((__u32 *)B_I_PITEM(bh, ih), I_UNFM_NUM (ih) - 1);
|
||||
|
||||
/* append to free space of the last unformatted node of indirect item ih */
|
||||
free_space = get_offset (&ih->ih_key) + fs->fs_blocksize * I_UNFM_NUM (ih) - get_offset (&comingih->ih_key);
|
||||
@@ -749,7 +750,7 @@ static int append_to_unformatted_node (struct item_head * comingih, struct item_
|
||||
/*if (unfm_ptr == 0 || unfm_ptr >= SB_BLOCK_COUNT (fs)) {*/
|
||||
unbh = reiserfsck_get_new_buffer (bh->b_blocknr);
|
||||
memset (unbh->b_data, 0, unbh->b_size);
|
||||
B_I_POS_UNFM_POINTER (bh, ih, I_UNFM_NUM (ih) - 1) = unbh->b_blocknr;
|
||||
d32_put ((__u32 *)B_I_PITEM(bh, ih), I_UNFM_NUM (ih) - 1, unbh->b_blocknr);
|
||||
/*mark_block_unformatted (unbh->b_blocknr);*/
|
||||
mark_buffer_dirty (bh);
|
||||
}
|
||||
@@ -802,7 +803,7 @@ int reiserfsck_append_file (struct item_head * comingih, char * item, int pos, s
|
||||
mark_buffer_uptodate (unbh, 1);
|
||||
|
||||
ni = getmem (UNFM_P_SIZE);
|
||||
*ni = cpu_to_le32 (unbh->b_blocknr);
|
||||
d32_put (ni, 0, unbh->b_blocknr);
|
||||
count = 1;
|
||||
|
||||
brelse (unbh);
|
||||
@@ -823,9 +824,9 @@ int reiserfsck_append_file (struct item_head * comingih, char * item, int pos, s
|
||||
|
||||
if (!was_in_tree) {
|
||||
for (i = 0; i < count; i++ ) {
|
||||
if (still_bad_unfm_ptr_2 (le32_to_cpu (ni[i])))
|
||||
die ("reiserfsck_append_file: Trying to insert a pointer to illegal block (%u)", le32_to_cpu (ni[i]));
|
||||
mark_block_used (le32_to_cpu (ni[i]), 0);
|
||||
if (still_bad_unfm_ptr_2 (d32_get (ni, i)))
|
||||
die ("reiserfsck_append_file: Trying to insert a pointer to illegal block (%u)", d32_get (ni, i));
|
||||
mark_block_used (d32_get (ni, i), 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -837,7 +838,7 @@ int reiserfsck_append_file (struct item_head * comingih, char * item, int pos, s
|
||||
return retval;
|
||||
}
|
||||
|
||||
int must_there_be_a_hole (struct item_head * comingih, struct path * path)
|
||||
long long int must_there_be_a_hole (struct item_head * comingih, struct path * path)
|
||||
{
|
||||
struct item_head * ih = PATH_PITEM_HEAD (path);
|
||||
|
||||
@@ -857,10 +858,10 @@ int must_there_be_a_hole (struct item_head * comingih, struct path * path)
|
||||
}
|
||||
|
||||
|
||||
int reiserfs_append_zero_unfm_ptr (struct path * path, int p_count)
|
||||
int reiserfs_append_zero_unfm_ptr (struct path * path, long long int p_count)
|
||||
{
|
||||
__u32 * ni;
|
||||
int count;
|
||||
long long int count;
|
||||
|
||||
if (is_direct_ih (PATH_PITEM_HEAD (path)))
|
||||
/* convert direct item to indirect */
|
||||
@@ -894,7 +895,7 @@ static int overwrite_by_direct_item (struct item_head * comingih, char * item, s
|
||||
bh = PATH_PLAST_BUFFER (path);
|
||||
ih = PATH_PITEM_HEAD (path);
|
||||
|
||||
unfm_ptr = le32_to_cpu (B_I_POS_UNFM_POINTER (bh, ih, path->pos_in_item));
|
||||
unfm_ptr = d32_get ((__u32 *)B_I_PITEM(bh, ih), path->pos_in_item);
|
||||
unbh = 0;
|
||||
|
||||
if (unfm_ptr != 0 && unfm_ptr < get_sb_block_count (fs->fs_ondisk_sb)) {
|
||||
@@ -910,7 +911,7 @@ static int overwrite_by_direct_item (struct item_head * comingih, char * item, s
|
||||
if (unfm_ptr == 0 || unfm_ptr >= get_sb_block_count (fs->fs_ondisk_sb)) {
|
||||
if ((unbh = reiserfsck_get_new_buffer (bh->b_blocknr)) != NULL) {
|
||||
memset (unbh->b_data, 0, unbh->b_size);
|
||||
B_I_POS_UNFM_POINTER (bh, ih, path->pos_in_item) = cpu_to_le32 (unbh->b_blocknr);
|
||||
d32_put ((__u32 *)B_I_PITEM(bh, ih), path->pos_in_item, unbh->b_blocknr);
|
||||
mark_buffer_dirty (bh);
|
||||
} else {
|
||||
die ("overwrite_by_direct_item: Could not allocate a new block for new data");
|
||||
@@ -1017,11 +1018,11 @@ static int overwrite_by_indirect_item (struct item_head * comingih, __u32 * comi
|
||||
}
|
||||
|
||||
for (i = 0; i < to_copy; i ++) {
|
||||
if (coming_item[i] != 0 && item_in_tree[i] == 0) {
|
||||
if (d32_get (coming_item, i) != 0 && d32_get (item_in_tree, i) == 0) {
|
||||
/* overwrite holes only by correct a pointer in the coming item
|
||||
which must be correct */
|
||||
item_in_tree[i] = coming_item[i];
|
||||
mark_block_used (le32_to_cpu (coming_item[i]), 0);
|
||||
d32_put (item_in_tree, i, d32_get (coming_item, i));
|
||||
mark_block_used (d32_get (coming_item, i), 0);
|
||||
dirty ++;
|
||||
}
|
||||
}
|
||||
@@ -1051,7 +1052,7 @@ static int reiserfsck_overwrite_file (struct item_head * comingih, char * item,
|
||||
reiserfs_panic ("reiserfsck_overwrite_file: The second part of the tail %k can not"
|
||||
" be overwritten by indirect item %k", &ih->ih_key, &comingih->ih_key);
|
||||
/* use pointer from coming indirect item */
|
||||
unfm_ptr = le32_to_cpu (*(__u32 *)(item + *pos_in_coming_item * UNFM_P_SIZE));
|
||||
unfm_ptr = d32_get ((__u32 *)item, *pos_in_coming_item);
|
||||
if (!was_in_tree) {
|
||||
if (still_bad_unfm_ptr_2 (unfm_ptr))
|
||||
die ("reiserfsck_overwrite_file: The pointer to the unformatted block (%u)"
|
||||
@@ -1080,7 +1081,7 @@ static int reiserfsck_overwrite_file (struct item_head * comingih, char * item,
|
||||
int reiserfsck_file_write (struct item_head * ih, char * item, int was_in_tree) {
|
||||
struct path path;
|
||||
int count, pos_in_coming_item;
|
||||
int retval, written;
|
||||
long long int retval, written;
|
||||
struct key key;
|
||||
int file_format = KEY_FORMAT_UNDEFINED;
|
||||
int relocated = 0;
|
||||
|
||||
+6
-4
@@ -211,10 +211,12 @@ void id_map_flush(struct id_map * map, reiserfs_filsys_t * fs) {
|
||||
max = ((fs->fs_blocksize - size) >> 3 << 1);
|
||||
set_sb_oid_maxsize (fs->fs_ondisk_sb, max);
|
||||
|
||||
sb_objectid_map[0] = id = 1;
|
||||
id = 1;
|
||||
sb_objectid_map[0] = cpu_to_le32(1);
|
||||
|
||||
for (i = 1; i < max - 1; i++) {
|
||||
sb_objectid_map[i] = id = id_map_next_bound(map, id);
|
||||
for (i = 1; i < max - 1; i++) {
|
||||
id = id_map_next_bound(map, id);
|
||||
sb_objectid_map[i] = cpu_to_le32(id);
|
||||
if (id == 0) {
|
||||
if (i % 2)
|
||||
die ("%s: Used interval is not closed on flushing.", __FUNCTION__);
|
||||
@@ -256,7 +258,7 @@ void id_map_flush(struct id_map * map, reiserfs_filsys_t * fs) {
|
||||
prev_id++;
|
||||
}
|
||||
|
||||
sb_objectid_map[max - 1] = prev_id + map->last_used * BM_INTERVAL;
|
||||
sb_objectid_map[max - 1] = cpu_to_le32(prev_id + map->last_used * BM_INTERVAL);
|
||||
} else {
|
||||
i--;
|
||||
memset(sb_objectid_map + i, 0, (max - i) * sizeof (__u32));
|
||||
|
||||
+10
-24
@@ -5,23 +5,6 @@
|
||||
|
||||
#include "fsck.h"
|
||||
|
||||
|
||||
/* key1 and key2 are pointer to deh_offset of the struct reiserfs_de_head */
|
||||
int comp_dir_entries (void * key1, void * key2)
|
||||
{
|
||||
__u32 off1, off2;
|
||||
|
||||
off1 = le32_to_cpu (*(__u32 *)key1);
|
||||
off2 = le32_to_cpu (*(__u32 *)key2);
|
||||
|
||||
if (off1 < off2)
|
||||
return -1;
|
||||
if (off1 > off2)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
struct tree_balance * cur_tb = 0;
|
||||
|
||||
void reiserfsck_paste_into_item (struct path * path, const char * body, int size)
|
||||
@@ -54,19 +37,21 @@ static void free_unformatted_nodes (struct item_head * ih, struct buffer_head *
|
||||
__u32 * punfm = (__u32 *)B_I_PITEM (bh, ih);
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < I_UNFM_NUM (ih); i ++, punfm ++)
|
||||
if (*punfm != 0) {
|
||||
for (i = 0; i < I_UNFM_NUM (ih); i ++) {
|
||||
__u32 unfm = d32_get (punfm, i);
|
||||
if (unfm != 0) {
|
||||
struct buffer_head * to_be_forgotten;
|
||||
|
||||
to_be_forgotten = find_buffer (fs->fs_dev, le32_to_cpu (*punfm), fs->fs_blocksize);
|
||||
to_be_forgotten = find_buffer (fs->fs_dev, unfm, fs->fs_blocksize);
|
||||
if (to_be_forgotten) {
|
||||
//atomic_inc(&to_be_forgotten->b_count);
|
||||
to_be_forgotten->b_count ++;
|
||||
bforget (to_be_forgotten);
|
||||
}
|
||||
|
||||
reiserfs_free_block (fs, le32_to_cpu (*punfm));
|
||||
reiserfs_free_block (fs, unfm);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void reiserfsck_delete_item (struct path * path, int temporary)
|
||||
@@ -95,17 +80,18 @@ void reiserfsck_cut_from_item (struct path * path, int cut_size)
|
||||
die ("reiserfsck_cut_from_item: cut size == %d", cut_size);
|
||||
|
||||
if (is_indirect_ih (ih = PATH_PITEM_HEAD (path))) {
|
||||
__u32 unfm_ptr = B_I_POS_UNFM_POINTER (PATH_PLAST_BUFFER (path), ih, I_UNFM_NUM (ih) - 1);
|
||||
struct buffer_head *bh = PATH_PLAST_BUFFER (path);
|
||||
__u32 unfm_ptr = d32_get ((__u32 *)B_I_PITEM(bh, ih), I_UNFM_NUM (ih) - 1);
|
||||
if (unfm_ptr != 0) {
|
||||
struct buffer_head * to_be_forgotten;
|
||||
|
||||
to_be_forgotten = find_buffer (fs->fs_dev, le32_to_cpu (unfm_ptr), fs->fs_blocksize);
|
||||
to_be_forgotten = find_buffer (fs->fs_dev, unfm_ptr, fs->fs_blocksize);
|
||||
if (to_be_forgotten) {
|
||||
//atomic_inc(&to_be_forgotten->b_count);
|
||||
to_be_forgotten->b_count ++;
|
||||
bforget (to_be_forgotten);
|
||||
}
|
||||
reiserfs_free_block (fs, le32_to_cpu (unfm_ptr));
|
||||
reiserfs_free_block (fs, unfm_ptr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+20
-6
@@ -1,7 +1,7 @@
|
||||
# Makefile.in generated by automake 1.7.2 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.7.6 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
|
||||
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
|
||||
# Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
@@ -35,6 +35,7 @@ POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
host_triplet = @host@
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMDEP_FALSE = @AMDEP_FALSE@
|
||||
AMDEP_TRUE = @AMDEP_TRUE@
|
||||
@@ -63,7 +64,11 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAINT = @MAINT@
|
||||
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
|
||||
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
@@ -85,12 +90,21 @@ ac_ct_STRIP = @ac_ct_STRIP@
|
||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
datadir = @datadir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
@@ -107,6 +121,7 @@ sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
noinst_HEADERS = io.h misc.h reiserfs_fs.h reiserfs_lib.h swab.h
|
||||
subdir = include
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
@@ -118,10 +133,10 @@ all: config.h
|
||||
$(MAKE) $(AM_MAKEFLAGS) all-am
|
||||
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu include/Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
|
||||
|
||||
config.h: stamp-h1
|
||||
@@ -134,7 +149,7 @@ stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
|
||||
@rm -f stamp-h1
|
||||
cd $(top_builddir) && $(SHELL) ./config.status include/config.h
|
||||
|
||||
$(srcdir)/config.h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOHEADER)
|
||||
touch $(srcdir)/config.h.in
|
||||
|
||||
@@ -232,7 +247,6 @@ check: check-am
|
||||
all-am: Makefile $(HEADERS) config.h
|
||||
|
||||
installdirs:
|
||||
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
|
||||
@@ -1,11 +1,20 @@
|
||||
/* include/config.h.in. Generated from configure.in by autoheader. */
|
||||
|
||||
/* Define for enable debug info. */
|
||||
#undef ENABLE_DEBUG
|
||||
|
||||
/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
|
||||
#undef HAVE_DOPRNT
|
||||
|
||||
/* Define to 1 if you have the <fcntl.h> header file. */
|
||||
#undef HAVE_FCNTL_H
|
||||
|
||||
/* Define to 1 if you have the `getmntent' function. */
|
||||
#undef HAVE_GETMNTENT
|
||||
|
||||
/* Define to 1 if you have the `hasmntopt' function. */
|
||||
#undef HAVE_HASMNTOPT
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
@@ -21,6 +30,15 @@
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
/* Define to 1 if you have the `memset' function. */
|
||||
#undef HAVE_MEMSET
|
||||
|
||||
/* Define to 1 if you have the `register_printf_function' function. */
|
||||
#undef HAVE_REGISTER_PRINTF_FUNCTION
|
||||
|
||||
/* Define to 1 if you have the `statfs' function. */
|
||||
#undef HAVE_STATFS
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#undef HAVE_STDINT_H
|
||||
|
||||
@@ -61,6 +79,12 @@
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#undef HAVE_SYS_TYPES_H
|
||||
|
||||
/* Define to 1 if you have the `time' function. */
|
||||
#undef HAVE_TIME
|
||||
|
||||
/* Define to 1 if you have the `uname' function. */
|
||||
#undef HAVE_UNAME
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
@@ -73,6 +97,14 @@
|
||||
/* gets set when configure --enable-io-failure-emulation */
|
||||
#undef IO_FAILURE_EMULATION
|
||||
|
||||
/* Define to 1 if `major', `minor', and `makedev' are declared in <mkdev.h>.
|
||||
*/
|
||||
#undef MAJOR_IN_MKDEV
|
||||
|
||||
/* Define to 1 if `major', `minor', and `makedev' are declared in
|
||||
<sysmacros.h>. */
|
||||
#undef MAJOR_IN_SYSMACROS
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
@@ -91,12 +123,24 @@
|
||||
/* Define to the version of this package. */
|
||||
#undef PACKAGE_VERSION
|
||||
|
||||
/* The size of a `blkcnt_t', as computed by sizeof. */
|
||||
#undef SIZEOF_BLKCNT_T
|
||||
|
||||
/* The size of a `off_t', as computed by sizeof. */
|
||||
#undef SIZEOF_OFF_T
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
||||
|
||||
/* Number of bits in a file offset, on hosts where this is settable. */
|
||||
#undef _FILE_OFFSET_BITS
|
||||
|
||||
/* Define for large files, on AIX-style hosts. */
|
||||
#undef _LARGE_FILES
|
||||
|
||||
/* Define to empty if `const' does not conform to ANSI C. */
|
||||
#undef const
|
||||
|
||||
|
||||
@@ -3,6 +3,20 @@
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
#ifndef REISERFSPROGS_IO_H
|
||||
#define REISERFSPROGS_IO_H
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "misc.h"
|
||||
|
||||
struct buffer_head {
|
||||
unsigned long b_blocknr;
|
||||
int b_dev;
|
||||
@@ -66,3 +80,5 @@ void do_fsck_rollback (int fd_device, int fd_journal_device, FILE * log);
|
||||
void flush_buffers (int);
|
||||
void free_buffers (void);
|
||||
void invalidate_buffers (int);
|
||||
|
||||
#endif
|
||||
+31
-41
@@ -5,18 +5,29 @@
|
||||
|
||||
/* nothing abount reiserfs here */
|
||||
|
||||
#ifndef REISERFS_MISC_H
|
||||
#define REISERFS_MISC_H
|
||||
#ifndef REISERFSPROGS_MISC_H
|
||||
#define REISERFSPROGS_MISC_H
|
||||
|
||||
#include <endian.h>
|
||||
#include "swab.h"
|
||||
#include <linux/major.h>
|
||||
#include <signal.h>
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <linux/major.h>
|
||||
|
||||
#if MAJOR_IN_MKDEV
|
||||
# include <sys/mkdev.h>
|
||||
#elif MAJOR_IN_SYSMACROS
|
||||
# include <sys/sysmacros.h>
|
||||
#endif
|
||||
|
||||
#include "swab.h"
|
||||
|
||||
#define POSITION_FOUND 8
|
||||
#define POSITION_NOT_FOUND 9
|
||||
@@ -53,7 +64,7 @@ void misc_print_credit(FILE *out);
|
||||
|
||||
typedef struct dma_info {
|
||||
int fd;
|
||||
struct stat64 stat;
|
||||
struct stat st;
|
||||
int support_type;
|
||||
int dma;
|
||||
__u64 speed;
|
||||
@@ -80,45 +91,21 @@ extern inline unsigned long long misc_find_first_zero_bit (const void *vaddr, un
|
||||
extern inline unsigned long long misc_find_next_zero_bit (const void *vaddr, unsigned long long size, unsigned long long offset);
|
||||
extern inline unsigned long long misc_find_next_set_bit(const void *vaddr, unsigned long long size, unsigned long long offset);
|
||||
extern inline unsigned long long misc_find_first_set_bit (const void *vaddr, unsigned long long size);
|
||||
|
||||
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
||||
|
||||
# define cpu_to_le16(val) (val)
|
||||
# define le16_to_cpu(val) (val)
|
||||
# define cpu_to_le32(val) (val)
|
||||
# define le32_to_cpu(val) (val)
|
||||
# define cpu_to_le64(val) (val)
|
||||
# define le64_to_cpu(val) (val)
|
||||
|
||||
#elif __BYTE_ORDER == __BIG_ENDIAN
|
||||
|
||||
# define cpu_to_le16(val) __swab16(val)
|
||||
# define le16_to_cpu(val) __swab16(val)
|
||||
# define cpu_to_le32(val) __swab32(val)
|
||||
# define le32_to_cpu(val) __swab32(val)
|
||||
# define cpu_to_le64(val) __swab64(val)
|
||||
# define le64_to_cpu(val) __swab64(val)
|
||||
|
||||
#else
|
||||
# error "nuxi/pdp-endian archs are not supported"
|
||||
#endif
|
||||
|
||||
#define STAT_FIELD_H(Field, Type) \
|
||||
inline Type misc_device_##Field(char *device);
|
||||
|
||||
STAT_FIELD_H(mode, mode_t);
|
||||
STAT_FIELD_H(rdev, dev_t);
|
||||
STAT_FIELD_H(size, off64_t);
|
||||
STAT_FIELD_H(blocks, blkcnt64_t);
|
||||
STAT_FIELD_H(size, off_t);
|
||||
STAT_FIELD_H(blocks, blkcnt_t);
|
||||
|
||||
/* these are to access bitfield in endian safe manner */
|
||||
__u16 mask16 (int from, int count);
|
||||
__u32 mask32 (int from, int count);
|
||||
__u64 mask64 (int from, int count);
|
||||
|
||||
|
||||
int reiserfs_bin_search (void * key, void * base, __u32 num, int width,
|
||||
__u32 *ppos, comparison_fn_t comp_func);
|
||||
__u32 *ppos, __compar_fn_t comp_func);
|
||||
|
||||
struct block_handler {
|
||||
__u32 blocknr;
|
||||
@@ -168,10 +155,12 @@ int blockdev_list_compare (const void * block1, const void * block2);
|
||||
return tmp;
|
||||
|
||||
|
||||
#ifndef MAJOR
|
||||
#define MAJOR(rdev) ((rdev)>>8)
|
||||
#define MINOR(rdev) ((rdev) & 0xff)
|
||||
#endif /* MAJOR */
|
||||
#ifndef major
|
||||
#define major(rdev) ((rdev)>>8)
|
||||
#define minor(rdev) ((rdev) & 0xff)
|
||||
#endif /* major */
|
||||
|
||||
|
||||
|
||||
#ifndef SCSI_DISK_MAJOR
|
||||
#define SCSI_DISK_MAJOR(maj) ((maj) == SCSI_DISK0_MAJOR || \
|
||||
@@ -196,4 +185,5 @@ int blockdev_list_compare (const void * block1, const void * block2);
|
||||
#endif /* IDE9_MAJOR */
|
||||
#endif /* IDE_DISK_MAJOR */
|
||||
|
||||
|
||||
#endif /* REISERFS_MISC_H */
|
||||
+16
-7
@@ -29,12 +29,17 @@
|
||||
|
||||
*/
|
||||
|
||||
#ifndef REISERFSPROGS_FS_H
|
||||
#define REISERFSPRIGS_FS_H
|
||||
|
||||
#ifndef NO_EXTERN_INLINE
|
||||
# define extern_inline extern inline
|
||||
#else
|
||||
# define extern_inline
|
||||
#endif
|
||||
|
||||
#include <asm/unaligned.h>
|
||||
|
||||
#define get_leXX(xx,p,field) (le##xx##_to_cpu ((p)->field))
|
||||
#define set_leXX(xx,p,field,val) do { (p)->field = cpu_to_le##xx(val); } while (0)
|
||||
|
||||
@@ -1420,6 +1425,16 @@ struct buffer_info {
|
||||
( get_offset(&(p_s_ih)->ih_key) <= (n_offset) && \
|
||||
get_offset(&(p_s_ih)->ih_key) + get_bytes_number(p_s_ih,n_blocksize) > (n_offset) )
|
||||
|
||||
/* these operate on indirect items, where you've got an array of ints
|
||||
** at a possibly unaligned location. These are a noop on ia32
|
||||
**
|
||||
** p is the array of __u32, i is the index into the array, v is the value
|
||||
** to store there.
|
||||
*/
|
||||
#define d32_get(p, i) le32_to_cpu(get_unaligned((p) + (i)))
|
||||
#define d32_put(p, i, v) put_unaligned(cpu_to_le32(v), (p) + (i))
|
||||
|
||||
|
||||
/* get the item header */
|
||||
#define B_N_PITEM_HEAD(bh,item_num) ( (struct item_head * )((bh)->b_data + BLKH_SIZE) + (item_num) )
|
||||
|
||||
@@ -1446,13 +1461,6 @@ struct buffer_info {
|
||||
#define MAX_DIRECT_ITEM_LEN(size) ((size) - BLKH_SIZE - 2*IH_SIZE - SD_SIZE - UNFM_P_SIZE)
|
||||
#define MAX_INDIRECT_ITEM_LEN(size) MAX_ITEM_LEN(size)
|
||||
|
||||
/* indirect items consist of entries which contain blocknrs, pos
|
||||
indicates which entry, and B_I_POS_UNFM_POINTER resolves to the
|
||||
blocknr contained by the entry pos points to */
|
||||
#define B_I_POS_UNFM_POINTER(bh,ih,pos) (*(((__u32 *)B_I_PITEM(bh,ih)) + (pos)))
|
||||
|
||||
|
||||
|
||||
/***************************************************************************/
|
||||
/* FUNCTION DECLARATIONS */
|
||||
/***************************************************************************/
|
||||
@@ -1560,6 +1568,7 @@ extern unsigned int get_journal_new_start_must (reiserfs_filsys_t * fs);
|
||||
extern unsigned int get_journal_start_must (reiserfs_filsys_t * fs);
|
||||
/*extern hashf_t hashes [];*/
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
|
||||
@@ -3,9 +3,8 @@
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
#ifndef REISERFS_LIB_H
|
||||
#define REISERFS_LIB_H
|
||||
|
||||
#ifndef REISERFSPROGS_LIB_H
|
||||
#define REISERFSPROGS_LIB_H
|
||||
|
||||
#define BADBLOCK_DIRID 1
|
||||
#define BADBLOCK_OBJID (__u32)-1
|
||||
@@ -118,9 +117,6 @@ int reiserfs_find_entry (reiserfs_filsys_t *, struct key * dir, char * name,
|
||||
int reiserfs_add_entry (reiserfs_filsys_t *, struct key * dir, char * name, int name_len,
|
||||
struct key * key, __u16 fsck_need);
|
||||
|
||||
|
||||
/*int reiserfs_bin_search (void * key, void * base, int num, int width,
|
||||
int *ppos, comparison_fn_t comp_func);*/
|
||||
struct key * uget_lkey (struct path * path);
|
||||
struct key * uget_rkey (struct path * path);
|
||||
int reiserfs_search_by_key_3 (reiserfs_filsys_t *, struct key * key,
|
||||
@@ -407,6 +403,4 @@ int can_we_format_it (char * device_name, int force);
|
||||
}\
|
||||
|
||||
|
||||
#endif /* REISERFS_LIB_H */
|
||||
|
||||
|
||||
#endif /* REISERFSPROGS_LIB_H */
|
||||
+54
-11
@@ -3,22 +3,65 @@
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
#ifndef _REISERFS_SWAB_H_
|
||||
#define _REISERFS_SWAB_H_
|
||||
#ifndef REISERFSPROGS_SWAB_H
|
||||
#define REISERFSPROGS_SWAB_H
|
||||
|
||||
#include <endian.h>
|
||||
#include <asm/types.h>
|
||||
|
||||
#if __BYTE_ORDER == __BIG_ENDIAN
|
||||
#define __swab16(x) \
|
||||
({ \
|
||||
__u16 __x = (x); \
|
||||
((__u16)( \
|
||||
(((__u16)(__x) & (__u16)0x00ffU) << 8) | \
|
||||
(((__u16)(__x) & (__u16)0xff00U) >> 8) )); \
|
||||
})
|
||||
|
||||
#define extern static
|
||||
#define __BYTEORDER_HAS_U64__
|
||||
#include <linux/byteorder/swab.h>
|
||||
#undef extern
|
||||
#define __swab32(x) \
|
||||
({ \
|
||||
__u32 __x = (x); \
|
||||
((__u32)( \
|
||||
(((__u32)(__x) & (__u32)0x000000ffUL) << 24) | \
|
||||
(((__u32)(__x) & (__u32)0x0000ff00UL) << 8) | \
|
||||
(((__u32)(__x) & (__u32)0x00ff0000UL) >> 8) | \
|
||||
(((__u32)(__x) & (__u32)0xff000000UL) >> 24) )); \
|
||||
})
|
||||
|
||||
#define __swab64(x) \
|
||||
({ \
|
||||
__u64 __x = (x); \
|
||||
((__u64)( \
|
||||
(__u64)(((__u64)(__x) & (__u64)0x00000000000000ffULL) << 56) | \
|
||||
(__u64)(((__u64)(__x) & (__u64)0x000000000000ff00ULL) << 40) | \
|
||||
(__u64)(((__u64)(__x) & (__u64)0x0000000000ff0000ULL) << 24) | \
|
||||
(__u64)(((__u64)(__x) & (__u64)0x00000000ff000000ULL) << 8) | \
|
||||
(__u64)(((__u64)(__x) & (__u64)0x000000ff00000000ULL) >> 8) | \
|
||||
(__u64)(((__u64)(__x) & (__u64)0x0000ff0000000000ULL) >> 24) | \
|
||||
(__u64)(((__u64)(__x) & (__u64)0x00ff000000000000ULL) >> 40) | \
|
||||
(__u64)(((__u64)(__x) & (__u64)0xff00000000000000ULL) >> 56) )); \
|
||||
})
|
||||
|
||||
|
||||
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
||||
|
||||
# define cpu_to_le16(val) (val)
|
||||
# define le16_to_cpu(val) (val)
|
||||
# define cpu_to_le32(val) (val)
|
||||
# define le32_to_cpu(val) (val)
|
||||
# define cpu_to_le64(val) (val)
|
||||
# define le64_to_cpu(val) (val)
|
||||
|
||||
#elif __BYTE_ORDER == __BIG_ENDIAN
|
||||
|
||||
# define cpu_to_le16(val) __swab16(val)
|
||||
# define le16_to_cpu(val) __swab16(val)
|
||||
# define cpu_to_le32(val) __swab32(val)
|
||||
# define le32_to_cpu(val) __swab32(val)
|
||||
# define cpu_to_le64(val) __swab64(val)
|
||||
# define le64_to_cpu(val) __swab64(val)
|
||||
|
||||
#else
|
||||
|
||||
#include <linux/byteorder/swab.h>
|
||||
|
||||
# error "nuxi/pdp-endian archs are not supported"
|
||||
#endif
|
||||
|
||||
#endif /* _REISERFS_SWAB_H_ */
|
||||
#endif /* REISERFS_SWAB_H */
|
||||
+21
-7
@@ -1,7 +1,7 @@
|
||||
# Makefile.in generated by automake 1.7.2 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.7.6 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
|
||||
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
|
||||
# Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
@@ -35,6 +35,7 @@ POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
host_triplet = @host@
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMDEP_FALSE = @AMDEP_FALSE@
|
||||
AMDEP_TRUE = @AMDEP_TRUE@
|
||||
@@ -63,7 +64,11 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAINT = @MAINT@
|
||||
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
|
||||
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
@@ -85,12 +90,21 @@ ac_ct_STRIP = @ac_ct_STRIP@
|
||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
datadir = @datadir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
@@ -109,6 +123,7 @@ noinst_LIBRARIES = libmisc.a
|
||||
|
||||
libmisc_a_SOURCES = io.c misc.c
|
||||
subdir = lib
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = $(top_builddir)/include/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
@@ -135,10 +150,10 @@ all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .o .obj
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu lib/Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
|
||||
|
||||
AR = ar
|
||||
@@ -165,7 +180,7 @@ distclean-depend:
|
||||
.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@ then mv -f "$(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@
|
||||
@@ -176,7 +191,7 @@ distclean-depend:
|
||||
.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@ then mv -f "$(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@
|
||||
@@ -275,7 +290,6 @@ check: check-am
|
||||
all-am: Makefile $(LIBRARIES)
|
||||
|
||||
installdirs:
|
||||
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
|
||||
@@ -3,24 +3,12 @@
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
#define _FILE_OFFSET_BITS 64
|
||||
#define _GNU_SOURCE
|
||||
#include "io.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <asm/types.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
|
||||
#include "io.h"
|
||||
#include "misc.h"
|
||||
#include "config.h"
|
||||
|
||||
void check_memory_msg (void) {
|
||||
fprintf(stderr,
|
||||
"\nThe problem has occurred looks like a hardware problem (perhaps\n"
|
||||
@@ -485,7 +473,7 @@ static int f_read(struct buffer_head * bh)
|
||||
buffer_reads++ ;
|
||||
|
||||
offset = (unsigned long long)bh->b_size * bh->b_blocknr;
|
||||
if (lseek64 (bh->b_dev, offset, SEEK_SET) < 0)
|
||||
if (lseek (bh->b_dev, offset, SEEK_SET) < 0)
|
||||
return -1;
|
||||
|
||||
bytes = read (bh->b_dev, bh->b_data, bh->b_size);
|
||||
@@ -545,12 +533,12 @@ static int rollback_blocksize;
|
||||
|
||||
void init_rollback_file (char * rollback_file, int *blocksize, FILE * log) {
|
||||
char * string;
|
||||
struct stat64 buf;
|
||||
struct stat buf;
|
||||
|
||||
if (rollback_file == NULL)
|
||||
return;
|
||||
|
||||
stat64(rollback_file, &buf);
|
||||
stat(rollback_file, &buf);
|
||||
|
||||
s_rollback_file = fopen (rollback_file, "w+");
|
||||
if (s_rollback_file == NULL) {
|
||||
@@ -589,12 +577,12 @@ static void erase_rollback_file (char * rollback_file) {
|
||||
|
||||
int open_rollback_file (char * rollback_file, FILE * log) {
|
||||
char string [28];
|
||||
struct stat64 buf;
|
||||
struct stat buf;
|
||||
|
||||
if (rollback_file == NULL)
|
||||
return -1;
|
||||
|
||||
if (stat64(rollback_file, &buf)) {
|
||||
if (stat(rollback_file, &buf)) {
|
||||
fprintf (stderr, "Cannot stat rollback file (%s)\n", rollback_file);
|
||||
return -1;
|
||||
}
|
||||
@@ -656,17 +644,17 @@ void close_rollback_file () {
|
||||
}
|
||||
|
||||
void do_fsck_rollback (int fd_device, int fd_journal_device, FILE * progress) {
|
||||
loff_t offset;
|
||||
long long int offset;
|
||||
|
||||
struct stat64 buf;
|
||||
struct stat buf;
|
||||
int descriptor;
|
||||
ssize_t retval;
|
||||
int count_failed = 0;
|
||||
int count_rollbacked = 0;
|
||||
|
||||
dev_t b_dev;
|
||||
dev_t n_dev = 0;
|
||||
dev_t n_journal_dev = 0;
|
||||
int b_dev;
|
||||
int n_dev = 0;
|
||||
int n_journal_dev = 0;
|
||||
unsigned long total, done = 0;
|
||||
|
||||
if (fd_device == 0) {
|
||||
@@ -675,14 +663,14 @@ void do_fsck_rollback (int fd_device, int fd_journal_device, FILE * progress) {
|
||||
}
|
||||
|
||||
if (fd_journal_device) {
|
||||
if (!fstat64 (fd_journal_device, &buf)) {
|
||||
if (!fstat (fd_journal_device, &buf)) {
|
||||
n_journal_dev = buf.st_rdev;
|
||||
} else {
|
||||
fprintf(stderr, "rollback: specified journal device cannot be stated\n");
|
||||
}
|
||||
}
|
||||
|
||||
if (!fstat64 (fd_device, &buf)) {
|
||||
if (!fstat (fd_device, &buf)) {
|
||||
n_dev = buf.st_rdev;
|
||||
} else {
|
||||
fprintf(stderr, "rollback: specified device cannot be stated, exit\n");
|
||||
@@ -731,7 +719,7 @@ void do_fsck_rollback (int fd_device, int fd_journal_device, FILE * progress) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (lseek64 (descriptor, offset, SEEK_SET) == (loff_t)-1) {
|
||||
if (lseek (descriptor, offset, SEEK_SET) == (loff_t)-1) {
|
||||
fprintf(stderr, "device cannot be lseeked, skip block\n");
|
||||
count_failed ++;
|
||||
continue;
|
||||
@@ -739,7 +727,7 @@ void do_fsck_rollback (int fd_device, int fd_journal_device, FILE * progress) {
|
||||
|
||||
if (write (descriptor, rollback_data, rollback_blocksize) == -1) {
|
||||
fprintf (stderr, "rollback: write %d bytes returned error "
|
||||
"(block=%lld, dev=%lld): %s\n", rollback_blocksize,
|
||||
"(block=%lld, dev=%d): %s\n", rollback_blocksize,
|
||||
offset/rollback_blocksize, b_dev, strerror (errno));
|
||||
count_failed ++;
|
||||
} else {
|
||||
@@ -802,19 +790,19 @@ int bwrite (struct buffer_head * bh)
|
||||
size = bh->b_size;
|
||||
offset = (loff_t)size * (loff_t)bh->b_blocknr;
|
||||
|
||||
if (lseek64 (bh->b_dev, offset, SEEK_SET) == (loff_t)-1){
|
||||
if (lseek (bh->b_dev, offset, SEEK_SET) == (loff_t)-1){
|
||||
fprintf (stderr, "bwrite: lseek to position %llu (block=%lu, dev=%d): %s\n",
|
||||
offset, bh->b_blocknr, bh->b_dev, strerror(errno));
|
||||
exit(8); /* File system errors left uncorrected */
|
||||
}
|
||||
|
||||
if (s_rollback_file != NULL && bh->b_size == (unsigned long)rollback_blocksize) {
|
||||
struct stat64 buf;
|
||||
struct stat buf;
|
||||
__u32 position;
|
||||
struct block_handler block_h;
|
||||
|
||||
/*log previous content into the log*/
|
||||
if (!fstat64 (bh->b_dev, &buf)) {
|
||||
if (!fstat (bh->b_dev, &buf)) {
|
||||
block_h.blocknr = bh->b_blocknr;
|
||||
block_h.device = buf.st_rdev;
|
||||
if (reiserfs_bin_search(&block_h, rollback_blocks_array,
|
||||
@@ -844,7 +832,7 @@ int bwrite (struct buffer_head * bh)
|
||||
exit(8);
|
||||
}
|
||||
|
||||
if (lseek64 (bh->b_dev, offset, SEEK_SET) == (loff_t)-1) {
|
||||
if (lseek (bh->b_dev, offset, SEEK_SET) == (loff_t)-1) {
|
||||
fprintf (stderr, "bwrite: lseek to position %llu (block=%lu, "
|
||||
"dev=%d): %s\n", offset, bh->b_blocknr, bh->b_dev,
|
||||
strerror(errno));
|
||||
|
||||
+73
-47
@@ -3,17 +3,14 @@
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
/* for stat64() */
|
||||
#define _FILE_OFFSET_BITS 64
|
||||
|
||||
/* for getline() proto and _LARGEFILE64_SOURCE */
|
||||
#define _GNU_SOURCE
|
||||
|
||||
#include "misc.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <asm/types.h>
|
||||
#include <stdlib.h>
|
||||
#include <mntent.h>
|
||||
#include <sys/vfs.h>
|
||||
#include <time.h>
|
||||
@@ -23,7 +20,9 @@
|
||||
#include <dirent.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "misc.h"
|
||||
#include <sys/ioctl.h>
|
||||
#include <signal.h>
|
||||
|
||||
|
||||
/* Debian modifications by Ed Boraas <ed@debian.org> */
|
||||
#include <sys/mount.h>
|
||||
@@ -42,8 +41,8 @@ inline Type misc_device_##Field(char *device) { \
|
||||
|
||||
STAT_FIELD(mode, mode_t);
|
||||
STAT_FIELD(rdev, dev_t);
|
||||
STAT_FIELD(size, off64_t);
|
||||
STAT_FIELD(blocks, blkcnt64_t);
|
||||
STAT_FIELD(size, off_t);
|
||||
STAT_FIELD(blocks, blkcnt_t);
|
||||
|
||||
void die (char * fmt, ...)
|
||||
{
|
||||
@@ -185,19 +184,21 @@ typedef int (*func_t) (char *);
|
||||
not correct. */
|
||||
static struct mntent *misc_mntent_lookup(char *mntfile,
|
||||
char *file,
|
||||
int fsname)
|
||||
int path)
|
||||
{
|
||||
struct mntent *mnt;
|
||||
int name_match = 0;
|
||||
struct stat st;
|
||||
dev_t rdev = 0;
|
||||
dev_t dev = 0;
|
||||
ino_t ino = 0;
|
||||
char *name;
|
||||
FILE *fp;
|
||||
|
||||
|
||||
assert(mntfile != NULL);
|
||||
assert(file != NULL);
|
||||
|
||||
if (fsname && stat(file, &st) == 0) {
|
||||
if (stat(file, &st) == 0) {
|
||||
/* Devices is stated. */
|
||||
if (S_ISBLK(st.st_mode)) {
|
||||
rdev = st.st_rdev;
|
||||
@@ -212,26 +213,44 @@ static struct mntent *misc_mntent_lookup(char *mntfile,
|
||||
|
||||
while ((mnt = getmntent(fp)) != NULL) {
|
||||
/* Check if names match. */
|
||||
if (fsname) {
|
||||
if (strcmp(file, mnt->mnt_fsname) == 0)
|
||||
break;
|
||||
} else {
|
||||
if (strcmp(file, mnt->mnt_dir) == 0)
|
||||
break;
|
||||
name = path ? mnt->mnt_dir : mnt->mnt_fsname;
|
||||
|
||||
if (strcmp(file, name) == 0)
|
||||
name_match = 1;
|
||||
|
||||
if (stat(name, &st))
|
||||
continue;
|
||||
|
||||
/* If names do not match, check if stats match. */
|
||||
if (!name_match) {
|
||||
if (rdev && S_ISBLK(st.st_mode)) {
|
||||
if (rdev != st.st_rdev)
|
||||
continue;
|
||||
} else if (dev && !S_ISBLK(st.st_mode)) {
|
||||
if (dev != st.st_dev ||
|
||||
ino != st.st_ino)
|
||||
continue;
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
/* Check if stats match. */
|
||||
if (stat(mnt->mnt_fsname, &st) == 0) {
|
||||
if (rdev && S_ISBLK(st.st_mode)) {
|
||||
if (rdev == st.st_rdev)
|
||||
break;
|
||||
} else {
|
||||
if (dev == st.st_dev &&
|
||||
ino == st.st_ino)
|
||||
break;
|
||||
}
|
||||
/* If not path and not block device do not check anything more. */
|
||||
if (!path && !rdev)
|
||||
break;
|
||||
|
||||
if (path) {
|
||||
/* Either names or stats match. Make sure the st_dev of
|
||||
the path is same as @mnt_fsname device rdev. */
|
||||
if (stat(mnt->mnt_fsname, &st) == 0 &&
|
||||
dev == st.st_rdev)
|
||||
break;
|
||||
} else {
|
||||
/* Either names or stats match. Make sure the st_dev of
|
||||
the mount entry is same as the given device rdev. */
|
||||
if (stat(mnt->mnt_dir, &st) == 0 &&
|
||||
rdev == st.st_dev)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -288,10 +307,10 @@ struct mntent *misc_mntent(char *device) {
|
||||
case as root entry can present as:
|
||||
rootfs / rootfs rw 0 0
|
||||
Look up the mount point in this case. */
|
||||
mnt = misc_mntent_lookup("/proc/mounts", "/", 0);
|
||||
mnt = misc_mntent_lookup("/proc/mounts", "/", 1);
|
||||
} else {
|
||||
/* Lookup the @device /proc/mounts */
|
||||
mnt = misc_mntent_lookup("/proc/mounts", device, 1);
|
||||
mnt = misc_mntent_lookup("/proc/mounts", device, 0);
|
||||
}
|
||||
|
||||
if (mnt == INVAL_PTR)
|
||||
@@ -311,9 +330,9 @@ struct mntent *misc_mntent(char *device) {
|
||||
path = 1;
|
||||
|
||||
if (root) {
|
||||
mnt = misc_mntent_lookup(MOUNTED, "/", 0);
|
||||
mnt = misc_mntent_lookup(MOUNTED, "/", 1);
|
||||
} else {
|
||||
mnt = misc_mntent_lookup(MOUNTED, device, 1);
|
||||
mnt = misc_mntent_lookup(MOUNTED, device, 0);
|
||||
}
|
||||
|
||||
if (mnt == INVAL_PTR)
|
||||
@@ -455,7 +474,7 @@ int valid_offset( int fd, loff_t offset) {
|
||||
loff_t res;
|
||||
|
||||
/*res = reiserfs_llseek (fd, offset, 0);*/
|
||||
res = lseek64 (fd, offset, SEEK_SET);
|
||||
res = lseek (fd, offset, SEEK_SET);
|
||||
if (res < 0)
|
||||
return 0;
|
||||
|
||||
@@ -657,16 +676,16 @@ void blocklist__insert_in_position (void *elem, void **base, __u32 *count,
|
||||
/* 1 - xt drive */
|
||||
/* 2 - ide drive */
|
||||
static void get_dma_support(dma_info_t *dma_info){
|
||||
if (S_ISREG(dma_info->stat.st_mode))
|
||||
dma_info->stat.st_rdev = dma_info->stat.st_dev;
|
||||
if (S_ISREG(dma_info->st.st_mode))
|
||||
dma_info->st.st_rdev = dma_info->st.st_dev;
|
||||
|
||||
if (IDE_DISK_MAJOR(MAJOR(dma_info->stat.st_rdev))) {
|
||||
if (IDE_DISK_MAJOR(major(dma_info->st.st_rdev))) {
|
||||
dma_info->support_type = 2;
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef XT_DISK_MAJOR
|
||||
if (MAJOR(dma_info->stat.st_rdev) == XT_DISK_MAJOR) {
|
||||
if (major(dma_info->st.st_rdev) == XT_DISK_MAJOR) {
|
||||
dma_info->support_type = 1;
|
||||
return;
|
||||
}
|
||||
@@ -680,10 +699,11 @@ static void get_dma_support(dma_info_t *dma_info){
|
||||
* 1 - preparation cannot be done
|
||||
* -1 - preparation failed
|
||||
*/
|
||||
|
||||
int prepare_dma_check(dma_info_t *dma_info) {
|
||||
DIR *dir;
|
||||
struct dirent *dirent;
|
||||
struct stat64 stat;
|
||||
struct stat st;
|
||||
dev_t rdev;
|
||||
int rem;
|
||||
char buf[256];
|
||||
@@ -692,8 +712,8 @@ int prepare_dma_check(dma_info_t *dma_info) {
|
||||
return -1;
|
||||
#endif
|
||||
|
||||
if (fstat64(dma_info->fd, &dma_info->stat))
|
||||
die("stat64 on device failed\n");
|
||||
if (fstat(dma_info->fd, &dma_info->st))
|
||||
die("stat on device failed\n");
|
||||
|
||||
get_dma_support(dma_info);
|
||||
|
||||
@@ -702,9 +722,9 @@ int prepare_dma_check(dma_info_t *dma_info) {
|
||||
return 1;
|
||||
|
||||
if (dma_info->support_type == 2) {
|
||||
rdev = dma_info->stat.st_rdev;
|
||||
rdev = dma_info->st.st_rdev;
|
||||
|
||||
if ((rem = (MINOR(rdev) % 64)) != 0) {
|
||||
if ((rem = (minor(rdev) % 64)) != 0) {
|
||||
rdev -= rem;
|
||||
if(!(dir = opendir("/dev/"))) {
|
||||
dma_info->support_type = 1;
|
||||
@@ -717,12 +737,18 @@ int prepare_dma_check(dma_info_t *dma_info) {
|
||||
memset(buf, 0, 256);
|
||||
strncat(buf, "/dev/", 5);
|
||||
strncat(buf, dirent->d_name, strlen(dirent->d_name));
|
||||
if (stat64(buf, &stat))
|
||||
break;
|
||||
if (S_ISBLK(stat.st_mode) && stat.st_rdev == rdev)
|
||||
|
||||
if (stat(buf, &st))
|
||||
break;
|
||||
|
||||
if (S_ISBLK(st.st_mode) && st.st_rdev == rdev)
|
||||
{
|
||||
dma_info->stat = stat;
|
||||
dma_info->fd = open(buf, O_RDONLY | O_LARGEFILE);
|
||||
dma_info->st = st;
|
||||
dma_info->fd = open(buf, O_RDONLY
|
||||
#if defined(O_LARGEFILE)
|
||||
| O_LARGEFILE
|
||||
#endif
|
||||
);
|
||||
closedir(dir);
|
||||
return 0;
|
||||
}
|
||||
|
||||
+21
-7
@@ -1,7 +1,7 @@
|
||||
# Makefile.in generated by automake 1.7.2 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.7.6 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
|
||||
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
|
||||
# Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
@@ -35,6 +35,7 @@ POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
host_triplet = @host@
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMDEP_FALSE = @AMDEP_FALSE@
|
||||
AMDEP_TRUE = @AMDEP_TRUE@
|
||||
@@ -63,7 +64,11 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAINT = @MAINT@
|
||||
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
|
||||
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
@@ -85,12 +90,21 @@ ac_ct_STRIP = @ac_ct_STRIP@
|
||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
datadir = @datadir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
@@ -113,6 +127,7 @@ EXTRA_DIST = $(man_MANS)
|
||||
|
||||
LDADD = $(top_srcdir)/lib/libmisc.a $(top_srcdir)/reiserfscore/libcore.a
|
||||
subdir = mkreiserfs
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = $(top_builddir)/include/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
@@ -145,10 +160,10 @@ all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .o .obj
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu mkreiserfs/Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
Makefile: @MAINTAINER_MODE_TRUE@ $(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)
|
||||
@@ -192,7 +207,7 @@ distclean-depend:
|
||||
.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@ then mv -f "$(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@
|
||||
@@ -203,7 +218,7 @@ distclean-depend:
|
||||
.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@ then mv -f "$(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@
|
||||
@@ -350,7 +365,6 @@ all-am: Makefile $(PROGRAMS) $(MANS)
|
||||
|
||||
installdirs:
|
||||
$(mkinstalldirs) $(DESTDIR)$(sbindir) $(DESTDIR)$(man8dir)
|
||||
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
|
||||
+49
-48
@@ -1,9 +1,9 @@
|
||||
.\" -*- nroff -*-
|
||||
.\" Copyright 1996-2004 Hans Reiser.
|
||||
.\"
|
||||
.TH MKREISERFS 8 "February 2004" "Reiserfsprogs-3.6.13"
|
||||
.TH MKREISERFS 8 "February 2004" "Reiserfsprogs-3.6.18"
|
||||
.SH NAME
|
||||
mkreiserfs \- create tool for the Linux ReiserFS file system
|
||||
mkreiserfs \- The create tool for the Linux ReiserFS filesystem.
|
||||
.SH SYNOPSIS
|
||||
.B mkreiserfs
|
||||
[ \fB-dfV\fR ]
|
||||
@@ -20,94 +20,95 @@ mkreiserfs \- create tool for the Linux ReiserFS file system
|
||||
[ \fB-B\fR | \fB--badblocks\fR \fIfile\fR ] \fI device\fR
|
||||
[ \fIfilesystem-size\fR ]
|
||||
.SH DESCRIPTION
|
||||
It creates a Linux ReiserFS file system on a device
|
||||
(usually a disk partition).
|
||||
\fBmkreiserfs\fR creates a Linux ReiserFS filesystem on a device (usually a disk
|
||||
partition).
|
||||
.TP
|
||||
.I device
|
||||
is the special file corresponding to the device (e.g /dev/hdXX for
|
||||
IDE disk partition or /dev/sdXX for SCSI disk partition).
|
||||
is the special file corresponding to a device or to a partition (e.g
|
||||
/dev/hdXX for an IDE disk partition or /dev/sdXX for a SCSI disk partition).
|
||||
.TP
|
||||
.I filesystem-size
|
||||
size of filesystem in blocks. If omitted, it will be
|
||||
determined by
|
||||
.B mkreiserfs
|
||||
automatically.
|
||||
is the size in blocks of the filesystem. If omitted, \fBmkreiserfs\fR will
|
||||
automatically set it.
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
\fB-b\fR | \fB--block-size \fIN\fR
|
||||
\fIN\fR is block size in bytes. 4096 only for now.
|
||||
\fIN\fR is block size in bytes. It may only be set to a power of 2 within the
|
||||
512-8192 interval.
|
||||
.TP
|
||||
\fB-h\fR | \fB--hash \fIHASH\fR
|
||||
\fIHASH\fR specifies the name of hash function file names in directories
|
||||
will be sorted with. Choose one of r5, rupasov, tea. r5 is default
|
||||
\fIHASH\fR specifies which hash function will sort the names in the directories.
|
||||
Choose from r5, rupasov, or tea. r5 is the default one.
|
||||
.TP
|
||||
\fB--format \fIFORMAT\fR
|
||||
\fIFORMAT\fR specifies a format new filsystem has to be of. Choose one
|
||||
of 3.5 and 3.6. If none is specified \fBmkreiserfs\fR will create format 3.6
|
||||
if running kernel is 2.4, 3.5 if 2.2 is running, and will refuse
|
||||
creation under other kernels.
|
||||
\fIFORMAT\fR specifies the format for the new filsystem. Choose format 3.5 or
|
||||
3.6. If none is specified \fBmkreiserfs\fR will create format 3.6 if running
|
||||
kernel is 2.4 or higher, and format 3.5 if kernel 2.2 is running, and will
|
||||
refuse creation under all other kernels.
|
||||
.TP
|
||||
\fB-u\fR | \fB--uuid \fIUUID\fR
|
||||
Set the universally unique identifier (\fB UUID \fR) of the filesystem to
|
||||
\fIUUID\fR (see also \fBuuidgen(8)\fR). The format of the UUID is a
|
||||
series of hex digits separated by hypthens, like this:
|
||||
"c1b9d5a2-f162-11cf-9ece-0020afc76f16". If the option skipped,
|
||||
\fBmkreiserfs\fR generates a new one.
|
||||
Sets the Universally Unique IDentifier of the filesystem to \fIUUID\fR
|
||||
(see also \fBuuidgen(8)\fR). The format of the \fIUUID\fR is a series
|
||||
of hex digits separated by hypthens, e.g.: "c1b9d5a2-f162-11cf-9ece-0020afc76f16".
|
||||
If the option is skipped, \fBmkreiserfs\fR will by default generate a new
|
||||
\fIUUID\fR.
|
||||
.TP
|
||||
\fB-l\fR | \fB--label \fILABEL\fR
|
||||
Set the volume label of the filesystem. \fILABEL\fR can be at most 16
|
||||
characters long; if it is longer than 16 characters, \fBmkreiserfs\fR will truncate it.
|
||||
Sets the volume label of the filesystem. \fILABEL\fR can at most be 16
|
||||
characters long; if it is longer than 16 characters, \fBmkreiserfs\fR will
|
||||
truncate it.
|
||||
.TP
|
||||
\fB-q\fR | \fB--quiet \fR
|
||||
Make \fBmkreiserfs\fR to work quiet without producing any message, progress and question.
|
||||
It is useful if you run \fBmkreiserfs\fR in a script. For use by end users only.
|
||||
Sets \fBmkreiserfs\fR to work quietly without producing messages, progress or
|
||||
questions. It is useful, but only for use by end users, if you run \fBmkreiserfs\fR
|
||||
in a script.
|
||||
.TP
|
||||
\fB-j\fR | \fB--journal-device \fIFILE\fR
|
||||
\fIFILE\fR is name of block device where the file system is to have
|
||||
journal on.
|
||||
\fIFILE\fR is the name of the block device on which is to be places the
|
||||
filesystem journal.
|
||||
.TP
|
||||
\fB-o\fR | \fB--journal-offset \fIN\fR
|
||||
\fIN\fR is an offset where journal starts when it is to be on a
|
||||
separate device. Default is 0. Makes no effect when journal is to be
|
||||
on a host device
|
||||
\fIN\fR is the offset where the journal starts when it is to be on a separate
|
||||
device. Default is 0. \fIN\fR has no effect when the journal is to be on the
|
||||
host device.
|
||||
.TP
|
||||
\fB-s\fR | \fB--journal-size \fIN
|
||||
\fIN\fR is size of journal in blocks. When journal is to be on a
|
||||
separate device - its size defaults to number of blocks that device
|
||||
has. When journal is to be on a host device - its size defaults 8193
|
||||
and maximal possible value is 32749 (for blocksize 4k). Minimun is 513
|
||||
for both cases.
|
||||
\fIN\fR is the size of the journal in blocks. When the journal is to be on a
|
||||
separate device, its size defaults to the number of blocks that the device has.
|
||||
When journal is to be on the host device, its size defaults to 8193 and the
|
||||
maximal possible size is 32749 (for blocksize 4k). The minimum size is 513 blocks
|
||||
(whether the journal is on the host or on a separate device).
|
||||
.TP
|
||||
\fB-t\fR | \fB--transaction-max-size \fIN
|
||||
\fIN\fR is the maximum transaction size parameter for the journal. The
|
||||
default, and max possible, value is 1024 blocks. It should be less
|
||||
than half the size of the journal. If specifed incorrectly, it will be
|
||||
adjusted.
|
||||
than half the size of the journal. If specified incorrectly, it will automatically
|
||||
be adjusted.
|
||||
.TP
|
||||
\fB-B\fR | \fB--badblocks \fIfile
|
||||
\fIFile\fR is the file name of the file that contains the list of blocks
|
||||
to be marked as bad on the filesystem. This list can be created by
|
||||
\fIFile\fR is the file name of the file that contains the list of blocks to be
|
||||
marked as bad on the filesystem. This list can be created by
|
||||
\fB/sbin/badblocks -b block-size device\fR.
|
||||
.TP
|
||||
\fB-f\fR
|
||||
This forces \fBmkreiserfs\fR to continue even if device is either whole
|
||||
disk, or looks mounted or is not a block device. Specified more than
|
||||
once allows to avoid asking for confirmation.
|
||||
Forces \fBmkreiserfs\fR to continue even when the device is the whole disk,
|
||||
looks mounted, or is not a block device. If \fB-f\fR is specified more than
|
||||
once, it allows the user to avoid asking for confirmation.
|
||||
.TP
|
||||
\fB-d\fR
|
||||
This makes \fBmkreiserfs\fR to print debugging information during \fBmkreiserfs\fR.
|
||||
Sets \fBmkreiserfs\fR to print debugging information during \fBmkreiserfs\fR.
|
||||
.TP
|
||||
\fB-V\fR
|
||||
This prints version and exits.
|
||||
Prints the version and then exits.
|
||||
|
||||
.SH AUTHOR
|
||||
This version of
|
||||
.B mkreiserfs
|
||||
has been written by Edward Shishkin <edward@namesys.com>.
|
||||
.SH BUGS
|
||||
No other blocksizes but 4k are available.
|
||||
Please, report about other bugs to
|
||||
the ReiserFS mail-list <reiserfs-list@namesys.com>
|
||||
Please report bugs to the ReiserFS developers <reiserfs-dev@namesys.com>, providing
|
||||
as much information as possible--your hardware, kernel, patches, settings, all printed
|
||||
messages; check the syslog file for any related information.
|
||||
.SH SEE ALSO
|
||||
.BR reiserfsck (8),
|
||||
.BR debugreiserfs (8),
|
||||
|
||||
+11
-23
@@ -13,29 +13,22 @@
|
||||
|
||||
#define _GNU_SOURCE
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <asm/types.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <sys/vfs.h>
|
||||
#include <time.h>
|
||||
#include <sys/mount.h>
|
||||
#include <sys/stat.h>
|
||||
#include <linux/kdev_t.h>
|
||||
#include <sys/utsname.h>
|
||||
#include <getopt.h>
|
||||
#include <stdarg.h>
|
||||
#ifndef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#include "io.h"
|
||||
#include "misc.h"
|
||||
#include "reiserfs_lib.h"
|
||||
#include "../include/config.h"
|
||||
|
||||
#include "../version.h"
|
||||
|
||||
#include <getopt.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <sys/utsname.h>
|
||||
|
||||
#if defined(HAVE_LIBUUID) && defined(HAVE_UUID_UUID_H)
|
||||
# include <uuid/uuid.h>
|
||||
#endif
|
||||
@@ -511,13 +504,8 @@ static int select_format (void)
|
||||
}
|
||||
|
||||
reiserfs_warning(stdout, "Kernel %s is running.\n", sysinfo.release);
|
||||
if (!strncmp (sysinfo.release, "2.6", 3))
|
||||
return REISERFS_FORMAT_3_6;
|
||||
|
||||
if (!strncmp (sysinfo.release, "2.5", 3))
|
||||
return REISERFS_FORMAT_3_6;
|
||||
|
||||
if (!strncmp (sysinfo.release, "2.4", 3))
|
||||
if (strncmp (sysinfo.release, "2.4", 3) >= 0)
|
||||
return REISERFS_FORMAT_3_6;
|
||||
|
||||
if (strncmp (sysinfo.release, "2.2", 3)) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Makefile.in generated by automake 1.7.2 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.7.6 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
|
||||
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
|
||||
# Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
@@ -35,6 +35,7 @@ POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
host_triplet = @host@
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMDEP_FALSE = @AMDEP_FALSE@
|
||||
AMDEP_TRUE = @AMDEP_TRUE@
|
||||
@@ -63,7 +64,11 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAINT = @MAINT@
|
||||
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
|
||||
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
@@ -85,12 +90,21 @@ ac_ct_STRIP = @ac_ct_STRIP@
|
||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
datadir = @datadir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
@@ -111,6 +125,7 @@ libcore_a_SOURCES = do_balan.c fix_node.c hashes.c ibalance.c lbalance.c prints.
|
||||
stree.c node_formats.c reiserfslib.c bitmap.c journal.c includes.h
|
||||
|
||||
subdir = reiserfscore
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = $(top_builddir)/include/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
@@ -145,10 +160,10 @@ all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .o .obj
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu reiserfscore/Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
|
||||
|
||||
AR = ar
|
||||
@@ -184,7 +199,7 @@ distclean-depend:
|
||||
.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@ then mv -f "$(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@
|
||||
@@ -195,7 +210,7 @@ distclean-depend:
|
||||
.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@ then mv -f "$(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@
|
||||
@@ -294,7 +309,6 @@ check: check-am
|
||||
all-am: Makefile $(LIBRARIES)
|
||||
|
||||
installdirs:
|
||||
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
|
||||
@@ -6,16 +6,6 @@
|
||||
#include "includes.h"
|
||||
|
||||
|
||||
/* this is one and only function that is used outside (do_balance.c) */
|
||||
int balance_internal (
|
||||
/*struct reiserfs_transaction_handle *th,*/
|
||||
struct tree_balance * ,
|
||||
int,
|
||||
int,
|
||||
struct item_head * ,
|
||||
struct buffer_head **
|
||||
);
|
||||
|
||||
/* modes of internal_shift_left, internal_shift_right and internal_insert_childs */
|
||||
#define INTERNAL_SHIFT_FROM_S_TO_L 0
|
||||
#define INTERNAL_SHIFT_FROM_R_TO_S 1
|
||||
|
||||
+8
-11
@@ -3,22 +3,19 @@
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
#define _GNU_SOURCE
|
||||
#include <stdio.h>
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#include "io.h"
|
||||
#include "misc.h"
|
||||
#include "reiserfs_lib.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include <asm/types.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <malloc.h>
|
||||
#include <sys/vfs.h>
|
||||
#include <unistd.h>
|
||||
#include <time.h>
|
||||
#include "io.h"
|
||||
#include "misc.h"
|
||||
#include "reiserfs_lib.h"
|
||||
#include "swab.h"
|
||||
|
||||
#include "../include/config.h"
|
||||
+48
-44
@@ -3,15 +3,9 @@
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
#include "includes.h"
|
||||
#define _GNU_SOURCE
|
||||
|
||||
/* this is provided for anybody who wants to deal with journal */
|
||||
int replay_one_transaction (reiserfs_filsys_t *, reiserfs_trans_t *);
|
||||
void for_each_transaction (reiserfs_filsys_t *, action_on_trans_t);
|
||||
void for_each_block (reiserfs_filsys_t *, reiserfs_trans_t *, action_on_block_t);
|
||||
int get_boundary_transactions (reiserfs_filsys_t *, reiserfs_trans_t *,
|
||||
reiserfs_trans_t *);
|
||||
int next_transaction (reiserfs_filsys_t *, reiserfs_trans_t *, reiserfs_trans_t);
|
||||
#include "includes.h"
|
||||
|
||||
/* compares description block with commit block. returns 0 if they differ, 1
|
||||
if they match */
|
||||
@@ -185,7 +179,6 @@ int get_boundary_transactions (reiserfs_filsys_t * fs,
|
||||
}
|
||||
|
||||
#define TRANS_FOUND 1
|
||||
#define TRANS_LAST 2
|
||||
#define TRANS_NOT_FOUND 0
|
||||
|
||||
/* trans is a valid transaction. Look for valid transaction with smallest
|
||||
@@ -235,8 +228,6 @@ int next_transaction (reiserfs_filsys_t * fs, reiserfs_trans_t * trans, reiserfs
|
||||
trans->commit_blocknr = commit_expected (fs, next_d_bh);
|
||||
trans->next_trans_offset = next_desc_expected (fs, next_d_bh) - j_start;
|
||||
found = TRANS_FOUND;
|
||||
if (break_trans.trans_id == get_desc_trans_id (next_d_bh))
|
||||
found = TRANS_LAST;
|
||||
}
|
||||
|
||||
brelse (d_bh);
|
||||
@@ -327,6 +318,7 @@ int replay_one_transaction (reiserfs_filsys_t * fs,
|
||||
reiserfs_trans_t * trans)
|
||||
{
|
||||
for_each_block (fs, trans, read_journal_write_in_place);
|
||||
fsync(fs->fs_dev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -341,10 +333,7 @@ void for_each_transaction (reiserfs_filsys_t * fs, action_on_trans_t action)
|
||||
|
||||
while (1) {
|
||||
action (fs, &oldest);
|
||||
if (ret == TRANS_LAST)
|
||||
break;
|
||||
ret = next_transaction (fs, &oldest, newest);
|
||||
if (ret == TRANS_NOT_FOUND)
|
||||
if ((ret = next_transaction (fs, &oldest, newest)) == TRANS_NOT_FOUND)
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -497,7 +486,11 @@ int reiserfs_open_journal (reiserfs_filsys_t * fs, char * j_filename, int flags)
|
||||
}
|
||||
}
|
||||
|
||||
fs->fs_journal_dev = open (j_filename, flags | O_LARGEFILE);
|
||||
fs->fs_journal_dev = open (j_filename, flags
|
||||
#if defined(O_LARGEFILE)
|
||||
| O_LARGEFILE
|
||||
#endif
|
||||
);
|
||||
if (fs->fs_journal_dev == -1)
|
||||
return -1;
|
||||
|
||||
@@ -624,7 +617,11 @@ int reiserfs_create_journal(
|
||||
*/
|
||||
}
|
||||
|
||||
fs->fs_journal_dev = open (j_device, O_RDWR | O_LARGEFILE);
|
||||
fs->fs_journal_dev = open (j_device, O_RDWR
|
||||
#if defined(O_LARGEFILE)
|
||||
| O_LARGEFILE
|
||||
#endif
|
||||
);
|
||||
if (fs->fs_journal_dev == -1) {
|
||||
reiserfs_warning (stderr, "reiserfs_create_journal: could not open "
|
||||
"%s: %s\n", j_device, strerror(errno));
|
||||
@@ -691,7 +688,11 @@ void reiserfs_reopen_journal (reiserfs_filsys_t * fs, int flag)
|
||||
if (close (fs->fs_journal_dev))
|
||||
die ("reiserfs_reopen_journal: closed failed: %s", strerror(errno));
|
||||
|
||||
fs->fs_journal_dev = open (fs->fs_j_file_name, flag | O_LARGEFILE);
|
||||
fs->fs_journal_dev = open (fs->fs_j_file_name, flag
|
||||
#if defined(O_LARGEFILE)
|
||||
| O_LARGEFILE
|
||||
#endif
|
||||
);
|
||||
if (fs->fs_journal_dev == -1)
|
||||
die ("reiserfs_reopen_journal: could not reopen journal device");
|
||||
|
||||
@@ -734,17 +735,21 @@ void reiserfs_close_journal (reiserfs_filsys_t * fs)
|
||||
}
|
||||
|
||||
/* update journal header */
|
||||
static void update_journal_header (struct buffer_head * bh_jh, reiserfs_trans_t trans) {
|
||||
static void update_journal_header (reiserfs_filsys_t * fs,
|
||||
struct buffer_head * bh_jh,
|
||||
reiserfs_trans_t *trans)
|
||||
{
|
||||
struct reiserfs_journal_header * j_head;
|
||||
|
||||
j_head = (struct reiserfs_journal_header *)(bh_jh->b_data);
|
||||
|
||||
/* update journal header */
|
||||
set_jh_last_flushed (j_head, trans.trans_id);
|
||||
set_jh_mount_id (j_head, trans.mount_id);
|
||||
set_jh_replay_start_offset (j_head, trans.next_trans_offset);
|
||||
set_jh_last_flushed (j_head, trans->trans_id);
|
||||
set_jh_mount_id (j_head, trans->mount_id);
|
||||
set_jh_replay_start_offset (j_head, trans->next_trans_offset);
|
||||
mark_buffer_dirty (bh_jh);
|
||||
bwrite (bh_jh);
|
||||
fsync(fs->fs_journal_dev);
|
||||
}
|
||||
|
||||
/* fixme: what should be done when not all transactions can be replayed in proper order? */
|
||||
@@ -780,29 +785,21 @@ int replay_journal (reiserfs_filsys_t * fs)
|
||||
replayed = 0;
|
||||
ret = TRANS_FOUND;
|
||||
|
||||
while (cur.mount_id != control.mount_id || cur.trans_id != control.trans_id) {
|
||||
if (control.mount_id == cur.mount_id && control.trans_id == 0 &&
|
||||
control.desc_blocknr == 0)
|
||||
/* Looking to the first valid not replayed transaction. */
|
||||
while (1) {
|
||||
if (cur.mount_id == control.mount_id &&
|
||||
cur.trans_id > control.trans_id)
|
||||
break;
|
||||
|
||||
ret = next_transaction (fs, &cur, newest);
|
||||
|
||||
if (ret != TRANS_FOUND)
|
||||
|
||||
if ((ret = next_transaction (fs, &cur, newest)) != TRANS_FOUND)
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
while (ret == TRANS_FOUND) {
|
||||
if (control.mount_id != cur.mount_id || control.trans_id != 0 ||
|
||||
control.desc_blocknr != 0)
|
||||
{
|
||||
ret = next_transaction (fs, &cur, newest);
|
||||
|
||||
if (ret == TRANS_NOT_FOUND)
|
||||
break;
|
||||
|
||||
if (cur.mount_id != control.mount_id || cur.trans_id != control.trans_id + 1)
|
||||
break;
|
||||
}
|
||||
/* If not the next transaction to be replayed, break out here. */
|
||||
if ((cur.mount_id != control.mount_id) ||
|
||||
(cur.trans_id != control.trans_id + 1 && control.trans_id))
|
||||
break;
|
||||
|
||||
if (!transaction_check_content(fs, &cur)) {
|
||||
reiserfs_warning (stderr, "Trans broken: mountid %lu, transid %lu, desc %lu, "
|
||||
@@ -816,17 +813,24 @@ int replay_journal (reiserfs_filsys_t * fs)
|
||||
cur.mount_id, cur.trans_id, cur.desc_blocknr, cur.trans_len,
|
||||
cur.commit_blocknr, cur.next_trans_offset);
|
||||
replay_one_transaction (fs, &cur);
|
||||
update_journal_header (bh, cur);
|
||||
update_journal_header (fs, bh, &cur);
|
||||
control = cur;
|
||||
replayed ++;
|
||||
|
||||
ret = next_transaction (fs, &cur, newest);
|
||||
}
|
||||
|
||||
reiserfs_warning (stderr, "%d transactions replayed\n", replayed);
|
||||
reiserfs_warning (stderr, "Reiserfs journal '%s' in blocks [%u..%u]: %d "
|
||||
"transactions replayed\n", fs->fs_j_file_name,
|
||||
get_jp_journal_1st_block(sb_jp(fs->fs_ondisk_sb)),
|
||||
get_jp_journal_1st_block(sb_jp(fs->fs_ondisk_sb)) +
|
||||
get_jp_journal_size(sb_jp(fs->fs_ondisk_sb)) + 1,
|
||||
replayed);
|
||||
|
||||
mark_buffer_dirty (fs->fs_super_bh);
|
||||
bwrite (fs->fs_super_bh);
|
||||
|
||||
update_journal_header (bh, newest);
|
||||
update_journal_header (fs, bh, &newest);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -949,7 +949,8 @@ void leaf_cut_from_buffer (reiserfs_filsys_t * fs,
|
||||
set_dc_child_size (dc, get_dc_child_size (dc) - cut_size);
|
||||
mark_buffer_dirty(bi->bi_parent);
|
||||
}
|
||||
if (is_a_leaf(bh->b_data, bh->b_size) != THE_LEAF)
|
||||
if (is_a_leaf(bh->b_data, bh->b_size) != THE_LEAF &&
|
||||
is_a_leaf(bh->b_data, bh->b_size) != HAS_IH_ARRAY)
|
||||
reiserfs_panic ("leaf_cut_from_buffer: bad leaf %lu: %b",
|
||||
bh->b_blocknr, bh);
|
||||
}
|
||||
@@ -1015,7 +1016,8 @@ static void leaf_delete_items_entirely (reiserfs_filsys_t * fs,
|
||||
(j - last_removed_loc + IH_SIZE * del_num));
|
||||
mark_buffer_dirty(bi->bi_parent);
|
||||
}
|
||||
if (is_a_leaf(bh->b_data, bh->b_size) != THE_LEAF)
|
||||
if (is_a_leaf(bh->b_data, bh->b_size) != THE_LEAF &&
|
||||
is_a_leaf(bh->b_data, bh->b_size) != HAS_IH_ARRAY)
|
||||
reiserfs_panic ("leaf_delete_items_entirely: bad leaf %lu: %b", bh->b_blocknr, bh);
|
||||
}
|
||||
|
||||
|
||||
@@ -202,9 +202,9 @@ int is_tree_node (struct buffer_head * bh, int level)
|
||||
|
||||
static int is_desc_block (char * buf, unsigned long buf_size)
|
||||
{
|
||||
struct reiserfs_journal_desc *desc = (struct reiserfs_journal_desc *)buf;
|
||||
if (!memcmp(buf + buf_size - 12, JOURNAL_DESC_MAGIC, 8) &&
|
||||
//get_jdesc_len (desc) > 0)
|
||||
le32_to_cpu(*((__u32*)(buf + 4))) > 0)
|
||||
le32_to_cpu (desc->j2_len) > 0)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
@@ -495,7 +495,7 @@ static int is_bad_indirect (reiserfs_filsys_t * fs, struct item_head * ih, char
|
||||
for (i = 0; i < I_UNFM_NUM (ih); i ++) {
|
||||
if (!ind [i])
|
||||
continue;
|
||||
if (check_unfm_func && check_unfm_func (fs, le32_to_cpu(ind [i])))
|
||||
if (check_unfm_func && check_unfm_func (fs, d32_get (ind, i)))
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
#define _GNU_SOURCE
|
||||
|
||||
#include "includes.h"
|
||||
#include <stdarg.h>
|
||||
#include <limits.h>
|
||||
@@ -392,9 +394,9 @@ void print_indirect_item (FILE * fp, struct buffer_head * bh, int item_num)
|
||||
reiserfs_warning (fp, "%d pointer%s\n[", I_UNFM_NUM (ih),
|
||||
I_UNFM_NUM (ih) != 1 ? "s" : "" );
|
||||
for (j = 0; j < I_UNFM_NUM (ih); j ++) {
|
||||
if (sequence_finished (prev, &num, unp[j])) {
|
||||
if (sequence_finished (prev, &num, d32_get(unp, j))) {
|
||||
print_sequence (fp, prev, num);
|
||||
start_new_sequence (&prev, &num, unp[j]);
|
||||
start_new_sequence (&prev, &num, d32_get(unp, j));
|
||||
}
|
||||
}
|
||||
print_sequence (fp, prev, num);
|
||||
|
||||
+27
-27
@@ -3,6 +3,8 @@
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
#define _GNU_SOURCE
|
||||
|
||||
#include "includes.h"
|
||||
#include <linux/kdev_t.h>
|
||||
|
||||
@@ -63,7 +65,11 @@ reiserfs_filsys_t * reiserfs_open (char * filename, int flags, int *error, void
|
||||
if (error)
|
||||
*error = 0;
|
||||
|
||||
fd = open (filename, flags | O_LARGEFILE);
|
||||
fd = open (filename, flags
|
||||
#if defined(O_LARGEFILE)
|
||||
| O_LARGEFILE
|
||||
#endif
|
||||
);
|
||||
if (fd == -1) {
|
||||
if (error)
|
||||
*error = errno;
|
||||
@@ -199,7 +205,11 @@ reiserfs_filsys_t * reiserfs_create (char * filename,
|
||||
return 0;
|
||||
}
|
||||
|
||||
fs->fs_dev = open (filename, O_RDWR | O_LARGEFILE);
|
||||
fs->fs_dev = open (filename, O_RDWR
|
||||
#if defined(O_LARGEFILE)
|
||||
| O_LARGEFILE
|
||||
#endif
|
||||
);
|
||||
if (fs->fs_dev == -1) {
|
||||
reiserfs_warning (stderr, "reiserfs_create: could not open %s: %s\n",
|
||||
filename, strerror(errno));
|
||||
@@ -322,7 +332,11 @@ static void reiserfs_only_reopen (reiserfs_filsys_t * fs, int flag)
|
||||
if (close (fs->fs_dev))
|
||||
die ("reiserfs_reopen: closed failed: %s", strerror(errno));
|
||||
|
||||
fs->fs_dev = open (fs->fs_file_name, flag | O_LARGEFILE);
|
||||
fs->fs_dev = open (fs->fs_file_name, flag
|
||||
#if defined(O_LARGEFILE)
|
||||
| O_LARGEFILE
|
||||
#endif
|
||||
);
|
||||
if (fs->fs_dev == -1)
|
||||
die ("reiserfs_reopen: could not reopen device: %s", strerror(errno));
|
||||
|
||||
@@ -413,18 +427,6 @@ int reiserfs_free_block (reiserfs_filsys_t * fs, unsigned long block)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
inline int reiserfs_bin_search (void * key, void * base, int num, int width,
|
||||
int *ppos, comparison_fn_t comp_func) {
|
||||
__u32 position = *ppos;
|
||||
int retval;
|
||||
|
||||
retval = reiserfs_bin_search (key, base, num, width, &position, comp_func);
|
||||
*ppos = position;
|
||||
return retval;
|
||||
}
|
||||
*/
|
||||
|
||||
static int reiserfs_search_by_key_x (reiserfs_filsys_t * fs, struct key * key,
|
||||
struct path * path, int key_length)
|
||||
{
|
||||
@@ -572,16 +574,14 @@ int usearch_by_position (reiserfs_filsys_t * s, struct key * key,
|
||||
|
||||
static int comp_dir_entries (const void * p1, const void * p2)
|
||||
{
|
||||
__u32 deh_offset;
|
||||
const __u32 * off1, * off2;
|
||||
__u32 off1, off2;
|
||||
|
||||
off1 = p1;
|
||||
off2 = p2;
|
||||
deh_offset = le32_to_cpu (*off1);
|
||||
|
||||
if (deh_offset < *off2)
|
||||
off1 = d32_get((__u32 *)p1, 0);
|
||||
off2 = *(__u32 *)p2;
|
||||
|
||||
if (off1 < off2)
|
||||
return -1;
|
||||
if (deh_offset > *off2)
|
||||
if (off1 > off2)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
@@ -1211,8 +1211,8 @@ int can_we_format_it (char * device_name, int force)
|
||||
reiserfs_warning (stderr, "%s is not a block special device\n", device_name);
|
||||
check_forcing_ask_confirmation (force);
|
||||
} else {
|
||||
if ((IDE_DISK_MAJOR (MAJOR(rdev)) && MINOR(rdev) % 64 == 0) ||
|
||||
(SCSI_BLK_MAJOR (MAJOR(rdev)) && MINOR(rdev) % 16 == 0)) {
|
||||
if ((IDE_DISK_MAJOR (major(rdev)) && minor(rdev) % 64 == 0) ||
|
||||
(SCSI_BLK_MAJOR (major(rdev)) && minor(rdev) % 16 == 0)) {
|
||||
/* /dev/hda or similar */
|
||||
reiserfs_warning (stderr, "%s is entire device, not just one partition!\n",
|
||||
device_name);
|
||||
@@ -1351,9 +1351,9 @@ void mark_badblock(reiserfs_filsys_t *fs,
|
||||
tmp_ih = get_ih(badblock_path);
|
||||
ind_item = (__u32 *)get_item(badblock_path);
|
||||
|
||||
for (i = 0; i < I_UNFM_NUM(tmp_ih); i++, ind_item++) {
|
||||
for (i = 0; i < I_UNFM_NUM(tmp_ih); i++) {
|
||||
reiserfs_bitmap_set_bit(fs->fs_badblocks_bm,
|
||||
le32_to_cpu(*ind_item));
|
||||
d32_get(ind_item, i));
|
||||
}
|
||||
|
||||
pathrelse (badblock_path);
|
||||
|
||||
@@ -60,8 +60,8 @@ int comp_short_keys (const void * k1, const void * k2)
|
||||
__u32 u1, u2;
|
||||
|
||||
for( ; n_key_length--; ++p_s_key1, ++p_s_key2 ) {
|
||||
u1 = le32_to_cpu(*p_s_key1) ;
|
||||
u2 = le32_to_cpu(*p_s_key2) ;
|
||||
u1 = d32_get(p_s_key1, 0) ;
|
||||
u2 = d32_get(p_s_key2, 0) ;
|
||||
if ( u1 < u2 )
|
||||
return -1;
|
||||
if ( u1 > u2 )
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
%define reiserfsprogsversion 3.6.13
|
||||
%define reiserfsprogsversion 3.6.18
|
||||
|
||||
Vendor: Hans Reiser
|
||||
Distribution: Hans Reiser
|
||||
@@ -44,7 +44,7 @@ Vladimir Saveliev <monstr@namesys.com>
|
||||
%{__ln_s} -f reiserfsck fsck.reiserfs
|
||||
%{__ln_s} -f mkreiserfs mkfs.reiserfs
|
||||
|
||||
# __os_install_post is normally executed after %install disable it
|
||||
# __os_install_post is normally executed after \%install disable it
|
||||
%define ___build_post %{nil}
|
||||
# explicitly call it now, so manpages get compressed, exec's stripped etc.
|
||||
%{?__os_install_post}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Makefile.in generated by automake 1.7.2 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.7.6 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
|
||||
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
|
||||
# Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
@@ -35,6 +35,7 @@ POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
host_triplet = @host@
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMDEP_FALSE = @AMDEP_FALSE@
|
||||
AMDEP_TRUE = @AMDEP_TRUE@
|
||||
@@ -63,7 +64,11 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAINT = @MAINT@
|
||||
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
|
||||
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
@@ -85,12 +90,21 @@ ac_ct_STRIP = @ac_ct_STRIP@
|
||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
datadir = @datadir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
@@ -113,6 +127,7 @@ EXTRA_DIST = $(man_MANS)
|
||||
|
||||
LDADD = $(top_srcdir)/lib/libmisc.a $(top_srcdir)/reiserfscore/libcore.a
|
||||
subdir = resize_reiserfs
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = $(top_builddir)/include/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
@@ -147,10 +162,10 @@ all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .o .obj
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu resize_reiserfs/Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
Makefile: @MAINTAINER_MODE_TRUE@ $(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)
|
||||
@@ -196,7 +211,7 @@ distclean-depend:
|
||||
.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@ then mv -f "$(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@
|
||||
@@ -207,7 +222,7 @@ distclean-depend:
|
||||
.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@ then mv -f "$(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@
|
||||
@@ -354,7 +369,6 @@ all-am: Makefile $(PROGRAMS) $(MANS)
|
||||
|
||||
installdirs:
|
||||
$(mkinstalldirs) $(DESTDIR)$(sbindir) $(DESTDIR)$(man8dir)
|
||||
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
|
||||
@@ -124,11 +124,11 @@ static unsigned long move_formatted_block(reiserfs_filsys_t * fs, unsigned long
|
||||
for (j = 0; j < I_UNFM_NUM(ih); j++) {
|
||||
unsigned long unfm_block;
|
||||
|
||||
if (indirect [j] == 0) /* hole */
|
||||
if (d32_get (indirect, j) == 0) /* hole */
|
||||
continue;
|
||||
unfm_block = move_unformatted_block(fs, le32_to_cpu (indirect [j]), bnd, h + 1);
|
||||
unfm_block = move_unformatted_block(fs, d32_get (indirect, j), bnd, h + 1);
|
||||
if (unfm_block) {
|
||||
indirect [j] = cpu_to_le32 (unfm_block);
|
||||
d32_put (indirect, j, unfm_block);
|
||||
mark_buffer_dirty(bh);
|
||||
}
|
||||
}
|
||||
|
||||
+11
-17
@@ -3,18 +3,15 @@
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
#define _GNU_SOURCE
|
||||
#ifndef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <asm/types.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <mntent.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdlib.h>
|
||||
#include "io.h"
|
||||
#include "misc.h"
|
||||
#include "reiserfs_lib.h"
|
||||
|
||||
#include "../version.h"
|
||||
|
||||
#if __GLIBC__ >= 2
|
||||
#include <sys/mount.h>
|
||||
@@ -22,13 +19,10 @@
|
||||
#include <linux/fs.h>
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "io.h"
|
||||
#include "misc.h"
|
||||
#include "reiserfs_lib.h"
|
||||
#include "../include/config.h"
|
||||
#include "../version.h"
|
||||
|
||||
#include <mntent.h>
|
||||
|
||||
#define print_usage_and_exit() {\
|
||||
fprintf (stderr, "Usage: %s [-s[+|-]#[G|M|K]] [-fqvV] device\n\n", argv[0]);\
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
.\" -*- nroff -*-
|
||||
.\" Copyright 1996-2004 Hans Reiser.
|
||||
.\"
|
||||
.TH RESIZE_REISERFS 8 "January 2004" "Reiserfsprogs-3.6.13"
|
||||
.TH RESIZE_REISERFS 8 "January 2004" "Reiserfsprogs-3.6.18"
|
||||
.SH NAME
|
||||
resize_reiserfs \- resizer tool for the ReiserFS filesystem
|
||||
.SH SYNOPSIS
|
||||
@@ -59,7 +59,7 @@ space on block
|
||||
.I device.
|
||||
|
||||
.PP
|
||||
If you wish to shrink an reiserfs partition, first use
|
||||
If you wish to shrink a reiserfs partition, first use
|
||||
.B resize_reiserfs
|
||||
to shrink the file system. You may then use
|
||||
.BR cfdisk (8)
|
||||
@@ -86,7 +86,7 @@ Turn on extra progress status messages (default).
|
||||
.SH RETURN VALUES
|
||||
0 Resizing successful.
|
||||
.TP
|
||||
\-1 In another case.
|
||||
\-1 Resizing not successful.
|
||||
|
||||
.SH EXAMPLES
|
||||
The following example shows how to test
|
||||
@@ -108,15 +108,14 @@ with a
|
||||
.br
|
||||
\ df /mnt
|
||||
|
||||
.SH WARNING
|
||||
Note that this is a BETA program and may corrupt filesystems.
|
||||
.SH AUTHOR
|
||||
This version of
|
||||
.B resize_reiserfs
|
||||
has been written by Alexander Zarochentcev <zam@namesys.com>.
|
||||
.SH BUGS
|
||||
Please, report about the bugs to Alexander Zarochentcev <zam@namesys.com> or
|
||||
to Hans Reiser <reiser@namesys.com>.
|
||||
Please report bugs to the ReiserFS developers <reiserfs-dev@namesys.com>, providing
|
||||
as much information as possible--your hardware, kernel, patches, settings, all printed
|
||||
messages; check the syslog file for any related information.
|
||||
.SH SEE ALSO
|
||||
.BR cfdisk (8),
|
||||
.BR reiserfsck (8),
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#define _GNU_SOURCE
|
||||
|
||||
#include "resize.h"
|
||||
#include <limits.h>
|
||||
|
||||
|
||||
+21
-7
@@ -1,7 +1,7 @@
|
||||
# Makefile.in generated by automake 1.7.2 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.7.6 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
|
||||
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
|
||||
# Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
@@ -35,6 +35,7 @@ POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
host_triplet = @host@
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMDEP_FALSE = @AMDEP_FALSE@
|
||||
AMDEP_TRUE = @AMDEP_TRUE@
|
||||
@@ -63,7 +64,11 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAINT = @MAINT@
|
||||
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
|
||||
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
@@ -85,12 +90,21 @@ ac_ct_STRIP = @ac_ct_STRIP@
|
||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
datadir = @datadir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
@@ -114,6 +128,7 @@ EXTRA_DIST = $(man_MANS)
|
||||
|
||||
LDADD = $(top_srcdir)/lib/libmisc.a $(top_srcdir)/reiserfscore/libcore.a
|
||||
subdir = tune
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = $(top_builddir)/include/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
@@ -146,10 +161,10 @@ all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .o .obj
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu tune/Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
Makefile: @MAINTAINER_MODE_TRUE@ $(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)
|
||||
@@ -193,7 +208,7 @@ distclean-depend:
|
||||
.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@ then mv -f "$(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@
|
||||
@@ -204,7 +219,7 @@ distclean-depend:
|
||||
.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@ then mv -f "$(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@
|
||||
@@ -351,7 +366,6 @@ all-am: Makefile $(PROGRAMS) $(MANS)
|
||||
|
||||
installdirs:
|
||||
$(mkinstalldirs) $(DESTDIR)$(sbindir) $(DESTDIR)$(man8dir)
|
||||
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
|
||||
+17
-14
@@ -1,9 +1,9 @@
|
||||
.\" -*- nroff -*-
|
||||
.\" Copyright 1996-2004 Hans Reiser.
|
||||
.\"
|
||||
.TH REISERFSTUNE 8 "February 2004" "Reiserfsprogs-3.6.13"
|
||||
.TH REISERFSTUNE 8 "February 2004" "Reiserfsprogs-3.6.18"
|
||||
.SH NAME
|
||||
reiserfstune \- tunning tool for the ReiserFS filesystem
|
||||
reiserfstune \- The tunning tool for the ReiserFS filesystem.
|
||||
.SH SYNOPSIS
|
||||
.B reiserfstune
|
||||
[ \fB-f\fR ]
|
||||
@@ -19,17 +19,18 @@ reiserfstune \- tunning tool for the ReiserFS filesystem
|
||||
[ \fB-l\fR | \fB--label \fILABEL\fR ]
|
||||
.I device
|
||||
.SH DESCRIPTION
|
||||
\fBreiserfstune\fR is used for tuning the ReiserFS
|
||||
journal. It can change two parameters (journal size and maximum
|
||||
transaction size), and it can move the journal's location to a new specified
|
||||
block device. (The old ReiserFS's journal may be
|
||||
kept unused, or discarded at the user's option.) Note: At the time of
|
||||
writing this feature was implemented for a special release of
|
||||
ReiserFS, and was not expected to be put into the mainstream kernel
|
||||
until approximately Linux 2.5. This means that if you have the stock
|
||||
kernel you must apply a special patch. Without this patch the kernel
|
||||
will refuse to mount the newly modified file system. We will charge
|
||||
$25 to explain this to you if you ask us why it doesn't work.
|
||||
\fBreiserfstune\fR is used for tuning the ReiserFS. It can change two journal
|
||||
parameters (the journal size and the maximum transaction size), and it can move
|
||||
the journal's location to a new specified block device. (The old ReiserFS's
|
||||
journal may be kept unused, or discarded at the user's option.) Besides that
|
||||
\fBreiserfstune\fR can store the bad block list to the ReiserFS and set UUID
|
||||
and LABEL.
|
||||
Note: At the time of writing the relocated journal was implemented for a special
|
||||
release of ReiserFS, and was not expected to be put into the mainstream kernel
|
||||
until approximately Linux 2.5. This means that if you have the stock kernel you
|
||||
must apply a special patch. Without this patch the kernel will refuse to mount
|
||||
the newly modified file system. We will charge $25 to explain this to you if
|
||||
you ask us why it doesn't work.
|
||||
.PP
|
||||
Perhaps the most interesting application of this code is to put the
|
||||
journal on a solid state disk.
|
||||
@@ -149,7 +150,9 @@ using /dev/hda1 under patched kernel
|
||||
This version of \fBreiserfstune\fR has been written by Vladimir
|
||||
Demidov <vova@namesys.com> and Edward Shishkin <edward@namesys.com>.
|
||||
.SH BUGS
|
||||
Please repoort bugs to the ReiserFS mail list <reiserfs-list@namesys.com>
|
||||
Please report bugs to the ReiserFS developers <reiserfs-dev@namesys.com>, providing
|
||||
as much information as possible--your hardware, kernel, patches, settings, all printed
|
||||
messages; check the syslog file for any related information.
|
||||
.SH SEE ALSO
|
||||
.BR reiserfsck (8),
|
||||
.BR debugreiserfs (8),
|
||||
|
||||
+18
-7
@@ -3,8 +3,15 @@
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
#define _GNU_SOURCE
|
||||
|
||||
#include "tune.h"
|
||||
|
||||
#include <getopt.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
char *program_name;
|
||||
|
||||
static void message( const char * fmt, ... )
|
||||
@@ -222,15 +229,15 @@ static void callback_new_badblocks(reiserfs_filsys_t *fs,
|
||||
tmp_ih = get_ih(badblock_path);
|
||||
ind_item = (__u32 *)get_item(badblock_path);
|
||||
|
||||
for (i = 0; i < I_UNFM_NUM(tmp_ih); i++, ind_item++) {
|
||||
for (i = 0; i < I_UNFM_NUM(tmp_ih); i++) {
|
||||
if (reiserfs_bitmap_test_bit(fs->fs_badblocks_bm,
|
||||
le32_to_cpu(*ind_item)))
|
||||
d32_get (ind_item, i)))
|
||||
{
|
||||
message("Block %u is marked as bad already.",
|
||||
le32_to_cpu(*ind_item));
|
||||
d32_get (ind_item, i));
|
||||
|
||||
reiserfs_bitmap_clear_bit(fs->fs_badblocks_bm,
|
||||
le32_to_cpu(*ind_item));
|
||||
d32_get (ind_item, i));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -247,9 +254,9 @@ static void callback_clear_badblocks(reiserfs_filsys_t *fs,
|
||||
tmp_ih = get_ih(badblock_path);
|
||||
ind_item = (__u32 *)get_item(badblock_path);
|
||||
|
||||
for (i = 0; i < I_UNFM_NUM(tmp_ih); i++, ind_item++) {
|
||||
for (i = 0; i < I_UNFM_NUM(tmp_ih); i++) {
|
||||
reiserfs_bitmap_clear_bit(fs->fs_bitmap2,
|
||||
le32_to_cpu(*ind_item));
|
||||
d32_get(ind_item, i));
|
||||
}
|
||||
|
||||
pathrelse (badblock_path);
|
||||
@@ -514,7 +521,11 @@ int main (int argc, char **argv)
|
||||
if (get_jp_journal_magic(sb_jp(fs->fs_ondisk_sb)) != NEED_TUNE &&
|
||||
!(Options & OPT_SKIP_J))
|
||||
{
|
||||
if (reiserfs_open_journal (fs, jdevice_name, O_RDWR | O_LARGEFILE)) {
|
||||
if (reiserfs_open_journal (fs, jdevice_name, O_RDWR
|
||||
#if defined(O_LARGEFILE)
|
||||
| O_LARGEFILE
|
||||
#endif
|
||||
)) {
|
||||
message ("Failed to open the journal device (%s).", jdevice_name);
|
||||
return 1;
|
||||
}
|
||||
|
||||
+4
-20
@@ -3,30 +3,14 @@
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
#define _GNU_SOURCE
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <asm/types.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <sys/vfs.h>
|
||||
#include <time.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/mount.h>
|
||||
#include <sys/stat.h>
|
||||
#include <linux/kdev_t.h>
|
||||
#include <sys/utsname.h>
|
||||
#include <getopt.h>
|
||||
#include <stdarg.h>
|
||||
#ifndef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#include "io.h"
|
||||
#include "misc.h"
|
||||
#include "reiserfs_lib.h"
|
||||
#include "../include/config.h"
|
||||
|
||||
#include "../version.h"
|
||||
|
||||
#if defined(HAVE_LIBUUID) && defined(HAVE_UUID_UUID_H)
|
||||
|
||||
Reference in new issue
Block a user