Compare commits
10
Commits
5eead9fb34
...
d3925f1521
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d3925f1521 | ||
|
|
f97d2e9dd7 | ||
|
|
14b57362f7 | ||
|
|
278866b5be | ||
|
|
1be2deaac0 | ||
|
|
3c0f2812b0 | ||
|
|
59dc067e79 | ||
|
|
df843a34a6 | ||
|
|
d5571fa1db | ||
|
|
0407950dfe |
No files matched your search
+31
-9
@@ -1,32 +1,54 @@
|
||||
# Editor / OS cruft
|
||||
*~
|
||||
*.[ao]
|
||||
*.8
|
||||
core
|
||||
tags
|
||||
|
||||
# Autotools generated files (run ./autogen.sh to regenerate)
|
||||
INSTALL
|
||||
Makefile.in
|
||||
aclocal.m4
|
||||
autom4te.cache/
|
||||
compile
|
||||
config.guess
|
||||
config.sub
|
||||
config.h.in
|
||||
configure
|
||||
depcomp
|
||||
config.h.in
|
||||
install-sh
|
||||
missing
|
||||
aclocal.m4
|
||||
autom4te.cache
|
||||
tags
|
||||
.pc
|
||||
ltmain.sh
|
||||
ar-lib
|
||||
/build-aux/
|
||||
/m4/
|
||||
|
||||
# configure / make output
|
||||
Makefile
|
||||
.deps
|
||||
.deps/
|
||||
.libs/
|
||||
*.o
|
||||
*.a
|
||||
*.lo
|
||||
*.la
|
||||
config.log
|
||||
config.status
|
||||
config.h
|
||||
include/config.h
|
||||
include/credits.h
|
||||
include/stamp-h1
|
||||
libtool
|
||||
reiserfscore/reiserfs_err.c
|
||||
reiserfscore/reiserfs_err.h
|
||||
reiserfscore/reiserfscore.pc
|
||||
|
||||
reiserfsprogs-*.tar.*
|
||||
# Generated man pages (from *.8.in)
|
||||
*.8
|
||||
|
||||
# Built programs
|
||||
/debugreiserfs/debugreiserfs
|
||||
/fsck/reiserfsck
|
||||
/mkreiserfs/mkreiserfs
|
||||
/resize_reiserfs/resize_reiserfs
|
||||
/tune/reiserfstune
|
||||
|
||||
# Release tarballs
|
||||
reiserfsprogs-*.tar.*
|
||||
@@ -1,3 +1,40 @@
|
||||
2016-06-06
|
||||
3.6.25 release.
|
||||
reiserfsprogs: use com_err in reiserfs_open
|
||||
reiserfscore: fix "new_insert_key may be used uninitialized..."
|
||||
reiserfsprogs: fix issues with inline functions
|
||||
man: Fixes a little glitch in the man page.
|
||||
manpages: escape dashes
|
||||
fsck: remove namesys.com reference in error text
|
||||
reiserfscore: constify struct pointer arguments
|
||||
reiserfscore: constify strings
|
||||
reiserfslib: add basic extended attribute helpers
|
||||
reiserfslib: add file data and directory iterators
|
||||
mkreiserfs: move block_size_ok out of reiserfscore
|
||||
debugreiserfs: fix incorrect memset size in unpack_stat_data
|
||||
reiserfsprogs: remove dead code
|
||||
debugreiserfs: fix use after free while closing log
|
||||
reiserfsprogs: add helpers for constant endian routines
|
||||
build: introduce shared libreiserfscore.so and export it
|
||||
reiserfsprogs: convert reiserfs_filsys_t from structure to pointer-to-structure
|
||||
reiserfsprogs: annotate for endian safeness
|
||||
reiserfsprogs: fix remaining sparse warnings
|
||||
reiserfsprogs: Fix sparse "warning: Using plain integer as NULL pointer"
|
||||
sparse: move bitops functions to include/misc.h
|
||||
reiserfscore: rename usearch_by_position to reiserfs_search_by_position
|
||||
reiserfscore: make reiserfs_open's filename argument const
|
||||
swab: protect le32_to_cpu and friends against being defined twice
|
||||
reiserfs_fs.h: Eliminate overlays in offset_v2 helpers
|
||||
reiserfscore: move endian helpers for offset_v2 into header
|
||||
reiserfs_fs.h: Fix ifndef for multiple inclusion
|
||||
cleanup: remove unused argument to reiserfs_invalidate_buffer
|
||||
cleanup: remove dead code
|
||||
cleanup: remove unnecessary fs pointer passed with buffer_infos
|
||||
cleanup: factor out buffer_info initialization into helpers
|
||||
cleanup: rename key and item_head accessors to more friendly names
|
||||
cleanup: remove trailing whitespace
|
||||
cleanup: run indent with the Linux Kernel style across all code
|
||||
cleanup: rename common structure names
|
||||
2013-08-25
|
||||
3.6.24 release.
|
||||
reiserfsprogs: autogenerate the version number in the man pages
|
||||
|
||||
Executable
+14
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
# Regenerate the autotools build system (configure, Makefile.in, ...).
|
||||
# Run this after a fresh clone; release tarballs ship the generated files.
|
||||
set -e
|
||||
|
||||
srcdir=$(dirname "$0")
|
||||
cd "$srcdir"
|
||||
|
||||
mkdir -p m4 build-aux
|
||||
|
||||
autoreconf -fi
|
||||
|
||||
echo
|
||||
echo "Now run ./configure && make"
|
||||
+70
-58
@@ -1,64 +1,79 @@
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
AC_INIT([reiserfsprogs], [3.6.24], [reiserfs-devel@vger.kernel.org])
|
||||
AC_INIT([reiserfsprogs], [3.6.25], [reiserfs-devel@vger.kernel.org])
|
||||
AC_CANONICAL_HOST
|
||||
AC_PREREQ(2.50)
|
||||
AC_PREREQ([2.64])
|
||||
|
||||
AC_CONFIG_MACRO_DIRS([m4])
|
||||
AC_CONFIG_AUX_DIR([build-aux])
|
||||
|
||||
AH_TEMPLATE([HAVE_LIBUUID], [Define for enable libuuid using.])
|
||||
|
||||
AM_INIT_AUTOMAKE([1.11.1 dist-xz silent-rules])
|
||||
AM_INIT_AUTOMAKE([1.11.1 foreign dist-xz silent-rules subdir-objects])
|
||||
AM_SILENT_RULES([yes])
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
dnl We install in /sbin, the utils are to be available on boot
|
||||
dnl AC_PREFIX(/)
|
||||
|
||||
AM_CONFIG_HEADER(include/config.h)
|
||||
AC_CONFIG_HEADERS([include/config.h])
|
||||
|
||||
dnl Checks for programs.
|
||||
AC_PROG_CC
|
||||
AC_PROG_AWK
|
||||
AC_PROG_AWK
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_LN_S
|
||||
AC_PROG_MAKE_SET
|
||||
AC_PROG_LIBTOOL
|
||||
AM_PROG_AR
|
||||
|
||||
dnl libtool, replaces the long-obsolete AC_PROG_LIBTOOL
|
||||
LT_INIT
|
||||
|
||||
dnl Checks for libraries.
|
||||
|
||||
# Check for LIBUUID
|
||||
AC_CHECK_LIB(uuid, uuid_generate, , AC_MSG_WARN(libuuid could not be found))
|
||||
AC_CHECK_LIB([uuid], [uuid_generate], [], [AC_MSG_WARN([libuuid could not be found])])
|
||||
UUID_LIBS="$LIBS"
|
||||
AC_SUBST(UUID_LIBS)
|
||||
AC_SUBST([UUID_LIBS])
|
||||
|
||||
AC_CHECK_LIB([com_err], [_et_list], [], [AC_MSG_ERROR([libcom_err could not be found])])
|
||||
COM_ERR_LIBS="$LIBS"
|
||||
AC_SUBST([COM_ERR_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_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
|
||||
AC_C_INLINE
|
||||
AC_TYPE_SIZE_T
|
||||
AC_STRUCT_ST_RDEV
|
||||
|
||||
dnl Use a deterministic language level: the code predates C99 and C23
|
||||
dnl removes constructs (e.g. implicit int in some spots) it relies on.
|
||||
AC_MSG_CHECKING([whether $CC accepts -std=gnu11])
|
||||
saved_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -std=gnu11"
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
|
||||
[AC_MSG_RESULT([yes])],
|
||||
[AC_MSG_RESULT([no]); CFLAGS="$saved_CFLAGS"])
|
||||
|
||||
# Checking for compiler warning options
|
||||
AC_CACHE_CHECK([whether -Wuninitialized works], [ac_cv_wuninitialized_flag], [
|
||||
saved_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="-O1 -Wuninitialized"
|
||||
AC_TRY_COMPILE(, , [ac_cv_wuninitialized_flag=yes], [ac_cv_wuninitialized_flag=no])
|
||||
CPPFLAGS="$saved_CPPFLAGS"
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
|
||||
[ac_cv_wuninitialized_flag=yes], [ac_cv_wuninitialized_flag=no])
|
||||
])
|
||||
|
||||
AC_CACHE_CHECK([whether -Wno-unused-parameter works], [ac_cv_wno_unused_parameter_flag], [
|
||||
saved_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="-Wno-unused-parameter"
|
||||
AC_TRY_COMPILE(, , [ac_cv_wno_unused_parameter_flag=yes], [ac_cv_wno_unused_parameter_flag=no])
|
||||
CPPFLAGS="$CPPFLAGS -Wno-unused-parameter"
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
|
||||
[ac_cv_wno_unused_parameter_flag=yes], [ac_cv_wno_unused_parameter_flag=no])
|
||||
CPPFLAGS="$saved_CPPFLAGS"
|
||||
])
|
||||
|
||||
AC_CACHE_CHECK([whether -Wredundant-decls works], [ac_cv_wredundant_decls_flag], [
|
||||
saved_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="-Wredundant-decls"
|
||||
AC_TRY_COMPILE(, , [ac_cv_wredundant_decls_flag=yes], [ac_cv_wredundant_decls_flag=no])
|
||||
CPPFLAGS="$CPPFLAGS -Wredundant-decls"
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
|
||||
[ac_cv_wredundant_decls_flag=yes], [ac_cv_wredundant_decls_flag=no])
|
||||
CPPFLAGS="$saved_CPPFLAGS"
|
||||
])
|
||||
|
||||
@@ -66,77 +81,74 @@ AC_CACHE_CHECK([whether -Wredundant-decls works], [ac_cv_wredundant_decls_flag],
|
||||
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_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, [
|
||||
AC_CHECK_SIZEOF([off_t], [8], [
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#include <unistd.h>
|
||||
])
|
||||
|
||||
AC_CHECK_SIZEOF(blkcnt_t, 64, [
|
||||
AC_CHECK_SIZEOF([blkcnt_t], [8], [
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.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 statfs getmntent hasmntopt memset time \
|
||||
uname strptime ctime_r register_printf_modifier \
|
||||
register_printf_specifier)
|
||||
AC_CHECK_FUNCS([strerror strstr strtol statfs getmntent hasmntopt memset time \
|
||||
uname strptime ctime_r register_printf_modifier \
|
||||
register_printf_specifier])
|
||||
|
||||
if test -z "${ac_cv_func_register_printf_function}" -a -z "${ac_cv_func_register_printf_specifier}"; then
|
||||
AC_MSG_ERROR(reiserfsprogs requires a method to add printf modifiers)
|
||||
if test "x$ac_cv_func_register_printf_specifier" != xyes -a \
|
||||
"x$ac_cv_func_register_printf_modifier" != xyes; then
|
||||
AC_MSG_ERROR([reiserfsprogs requires a method to add printf modifiers])
|
||||
fi
|
||||
|
||||
|
||||
dnl Never enable this. It is for debugging only
|
||||
AC_ARG_ENABLE(io-failure-emulation,
|
||||
AC_ARG_ENABLE([io-failure-emulation],
|
||||
[AS_HELP_STRING([--enable-io-failure-emulation], [Never use this. It is for debugging only])])
|
||||
if test "$enable_io_failure_emulation" = "yes" ; then
|
||||
AC_MSG_WARN([Careful! IO failure emulation is ON])
|
||||
AC_DEFINE(IO_FAILURE_EMULATION, 1, [gets set when configure --enable-io-failure-emulation])
|
||||
AC_DEFINE([IO_FAILURE_EMULATION], [1], [gets set when configure --enable-io-failure-emulation])
|
||||
fi
|
||||
|
||||
if test "x$ac_cv_wno_unused_parameter_flag" = xyes; then
|
||||
CFLAGS="$CFLAGS -Wno-unused-parameter"
|
||||
else
|
||||
CFLAGS="$CFLAGS -Wno-unused"
|
||||
fi
|
||||
|
||||
|
||||
if test "x$ac_cv_wredundant_decls_flag" = xyes; then
|
||||
CFLAGS="$CFLAGS -Wredundant-decls"
|
||||
fi
|
||||
|
||||
|
||||
if test "x$ac_cv_wuninitialized_flag" = xyes; then
|
||||
CFLAGS="$CFLAGS -Wuninitialized"
|
||||
fi
|
||||
|
||||
CPPFLAGS="-I\$(top_srcdir)/include $CPPFLAGS"
|
||||
|
||||
AC_OUTPUT(
|
||||
include/Makefile
|
||||
mkreiserfs/Makefile
|
||||
mkreiserfs/mkreiserfs.8
|
||||
resize_reiserfs/Makefile
|
||||
resize_reiserfs/resize_reiserfs.8
|
||||
fsck/Makefile
|
||||
fsck/reiserfsck.8
|
||||
lib/Makefile
|
||||
Makefile
|
||||
reiserfscore/Makefile
|
||||
reiserfscore/reiserfscore.pc
|
||||
debugreiserfs/Makefile
|
||||
debugreiserfs/debugreiserfs.8
|
||||
tune/Makefile
|
||||
tune/reiserfstune.8
|
||||
)
|
||||
AC_CONFIG_FILES([
|
||||
Makefile
|
||||
include/Makefile
|
||||
lib/Makefile
|
||||
reiserfscore/Makefile
|
||||
reiserfscore/reiserfscore.pc
|
||||
fsck/Makefile
|
||||
fsck/reiserfsck.8
|
||||
mkreiserfs/Makefile
|
||||
mkreiserfs/mkreiserfs.8
|
||||
debugreiserfs/Makefile
|
||||
debugreiserfs/debugreiserfs.8
|
||||
resize_reiserfs/Makefile
|
||||
resize_reiserfs/resize_reiserfs.8
|
||||
tune/Makefile
|
||||
tune/reiserfstune.8
|
||||
])
|
||||
|
||||
AC_OUTPUT
|
||||
|
||||
AC_MSG_NOTICE([
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ an IDE disk partition or /dev/sdXX for a SCSI disk partition).
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
\fB-j\fR \fIdevice\fR
|
||||
prints the contents of the journal. The option -p allows it to pack the journal
|
||||
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
|
||||
@@ -61,22 +61,22 @@ prints the specified block of the filesystem.
|
||||
.\" formatted nodes found. Can be used to find specific key in the filesystem.
|
||||
.\" .TP
|
||||
.B -p
|
||||
extracts the filesystem's metadata with \fBdebugreiserfs\fR -p /dev/xxx | gzip -c >
|
||||
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.
|
||||
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
|
||||
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
|
||||
were packed with \fBdebugreiserfs \-p\fR, but the filesystem structure is completely
|
||||
recreated.
|
||||
.TP
|
||||
.B -S
|
||||
When -S is not specified -p
|
||||
When \-S is not specified \-p
|
||||
.\" and -s
|
||||
deals with blocks marked used in the filesystem bitmap only. With this option
|
||||
set \fBdebugreiserfs\fR will work with the entire device.
|
||||
@@ -84,7 +84,7 @@ set \fBdebugreiserfs\fR will work with the entire device.
|
||||
.B -q
|
||||
When
|
||||
.\" -s or
|
||||
-p is in use, suppress showing the speed of progress.
|
||||
\-p is in use, suppress showing the speed of progress.
|
||||
.SH AUTHOR
|
||||
This version of \fBdebugreiserfs\fR has been written by Vitaly Fertman
|
||||
<vitaly@namesys.com>.
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
*/
|
||||
|
||||
#include "debugreiserfs.h"
|
||||
#include <com_err.h>
|
||||
|
||||
reiserfs_filsys_t fs;
|
||||
|
||||
@@ -683,7 +684,7 @@ static void debugreiserfs_zero_reiserfs(reiserfs_filsys_t fs)
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
char *file_name;
|
||||
int error;
|
||||
long error;
|
||||
struct debugreiserfs_data *data;
|
||||
FILE *log;
|
||||
|
||||
@@ -701,7 +702,7 @@ int main(int argc, char *argv[])
|
||||
if (no_reiserfs_found(fs)) {
|
||||
reiserfs_exit(1, "\n\ndebugreiserfs: can not open reiserfs on "
|
||||
"\"%s\": %s\n\n", file_name,
|
||||
error ? strerror(error)
|
||||
error ? error_message(error)
|
||||
: "no filesystem found");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@@ -106,13 +106,35 @@ struct packed_item {
|
||||
__u32 type_2_mask_18_len_12;
|
||||
};
|
||||
|
||||
/* defined as inlines in both pack.c and unpack.c */
|
||||
inline void set_pi_type(struct packed_item *pi, __u32 val);
|
||||
inline __u32 get_pi_type(const struct packed_item *pi);
|
||||
inline void set_pi_mask(struct packed_item *pi, __u32 val);
|
||||
inline __u32 get_pi_mask(const struct packed_item *pi);
|
||||
inline void set_pi_item_len(struct packed_item *pi, __u32 val);
|
||||
inline __u32 get_pi_item_len(const struct packed_item *pi);
|
||||
static inline void set_pi_type(struct packed_item *pi, __u32 val)
|
||||
{
|
||||
set_bit_field_XX(32, pi, val, 0, 2);
|
||||
}
|
||||
|
||||
static inline __u32 get_pi_type(const struct packed_item *pi)
|
||||
{
|
||||
get_bit_field_XX(32, pi, 0, 2);
|
||||
}
|
||||
|
||||
static inline void set_pi_mask(struct packed_item *pi, __u32 val)
|
||||
{
|
||||
set_bit_field_XX(32, pi, val, 2, 18);
|
||||
}
|
||||
|
||||
static inline __u32 get_pi_mask(const struct packed_item *pi)
|
||||
{
|
||||
get_bit_field_XX(32, pi, 2, 18);
|
||||
}
|
||||
|
||||
static inline void set_pi_item_len(struct packed_item *pi, __u32 val)
|
||||
{
|
||||
set_bit_field_XX(32, pi, val, 20, 12);
|
||||
}
|
||||
|
||||
static inline __u32 get_pi_item_len(const struct packed_item *pi)
|
||||
{
|
||||
get_bit_field_XX(32, pi, 20, 12);
|
||||
}
|
||||
|
||||
#define HAS_DIR_ID 0x01
|
||||
#define HAS_GEN_COUNTER 0x02
|
||||
|
||||
@@ -16,36 +16,6 @@ reiserfs_bitmap_t *what_to_pack;
|
||||
unsigned long sent_bytes; /* how many bytes sent to stdout */
|
||||
unsigned long had_to_be_sent; /* how many bytes were to be sent */
|
||||
|
||||
inline void set_pi_type(struct packed_item *pi, __u32 val)
|
||||
{
|
||||
set_bit_field_XX(32, pi, val, 0, 2);
|
||||
}
|
||||
|
||||
inline __u32 get_pi_type(const struct packed_item *pi)
|
||||
{
|
||||
get_bit_field_XX(32, pi, 0, 2);
|
||||
}
|
||||
|
||||
inline void set_pi_mask(struct packed_item *pi, __u32 val)
|
||||
{
|
||||
set_bit_field_XX(32, pi, val, 2, 18);
|
||||
}
|
||||
|
||||
__u32 get_pi_mask(const struct packed_item *pi)
|
||||
{
|
||||
get_bit_field_XX(32, pi, 2, 18);
|
||||
}
|
||||
|
||||
inline void set_pi_item_len(struct packed_item *pi, __u32 val)
|
||||
{
|
||||
set_bit_field_XX(32, pi, val, 20, 12);
|
||||
}
|
||||
|
||||
inline __u32 get_pi_item_len(const struct packed_item *pi)
|
||||
{
|
||||
get_bit_field_XX(32, pi, 20, 12);
|
||||
}
|
||||
|
||||
static void pack_ih(struct packed_item *pi, struct item_head *ih)
|
||||
{
|
||||
__u32 v32;
|
||||
|
||||
+1
-1
@@ -387,7 +387,7 @@ static int bad_direct_item(reiserfs_filsys_t fs,
|
||||
return 0;
|
||||
}
|
||||
|
||||
inline void handle_one_pointer(reiserfs_filsys_t fs,
|
||||
static inline void handle_one_pointer(reiserfs_filsys_t fs,
|
||||
struct buffer_head *bh, __le32 * item,
|
||||
int offset)
|
||||
{
|
||||
|
||||
+2
-2
@@ -1318,7 +1318,7 @@ int main(int argc, char *argv[])
|
||||
struct rlimit rlim = { RLIM_INFINITY, RLIM_INFINITY };
|
||||
char *width;
|
||||
int retval;
|
||||
int error;
|
||||
long error;
|
||||
|
||||
width = getenv("COLUMNS");
|
||||
if (width)
|
||||
@@ -1391,7 +1391,7 @@ int main(int argc, char *argv[])
|
||||
if (error) {
|
||||
reiserfs_exit(EXIT_OPER, "Failed to open the device "
|
||||
"'%s': %s\n\n", file_name,
|
||||
strerror(error));
|
||||
error_message(error));
|
||||
}
|
||||
|
||||
if (data->mode != FSCK_SB) {
|
||||
|
||||
+20
-19
@@ -59,10 +59,10 @@ for directories, and deleting invalid directory entries.
|
||||
.B --rebuild-tree
|
||||
This option rebuilds the entire filesystem tree using leaf nodes
|
||||
found on the device. Normally you only need this option if the
|
||||
\fBreiserfsck --check\fR reports "Running with \fB--rebuild-tree\fR
|
||||
\fBreiserfsck \-\-check\fR reports "Running with \fB\-\-rebuild-tree\fR
|
||||
is required". You are strongly encouraged to make a backup copy
|
||||
of the whole partition before attempting the \fB--rebuild-tree\fR
|
||||
option. Once \fBreiserfsck --rebuild-tree\fR is started it must
|
||||
option. Once \fBreiserfsck \-\-rebuild-tree\fR is started it must
|
||||
finish its work (and you should not interrupt it), otherwise the
|
||||
filesystem will be left in the unmountable state to avoid subsequent
|
||||
data corruptions.
|
||||
@@ -95,7 +95,7 @@ byte are corrected by \fB--fix-fixable\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. 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
|
||||
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
|
||||
@@ -114,7 +114,7 @@ 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
|
||||
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 filesystem, to check if error
|
||||
flags in the superblock are set and to do some light-weight checks. If these
|
||||
@@ -129,7 +129,8 @@ Force checking even if the file system seems clean.
|
||||
.B -V
|
||||
This option prints the reiserfsprogs version and then exit.
|
||||
.TP
|
||||
\fB-r\fR This option does nothing at all; it is provided only for
|
||||
.B -r
|
||||
This option does nothing at all; it is provided only for
|
||||
backwards compatibility.
|
||||
.SH EXPERT OPTIONS
|
||||
DO NOT USE THESE OPTIONS UNLESS YOU KNOW WHAT YOU ARE DOING.
|
||||
@@ -149,23 +150,23 @@ the used space on the partition.
|
||||
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.
|
||||
|
||||
2. Run \fBreiserfsck --check --logfile check.log /dev/hda1\fR. If \fBreiserfsck
|
||||
--check\fR exits with status 0 it means no errors were discovered.
|
||||
2. Run \fBreiserfsck \-\-check \-\-logfile check.log /dev/hda1\fR. If \fBreiserfsck
|
||||
\-\-check\fR exits with status 0 it means no errors were discovered.
|
||||
|
||||
3. If \fBreiserfsck --check\fR exits with status 1 (and reports about fixable
|
||||
corruptions) it means that you should run \fBreiserfsck --fix-fixable --logfile
|
||||
3. If \fBreiserfsck \-\-check\fR exits with status 1 (and reports about fixable
|
||||
corruptions) it means that you should run \fBreiserfsck \-\-fix-fixable \-\-logfile
|
||||
fixable.log /dev/hda1\fR.
|
||||
|
||||
4. If \fBreiserfsck --check\fR exits with status 2 (and reports about fatal
|
||||
corruptions) it means that you need to run \fBreiserfsck --rebuild-tree\fR.
|
||||
If \fBreiserfsck --check\fR fails in some way you should also run \fBreiserfsck
|
||||
--rebuild-tree\fR, but we also encourage you to submit this as a bug report.
|
||||
4. If \fBreiserfsck \-\-check\fR exits with status 2 (and reports about fatal
|
||||
corruptions) it means that you need to run \fBreiserfsck \-\-rebuild\-tree\fR.
|
||||
If \fBreiserfsck \-\-check\fR fails in some way you should also run \fBreiserfsck
|
||||
\-\-rebuild-tree\fR, but we also encourage you to submit this as a bug report.
|
||||
|
||||
5. Before running \fBreiserfsck --rebuild-tree\fR, please make a backup of
|
||||
the whole partition before proceeding. Then run \fBreiserfsck --rebuild-tree
|
||||
--logfile rebuild.log /dev/hda1\fR.
|
||||
5. Before running \fBreiserfsck \-\-rebuild-tree\fR, please make a backup of
|
||||
the whole partition before proceeding. Then run \fBreiserfsck \-\-rebuild-tree
|
||||
\-\-logfile rebuild.log /dev/hda1\fR.
|
||||
|
||||
6. If the \fBreiserfsck --rebuild-tree\fR step fails or does not recover what
|
||||
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 including your platform and Linux kernel version. We
|
||||
will try to help solve the problem.
|
||||
@@ -180,11 +181,11 @@ will try to help solve the problem.
|
||||
.br
|
||||
\ \fI4\fR \-\ File system fatal errors left uncorrected,
|
||||
.br
|
||||
\ \fBreiserfsck --rebuild-tree\fR needs to be launched.
|
||||
\ \fBreiserfsck \-\-rebuild-tree\fR needs to be launched.
|
||||
.br
|
||||
\ \fI6\fR \-\ File system fixable errors left uncorrected,
|
||||
.br
|
||||
\ \fBreiserfsck --fix-fixable\fR needs to be launched.
|
||||
\ \fBreiserfsck \-\-fix-fixable\fR needs to be launched.
|
||||
.br
|
||||
\ \fI8\fR \-\ Operational error.
|
||||
.br
|
||||
|
||||
+13
-5
@@ -190,6 +190,7 @@ void rebuild_sb(reiserfs_filsys_t fs, char *filename, struct fsck_data *data)
|
||||
size_t n = 0;
|
||||
struct stat stat_buf;
|
||||
int retval, exit_code = EXIT_OK;
|
||||
long error;
|
||||
|
||||
if (!no_reiserfs_found(fs)) {
|
||||
sb = getmem(sizeof(*sb));
|
||||
@@ -381,24 +382,31 @@ void rebuild_sb(reiserfs_filsys_t fs, char *filename, struct fsck_data *data)
|
||||
switch (version) {
|
||||
case 1:
|
||||
fs = reiserfs_create(filename, REISERFS_FORMAT_3_6,
|
||||
block_count, retval, 1, 1);
|
||||
block_count, retval, 1, 1,
|
||||
&error);
|
||||
break;
|
||||
case 2:
|
||||
fs = reiserfs_create(filename, REISERFS_FORMAT_3_5,
|
||||
block_count, retval, 1, 1);
|
||||
block_count, retval, 1, 1,
|
||||
&error);
|
||||
break;
|
||||
case 3:
|
||||
fs = reiserfs_create(filename, REISERFS_FORMAT_3_6,
|
||||
block_count, retval, 1, 0);
|
||||
block_count, retval, 1, 0,
|
||||
&error);
|
||||
break;
|
||||
case 4:
|
||||
fs = reiserfs_create(filename, REISERFS_FORMAT_3_5,
|
||||
block_count, retval, 1, 0);
|
||||
block_count, retval, 1, 0,
|
||||
&error);
|
||||
break;
|
||||
}
|
||||
|
||||
if (fs == NULL)
|
||||
if (fs == NULL) {
|
||||
fprintf(stderr, "reiserfs_create failed: %s\n",
|
||||
error_message(error));
|
||||
return;
|
||||
}
|
||||
|
||||
sb = fs->fs_ondisk_sb;
|
||||
fs->fs_vp = data;
|
||||
|
||||
+15
-6
@@ -222,13 +222,22 @@ static inline unsigned long long misc_find_next_set_bit(const void *vaddr,
|
||||
return res + (p - addr) * 8;
|
||||
}
|
||||
|
||||
#define STAT_FIELD_H(Field, Type) \
|
||||
inline Type misc_device_##Field(const char *device);
|
||||
#define STAT_FIELD(Field, Type) \
|
||||
static inline Type misc_device_##Field(const char *device) \
|
||||
{ \
|
||||
struct stat st; \
|
||||
\
|
||||
if (stat(device, &st) == 0) \
|
||||
return st.st_##Field; \
|
||||
\
|
||||
fprintf(stderr, "Stat of the device '%s' failed.", device); \
|
||||
exit(8); \
|
||||
}
|
||||
|
||||
STAT_FIELD_H(mode, mode_t);
|
||||
STAT_FIELD_H(rdev, dev_t);
|
||||
STAT_FIELD_H(size, off_t);
|
||||
STAT_FIELD_H(blocks, blkcnt_t);
|
||||
STAT_FIELD(mode, mode_t);
|
||||
STAT_FIELD(rdev, dev_t);
|
||||
STAT_FIELD(size, off_t);
|
||||
STAT_FIELD(blocks, blkcnt_t);
|
||||
|
||||
__u16 mask16(int from, int count);
|
||||
__u32 mask32(int from, int count);
|
||||
|
||||
@@ -1581,7 +1581,7 @@ static inline void buffer_info_init_bh(const struct tree_balance *tb,
|
||||
struct buffer_info *bi,
|
||||
struct buffer_head *bh)
|
||||
{
|
||||
bi->bi_fs = tb->tb_fs;
|
||||
bi->bi_fs = tb ? tb->tb_fs : NULL;
|
||||
bi->bi_bh = bh;
|
||||
bi->bi_parent = NULL;
|
||||
bi->bi_position = 0;
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
typedef struct reiserfs_filsys * reiserfs_filsys_t;
|
||||
|
||||
#include <com_err.h>
|
||||
#include "reiserfs_fs.h"
|
||||
|
||||
struct _bitmap {
|
||||
@@ -75,11 +76,12 @@ typedef struct _transaction reiserfs_trans_t;
|
||||
void init_tb_struct(struct tree_balance *tb, reiserfs_filsys_t ,
|
||||
struct reiserfs_path *path, int size);
|
||||
|
||||
reiserfs_filsys_t reiserfs_open(const char *filename, int flags, int *error,
|
||||
reiserfs_filsys_t reiserfs_open(const char *filename, int flags, long *error,
|
||||
void *vp, int skip_check);
|
||||
reiserfs_filsys_t reiserfs_create(const char *filename, int version,
|
||||
unsigned long block_count, int block_size,
|
||||
int default_journal, int new_format);
|
||||
int default_journal, int new_format,
|
||||
long *error);
|
||||
void reiserfs_flush(reiserfs_filsys_t );
|
||||
void reiserfs_free(reiserfs_filsys_t );
|
||||
void reiserfs_close(reiserfs_filsys_t );
|
||||
|
||||
-16
@@ -27,22 +27,6 @@
|
||||
#include <sys/mount.h>
|
||||
/* End Debian mods */
|
||||
|
||||
#define STAT_FIELD(Field, Type) \
|
||||
inline Type misc_device_##Field(const char *device) { \
|
||||
struct stat st; \
|
||||
\
|
||||
if (stat(device, &st) == 0) \
|
||||
return st.st_##Field; \
|
||||
\
|
||||
fprintf(stderr, "Stat of the device '%s' failed.", device); \
|
||||
exit(8); \
|
||||
}
|
||||
|
||||
STAT_FIELD(mode, mode_t);
|
||||
STAT_FIELD(rdev, dev_t);
|
||||
STAT_FIELD(size, off_t);
|
||||
STAT_FIELD(blocks, blkcnt_t);
|
||||
|
||||
void die(const char *fmt, ...)
|
||||
{
|
||||
static char buf[1024];
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
#define _XOPEN_SOURCE
|
||||
#define _GNU_SOURCE
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
@@ -88,7 +88,7 @@ be adjusted.
|
||||
\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
|
||||
\fB/sbin/badblocks -b block-size device\fR.
|
||||
\fB/sbin/badblocks \-b block-size device\fR.
|
||||
.TP
|
||||
\fB-f\fR
|
||||
Forces \fBmkreiserfs\fR to continue even when the device is the whole disk,
|
||||
|
||||
@@ -576,6 +576,7 @@ int main(int argc, char **argv)
|
||||
__u64 fs_size = 0;
|
||||
int c;
|
||||
static int flag;
|
||||
long error;
|
||||
|
||||
program_name = strrchr(argv[0], '/');
|
||||
|
||||
@@ -751,9 +752,11 @@ int main(int argc, char **argv)
|
||||
return 1;
|
||||
|
||||
fs = reiserfs_create(device_name, select_format(), fs_size, Block_size,
|
||||
Create_default_journal, 1);
|
||||
Create_default_journal, 1, &error);
|
||||
|
||||
if (!fs) {
|
||||
reiserfs_warning(stderr, "reiserfs_create failed: %s %ld\n",
|
||||
error_message(error), error);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,22 @@
|
||||
lib_LTLIBRARIES = libreiserfscore.la
|
||||
|
||||
reiserfsdir = $(includedir)/reiserfs
|
||||
reiserfs_HEADERS = reiserfs_err.h
|
||||
|
||||
reiserfs_err.c reiserfs_err.h: reiserfs_err.et
|
||||
$(RM) -f reisefs_err.c reiserfs_err.h
|
||||
compile_et reiserfs_err.et
|
||||
reiserfs_err.h: reiserfs_err.c
|
||||
|
||||
BUILT_SOURCES = reiserfs_err.h reiserfs_err.c
|
||||
CLEANFILES = reiserfs_err.h reiserfs_err.c
|
||||
EXTRA_DIST = reiserfs_err.et
|
||||
|
||||
libreiserfscore_la_SOURCES = do_balan.c fix_node.c hashes.c ibalance.c \
|
||||
lbalance.c prints.c stree.c node_formats.c \
|
||||
reiserfslib.c bitmap.c journal.c xattr.c includes.h
|
||||
libreiserfscore_la_LIBADD = ../lib/libmisc.la
|
||||
reiserfslib.c bitmap.c journal.c xattr.c \
|
||||
includes.h reiserfs_err.c
|
||||
libreiserfscore_la_LIBADD = ../lib/libmisc.la -lcom_err
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = reiserfscore.pc
|
||||
@@ -881,8 +881,9 @@ int balance_internal(struct tree_balance *tb, /* tree_balance structure
|
||||
insert_key, insert_ptr);
|
||||
}
|
||||
|
||||
memcpy(new_insert_key_addr, &new_insert_key, KEY_SIZE);
|
||||
insert_ptr[0] = new_insert_ptr;
|
||||
if (new_insert_ptr)
|
||||
memcpy(new_insert_key_addr, &new_insert_key, KEY_SIZE);
|
||||
|
||||
return order;
|
||||
}
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "io.h"
|
||||
#include "misc.h"
|
||||
#include "reiserfs_lib.h"
|
||||
#include "reiserfs_err.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
# reiserfs_err.et - Error codes for reiserfscore
|
||||
#
|
||||
# Copyright (C) 2016 SUSE
|
||||
#
|
||||
error_table reiserfs
|
||||
ec REISERFS_ET_BREAD_FAILED,
|
||||
"bread failed to read block"
|
||||
|
||||
ec REISERFS_ET_BAD_MAGIC,
|
||||
"the reiserfs superblock cannot be found"
|
||||
|
||||
ec REISERFS_ET_BAD_SUPER,
|
||||
"a superblock with wrong parameters was found in the block"
|
||||
|
||||
ec REISERFS_ET_SMALL_PARTITION,
|
||||
"Your partition is not big enough to contain the filesystem"
|
||||
|
||||
ec REISERFS_ET_NOT_ENOUGH_BLOCKS,
|
||||
"not enough blocks on device"
|
||||
|
||||
ec REISERFS_ET_TOO_SMALL,
|
||||
"cannot create a file system that small"
|
||||
|
||||
ec REISERFS_ET_GETBLK_FAILED,
|
||||
"getblk failed"
|
||||
|
||||
end
|
||||
@@ -5,6 +5,6 @@ includedir=@includedir@
|
||||
|
||||
Name: reiserfscore
|
||||
Description: ReiserFS Core Library
|
||||
Version: @REISERFSPROGS_VERSION@
|
||||
Version: @PACKAGE_VERSION@
|
||||
Cflags: -I${includedir}/reiserfs -I${includedir}
|
||||
Libs: -L${libdir} -lreiserfscore
|
||||
+22
-34
@@ -56,7 +56,7 @@ int is_block_count_correct(unsigned long journal_offset,
|
||||
is refused. Journal and bitmap are to be opened separately.
|
||||
skip_check is set to 1 if checks of openned SB should be omitted.*/
|
||||
reiserfs_filsys_t reiserfs_open(const char *filename, int flags,
|
||||
int *error, void *vp, int check)
|
||||
long *error, void *vp, int check)
|
||||
{
|
||||
reiserfs_filsys_t fs;
|
||||
struct buffer_head *bh;
|
||||
@@ -67,8 +67,7 @@ reiserfs_filsys_t reiserfs_open(const char *filename, int flags,
|
||||
/* convert root dir key and parent root dir key to little endian format */
|
||||
make_const_keys();
|
||||
|
||||
if (error)
|
||||
*error = 0;
|
||||
*error = 0;
|
||||
|
||||
fd = open(filename, flags
|
||||
#if defined(O_LARGEFILE)
|
||||
@@ -76,8 +75,7 @@ reiserfs_filsys_t reiserfs_open(const char *filename, int flags,
|
||||
#endif
|
||||
);
|
||||
if (fd == -1) {
|
||||
if (error)
|
||||
*error = errno;
|
||||
*error = errno;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -91,9 +89,7 @@ reiserfs_filsys_t reiserfs_open(const char *filename, int flags,
|
||||
for (i = 2; i < 17; i += 14) {
|
||||
bh = bread(fd, i, 4096);
|
||||
if (!bh) {
|
||||
reiserfs_warning(stderr,
|
||||
"reiserfs_open: bread failed reading block %d\n",
|
||||
i);
|
||||
*error = REISERFS_ET_BREAD_FAILED;
|
||||
} else {
|
||||
sb = (struct reiserfs_super_block *)bh->b_data;
|
||||
|
||||
@@ -105,9 +101,7 @@ reiserfs_filsys_t reiserfs_open(const char *filename, int flags,
|
||||
}
|
||||
}
|
||||
|
||||
reiserfs_warning(stderr,
|
||||
"\nreiserfs_open: the reiserfs superblock cannot be found on %s.\n",
|
||||
filename);
|
||||
*error = REISERFS_ET_BAD_MAGIC;
|
||||
|
||||
freemem(fs);
|
||||
close(fd);
|
||||
@@ -117,9 +111,7 @@ reiserfs_filsys_t reiserfs_open(const char *filename, int flags,
|
||||
found:
|
||||
|
||||
if (!is_blocksize_correct(get_sb_block_size(sb))) {
|
||||
reiserfs_warning(stderr,
|
||||
"reiserfs_open: a superblock with wrong parameters "
|
||||
"was found in the block (%d).\n", i);
|
||||
*error = REISERFS_ET_BAD_SUPER;
|
||||
freemem(fs);
|
||||
close(fd);
|
||||
brelse(bh);
|
||||
@@ -135,12 +127,7 @@ found:
|
||||
get_sb_block_size(sb));
|
||||
|
||||
if (!tmp_bh) {
|
||||
reiserfs_warning(stderr,
|
||||
"\n%s: Your partition is not big enough to contain the \n"
|
||||
"filesystem of (%lu) blocks as was specified in the found super block.\n",
|
||||
__FUNCTION__,
|
||||
get_sb_block_count(sb) - 1);
|
||||
|
||||
*error = REISERFS_ET_SMALL_PARTITION;
|
||||
freemem(fs);
|
||||
close(fd);
|
||||
brelse(bh);
|
||||
@@ -158,9 +145,7 @@ found:
|
||||
brelse(bh);
|
||||
bh = bread(fd, i, fs->fs_blocksize);
|
||||
if (!bh) {
|
||||
reiserfs_warning(stderr,
|
||||
"reiserfs_open: bread failed reading block %d, size %d\n",
|
||||
i, fs->fs_blocksize);
|
||||
*error = REISERFS_ET_BREAD_FAILED;
|
||||
freemem(fs);
|
||||
return NULL;
|
||||
}
|
||||
@@ -189,32 +174,32 @@ reiserfs_filsys_t reiserfs_create(const char *filename,
|
||||
int version,
|
||||
unsigned long block_count,
|
||||
int block_size,
|
||||
int default_journal, int new_format)
|
||||
int default_journal, int new_format,
|
||||
long *error)
|
||||
{
|
||||
reiserfs_filsys_t fs;
|
||||
time_t now;
|
||||
unsigned int bmap_nr = reiserfs_bmap_nr(block_count, block_size);;
|
||||
|
||||
*error = 0;
|
||||
|
||||
/* convert root dir key and parent root dir key to little endian format */
|
||||
make_const_keys();
|
||||
|
||||
if (count_blocks(filename, block_size) < block_count) {
|
||||
reiserfs_warning(stderr,
|
||||
"reiserfs_create: no enough blocks on device\n");
|
||||
*error = REISERFS_ET_NOT_ENOUGH_BLOCKS;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!is_block_count_correct(REISERFS_DISK_OFFSET_IN_BYTES / block_size,
|
||||
block_size, block_count, 0)) {
|
||||
reiserfs_warning(stderr,
|
||||
"reiserfs_create: can not create that small "
|
||||
"(%u blocks) filesystem\n", block_count);
|
||||
*error = REISERFS_ET_TOO_SMALL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
fs = getmem(sizeof(*fs));
|
||||
if (!fs) {
|
||||
reiserfs_warning(stderr, "reiserfs_create: getmem failed\n");
|
||||
*error = errno;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -224,9 +209,7 @@ reiserfs_filsys_t reiserfs_create(const char *filename,
|
||||
#endif
|
||||
);
|
||||
if (fs->fs_dev == -1) {
|
||||
reiserfs_warning(stderr,
|
||||
"reiserfs_create: could not open %s: %s\n",
|
||||
filename, strerror(errno));
|
||||
*error = errno;
|
||||
freemem(fs);
|
||||
return NULL;
|
||||
}
|
||||
@@ -245,7 +228,7 @@ reiserfs_filsys_t reiserfs_create(const char *filename,
|
||||
block_size, block_size);
|
||||
|
||||
if (!fs->fs_super_bh) {
|
||||
reiserfs_warning(stderr, "reiserfs_create: getblk failed\n");
|
||||
*error = REISERFS_ET_GETBLK_FAILED;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -1647,3 +1630,8 @@ fail:
|
||||
pathrelse(&path);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void __attribute__ ((constructor)) init(void)
|
||||
{
|
||||
initialize_reiserfs_error_table();
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
#include <sys/types.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <sys/acl.h>
|
||||
#include "reiserfs_lib.h"
|
||||
|
||||
static inline unsigned short from32to16(unsigned int x)
|
||||
|
||||
@@ -102,7 +102,7 @@ with a
|
||||
.br
|
||||
\ umount /mnt
|
||||
.br
|
||||
\ resize_reiserfs -s -1G /dev/hda8
|
||||
\ resize_reiserfs \-s \-1G /dev/hda8
|
||||
.br
|
||||
\ mount /dev/hda8 /mnt
|
||||
.br
|
||||
|
||||
@@ -191,7 +191,7 @@ int main(int argc, char *argv[])
|
||||
struct reiserfs_super_block *sb;
|
||||
|
||||
int c;
|
||||
int error;
|
||||
long error;
|
||||
|
||||
struct reiserfs_super_block *sb_old;
|
||||
|
||||
@@ -253,7 +253,7 @@ int main(int argc, char *argv[])
|
||||
if (!fs) {
|
||||
if (error) {
|
||||
reiserfs_exit(1, "cannot open '%s': %s",
|
||||
devname, strerror(error));
|
||||
devname, error_message(error));
|
||||
} else {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@@ -197,14 +197,14 @@ it working with its journal on the device /dev/journal
|
||||
.nf
|
||||
.IP
|
||||
boot kernel patched with special "relocatable journal support" patch
|
||||
reiserfstune /dev/hda1 --journal-new-device /dev/journal -f
|
||||
reiserfstune /dev/hda1 \-\-journal\-new\-device /dev/journal \-f
|
||||
mount /dev/hda1 and use.
|
||||
You would like to change max transaction size to 512 blocks
|
||||
reiserfstune -t 512 /dev/hda1
|
||||
reiserfstune \-t 512 /dev/hda1
|
||||
You would like to use your file system on another kernel that doesn't
|
||||
contain relocatable journal support.
|
||||
umount /dev/hda1
|
||||
reiserfstune /dev/hda1 -j /dev/journal --journal-new-device /dev/hda1 --make-journal-standard
|
||||
reiserfstune /dev/hda1 \-j /dev/journal \-\-journal\-new\-device /dev/hda1 \-\-make\-journal\-standard
|
||||
mount /dev/hda1 and use.
|
||||
.LP
|
||||
2. You would like to have ReiserFS on /dev/hda1 and to be able to
|
||||
@@ -215,13 +215,13 @@ device containing the filesystem.
|
||||
boot kernel patched with special "relocatable journal support" patch
|
||||
mkreiserfs /dev/hda1
|
||||
you got solid state disk (perhaps /dev/sda, they typically look like scsi disks)
|
||||
reiserfstune --journal-new-device /dev/sda1 -f /dev/hda1
|
||||
reiserfstune \-\-journal\-new\-device /dev/sda1 \-f /dev/hda1
|
||||
Your scsi device dies, it is three in the morning, you have an extra IDE device
|
||||
lying around
|
||||
reiserfsck --no-journal-available /dev/hda1
|
||||
reiserfsck \-\-no\-journal\-available /dev/hda1
|
||||
or
|
||||
reiserfsck --rebuild-tree --no-journal-available /dev/hda1
|
||||
reiserfstune --no-journal-available --journal-new-device /dev/hda1 /dev/hda1
|
||||
reiserfsck \-\-rebuild-tree \-\-no\-journal\-available /dev/hda1
|
||||
reiserfstune \-\-no\-journal\-available \-\-journal\-new\-device /dev/hda1 /dev/hda1
|
||||
using /dev/hda1 under patched kernel
|
||||
.SH AUTHOR
|
||||
This version of \fBreiserfstune\fR has been written by Vladimir
|
||||
|
||||
+4
-2
@@ -398,6 +398,7 @@ int main(int argc, char **argv)
|
||||
struct reiserfs_journal_header *j_head;
|
||||
reiserfs_trans_t old, new;
|
||||
int Is_journal_or_maxtrans_size_specified = 0;
|
||||
long error;
|
||||
|
||||
program_name = strrchr(argv[0], '/');
|
||||
|
||||
@@ -560,9 +561,10 @@ int main(int argc, char **argv)
|
||||
/* device to be formatted */
|
||||
device_name = argv[optind];
|
||||
|
||||
fs = reiserfs_open(device_name, O_RDONLY, NULL, NULL, 1);
|
||||
fs = reiserfs_open(device_name, O_RDONLY, &error, NULL, 1);
|
||||
if (no_reiserfs_found(fs)) {
|
||||
message("Cannot open reiserfs on %s", device_name);
|
||||
message("Cannot open reiserfs on %s: %s", device_name,
|
||||
error_message(error));
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user