Imported reiserfsprogs-3.6.21

This commit is contained in:
Jeff Mahoney committed 2012-10-11 11:32:39 -04:00
1 parent dac518d099
commit 149a82e2e9
193 files changed
+32708 -44216

No files matched your search

+1 -1
View File
@@ -1 +1 @@
SUBDIRS = misc reiserfs util
noinst_HEADERS = io.h misc.h reiserfs_fs.h reiserfs_lib.h swab.h parse_time.h progbar.h
+98 -173
View File
@@ -1,8 +1,8 @@
# Makefile.in generated by automake 1.9.5 from Makefile.am.
# Makefile.in generated by automake 1.10 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005 Free Software Foundation, Inc.
# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -13,15 +13,12 @@
# PARTICULAR PURPOSE.
@SET_MAKE@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
@@ -36,29 +33,22 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = include
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/config.h.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
install-exec-recursive install-info-recursive \
install-recursive installcheck-recursive installdirs-recursive \
pdf-recursive ps-recursive uninstall-info-recursive \
uninstall-recursive
HEADERS = $(noinst_HEADERS)
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
@@ -77,6 +67,8 @@ ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -87,9 +79,8 @@ LIBS = @LIBS@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -98,18 +89,17 @@ PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PROGS_LDFLAGS = @PROGS_LDFLAGS@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
UUID_LIBS = @UUID_LIBS@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
@@ -121,30 +111,42 @@ build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
SUBDIRS = misc reiserfs util
all: all-recursive
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
noinst_HEADERS = io.h misc.h reiserfs_fs.h reiserfs_lib.h swab.h parse_time.h progbar.h
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-am
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@@ -176,78 +178,23 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
uninstall-info-am:
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
@failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
config.h: stamp-h1
@if test ! -f $@; then \
rm -f stamp-h1; \
$(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
else :; fi
mostlyclean-recursive clean-recursive distclean-recursive \
maintainer-clean-recursive:
@failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
rev=''; for subdir in $$list; do \
if test "$$subdir" = "."; then :; else \
rev="$$subdir $$rev"; \
fi; \
done; \
rev="$$rev ."; \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
done
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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_srcdir) && $(AUTOHEADER)
rm -f stamp-h1
touch $@
distclean-hdr:
-rm -f config.h stamp-h1
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -259,24 +206,11 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
mkid -fID $$unique
tags: TAGS
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
@@ -288,11 +222,11 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$$tags $$unique; \
fi
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
@@ -311,22 +245,21 @@ distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
@@ -337,35 +270,19 @@ distdir: $(DISTFILES)
|| exit 1; \
fi; \
done
list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -d "$(distdir)/$$subdir" \
|| $(mkdir_p) "$(distdir)/$$subdir" \
|| exit 1; \
distdir=`$(am__cd) $(distdir) && pwd`; \
top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
(cd $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$top_distdir" \
distdir="$$distdir/$$subdir" \
distdir) \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-recursive
all-am: Makefile
installdirs: installdirs-recursive
installdirs-am:
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
check: check-am
all-am: Makefile $(HEADERS) config.h
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
@@ -381,65 +298,73 @@ distclean-generic:
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive
clean: clean-am
clean-am: clean-generic mostlyclean-am
distclean: distclean-recursive
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-tags
distclean-am: clean-am distclean-generic distclean-hdr distclean-tags
dvi: dvi-recursive
dvi: dvi-am
dvi-am:
html: html-recursive
html: html-am
info: info-recursive
info: info-am
info-am:
install-data-am:
install-dvi: install-dvi-am
install-exec-am:
install-info: install-info-recursive
install-html: install-html-am
install-info: install-info-am
install-man:
install-pdf: install-pdf-am
install-ps: install-ps-am
installcheck-am:
maintainer-clean: maintainer-clean-recursive
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic
pdf: pdf-recursive
pdf: pdf-am
pdf-am:
ps: ps-recursive
ps: ps-am
ps-am:
uninstall-am: uninstall-info-am
uninstall-am:
uninstall-info: uninstall-info-recursive
.MAKE: install-am install-strip
.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
clean clean-generic clean-recursive ctags ctags-recursive \
distclean distclean-generic distclean-recursive distclean-tags \
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
ctags distclean distclean-generic distclean-hdr distclean-tags \
distdir dvi dvi-am html html-am info info-am install \
install-am install-data install-data-am install-exec \
install-exec-am install-info install-info-am install-man \
install-am install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am install-man \
install-pdf install-pdf-am install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
installdirs-am maintainer-clean maintainer-clean-generic \
maintainer-clean-recursive mostlyclean mostlyclean-generic \
mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
uninstall uninstall-am uninstall-info-am
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
uninstall-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
+160
View File
@@ -0,0 +1,160 @@
/* include/config.h.in. Generated from configure.in by autoheader. */
/* Define for enable debug info. */
#undef ENABLE_DEBUG
/* Define to 1 if you have the `ctime_r' function. */
#undef HAVE_CTIME_R
/* 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
/* Define to 1 if you have the `uuid' library (-luuid). */
#undef HAVE_LIBUUID
/* Define to 1 if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H
/* Define to 1 if you have the <malloc.h> header file. */
#undef HAVE_MALLOC_H
/* 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
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the `strerror' function. */
#undef HAVE_STRERROR
/* Define to 1 if you have the `strftime' function. */
#undef HAVE_STRFTIME
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the `strptime' function. */
#undef HAVE_STRPTIME
/* Define to 1 if you have the `strstr' function. */
#undef HAVE_STRSTR
/* Define to 1 if you have the `strtol' function. */
#undef HAVE_STRTOL
/* Define to 1 if `st_rdev' is member of `struct stat'. */
#undef HAVE_STRUCT_STAT_ST_RDEV
/* Define to 1 if your `struct stat' has `st_rdev'. Deprecated, use
`HAVE_STRUCT_STAT_ST_RDEV' instead. */
#undef HAVE_ST_RDEV
/* Define to 1 if you have the <sys/ioctl.h> header file. */
#undef HAVE_SYS_IOCTL_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* 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
/* Define to 1 if you have the <uuid/uuid.h> header file. */
#undef HAVE_UUID_UUID_H
/* Define to 1 if you have the `vprintf' function. */
#undef HAVE_VPRINTF
/* 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
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* The size of `blkcnt_t', as computed by sizeof. */
#undef SIZEOF_BLKCNT_T
/* The size of `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
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
#undef inline
#endif
/* Define to `unsigned int' if <sys/types.h> does not define. */
#undef size_t
+84
View File
@@ -0,0 +1,84 @@
/*
* Copyright 1996-2004 by Hans Reiser, licensing governed by
* 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;
unsigned long b_size;
char * b_data;
unsigned long b_state;
unsigned int b_count;
unsigned int b_list ;
void (*b_start_io) (unsigned long);
void (*b_end_io)(struct buffer_head *bh, int uptodate);
struct buffer_head * b_next;
struct buffer_head * b_prev;
struct buffer_head * b_hash_next;
struct buffer_head * b_hash_prev;
};
#define BH_Uptodate 0
#define BH_Dirty 1
#define BH_Lock 2
#define BH_Do_not_flush 3
#define buffer_uptodate(bh) misc_test_bit(BH_Uptodate, &(bh)->b_state)
#define buffer_dirty(bh) misc_test_bit(BH_Dirty, &(bh)->b_state)
#define buffer_locked(bh) misc_test_bit(BH_Lock, &(bh)->b_state)
#define buffer_clean(bh) !misc_test_bit(BH_Dirty, &(bh)->b_state)
#define buffer_do_not_flush(bh) misc_test_bit(BH_Do_not_flush, &(bh)->b_state)
#define mark_buffer_dirty(bh) misc_set_bit(BH_Dirty, &(bh)->b_state)
#define mark_buffer_uptodate(bh,i) misc_set_bit(BH_Uptodate, &(bh)->b_state)
#define mark_buffer_clean(bh) misc_clear_bit(BH_Dirty, &(bh)->b_state)
#define mark_buffer_do_not_flush(bh) misc_set_bit(BH_Do_not_flush, &(bh)->b_state)
#define clear_buffer_do_not_flush(bh) misc_clear_bit(BH_Do_not_flush, &(bh)->b_state)
/*
printf ("%s:%s:%u %p %p %p\n",
__FILE__, __FUNCTION__, __LINE__,
__builtin_return_address (0),
__builtin_return_address (1),
__builtin_return_address (2));
*/
void __wait_on_buffer (struct buffer_head * bh);
struct buffer_head * getblk (int dev, unsigned long block, int size);
struct buffer_head * reiserfs_getblk (int dev, unsigned long block, int size, int *repeat);
struct buffer_head * find_buffer (int dev, unsigned long block, unsigned long size);
struct buffer_head * get_hash_table(dev_t dev, unsigned long block, int size);
struct buffer_head * bread (int dev, unsigned long block, size_t size);
struct buffer_head * reiserfs_bread (int dev, unsigned long block, int size, int *repeat);
int bwrite (struct buffer_head * bh);
void brelse (struct buffer_head * bh);
void bforget (struct buffer_head * bh);
void init_rollback_file (char * rollback_file, int *bloksize, FILE * log);
int open_rollback_file (char * rollback_file, FILE * log);
void close_rollback_file ();
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
+189
View File
@@ -0,0 +1,189 @@
/*
* Copyright 1996-2004 by Hans Reiser, licensing governed by
* reiserfsprogs/README
*/
/* nothing abount reiserfs here */
#ifndef REISERFSPROGS_MISC_H
#define REISERFSPROGS_MISC_H
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <stdio.h>
#include <unistd.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
#define INVAL_PTR (void *)-1
void check_memory_msg(void);
void die (char * fmt, ...) __attribute__ ((format (printf, 1, 2)));
void * getmem (int size);
void *mem_alloc(int size);
void freemem (void * p);
void checkmem (char * p, int size);
void * expandmem (void * p, int size, int by);
unsigned int get_mem_size (char * p);
void check_and_free_mem (void);
char * kdevname (int dev);
typedef enum mount_flags {
MF_NOT_MOUNTED = 0x0,
MF_RO = 0x1,
MF_RW = 0x2
} mount_flags_t;
typedef struct mount_hint {
char *point; /* Mount point. */
__u32 psize; /* Mount point buffer size. */
__u32 flags; /* Mount flags. */
} mount_hint_t;
struct mntent *misc_mntent(char *device);
int misc_device_mounted(char *device);
void misc_print_credit(FILE *out);
typedef struct dma_info {
int fd;
struct stat st;
int support_type;
int dma;
__u64 speed;
} dma_info_t;
int prepare_dma_check(dma_info_t *dma_info);
int get_dma_info(dma_info_t *dma_info);
void clean_after_dma_check(int fd, dma_info_t *dma_info);
int valid_offset( int fd, loff_t offset);
unsigned long count_blocks (char * filename, int blocksize);
void print_how_far (FILE * fp, unsigned long *passed, unsigned long total, unsigned int inc, int quiet);
void print_how_fast (unsigned long total,
unsigned long passed, int cursor_pos, int reset_time);
__u32 get_random (void);
int user_confirmed (FILE * fp, char * q, char * yes);
extern inline int misc_set_bit (unsigned long long nr, void * addr);
extern inline int misc_clear_bit (unsigned long long nr, void * addr);
extern inline int misc_test_bit(unsigned long long nr, const void * addr);
extern inline unsigned long long misc_find_first_zero_bit (const void *vaddr, unsigned long long size);
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);
#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, off_t);
STAT_FIELD_H(blocks, blkcnt_t);
__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, __compar_fn_t comp_func);
struct block_handler {
__u32 blocknr;
dev_t device;
};
int blocklist__is_block_saved (struct block_handler ** base, __u32 * count, __u32 blocknr,
dev_t device, __u32 * position);
void blocklist__insert_in_position (void * block_h, void ** base, __u32 * count,
int elem_size, __u32 * position);
int blockdev_list_compare (const void * block1, const void * block2);
#define set_bit_field_XX(XX,vp,val,from,count) \
{\
__u##XX * p, tmp;\
\
/* make sure that given value can be put in 'count' bits */\
if (val > (1 << count))\
die ("set_bit_field: val %d is too big for %d bits", val, count);\
\
p = (__u##XX *)vp;\
tmp = le##XX##_to_cpu (*p);\
\
/* clear 'count' bits starting from 'from'-th one */\
tmp &= ~mask##XX (from, count);\
\
/* put given value in proper bits */\
tmp |= (val << from);\
\
*p = cpu_to_le##XX (tmp);\
}
#define get_bit_field_XX(XX,vp,from,count) \
\
__u##XX * p, tmp;\
\
p = (__u##XX *)vp;\
tmp = le##XX##_to_cpu (*p);\
\
/* clear all bits but 'count' bits starting from 'from'-th one */\
tmp &= mask##XX (from, count);\
\
/* get value written in specified bits */\
tmp >>= from;\
return tmp;
#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 || \
((maj) >= SCSI_DISK1_MAJOR && (maj) <= SCSI_DISK7_MAJOR))
#endif /* SCSI_DISK_MAJOR */
#ifndef SCSI_BLK_MAJOR
#define SCSI_BLK_MAJOR(maj) (SCSI_DISK_MAJOR(maj) || (maj) == SCSI_CDROM_MAJOR)
#endif /* SCSI_BLK_MAJOR */
#ifndef IDE_DISK_MAJOR
#ifdef IDE9_MAJOR
#define IDE_DISK_MAJOR(maj) ((maj) == IDE0_MAJOR || (maj) == IDE1_MAJOR || \
(maj) == IDE2_MAJOR || (maj) == IDE3_MAJOR || \
(maj) == IDE4_MAJOR || (maj) == IDE5_MAJOR || \
(maj) == IDE6_MAJOR || (maj) == IDE7_MAJOR || \
(maj) == IDE8_MAJOR || (maj) == IDE9_MAJOR)
#else
#define IDE_DISK_MAJOR(maj) ((maj) == IDE0_MAJOR || (maj) == IDE1_MAJOR || \
(maj) == IDE2_MAJOR || (maj) == IDE3_MAJOR || \
(maj) == IDE4_MAJOR || (maj) == IDE5_MAJOR)
#endif /* IDE9_MAJOR */
#endif /* IDE_DISK_MAJOR */
#endif /* REISERFS_MISC_H */
-1
View File
@@ -1 +0,0 @@
noinst_HEADERS = types.h bitops.h malloc.h swab.h device.h misc.h unaligned.h
-337
View File
@@ -1,337 +0,0 @@
# Makefile.in generated by automake 1.9.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ../..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = include/misc
DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
SOURCES =
DIST_SOURCES =
HEADERS = $(noinst_HEADERS)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
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@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PROGS_LDFLAGS = @PROGS_LDFLAGS@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
UUID_LIBS = @UUID_LIBS@
VERSION = @VERSION@
ac_ct_CC = @ac_ct_CC@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
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@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
noinst_HEADERS = types.h bitops.h malloc.h swab.h device.h misc.h unaligned.h
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/misc/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu include/misc/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
uninstall-info-am:
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(HEADERS)
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am:
install-exec-am:
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-info-am
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
ctags distclean distclean-generic distclean-tags distdir dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-exec install-exec-am \
install-info install-info-am install-man install-strip \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
pdf-am ps ps-am tags uninstall uninstall-am uninstall-info-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
-79
View File
@@ -1,79 +0,0 @@
/*
* Copyright 1996-2004 by Hans Reiser, licensing governed by
* reiserfsprogs/README
*/
#ifndef MISC_BITOPS_H
#define MISC_BITOPS_H
#include "misc/types.h"
#include "misc/misc.h"
extern __u16 mask16 (int from, int count);
extern __u32 mask32 (int from, int count);
extern __u64 mask64 (int from, int count);
#define misc_set_bitfield_XX(XX,vp,val,from,count) \
({ \
__u##XX * p, tmp; \
\
/* make sure that given value can be put in 'count' bits */ \
if (val > (1 << count)) \
misc_die ("misc_set_bitfield: val %d is too big for %d bits", val, count); \
\
p = (__u##XX *)vp; \
tmp = le##XX##_to_cpu (*p); \
\
/* clear 'count' bits starting from 'from'-th one */ \
tmp &= ~mask##XX (from, count); \
\
/* put given value in proper bits */ \
tmp |= (val << from); \
\
*p = cpu_to_le##XX (tmp); \
})
#define misc_get_bitfield_XX(XX,vp,from,count) \
({ \
__u##XX * p, tmp; \
\
p = (__u##XX *)vp; \
tmp = le##XX##_to_cpu (*p); \
\
/* clear all bits but 'count' bits starting from 'from'-th one */ \
tmp &= mask##XX (from, count); \
\
/* get value written in specified bits */ \
tmp >>= from; \
tmp; \
})
extern inline int misc_set_bit (unsigned long long nr,
void * addr);
extern inline int misc_clear_bit (unsigned long long nr,
void * addr);
extern inline int misc_test_bit(unsigned long long nr,
const void * addr);
extern inline unsigned long long
misc_find_first_zero_bit (const void *vaddr,
unsigned long long size);
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);
#endif
-24
View File
@@ -1,24 +0,0 @@
/*
* Copyright 1996-2004 by Hans Reiser, licensing governed by
* reiserfsprogs/README
*/
#ifndef MISC_DEVICE_H
#define MISC_DEVICE_H
#include <sys/types.h>
extern int misc_device_valid_offset(int fd, long long int offset);
extern unsigned long misc_device_count_blocks (char * filename,
int blocksize);
extern char misc_device_typec (unsigned short mode);
#define STAT_FIELD_H(Field, Type) \
Type misc_device_##Field(char *device);
STAT_FIELD_H(mode, mode_t);
STAT_FIELD_H(rdev, dev_t);
#endif
-21
View File
@@ -1,21 +0,0 @@
/*
* Copyright 1996-2004 by Hans Reiser, licensing governed by
* reiserfsprogs/README
*/
#ifndef MISC_MALLOC_H
#define MISC_MALLOC_H
extern void *misc_getmem (int size);
extern void *misc_malloc(int size);
extern void misc_freemem (void * p);
extern void misc_checkmem (char * p, int size);
extern void *misc_expandmem (void * p, int size, int by);
extern unsigned int misc_memsize (char * p);
#endif
-41
View File
@@ -1,41 +0,0 @@
/*
* Copyright 1996-2004 by Hans Reiser, licensing governed by
* reiserfsprogs/README
*/
/* nothing abount reiserfs here */
#ifndef MISC_H
#define MISC_H
#include "misc/types.h"
/* n must be power of 2 */
#define MISC_UP(x,n) (((x)+(n)-1u) / (n) * (n))
#define MISC_DOWN(x,n) ((x) / (n) * (n))
/* to be ok for alpha etc we have to align structures to 8 byte boundary. */
#define MISC_ROUND_UP(x) MISC_UP(x,8LL)
extern void misc_die (char * fmt, ...) __attribute__ ((format (printf, 1, 2)));
typedef int (*dir_walk_func_t) (char *path, void *data);
extern int misc_dir_walk(char *path, dir_walk_func_t func, void *data);
extern __u32 misc_random (void);
typedef int (*misc_comp_func_t) (const void *, const void *);
extern int misc_device_rdev_match(char *path, void *data);
extern int misc_bin_search (const void * key, void * base,
__u32 num, int width, int *ppos,
misc_comp_func_t comp_func);
extern void blocklist__insert_in_position (void * block_h, void ** base,
__u32 * count, int elem_size,
int * position);
extern int blockdev_list_compare (const void * block1, const void * block2);
#endif
-21
View File
@@ -1,21 +0,0 @@
/*
* Copyright 1996-2004 by Hans Reiser, licensing governed by
* reiserfsprogs/README
*/
#ifndef MISC_TYPES_H
#define MISC_TYPES_H
#include <string.h>
typedef unsigned char __u8;
typedef unsigned short int __u16;
typedef unsigned int __u32;
typedef unsigned long long int __u64;
#define INVAL_PTR (void *)-1
#define MAX_INT 2147483647
#define LONG_LONG_MAX 9223372036854775807LL
#define LONG_LONG_MIN (-LONG_LONG_MAX - 1LL)
#endif
-40
View File
@@ -1,40 +0,0 @@
/*
* Copyright 2000-2004 by Hans Reiser, licensing governed by
* reiserfsprogs/README
*/
#ifndef MISC_UNALIGNED_H
#define MISC_UNALIGNED_H
#ifdef HAVE_ASM_UNALIGNED_H
# include <asm/unaligned.h>
#endif
#ifndef get_unaligned
#define get_unaligned(ptr) \
({ \
__typeof__(*(ptr)) __tmp; \
memcpy(&__tmp, (ptr), sizeof(*(ptr))); \
__tmp; \
})
#endif
#ifndef put_unaligned
#define put_unaligned(val, ptr) \
({ \
__typeof__(*(ptr)) __tmp = (val); \
memcpy((ptr), &__tmp, sizeof(*(ptr))); \
(void)0; \
})
#endif
/* these operate on extent 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((__u32 *)(p) + (i)))
#define d32_put(p, i, v) put_unaligned(cpu_to_le32(v), (__u32 *)(p) + (i))
#endif
+15
View File
@@ -0,0 +1,15 @@
/*
* Copyright 1996-2004 by Hans Reiser, licensing governed by
* reiserfsprogs/README
*/
/* nothing abount reiserfs here */
#ifndef TIME_H
#define TIME_H
#include <time.h>
time_t parse_time(char *str);
#endif /* TIME_H */
+32
View File
@@ -0,0 +1,32 @@
#ifndef _PROGBAR_H_
#define _PROGBAR_H_
enum {
E2F_FLAG_PROG_SUPPRESS = 1,
E2F_FLAG_PROG_BAR = 2,
};
struct progbar {
char units[16];
int progress_pos;
int progress_last_percent;
time_t progress_last_time;
int flags;
FILE *file;
};
struct spinner {
int count;
FILE *file;
};
void progbar_init(struct progbar *ctx, const char *units, FILE *fp);
void progbar_clear(struct progbar * ctx);
int progbar_update(struct progbar * ctx, const char *label, int curr, int max,
unsigned int dpynum);
void spinner_init(struct spinner *spinner, FILE *fp);
void spinner_touch(struct spinner *spinner);
void spinner_clear(struct spinner *spinner);
#endif /* _PROGBAR_H_ */
-6
View File
@@ -1,6 +0,0 @@
noinst_HEADERS = badblock.h bitmap.h buffer.h direntry.h extent.h \
filesystem.h fix_node.h hash.h internal.h \
internal_balance.h journal.h key.h leaf.h \
leaf_balance.h node.h objmap.h policy.h print.h \
stat.h super.h tree.h tree_balance.h libreiserfs.h \
types.h
-343
View File
@@ -1,343 +0,0 @@
# Makefile.in generated by automake 1.9.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ../..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = include/reiserfs
DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
SOURCES =
DIST_SOURCES =
HEADERS = $(noinst_HEADERS)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
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@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PROGS_LDFLAGS = @PROGS_LDFLAGS@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
UUID_LIBS = @UUID_LIBS@
VERSION = @VERSION@
ac_ct_CC = @ac_ct_CC@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
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@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
noinst_HEADERS = badblock.h bitmap.h buffer.h direntry.h extent.h \
filesystem.h fix_node.h hash.h internal.h \
internal_balance.h journal.h key.h leaf.h \
leaf_balance.h node.h objmap.h policy.h print.h \
stat.h super.h tree.h tree_balance.h libreiserfs.h \
types.h
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/reiserfs/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu include/reiserfs/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
uninstall-info-am:
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(HEADERS)
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am:
install-exec-am:
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-info-am
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
ctags distclean distclean-generic distclean-tags distdir dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-exec install-exec-am \
install-info install-info-am install-man install-strip \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
pdf-am ps ps-am tags uninstall uninstall-am uninstall-info-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
-29
View File
@@ -1,29 +0,0 @@
/*
* Copyright 2000-2004 by Hans Reiser, licensing governed by
* reiserfsprogs/README
*/
#ifndef REISERFS_BADBLOCK_H
#define REISERFS_BADBLOCK_H
#include "reiserfs/types.h"
#define REISERFS_BAD_DID 1
#define REISERFS_BAD_OID (__u32)-1
typedef void (*badblock_func_t) (reiserfs_filsys_t *fs,
reiserfs_path_t *badblock_path,
void *data);
extern void reiserfs_badblock_extract(reiserfs_filsys_t *fs,
reiserfs_path_t *badblock_path,
void *data);
extern void reiserfs_badblock_flush (reiserfs_filsys_t * fs,
int no_badblock_in_tree_yet);
extern void reiserfs_badblock_traverse(reiserfs_filsys_t * fs,
badblock_func_t action,
void *data);
#endif
-89
View File
@@ -1,89 +0,0 @@
/*
* Copyright 2000-2004 by Hans Reiser, licensing governed by
* reiserfsprogs/README
*/
#ifndef REISERFS_BITMAP_H
#define REISERFS_BITMAP_H
#include "reiserfs/types.h"
#include <stdio.h>
#define reiserfs_bmap_nr(count, blk_size) \
((count - 1) / (blk_size * 8) + 1)
#define reiserfs_bmap_over(nr) (nr > ((1ll << 16) - 1))
extern reiserfs_bitmap_t *reiserfs_bitmap_create (unsigned int bit_count);
extern int reiserfs_bitmap_open(reiserfs_filsys_t *);
extern void reiserfs_bitmap_delete (reiserfs_bitmap_t * bm);
extern void reiserfs_bitmap_free (reiserfs_filsys_t *);
extern void reiserfs_bitmap_close (reiserfs_filsys_t *);
extern int reiserfs_bitmap_flush (reiserfs_bitmap_t * bm,
reiserfs_filsys_t * fs);
extern int reiserfs_bitmap_expand (reiserfs_bitmap_t * bm,
unsigned int bit_count);
extern void reiserfs_bitmap_shrink (reiserfs_bitmap_t * bm,
unsigned int bit_count);
extern void reiserfs_bitmap_copy (reiserfs_bitmap_t * to,
reiserfs_bitmap_t * from);
extern int reiserfs_bitmap_compare (reiserfs_bitmap_t * bm1,
reiserfs_bitmap_t * bm2);
extern void reiserfs_bitmap_disjunction (reiserfs_bitmap_t * disk,
reiserfs_bitmap_t * cont);
extern void reiserfs_bitmap_delta (reiserfs_bitmap_t * base,
reiserfs_bitmap_t * exclude);
extern void reiserfs_bitmap_set_bit (reiserfs_bitmap_t * bm,
unsigned int bit_number);
extern void reiserfs_bitmap_clear_bit (reiserfs_bitmap_t * bm,
unsigned int bit_number);
extern int reiserfs_bitmap_test_bit (reiserfs_bitmap_t * bm,
unsigned int bit_number);
extern int reiserfs_bitmap_find_zero_bit (reiserfs_bitmap_t * bm,
unsigned long * start);
extern void reiserfs_bitmap_zero (reiserfs_bitmap_t * bm);
extern void reiserfs_bitmap_fill (reiserfs_bitmap_t * bm);
extern void reiserfs_bitmap_invert (reiserfs_bitmap_t * bm);
extern unsigned int reiserfs_bitmap_ones (reiserfs_bitmap_t * bm);
extern unsigned int reiserfs_bitmap_zeros (reiserfs_bitmap_t * bm);
extern int reiserfs_bitmap_spread (reiserfs_filsys_t *);
extern int reiserfs_bitmap_block (reiserfs_filsys_t *,
unsigned long block);
/* Backup copies. */
extern void reiserfs_bitmap_save (FILE * fp,
reiserfs_bitmap_t *bm);
extern reiserfs_bitmap_t * reiserfs_bitmap_load (FILE * fp);
extern void reiserfs_bitmap_print (FILE * fp, reiserfs_filsys_t * fs,
int silent);
extern void reiserfs_print_bmap_block (FILE * fp, int i,
unsigned long block,
char * map, int blocks,
int silent, int blocksize);
#endif
-44
View File
@@ -1,44 +0,0 @@
/*
* Copyright 1996-2004 by Hans Reiser, licensing governed by
* reiserfsprogs/README
*/
#ifndef REISERFS_BUFFER_H
#define REISERFS_BUFFER_H
#include "reiserfs/types.h"
#define BH_Uptodate 0
#define BH_Dirty 1
#define BH_Lock 2
#define BH_Do_not_flush 3
#define reiserfs_buffer_uptodate(bh) misc_test_bit(BH_Uptodate, &(bh)->b_state)
#define reiserfs_buffer_mkuptodate(bh,i) misc_set_bit(BH_Uptodate, &(bh)->b_state)
#define reiserfs_buffer_isdirty(bh) misc_test_bit(BH_Dirty, &(bh)->b_state)
#define reiserfs_buffer_isclean(bh) !misc_test_bit(BH_Dirty, &(bh)->b_state)
#define reiserfs_buffer_mkdirty(bh) misc_set_bit(BH_Dirty, &(bh)->b_state)
#define reiserfs_buffer_mkclean(bh) misc_clear_bit(BH_Dirty, &(bh)->b_state)
#define reiserfs_buffer_noflush(bh) misc_test_bit(BH_Do_not_flush, &(bh)->b_state)
#define reiserfs_buffer_mknoflush(bh) misc_set_bit(BH_Do_not_flush, &(bh)->b_state)
#define reiserfs_buffer_clnoflush(bh) misc_clear_bit(BH_Do_not_flush, &(bh)->b_state)
extern reiserfs_bh_t * reiserfs_buffer_open (int, unsigned long, unsigned long);
extern reiserfs_bh_t * reiserfs_buffer_find (int, unsigned long, unsigned long);
extern reiserfs_bh_t * reiserfs_buffer_read (int, unsigned long, unsigned long);
extern int reiserfs_buffer_write (reiserfs_bh_t *);
extern void reiserfs_buffer_close (reiserfs_bh_t *);
extern void reiserfs_buffer_forget (reiserfs_bh_t *);
extern void reiserfs_buffer_flush_all(int);
extern void reiserfs_buffer_free_all (void);
extern void reiserfs_buffer_invalidate_all (int);
#endif
-158
View File
@@ -1,158 +0,0 @@
/*
* Copyright 2000-2004 by Hans Reiser, licensing governed by
* reiserfsprogs/README
*/
#ifndef REISERFS_DIRENTRY_H
#define REISERFS_DIRENTRY_H
#include "reiserfs/types.h"
/***************************************************************************/
/* DIRECTORY STRUCTURE */
/***************************************************************************/
/*
Picture represents the structure of directory items
________________________________________________
| Array of | | | | | |
| directory |N-1| N-2 | .... | 1st |0th|
| entry headers | | | | | |
|_______________|___|_____|________|_______|___|
<---- directory entries ------>
First directory item has k_offset component 1. We store "." and ".."
in one item, always, we never split "." and ".." into differing
items. This makes, among other things, the code for removing
directories simpler. */
/* Each directory entry has its header. This header has deh_dir_id and
deh_objectid fields, those are key of object, entry points to */
/* NOT IMPLEMENTED:
Directory will someday contain stat data of object */
struct reiserfs_de_head
{
__u32 deh2_offset; /* third component of the directory entry key */
__u32 deh2_dir_id; /* objectid of the parent directory of the object,
that is referenced by directory entry */
__u32 deh2_objectid;/* objectid of the object, that is referenced by
directory entry */
__u16 deh2_location;/* offset of name in the whole item */
__u16 deh2_state; /* whether 1) entry contains stat data (for future),
and 2) whether entry is hidden (unlinked) */
} __attribute__ ((__packed__));
typedef struct reiserfs_de_head reiserfs_deh_t;
#define REISERFS_DEH_SIZE sizeof(reiserfs_deh_t)
/* set/get fields of dir entry head these defines */
#define reiserfs_deh_get_off(deh) get_le32 (deh, deh2_offset)
#define reiserfs_deh_set_off(deh,val) set_le32 (deh, deh2_offset, val)
#define reiserfs_deh_get_did(deh) get_le32 (deh, deh2_dir_id)
#define reiserfs_deh_set_did(deh,val) set_le32 (deh, deh2_dir_id, val)
#define reiserfs_deh_get_obid(deh) get_le32 (deh, deh2_objectid)
#define reiserfs_deh_set_obid(deh,val) set_le32 (deh, deh2_objectid, val)
#define reiserfs_deh_get_loc(deh) get_le16 (deh, deh2_location)
#define reiserfs_deh_set_loc(deh,val) set_le16 (deh, deh2_location, val)
#define reiserfs_deh_get_state(deh) get_le16 (deh, deh2_state)
#define reiserfs_deh_set_state(deh,val) set_le16 (deh, deh2_state, val)
#define reiserfs_deh_name(deh, pos) \
((char *)(deh - pos) + reiserfs_deh_get_loc(deh))
/* empty directory contains two entries "." and ".." and their headers */
#define REISERFS_DIR_MIN \
(REISERFS_DEH_SIZE * 2 + \
MISC_ROUND_UP (strlen (".")) + \
MISC_ROUND_UP (strlen ("..")))
/* old format directories have this size when empty */
#define REISERFS_DIR_MIN_V1 (REISERFS_DEH_SIZE * 2 + 3)
#define DEH_Statdata 0 /* not used now */
#define DEH_Visible2 2
#define DEH_Bad_offset 4 /* fsck marks entries to be deleted with this flag */
#define DEH_Bad_location 5
#define reiserfs_deh_state_bit(deh,bit) \
(reiserfs_deh_get_state (deh) & (1 << bit))
#define reiserfs_deh_state_set_bit(deh,bit) \
{ \
__u16 state; \
state = reiserfs_deh_get_state (deh); \
state |= (1 << bit); \
reiserfs_deh_set_state(deh, state); \
}
#define reiserfs_deh_state_clear_bit(deh,bit) \
{ \
__u16 state; \
state = reiserfs_deh_get_state (deh); \
state &= ~(1 << bit); \
reiserfs_deh_set_state(deh, state); \
}
/* Bad means "hashed unproperly or/and invalid location" */
#define reiserfs_deh_locbad(deh) \
reiserfs_deh_state_bit (deh, DEH_Bad_location)
#define reiserfs_deh_set_locbad(deh) \
reiserfs_deh_state_set_bit (deh, DEH_Bad_location)
#define reiserfs_deh_set_locok(deh) \
reiserfs_deh_state_clear_bit (deh, DEH_Bad_location)
#define reiserfs_deh_offbad(deh) \
reiserfs_deh_state_bit (deh, DEH_Bad_offset)
#define reiserfs_deh_set_offbad(deh) \
reiserfs_deh_state_set_bit (deh, DEH_Bad_offset)
#define reiserfs_deh_bad(deh) \
(reiserfs_deh_locbad(deh) || reiserfs_deh_offbad(deh))
/* for directories st_blocks is number of 512 byte units which fit into dir
size round up to blocksize */
#define REISERFS_DIR_BLOCKS(size) ((size + 511) / 512)
/* array of the entry headers */
#define reiserfs_deh(bh,ih) ((reiserfs_deh_t *)(reiserfs_item_by_ih(bh,ih)))
#define REISERFS_NAME_MAX 256
/* #define REISERFS_NAME_MAX(block_size) \
(block_size - REISERFS_NODEH_SIZE - \
REISERFS_IH_SIZE - REISERFS_DEH_SIZE)
*/
/* -REISERFS_SD_SIZE when entry will contain stat data */
extern int reiserfs_direntry_loc_check (reiserfs_deh_t * deh,
reiserfs_ih_t * ih,
int first);
extern int reiserfs_direntry_entry_len (reiserfs_ih_t * ih,
reiserfs_deh_t * deh,
int pos_in_item);
extern int reiserfs_direntry_name_len (reiserfs_ih_t * ih,
reiserfs_deh_t * deh,
int pos_in_item);
extern int reiserfs_direntry_entry_estimate (char * name,
int key_format);
extern int reiserfs_direntry_check (reiserfs_filsys_t * fs,
reiserfs_ih_t * ih,
char * item,
int bad_dir);
extern void reiserfs_direntry_print (FILE * fp,
reiserfs_filsys_t * fs,
reiserfs_bh_t * bh,
reiserfs_ih_t * ih);
#endif
-26
View File
@@ -1,26 +0,0 @@
/*
* Copyright 2000-2004 by Hans Reiser, licensing governed by
* reiserfsprogs/README
*/
#ifndef REISERFS_EXTENT_H
#define REISERFS_EXTENT_H
#include "reiserfs/types.h"
/* Size of pointer to the unformatted node. */
#define REISERFS_EXT_SIZE (sizeof(__u32))
/* number of blocks pointed to by the extent item */
#define reiserfs_ext_count(p_s_ih) \
(reiserfs_ih_get_len(p_s_ih) / REISERFS_EXT_SIZE)
extern int reiserfs_ext_check (reiserfs_filsys_t * fs,
reiserfs_ih_t * ih, char * item,
unfm_func_t func);
extern void reiserfs_ext_print(FILE * fp,
reiserfs_bh_t * bh,
int item_num);
#endif
-73
View File
@@ -1,73 +0,0 @@
/*
* Copyright 2000-2004 by Hans Reiser, licensing governed by
* reiserfsprogs/README
*/
#ifndef REISERFS_FS_H
#define REISERFS_FS_H
#include <reiserfs/types.h>
/* ReiserFS leaves the first 64k unused, so that partition labels have enough
space. If someone wants to write a fancy bootloader that needs more than
64k, let us know, and this will be increased in size. This number must be
larger than than the largest block size on any platform, or code will
break. -Hans */
#define REISERFS_DISK_OFFSET_IN_BYTES (64 * 1024)
/*#define MD_RAID_SUPERBLOCKS_IN_BYTES (128 * 1024)*/
/* the spot for the super in versions 3.5 - 3.5.11 (inclusive) */
#define REISERFS_OLD_DISK_OFFSET_IN_BYTES (8 * 1024)
#define reiserfs_ondisk_offset(block_of_super_block, block_size) \
(block_of_super_block * block_size)
#define reiserfs_new_location(block_of_super_block, block_size) \
((reiserfs_ondisk_offset(block_of_super_block, block_size) == \
REISERFS_DISK_OFFSET_IN_BYTES) ? 1 : 0)
/*only 4k blocks for old location*/
#define reiserfs_old_location(block_of_super_block, block_size) \
((reiserfs_ondisk_offset(block_of_super_block, 4096) == \
REISERFS_OLD_DISK_OFFSET_IN_BYTES) ? 1 : 0)
enum reiserfs_blktype {
BT_INVAL = 0x1,
BT_SUPER = 0x2,
BT_JOURNAL = 0x3,
BT_BITMAP = 0x4,
BT_UNKNOWN
};
typedef enum reiserfs_blktype reiserfs_blktype_t;
extern reiserfs_filsys_t * reiserfs_fs_open (char * filename,
int flags,
int * error,
void * vp,
int skip_check);
extern reiserfs_filsys_t * reiserfs_fs_create (char * filename,
int version,
unsigned long block_count,
int block_size,
int default_journal,
int new_format);
extern void reiserfs_fs_flush (reiserfs_filsys_t *);
extern void reiserfs_fs_free (reiserfs_filsys_t *);
extern void reiserfs_fs_close (reiserfs_filsys_t *);
extern void reiserfs_fs_reopen (reiserfs_filsys_t *, int flags);
extern int reiserfs_fs_rw (reiserfs_filsys_t * fs);
extern int reiserfs_fs_blksize_check (unsigned int blocksize);
extern reiserfs_blktype_t reiserfs_fs_block(reiserfs_filsys_t *fs,
unsigned long block);
#endif
-76
View File
@@ -1,76 +0,0 @@
/*
* Copyright 2000-2004 by Hans Reiser, licensing governed by
* reiserfsprogs/README
*/
#ifndef REISERFS_FIX_NODE_H
#define REISERFS_FIX_NODE_H
#include <reiserfs/types.h>
#include <reiserfs/tree_balance.h>
/* maximum number of FEB blocknrs on a single level */
#define FN_AMOUNT_MAX 2
/* To make any changes in the tree we always first find node, that contains
item to be changed/deleted or place to insert a new item. We call this node
S. To do balancing we need to decide what we will shift to left/right
neighbor, or to a new node, where new item will be etc. To make this
analysis simpler we build virtual node. Virtual node is an array of items,
that will replace items of node S. (For instance if we are going to delete
an item, virtual node does not contain it). Virtual node keeps information
about item sizes and types, mergeability of first and last items, sizes of
all entries in directory item. We use this array of items when calculating
what we can shift to neighbors and how many nodes we have to have if we do
not any shiftings, if we shift to left/right neighbor or to both. */
struct reiserfs_virtual_item
{
/* item type, mergeability */
unsigned short vi_type;
/* length of item that it will have after balancing */
unsigned short vi_item_len;
/* offset of item that it have before balancing */
__u64 vi_item_offset;
/* number of entries in directory item (including the new one if any,
or excluding entry if it must be cut) */
short vi_entry_count;
/* array of entry lengths for directory item */
unsigned short * vi_entry_sizes;
};
struct reiserfs_virtual_node
{
/* this is a pointer to the free space in the buffer */
char * vn_free_ptr;
/* number of items in virtual node */
unsigned short vn_nr_item;
/* size of node , that node would have if it has unlimited size and no
balancing is performed */
short vn_size;
/* mode of balancing (paste, insert, delete, cut) */
short vn_mode;
short vn_affected_item_num;
short vn_pos_in_item;
/* item header of inserted item, 0 for other modes */
reiserfs_ih_t * vn_ins_ih;
/* array of items (including a new one, excluding item to be deleted) */
struct reiserfs_virtual_item * vn_vi;
};
extern int reiserfs_fix_nodes (int n_op_mode,
reiserfs_tb_t * p_s_tb,
reiserfs_ih_t * p_s_ins_ih);
extern void reiserfs_unfix_nodes (reiserfs_tb_t *);
/* FIXME: move these 2 into tree.h when get rid of search_by_key */
extern reiserfs_bh_t * reiserfs_tree_right_neighbor (reiserfs_filsys_t * s,
reiserfs_path_t * path);
extern reiserfs_bh_t * reiserfs_tree_left_neighbor (reiserfs_filsys_t * s,
reiserfs_path_t * path);
extern void reiserfs_fix_node_print(struct reiserfs_virtual_node * vn);
#endif
-52
View File
@@ -1,52 +0,0 @@
/*
* Copyright 2000-2004 by Hans Reiser, licensing governed by
* reiserfsprogs/README
*/
#ifndef REISERFS_HASH_H
#define REISERFS_HASH_H
#include "misc/types.h"
#define UNSET_HASH 0 // read_super will guess about, what hash names
// in directories were sorted with
enum {
REISERFS_HASH_TEA = 0x1,
REISERFS_HASH_YURA = 0x2,
REISERFS_HASH_R5 = 0x3,
REISERFS_HASH_LAST
};
#define DEFAULT_HASH REISERFS_HASH_R5
/* hashes.c */
extern __u32 reiserfs_hash_keyed (const char *msg, int len);
extern __u32 reiserfs_hash_yura (const char *msg, int len);
extern __u32 reiserfs_hash_r5 (const char *msg, int len);
extern int reiserfs_hash_count (void);
extern int reiserfs_hash_correct (hashf_t *func,
char * name,
int namelen,
__u32 offset);
extern int reiserfs_hash_find (char * name,
int namelen,
__u32 deh_offset,
unsigned int code_to_try_first);
extern char *reiserfs_hash_name (unsigned int code);
extern int reiserfs_hash_code (hashf_t func);
extern hashf_t reiserfs_hash_func (unsigned int code);
extern hashf_t reiserfs_hash_get (char * hash);
extern __u32 reiserfs_hash_value (hashf_t func, char * name, int namelen);
#endif
-78
View File
@@ -1,78 +0,0 @@
/*
* Copyright 2000-2004 by Hans Reiser, licensing governed by
* reiserfsprogs/README
*/
#ifndef REISERFS_INTERNAL_H
#define REISERFS_INTERNAL_H
/*
* Picture represents an internal node of the reiserfs tree
* ______________________________________________________
* | | Array of | Array of | Free |
* |block | keys | pointers | space |
* | head | N | N+1 | |
* |______|_______________|___________________|___________|
*/
/* Disk child pointer: The pointer from an internal node of the tree
to a node that is on disk. */
struct reiserfs_dc {
__u32 dc2_block_number; /* Disk child's block number. */
__u16 dc2_size; /* Disk child's used space. */
__u16 dc2_reserved;
} __attribute__ ((__packed__));
typedef struct reiserfs_dc reiserfs_dc_t;
#define REISERFS_DC_SIZE (sizeof(reiserfs_dc_t))
/* set/get fields of disk_child with these defines */
#define reiserfs_dc_get_nr(dc) get_le32 (dc, dc2_block_number)
#define reiserfs_dc_set_nr(dc,val) set_le32 (dc, dc2_block_number, val)
#define reiserfs_dc_get_size(dc) get_le16 (dc, dc2_size)
#define reiserfs_dc_set_size(dc,val) set_le16 (dc, dc2_size, val)
#define reiserfs_dc_init(dc, size, blocknr) \
({ \
reiserfs_dc_set_nr(dc, blocknr); \
reiserfs_dc_set_size(dc, size); \
set_le16(dc, dc2_reserved, 0); \
})
/* max and min number of keys in internal node */
#define REISERFS_INT_MAX(bh) \
((REISERFS_NODE_SPACE(bh->b_size) - REISERFS_DC_SIZE) / \
(REISERFS_KEY_SIZE+REISERFS_DC_SIZE))
#define REISERFS_INT_MIN(bh) (REISERFS_INT_MAX(bh) / 2)
/* get key */
#define reiserfs_int_key_at(bh,item_num) \
((reiserfs_key_t * )((bh)->b_data + REISERFS_NODEH_SIZE) + \
(item_num) )
/* Get disk child by buffer header and position in the tree node. */
#define reiserfs_int_at(p_s_bh,n_pos) \
((reiserfs_dc_t *) ((p_s_bh)->b_data + REISERFS_NODEH_SIZE + \
reiserfs_node_items(p_s_bh) * REISERFS_KEY_SIZE +\
REISERFS_DC_SIZE * (n_pos)))
#define reiserfs_int_head(bh) \
((reiserfs_nh_get_level (((reiserfs_node_head_t *)((bh)->b_data))) > \
LEAF_LEVEL) && \
(reiserfs_nh_get_level (((reiserfs_node_head_t *)((bh)->b_data))) <= \
REISERFS_TREE_HEIGHT_MAX))
extern int reiserfs_internal_correct (reiserfs_bh_t *bh);
extern int reiserfs_internal_print (FILE * fp,
reiserfs_bh_t * bh,
int first, int last);
extern int reiserfs_internal_get_pos (reiserfs_bh_t * bh,
unsigned long block);
#endif
-14
View File
@@ -1,14 +0,0 @@
/*
* Copyright 2000-2004 by Hans Reiser, licensing governed by
* reiserfsprogs/README
*/
#ifndef REISERFS_IB_H
#define REISERFS_IB_H
extern int reiserfs_ib_balance (reiserfs_tb_t * tb,
int h, int child_pos,
reiserfs_ih_t * insert_key,
reiserfs_bh_t ** insert_ptr);
#endif
-211
View File
@@ -1,211 +0,0 @@
/*
* Copyright 2000-2004 by Hans Reiser, licensing governed by
* reiserfsprogs/README
*/
#ifndef REISERFS_JOURNAL_H
#define REISERFS_JOURNAL_H
#define reiserfs_jp_get_start(jp) get_le32(jp, jp_start)
#define reiserfs_jp_set_start(jp,val) set_le32(jp, jp_start, val)
#define reiserfs_jp_get_dev(jp) get_le32 (jp, jp_dev)
#define reiserfs_jp_set_dev(jp,val) set_le32 (jp, jp_dev, val)
#define reiserfs_jp_get_size(jp) get_le32 (jp, jp_size)
#define reiserfs_jp_set_size(jp,val) set_le32 (jp, jp_size, val)
#define reiserfs_jp_get_tlen(jp) get_le32 (jp, jp_tlen)
#define reiserfs_jp_set_tlen(jp,val) set_le32 (jp, jp_tlen, val)
#define reiserfs_jp_get_magic(jp) get_le32 (jp, jp_magic)
#define reiserfs_jp_set_magic(jp,val) set_le32 (jp, jp_magic, val)
#define NEED_TUNE 0xffffffff
#define reiserfs_jp_get_max_batch(jp) get_le32 (jp, jp_max_batch)
#define reiserfs_jp_set_max_batch(jp,val) set_le32 (jp, jp_max_batch, val)
#define reiserfs_jp_get_commit_age(jp) get_le32 (jp, jp_commit_age)
#define reiserfs_jp_set_commit_age(jp,val) set_le32 (jp, jp_commit_age, val)
#define reiserfs_jp_get_trans_age(jp) get_le32 (jp, jp_trans_age)
#define reiserfs_jp_set_trans_age(jp,val) set_le32 (jp, jp_trans_age, val)
/* must be correct to keep the desc and commit structs at 4k */
/* first block written in a commit. BUG, not 64bit safe */
struct reiserfs_journal_desc {
/* id of commit */
__u32 j2_trans_id ;
/* length of commit. len +1 is the commit block */
__u32 j2_len ;
/* mount id of this trans*/
__u32 j2_mount_id ;
/* real locations for each block */
__u32 j2_realblock[1] ;
};
#define reiserfs_jd_magic(bh) (bh->b_data + bh->b_size - 12)
#define reiserfs_jd_head(bh) ((struct reiserfs_journal_desc *)bh->b_data)
#define reiserfs_jd_get_trans(bh) get_le32 (reiserfs_jd_head (bh), j2_trans_id)
#define reiserfs_jd_set_trans(bh,val) set_le32 (reiserfs_jd_head (bh), j2_trans_id, val)
#define reiserfs_jd_get_len(bh) get_le32 (reiserfs_jd_head (bh), j2_len)
#define reiserfs_jd_set_len(bh,val) set_le32 (reiserfs_jd_head (bh), j2_len, val)
#define reiserfs_jd_get_mount(bh) get_le32 (reiserfs_jd_head (bh), j2_mount_id)
#define reiserfs_jd_set_mount(bh,val) set_le32 (reiserfs_jd_head (bh), j2_mount_id, val)
/* last block written in a commit BUG, not 64bit safe */
struct reiserfs_journal_commit {
__u32 j3_trans_id ; /* must match j_trans_id from the desc block */
__u32 j3_len ; /* ditto */
__u32 j3_realblock[1] ; /* real locations for each block */
} ;
#define reiserfs_jc_head(bh) ((struct reiserfs_journal_commit *)bh->b_data)
#define reiserfs_jc_get_trans(bh) get_le32 (reiserfs_jc_head(bh), j3_trans_id)
#define reiserfs_jc_set_trans(bh,val) set_le32 (reiserfs_jc_head(bh), j3_trans_id, val)
#define reiserfs_jc_get_len(bh) get_le32 (reiserfs_jc_head(bh), j3_len)
#define reiserfs_jc_set_len(bh,val) set_le32 (reiserfs_jc_head(bh), j3_len, val)
/* set/get fields of journal header with these defines */
#define reiserfs_jh_get_mount(jh) get_le32 (jh, jh_mount_id)
#define reiserfs_jh_set_mount(jh,val) set_le32 (jh, jh_mount_id, val)
#define reiserfs_jh_get_flushed(jh) get_le32 (jh, jh_last_flush_trans_id)
#define reiserfs_jh_set_flushed(jh,val) set_le32 (jh, jh_last_flush_trans_id, val)
#define reiserfs_jh_get_start(jh) get_le32 (jh, jh_flush_offset)
#define reiserfs_jh_set_start(jh,val) set_le32 (jh, jh_flush_offset, val)
/* Journal Transaction Half */
#define reiserfs_jt_half(blocksize) \
((blocksize - sizeof (struct reiserfs_journal_desc) + \
sizeof (__u32) - 12) / sizeof (__u32))
/* journal default settings */
#define JOURNAL_MIN_SIZE 512
/* biggest possible single transaction, don't change for now (8/3/99) */
#define JOURNAL_TRANS_MAX 1024
/* need to check whether it works */
#define JOURNAL_TRANS_MIN 256
/* default journal size / max trans length */
#define JOURNAL_DEFAULT_RATIO 8
#define JOURNAL_MIN_RATIO 2
/* max blocks to batch into one transaction, don't make this
any bigger than 900 */
#define JOURNAL_MAX_BATCH 900
#define JOURNAL_MAX_COMMIT_AGE 30
#define JOURNAL_MAX_TRANS_AGE 30
/* journal max size is a maximum number of blocks pointed by first bitmap -
REISERFS_DISK_OFFSET - superblock - first bitmap - journal herader */
#define reiserfs_journal_max(sb_nr,blocksize) \
blocksize * 8 - (sb_nr + 1 + 1 + 1)
#define reiserfs_journal_default(sb_nr,blocksize) \
(unsigned long long) \
((8192 > reiserfs_journal_max (sb_nr,blocksize)) ? \
reiserfs_journal_max (sb_nr,blocksize) : 8192)
struct reiserfs_trans {
unsigned long mount_id;
unsigned long trans_id;
unsigned long desc_blocknr;
unsigned long trans_len;
unsigned long commit_blocknr;
unsigned long next_trans_offset;
};
typedef struct reiserfs_trans reiserfs_trans_t;
extern unsigned long reiserfs_journal_hostsize (reiserfs_sb_t *sb);
extern int reiserfs_journal_block (reiserfs_filsys_t *,
unsigned long block);
extern int reiserfs_journal_desc_valid (reiserfs_bh_t *);
extern int reiserfs_journal_get_transactions (reiserfs_filsys_t *,
reiserfs_trans_t *,
reiserfs_trans_t *);
typedef void (*action_on_trans_t) (reiserfs_filsys_t *,
reiserfs_trans_t *);
extern void reiserfs_journal_by_transaction (reiserfs_filsys_t *,
action_on_trans_t);
typedef void (*action_on_block_t) (reiserfs_filsys_t *,
reiserfs_trans_t *,
unsigned int index,
unsigned long in_journal,
unsigned long in_place);
extern void reiserfs_journal_foreach (reiserfs_filsys_t * fs,
reiserfs_trans_t * trans,
action_on_block_t action);
extern int reiserfs_journal_open (reiserfs_filsys_t *,
char *, int flags);
extern int reiserfs_journal_params_check(reiserfs_filsys_t *fs);
extern int reiserfs_journal_create (reiserfs_filsys_t * fs,
char * j_filename,
unsigned long offset,
unsigned long len,
int transaction_max_size);
extern int reiserfs_journal_opened (reiserfs_filsys_t *);
extern void reiserfs_journal_flush (reiserfs_filsys_t * fs);
extern void reiserfs_journal_free (reiserfs_filsys_t * fs);
extern void reiserfs_journal_close (reiserfs_filsys_t *);
extern void reiserfs_journal_reopen (reiserfs_filsys_t * fs, int flag);
extern int reiserfs_journal_replay (reiserfs_filsys_t * fs);
extern __u32 reiserfs_journal_trans_age (void);
extern __u32 reiserfs_journal_commit_age (void);
extern __u32 reiserfs_journal_batch (unsigned long journal_trans_max);
extern __u32 reiserfs_journal_tlen (__u32 desired,
__u32 journal_size,
int blocksize,
int verbose);
extern unsigned int reiserfs_journal_start_must (reiserfs_filsys_t * fs);
extern int reiserfs_journal_fits (unsigned long sb_nr,
unsigned int block_size,
unsigned long block_count,
unsigned long journal_size);
extern void reiserfs_journal_print_params (FILE * fp,
reiserfs_journal_param_t * jp);
extern void reiserfs_journal_print_header (reiserfs_filsys_t * fs);
extern void reiserfs_journal_print (reiserfs_filsys_t *);
extern int reiserfs_print_jdesc (FILE * fp, reiserfs_bh_t * bh);
#endif
-126
View File
@@ -1,126 +0,0 @@
/*
* Copyright 2000-2004 by Hans Reiser, licensing governed by
* reiserfsprogs/README
*/
#ifndef REISERFS_KEY_H
#define REISERFS_KEY_H
/* set/get fields of keys on disk with these defines */
#define reiserfs_key_get_did(k) get_le32 (k, k2_dir_id)
#define reiserfs_key_set_did(k,val) set_le32 (k, k2_dir_id, val)
#define reiserfs_key_get_oid(k) get_le32 (k, k2_objectid)
#define reiserfs_key_set_oid(k,val) set_le32 (k, k2_objectid, val)
#define reiserfs_key_get_off1(k) get_le32 (k, u.k2_offset_v1.k_offset)
#define reiserfs_key_set_off1(k,val) set_le32 (k, u.k2_offset_v1.k_offset, val)
#define reiserfs_key_get_uni(k) get_le32 (k, u.k2_offset_v1.k_uniqueness)
#define reiserfs_key_set_uni(k,val) set_le32 (k, u.k2_offset_v1.k_uniqueness, val)
#define REISERFS_KEY_SIZE (sizeof(reiserfs_key_t))
#define REISERFS_KEY_SHSIZE 8
// values for k_uniqueness field of the reiserfs_key_t
#define UNI_SD 0
#define UNI_DE 500
#define UNI_DE 500
#define UNI_DIRECT 0xffffffff
#define UNI_EXT 0xfffffffe
#define UNI_UNKN 555
/* values for k_type field of the reiserfs_key_t */
#define TYPE_STAT_DATA 0x0
#define TYPE_EXTENT 0x1
#define TYPE_DIRECT 0X2
#define TYPE_DIRENTRY 0X3
#define TYPE_LAST 0x4
#define TYPE_UNKNOWN 0xf
#define KEY_FORMAT_1 0
#define KEY_FORMAT_2 1
#define KEY_FORMAT_UNDEFINED 15
/* Our function for comparing keys can compare keys of different lengths.
It takes as a parameter the length of the keys it is to compare. These
defines are used in determining what is to be passed to it as that
parameter. */
#define REISERFS_KEY_LEN 4
#define REISERFS_KEY_SHORT_LEN 2
/* there are 4 types of items: stat data, directory item, extent, direct.
FIXME: This table does not describe new key format
+-------------------+------------+--------------+------------+
| | k_offset | k_uniqueness | mergeable? |
+-------------------+------------+--------------+------------+
| stat data | 0 | 0 | no |
+-------------------+------------+--------------+------------+
| 1st directory item| OFFSET_DOT |DIRENTRY_UNIQU| no |
| non 1st directory | hash value | | yes |
| item | | | |
+-------------------+------------+--------------+------------+
| extent item | offset + 1 |TYPE_EXTENT | if not the first object EXT item
+-------------------+------------+--------------+------------+
| direct item | offset + 1 |TYPE_DIRECT | if not the first object direct item
+-------------------+------------+--------------+------------+
*/
#define reiserfs_key_stat(p_s_key) \
(reiserfs_key_get_type (p_s_key) == TYPE_STAT_DATA )
#define reiserfs_key_dir(p_s_key) \
(reiserfs_key_get_type (p_s_key) == TYPE_DIRENTRY )
#define reiserfs_key_direct(p_s_key) \
(reiserfs_key_get_type (p_s_key) == TYPE_DIRECT )
#define reiserfs_key_ext(p_s_key) \
(reiserfs_key_get_type (p_s_key) == TYPE_EXTENT )
#define reiserfs_key_unkn(p_s_key) \
(reiserfs_key_get_type (p_s_key) >= TYPE_LAST)
#define MAX_KEY1_OFFSET 0xffffffff
#define MAX_KEY2_OFFSET 0xfffffffffffffffLL
/* hash value occupies 24 bits starting from 7 up to 30 */
#define OFFSET_HASH(offset) ((offset) & 0x7fffff80)
/* generation number occupies 7 bits starting from 0 up to 6 */
#define OFFSET_GEN(offset) ((offset) & 0x0000007f)
#define OFFSET_SD 0
#define OFFSET_DOT 1
#define OFFSET_DOT_DOT 2
extern const reiserfs_key_t MIN_KEY;
extern const reiserfs_key_t MAX_KEY;
extern const reiserfs_key_t root_dir_key;
extern const reiserfs_key_t parent_root_dir_key;
extern reiserfs_key_t lost_found_dir_key;
extern void reiserfs_key_copy (reiserfs_key_t * to, const reiserfs_key_t * from);
extern void reiserfs_key_copy2 (reiserfs_key_t * to, const reiserfs_key_t * from);
extern int reiserfs_key_comp (const void * k1, const void * k2);
extern int reiserfs_key_comp3 (const void * k1, const void * k2);
extern int reiserfs_key_comp2 (const void * p_s_key1, const void * p_s_key2);
extern int reiserfs_key_format (const reiserfs_key_t * key);
extern unsigned long long reiserfs_key_get_off (const reiserfs_key_t * key);
extern int reiserfs_key_get_type (const reiserfs_key_t * key);
extern char * reiserfs_key_name (const reiserfs_key_t * key);
extern void reiserfs_key_set_type (int format,
reiserfs_key_t * key,
int type);
extern void reiserfs_key_set_off (int format,
reiserfs_key_t * key,
unsigned long long offset);
extern void reiserfs_key_set_sec (int format,
reiserfs_key_t * key,
unsigned long long offset,
int type);
#endif
-197
View File
@@ -1,197 +0,0 @@
/*
* Copyright 2000-2004 by Hans Reiser, licensing governed by
* reiserfsprogs/README
*
* Leaf balancing method declarations.
*
*/
#ifndef REISERFS_LEAF_H
#define REISERFS_LEAF_H
#include <reiserfs/types.h>
#include <misc/bitops.h>
/* size of item header */
#define REISERFS_IH_SIZE (sizeof(reiserfs_ih_t))
/* set/get fields of item head on disk with these defines */
#define reiserfs_ih_get_entries(ih) get_le16 (ih, u.ih2_entry_count)
#define reiserfs_ih_set_entries(ih,val) set_le16 (ih, u.ih2_entry_count, val)
#define reiserfs_ih_get_free(ih) get_le16 (ih, u.ih2_free_space)
#define reiserfs_ih_set_free(ih,val) set_le16 (ih, u.ih2_free_space, 0)
#define reiserfs_ih_get_len(ih) get_le16 (ih, ih2_item_len)
#define reiserfs_ih_set_len(ih,val) set_le16 (ih, ih2_item_len, val)
#define reiserfs_ih_get_loc(ih) get_le16 (ih, ih2_item_location)
#define reiserfs_ih_set_loc(ih,val) set_le16 (ih, ih2_item_location, val)
#define reiserfs_ih_format_v1(ih) (reiserfs_ih_get_format (ih) == KEY_FORMAT_1)
#define IH_Unreachable 0
#define IH_Was_Tail 1
#define IH_Checked 2
#define IH_Writable 3
/* Unreachable bit is set on tree rebuilding and is cleared in semantic pass */
#define reiserfs_ih_clflags(ih) reiserfs_ih_set_flags (ih, 0)
#define reiserfs_ih_isreach(ih) \
(!(reiserfs_ih_get_flags (ih) & (1 << IH_Unreachable)))
#define reiserfs_ih_clunreach(ih) reiserfs_ih_set_flags (ih, \
reiserfs_ih_get_flags (ih) & ~(1 << IH_Unreachable))
#define reiserfs_ih_mkunreach(ih) reiserfs_ih_set_flags (ih, \
reiserfs_ih_get_flags (ih) | (1 << IH_Unreachable))
#define reiserfs_ih_wastail(ih) \
(reiserfs_ih_get_flags (ih) & (1 << IH_Was_Tail))
#define reiserfs_ih_mktail(ih) reiserfs_ih_set_flags (ih, \
reiserfs_ih_get_flags (ih) | (1 << IH_Was_Tail))
#define reiserfs_ih_cltail(ih) reiserfs_ih_set_flags (ih, \
reiserfs_ih_get_flags (ih) & ~(1 << IH_Was_Tail))
#define reiserfs_ih_ischeck(ih) \
(reiserfs_ih_get_flags (ih) & (1 << IH_Checked))
#define reiserfs_ih_mkcheck(ih) reiserfs_ih_set_flags (ih, \
reiserfs_ih_get_flags (ih) | (1 << IH_Checked))
#define reiserfs_ih_clcheck(ih) reiserfs_ih_set_flags (ih, \
reiserfs_ih_get_flags (ih) & ~(1 << IH_Checked))
#define reiserfs_ih_iswrite(ih) \
(reiserfs_ih_get_flags (ih) & (1 << IH_Writable))
#define reiserfs_ih_mkwrite(ih) reiserfs_ih_set_flags (ih, \
reiserfs_ih_get_flags (ih) | (1 << IH_Writable))
#define reiserfs_ih_clwrite(ih) reiserfs_ih_set_flags (ih, \
reiserfs_ih_get_flags (ih) & ~(1 << IH_Writable))
#define reiserfs_ih_stat(p_s_ih) reiserfs_key_stat(&((p_s_ih)->ih_key))
#define reiserfs_ih_dir(p_s_ih) reiserfs_key_dir(&((p_s_ih)->ih_key))
#define reiserfs_ih_direct(p_s_ih) reiserfs_key_direct(&((p_s_ih)->ih_key))
#define reiserfs_ih_ext(p_s_ih) reiserfs_key_ext(&((p_s_ih)->ih_key))
/* maximal length of item */
#define REISERFS_ITEM_MAX(block_size) \
(block_size - REISERFS_NODEH_SIZE - REISERFS_IH_SIZE)
#define REISERFS_ITEM_MIN 1
#define REISERFS_DIRECT_MAX(size) \
((size) - REISERFS_NODEH_SIZE - 2 * REISERFS_IH_SIZE - \
REISERFS_SD_SIZE - REISERFS_EXT_SIZE)
/* get the item header */
#define reiserfs_ih_at(bh,item_num) \
((reiserfs_ih_t * )((bh)->b_data + REISERFS_NODEH_SIZE) + (item_num))
/* get the key */
#define reiserfs_ih_key_at(bh,item_num) \
(&(reiserfs_ih_at(bh,item_num)->ih_key))
/* get item body */
#define reiserfs_item_at(bh,item_num) \
( (bh)->b_data + reiserfs_ih_get_loc (reiserfs_ih_at((bh),(item_num))))
/* following defines use reiserfs buffer header and item header */
/* get item body */
#define reiserfs_item_by_ih(bh,ih) ((bh)->b_data + reiserfs_ih_get_loc(ih))
#define reiserfs_leaf_head(bh) \
(reiserfs_nh_get_level ((reiserfs_node_head_t *)((bh)->b_data)) \
== LEAF_LEVEL)
/* check whether byte number 'offset' is in this item */
#define reiserfs_item_has_off(p_s_ih, n_offset, n_blocksize) \
(reiserfs_key_get_off(&(p_s_ih)->ih_key) <= (n_offset) && \
reiserfs_key_get_off(&(p_s_ih)->ih_key) + \
reiserfs_leaf_ibytes(p_s_ih,n_blocksize) > (n_offset) )
#define reiserfs_item_has_key(p_s_ih, p_s_key, n_blocksize) \
(!reiserfs_key_comp2(p_s_ih, p_s_key) && \
reiserfs_item_has_off(p_s_ih, reiserfs_key_get_off (p_s_key), \
n_blocksize))
#define reiserfs_item_off_at(ih, pos, bs) \
(reiserfs_key_get_off (&(ih)->ih_key) + \
(pos) * (reiserfs_ih_direct(ih) ? 1 : (bs)))
#define reiserfs_dir(ih, item) \
((reiserfs_ih_stat(ih) && !not_a_directory(item)) || \
reiserfs_ih_dir(ih))
#define reiserfs_item_count(ih) \
(reiserfs_ih_ext(ih) ? reiserfs_ext_count(ih) : \
reiserfs_ih_direct(ih) ? reiserfs_ih_get_len(ih) : \
reiserfs_ih_dir(ih) ? reiserfs_ih_get_entries(ih) : \
reiserfs_ih_stat(ih) ? 1 : 0)
extern void reiserfs_leaf_mkempty (reiserfs_bh_t *bh);
extern int reiserfs_leaf_mergeable (reiserfs_ih_t *left,
reiserfs_ih_t *right,
int bsize);
extern int reiserfs_leaf_count_items(reiserfs_bh_t *bh);
extern int reiserfs_leaf_free_count(reiserfs_bh_t *bh);
extern int reiserfs_leaf_estimate_items(reiserfs_bh_t * bh);
extern int reiserfs_leaf_valid(reiserfs_bh_t *bh);
typedef void (*ih_func_t) (reiserfs_ih_t * ih);
typedef void (*item_func_t) (reiserfs_bh_t * bh,
reiserfs_ih_t * ih);
extern void reiserfs_leaf_traverse(reiserfs_bh_t * bh,
ih_func_t action,
item_func_t * actions);
extern void reiserfs_leaf_delete_item (reiserfs_filsys_t *,
reiserfs_bh_t * bh,
int item_num);
extern void reiserfs_leaf_delete_entry (reiserfs_filsys_t *,
reiserfs_bh_t * bh,
int item_num,
int entry_num,
int del_count);
extern int reiserfs_leaf_correct_at (reiserfs_filsys_t *,
reiserfs_ih_t *, char *,
unfm_func_t, int);
extern __u32 reiserfs_leaf_ibytes (const reiserfs_ih_t * ih,
int blocksize);
extern int reiserfs_leaf_print(FILE * fp,
reiserfs_filsys_t * fs,
reiserfs_bh_t * bh,
int print_mode,
int first,
int last);
/* key format is stored in 12 bits starting from 0-th of item_head's ih2_format*/
extern __u16 reiserfs_ih_get_format(const reiserfs_ih_t *ih);
extern void reiserfs_ih_set_format(reiserfs_ih_t *ih, __u16 val);
extern __u16 reiserfs_ih_get_flags(const reiserfs_ih_t *ih);
extern void reiserfs_ih_set_flags(reiserfs_ih_t *ih, __u16 val);
enum leaf_print {
LP_LEAF_DETAILS = 0x1,
LP_DIRECT_ITEMS = 0x2,
LP_LAST
};
#endif
-42
View File
@@ -1,42 +0,0 @@
/*
* Copyright 2000-2004 by Hans Reiser, licensing governed by
* reiserfsprogs/README
*/
#ifndef REISERFS_LB_H
#define REISERFS_LB_H
extern void reiserfs_lb_delete_item (reiserfs_filsys_t * fs,
reiserfs_bufinfo_t * bi,
int first,
int del_num);
extern void reiserfs_lb_delete_unit (reiserfs_filsys_t * fs,
reiserfs_bufinfo_t * bi,
int cut_item_num,
int pos_in_item,
int cut_size);
extern void reiserfs_lb_delete (reiserfs_filsys_t * fs,
reiserfs_bufinfo_t * cur_bi,
int last_first,
int first,
int del_num,
int del_bytes);
extern int reiserfs_lb_balance (reiserfs_tb_t * tb,
reiserfs_ih_t * ih,
const char * body,
int flag,
int zeros_number,
reiserfs_ih_t * insert_key,
reiserfs_bh_t ** insert_ptr);
extern int reiserfs_lb_copy (reiserfs_filsys_t * fs,
reiserfs_bufinfo_t * dest_bi,
reiserfs_bh_t * src,
int last_first,
int cpy_num,
int cpy_bytes);
#endif
-46
View File
@@ -1,46 +0,0 @@
/*
* Copyright 2000-2004 by Hans Reiser, licensing governed by
* reiserfsprogs/README
*/
#ifndef REISERFS_LIBREISER4_H
#define REISERFS_LIBREISER4_H
#ifdef __cplusplus
extern "C" {
#endif
#include <reiserfs/types.h>
#include <reiserfs/bitmap.h>
#include <reiserfs/buffer.h>
#include <reiserfs/filesystem.h>
#include <reiserfs/journal.h>
#include <reiserfs/super.h>
#include <reiserfs/tree.h>
#include <reiserfs/key.h>
#include <reiserfs/node.h>
#include <reiserfs/leaf.h>
#include <reiserfs/direntry.h>
#include <reiserfs/internal.h>
#include <reiserfs/extent.h>
#include <reiserfs/stat.h>
#include <reiserfs/fix_node.h>
#include <reiserfs/tree_balance.h>
#include <reiserfs/internal_balance.h>
#include <reiserfs/leaf_balance.h>
#include <reiserfs/badblock.h>
#include <reiserfs/objmap.h>
#include <reiserfs/policy.h>
#include <reiserfs/print.h>
#include <reiserfs/hash.h>
#ifdef LIBREISERFS_READY
extern const char *libreiserfs_version(void);
extern int libreiserfs_max_interface_version(void);
extern int libreiserfs_min_interface_version(void);
#endif
#ifdef __cplusplus
}
#endif
#endif
-92
View File
@@ -1,92 +0,0 @@
/*
* Copyright 2000-2004 by Hans Reiser, licensing governed by
* reiserfsprogs/README
*/
#ifndef REISERFS_NODE_H
#define REISERFS_NODE_H
/*
* Picture represents a leaf of internal tree
* ______________________________________________________
* | | Array of | | |
* |Block | Object-Item | F r e e | Objects- |
* | head | Headers | S p a c e | Items |
* |______|_______________|___________________|___________|
*/
/* Header of a disk block. More precisely, header of a formatted leaf
or internal node, and not the header of an unformatted node. */
struct reiserfs_node_head {
__u16 blk2_level; /* Level of a block in the tree. */
__u16 blk2_nr_item; /* Number of keys/items in a block. */
__u16 blk2_free_space; /* Block free space in bytes. */
__u16 blk_reserved;
__u32 reserved [4];
};
typedef struct reiserfs_node_head reiserfs_node_head_t;
#define REISERFS_NODEH_SIZE (sizeof(reiserfs_node_head_t))
/* set/get fields of block head on disk with these defines */
#define reiserfs_nh_get_level(blkh) get_le16 (blkh, blk2_level)
#define reiserfs_nh_set_level(blkh,val) set_le16 (blkh, blk2_level, val)
#define reiserfs_nh_get_items(blkh) get_le16 (blkh, blk2_nr_item)
#define reiserfs_nh_set_items(blkh,val) set_le16 (blkh, blk2_nr_item, val)
#define reiserfs_nh_get_free(blkh) get_le16 (blkh, blk2_free_space)
#define reiserfs_nh_set_free(blkh,val) set_le16 (blkh, blk2_free_space, val)
/*
* values for blk_type field
*/
#define FREE_LEVEL 0 /* Node of this level is out of the tree. */
#define LEAF_LEVEL 1 /* Leaf node level. */
/* Given the buffer head of a formatted node, resolve to the block head of that node. */
#define NODE_HEAD(p_s_bh) ((reiserfs_node_head_t *)((p_s_bh)->b_data))
#define reiserfs_node_items(bh) reiserfs_nh_get_items (NODE_HEAD(bh))
#define reiserfs_node_level(bh) reiserfs_nh_get_level (NODE_HEAD(bh))
#define reiserfs_node_free(bh) reiserfs_nh_get_free (NODE_HEAD(bh))
/* Does the buffer contain a disk block which is in the tree. */
#define REISERFS_NODE_INTREE(p_s_bh) \
(reiserfs_nh_get_level(NODE_HEAD (p_s_bh)) != FREE_LEVEL)
#define REISERFS_NODE_SPACE(blocksize) ((blocksize) - REISERFS_NODEH_SIZE)
/* amount of used space in buffer (not including block head) */
#define reiserfs_node_used(cur) (REISERFS_NODE_SPACE(cur->b_size) - \
(reiserfs_node_free(cur)))
enum node_type {
NT_LEAF = 0x1,
NT_INTERNAL = 0x2,
NT_SUPER = 0x3,
NT_JDESC = 0x4,
NT_IH_ARRAY = 0x5,
NT_UNKNOWN
};
typedef enum node_type node_type_t;
extern void reiserfs_node_replace_key (reiserfs_bh_t * dest, int n_dest,
reiserfs_bh_t * src, int n_src);
extern void reiserfs_node_forget(reiserfs_filsys_t *fs,
unsigned long blk);
extern int reiserfs_node_formatted (reiserfs_bh_t * bh, int level);
extern int reiserfs_node_type (reiserfs_bh_t *bh);
extern char *reiserfs_node_type_name(int code);
extern void reiserfs_node_print (FILE * fp,
reiserfs_filsys_t *,
reiserfs_bh_t * bh, ...);
#endif
-19
View File
@@ -1,19 +0,0 @@
/*
* Copyright 2000-2004 by Hans Reiser, licensing governed by
* reiserfsprogs/README
*/
#ifndef REISERFS_OBJMAP_H
#define REISERFS_OBJMAP_H
/* object identifier for root dir */
#define REISERFS_ROOT_OBJECTID 2
#define REISERFS_ROOT_PARENT_OBJECTID 1
extern int reiserfs_objmap_test (reiserfs_filsys_t * fs, __u32 objectid);
extern void reiserfs_objmap_set (reiserfs_filsys_t * fs, __u32 objectid);
extern void reiserfs_objmap_print (FILE * fp, reiserfs_filsys_t * fs);
#endif
-25
View File
@@ -1,25 +0,0 @@
/*
* Copyright 2000-2004 by Hans Reiser, licensing governed by
* reiserfsprogs/README
*/
#ifndef REISERFS_POLICY_H
#define REISERFS_POLICY_H
/* this is aggressive tail suppression policy taken from the kernel */
/* It should be REISERFS_DIRECT_MAX used here, but sometimes it is not enough,
* and items got deleted. */
#define reiserfs_policy_ext(n_file_size,n_tail_size,n_block_size) \
( \
(!(n_tail_size)) || \
(((n_tail_size) > REISERFS_ITEM_MAX(n_block_size)) || \
( (n_file_size) >= (n_block_size) * 4 ) || \
( ( (n_file_size) >= (n_block_size) * 3 ) && \
( (n_tail_size) >= (REISERFS_ITEM_MAX(n_block_size))/4) ) || \
( ( (n_file_size) >= (n_block_size) * 2 ) && \
( (n_tail_size) >= (REISERFS_ITEM_MAX(n_block_size))/2) ) || \
( ( (n_file_size) >= (n_block_size) ) && \
( (n_tail_size) >= (REISERFS_ITEM_MAX(n_block_size) * 3)/4) ) ) \
)
#endif
-29
View File
@@ -1,29 +0,0 @@
/*
* Copyright 2000-2004 by Hans Reiser, licensing governed by
* reiserfsprogs/README
*/
#ifndef REISERFS_PRINT_H
#define REISERFS_PRINT_H
#include <stdlib.h>
extern void reiserfs_warning (FILE * fp, const char * fmt, ...);
#define reiserfs_panic(fmt, list...) \
{\
fflush (stdout);\
fprintf (stderr, "%s %d %s\n", __FILE__, __LINE__, __FUNCTION__);\
reiserfs_warning (stderr, (const char *)fmt, ## list);\
reiserfs_warning (stderr, "\n" );\
abort ();\
}
#define reiserfs_exit(val, fmt, list...) \
{\
fflush (stdout);\
reiserfs_warning (stderr, (const char *)fmt, ## list);\
reiserfs_warning (stderr, "\n" );\
exit (val);\
}
#endif
-192
View File
@@ -1,192 +0,0 @@
/*
* Copyright 2000-2004 by Hans Reiser, licensing governed by
* reiserfsprogs/README
*/
#ifndef REISERFS_STAT_H
#define REISERFS_STAT_H
/* Stat Data on disk (reiserfs version of UFS disk inode minus the address blocks) */
/* The sense of adding union to stat data is to keep a value of real number of
blocks used by file. The necessity of adding such information is caused by
existing of files with holes. Reiserfs should keep number of used blocks
for file, but not calculate it from file size (that is not correct for
holed files). Thus we have to add additional information to stat data.
When we have a device special file, there is no need to get number of used
blocks for them, and, accordingly, we doesn't need to keep major and minor
numbers for regular files, which might have holes. So this field is being
overloaded. */
struct reiserfs_sd_v1 {
__u16 sd_mode; /* file type, permissions */
__u16 sd_nlink; /* number of hard links */
__u16 sd_uid; /* owner */
__u16 sd_gid; /* group */
__u32 sd_size; /* file size */
__u32 sd_atime; /* time of last access */
__u32 sd_mtime; /* time file was last modified */
__u32 sd_ctime; /* time inode (stat data) was last changed (except
changes to sd_atime and sd_mtime) */
union {
__u32 sd_rdev;
__u32 sd_blocks; /* number of blocks file uses */
} __attribute__ ((__packed__)) u;
__u32 sd_fdb; /* first byte of file which is stored
in a direct item: except that if it
equals 1 it is a symlink and if it
equals MAX_KEY_OFFSET there is no
direct item. The existence of this
field really grates on me. Let's
replace it with a macro based on
sd_size and our tail suppression
policy. Someday. -Hans */
} __attribute__ ((__packed__));
typedef struct reiserfs_sd_v1 reiserfs_sd_v1_t;
#define REISERFS_SD_SIZE_V1 (sizeof(reiserfs_sd_v1_t))
/* this is used to check sd_size of stat data v1 */
#define REISERFS_SD_SIZE_MAX_V1 0x7fffffff
// sd_fdb is set to this when there are no direct items in a file
#define REISERFS_SD_NODIRECT 0xffffffff
/* Stat Data on disk (reiserfs version of UFS disk inode minus the
address blocks) */
struct reiserfs_sd {
__u16 sd_mode; /* file type, permissions */
__u16 sd_attrs;
__u32 sd_nlink; /* 32 bit nlink! */
__u64 sd_size; /* 64 bit size!*/
__u32 sd_uid; /* 32 bit uid! */
__u32 sd_gid; /* 32 bit gid! */
__u32 sd_atime; /* time of last access */
__u32 sd_mtime; /* time file was last modified */
__u32 sd_ctime; /* time inode (stat data) was last changed (except
changes to sd_atime and sd_mtime) */
__u32 sd_blocks;
union {
__u32 sd_rdev;
__u32 sd_generation;
//__u32 sd_fdb;
/* first byte of file which is stored in a direct item: except that if
it equals 1 it is a symlink and if it equals ~(__u32)0 there is no
direct item. The existence of this field really grates on me. Let's
replace it with a macro based on sd_size and our tail suppression
policy? */
} __attribute__ ((__packed__)) u;
} __attribute__ ((__packed__));
//
// this is 44 bytes long
//
typedef struct reiserfs_sd reiserfs_sd_t;
#define REISERFS_SD_SIZE (sizeof(reiserfs_sd_t))
/* this is used to check sd_size of stat data v2: max offset which can
be reached with a key of format 2 is 60 bits */
#define REISERFS_SD_SIZE_MAX_V2 0xfffffffffffffffLL
/* reiserfs_sd_v1_t* access macros */
#define reiserfs_sd_v1_mode(sd) (le16_to_cpu((sd)->sd_mode))
#define reiserfs_set_sd_v1_mode(sd,n) ((sd)->sd_mode = cpu_to_le16((n)))
#define reiserfs_sd_v1_nlink(sd) (le16_to_cpu((sd)->sd_nlink))
#define reiserfs_set_sd_v1_nlink(sd,n) ((sd)->sd_nlink = cpu_to_le16((n)))
#define reiserfs_sd_v1_uid(sd) (le16_to_cpu((sd)->sd_uid))
#define reiserfs_set_sd_v1_uid(sd,n) ((sd)->sd_uid = cpu_to_le16((n)))
#define reiserfs_sd_v1_gid(sd) (le16_to_cpu((sd)->sd_gid))
#define reiserfs_set_sd_v1_gid(sd,n) ((sd)->sd_gid = cpu_to_le16((n)))
#define reiserfs_sd_v1_size(sd) (le32_to_cpu((sd)->sd_size))
#define reiserfs_set_sd_v1_size(sd,n) ((sd)->sd_size = cpu_to_le32((n)))
#define reiserfs_sd_v1_atime(sd) (le32_to_cpu((sd)->sd_atime))
#define reiserfs_set_sd_v1_atime(sd,n) ((sd)->sd_atime = cpu_to_le32((n)))
#define reiserfs_sd_v1_mtime(sd) (le32_to_cpu((sd)->sd_mtime))
#define reiserfs_set_sd_v1_mtime(sd,n) ((sd)->sd_mtime = cpu_to_le32((n)))
#define reiserfs_sd_v1_ctime(sd) (le32_to_cpu((sd)->sd_ctime))
#define reiserfs_set_sd_v1_ctime(sd,n) ((sd)->sd_ctime = cpu_to_le32((n)))
#define reiserfs_sd_v1_blocks(sd) (le32_to_cpu((sd)->u.sd_blocks))
#define reiserfs_set_sd_v1_blocks(sd,n) ((sd)->u.sd_blocks = cpu_to_le32((n)))
#define reiserfs_sd_v1_rdev(sd) (le32_to_cpu((sd)->u.sd_rdev))
#define reiserfs_set_sd_v1_rdev(sd,n) ((sd)->u.sd_rdev = cpu_to_le32((n)))
#define reiserfs_sd_v1_fdb(sd) (le32_to_cpu((sd)->sd_fdb))
#define reiserfs_set_sd_v1_fdb(sd,n) ((sd)->sd_fdb = cpu_to_le32((n)))
/* reiserfs_sd_t */
#define reiserfs_sd_v2_mode(sd) (le16_to_cpu((sd)->sd_mode))
#define reiserfs_set_sd_v2_mode(sd,n) ((sd)->sd_mode = cpu_to_le16((n)))
#define reiserfs_sd_v2_attrs(sd) (le16_to_cpu((sd)->sd_attrs))
#define reiserfs_set_sd_v2_attrs(sd,n) ((sd)->sd_attrs = cpu_to_le16((n)))
#define reiserfs_sd_v2_nlink(sd) (le32_to_cpu((sd)->sd_nlink))
#define reiserfs_set_sd_v2_nlink(sd,n) ((sd)->sd_nlink = cpu_to_le32((n)))
#define reiserfs_sd_v2_size(sd) (le64_to_cpu((sd)->sd_size))
#define reiserfs_set_sd_v2_size(sd,n) ((sd)->sd_size = cpu_to_le64((n)))
#define reiserfs_sd_v2_uid(sd) (le32_to_cpu((sd)->sd_uid))
#define reiserfs_set_sd_v2_uid(sd,n) ((sd)->sd_uid = cpu_to_le32((n)))
#define reiserfs_sd_v2_gid(sd) (le32_to_cpu((sd)->sd_gid))
#define reiserfs_set_sd_v2_gid(sd,n) ((sd)->sd_gid = cpu_to_le32((n)))
#define reiserfs_sd_v2_atime(sd) (le32_to_cpu((sd)->sd_atime))
#define reiserfs_set_sd_v2_atime(sd,n) ((sd)->sd_atime = cpu_to_le32((n)))
#define reiserfs_sd_v2_mtime(sd) (le32_to_cpu((sd)->sd_mtime))
#define reiserfs_set_sd_v2_mtime(sd,n) ((sd)->sd_mtime = cpu_to_le32((n)))
#define reiserfs_sd_v2_ctime(sd) (le32_to_cpu((sd)->sd_ctime))
#define reiserfs_set_sd_v2_ctime(sd,n) ((sd)->sd_ctime = cpu_to_le32((n)))
#define reiserfs_sd_v2_blocks(sd) (le32_to_cpu((sd)->sd_blocks))
#define reiserfs_set_sd_v2_blocks(sd,n) ((sd)->sd_blocks = cpu_to_le32((n)))
#define reiserfs_sd_v2_rdev(sd) (le32_to_cpu((sd)->u.sd_rdev))
#define reiserfs_set_sd_v2_rdev(sd,n) ((sd)->u.sd_rdev = cpu_to_le32((n)))
extern void reiserfs_stat_init (int blocksize, int key_format,
__u32 dirid, __u32 objectid,
reiserfs_ih_t * ih, void * sd);
extern void reiserfs_stat_set (int field, reiserfs_ih_t * ih,
void * sd, void * value);
extern void reiserfs_stat_get (int field, reiserfs_ih_t * ih,
void * sd, void * value);
/* access to stat data fields */
#define STAT_MODE 0
#define STAT_SIZE 1
#define STAT_NLINK 2
#define STAT_BLOCKS 3
#define STAT_FDB 4
#define reiserfs_stat_get_mode(ih, sd, pmode) \
reiserfs_stat_get(STAT_MODE, ih, sd, pmode)
#define reiserfs_stat_set_mode(ih, sd, pmode) \
reiserfs_stat_set(STAT_MODE, ih, sd, pmode)
#define reiserfs_stat_get_size(ih, sd, psize) \
reiserfs_stat_get(STAT_SIZE, ih, sd, psize)
#define reiserfs_stat_set_size(ih, sd, psize) \
reiserfs_stat_set(STAT_SIZE, ih, sd, psize)
#define reiserfs_stat_get_blocks(ih, sd, pblocks) \
reiserfs_stat_get(STAT_BLOCKS, ih, sd, pblocks)
#define reiserfs_stat_set_blocks(ih, sd, pblocks) \
reiserfs_stat_set(STAT_BLOCKS, ih, sd, pblocks)
#define reiserfs_stat_get_nlink(ih, sd, pnlink) \
reiserfs_stat_get(STAT_NLINK, ih, sd, pnlink)
#define reiserfs_stat_set_nlink(ih, sd, pnlink) \
reiserfs_stat_set(STAT_NLINK, ih, sd, pnlink)
#define reiserfs_stat_get_fdb(ih, sd, pfdb) \
reiserfs_stat_get(STAT_FDB, ih, sd, pfdb)
#define reiserfs_stat_set_fdb(ih, sd, pfdb) \
reiserfs_stat_set(STAT_FDB, ih, sd, pfdb)
extern int reiserfs_print_stat_data (FILE * fp,
reiserfs_bh_t * bh,
reiserfs_ih_t * ih,
int alltimes);
#endif
-156
View File
@@ -1,156 +0,0 @@
/*
* Copyright 2000-2004 by Hans Reiser, licensing governed by
* reiserfsprogs/README
*/
#ifndef REISERFS_SUPER_H
#define REISERFS_SUPER_H
#define REISERFS_SB_SIZE_V1 (sizeof(reiserfs_sb_v1_t)) /* 76 bytes */
#define reiserfs_sb_jp(sb) (&((sb)->s_v1.sb_journal))
/* values for sb_version field of struct reiserfs_super_block. sb_version is
only reliable on filesystem with non-standard journal */
#define REISERFS_FORMAT_3_5 0
#define REISERFS_FORMAT_3_6 2
#define REISERFS_FORMAT_UNKNOWN -1
/* values for sb_mount_state field */
#define FS_CLEANLY_UMOUNTED 1 /* this was REISERFS_VALID_FS */
#define FS_NOT_CLEANLY_UMOUNTED 2 /* this was REISERFS_ERROR. It
means that filesystem was not
cleanly unmounted */
typedef enum {
reiserfs_attrs_cleared = 0x00000001,
} reiserfs_super_block_flags;
#define REISERFS_SB_SIZE (sizeof(reiserfs_sb_t)) /* 204 bytes */
/* set/get fields of super block with these defines */
#define reiserfs_sb_get_blocks(sb) get_le32 (sb, s_v1.sb_block_count)
#define reiserfs_sb_set_blocks(sb,val) set_le32 (sb, s_v1.sb_block_count, val)
#define reiserfs_sb_get_free(sb) get_le32 (sb, s_v1.sb_free_blocks)
#define reiserfs_sb_set_free(sb,val) set_le32 (sb, s_v1.sb_free_blocks, val)
#define reiserfs_sb_get_root(sb) get_le32 (sb,s_v1.sb_root_block)
#define reiserfs_sb_set_root(sb,val) set_le32 (sb, s_v1.sb_root_block, val)
#if 0
#define get_sb_mount_id(sb) get_le32 (sb,s_v1.sb_mountid)
#define set_sb_mount_id(sb,val) set_le32 (sb, s_v1.sb_mountid, val)
#define get_sb_journal_magic(sb) get_le32 (sb, s_v1.sb_journal_magic)
#define set_sb_journal_magic(sb,val) set_le32 (sb, s_v1.sb_journal_magic, val)
#endif
#define reiserfs_sb_get_blksize(sb) get_le16 (sb, s_v1.sb_blocksize)
#define reiserfs_sb_set_blksize(sb,val) set_le16 (sb, s_v1.sb_blocksize, val)
#define reiserfs_sb_get_mapmax(sb) get_le16 (sb, s_v1.sb_oid_maxsize)
#define reiserfs_sb_set_mapmax(sb,val) set_le16 (sb, s_v1.sb_oid_maxsize, val)
#define reiserfs_sb_get_mapcur(sb) get_le16 (sb, s_v1.sb_oid_cursize)
#define reiserfs_sb_set_mapcur(sb,val) set_le16 (sb, s_v1.sb_oid_cursize, val)
#define reiserfs_sb_get_umount(sb) get_le16 (sb, s_v1.sb_umount_state)
#define reiserfs_sb_set_umount(sb,val) set_le16 (sb, s_v1.sb_umount_state, val)
#define reiserfs_sb_get_state(sb) get_le16 (sb, s_v1.sb_fs_state)
#define reiserfs_sb_set_state(sb,flag) set_le16 (sb, s_v1.sb_fs_state, flag)
#define reiserfs_sb_get_hash(sb) get_le32 (sb, s_v1.sb_hash_function_code)
#define reiserfs_sb_set_hash(sb,val) set_le32 (sb, s_v1.sb_hash_function_code, val)
#define reiserfs_sb_get_height(sb) get_le16 (sb, s_v1.sb_tree_height)
#define reiserfs_sb_set_height(sb,val) set_le16 (sb, s_v1.sb_tree_height, val)
#define reiserfs_sb_get_bmaps(sb) get_le16 (sb, s_v1.sb_bmap_nr)
#define reiserfs_sb_set_bmaps(sb,val) set_le16 (sb, s_v1.sb_bmap_nr, val)
#define reiserfs_sb_get_version(sb) get_le16 (sb, s_v1.sb_version)
#define reiserfs_sb_set_version(sb,val) set_le16 (sb, s_v1.sb_version, val)
#define reiserfs_sb_get_reserved(sb) \
get_le16 (sb, s_v1.sb_reserved_for_journal)
#define reiserfs_sb_set_reserved(sb,val) \
set_le16 (sb, s_v1.sb_reserved_for_journal, val)
#define reiserfs_sb_get_gen(sb) get_le32 (sb, sb_inode_generation)
#define reiserfs_sb_set_gen(sb,val) set_le32 (sb, sb_inode_generation, val)
#define reiserfs_sb_get_flags(sb) get_le32 (sb, s_flags)
#define reiserfs_sb_set_flags(sb, val) set_le32 (sb, s_flags, val)
#define reiserfs_sb_isflag(sb, flag) \
(get_le32 (sb, s_flags) & flag)
#define reiserfs_sb_mkflag(sb, flag) \
set_le32 (sb, s_flags, get_le32 (sb, s_flags) | flag)
#define reiserfs_sb_clflag(sb, flag) \
set_le32 (sb, s_flags, get_le32 (sb, s_flags) & ~(flag))
/* 0 does not guarantee that fs is consistent */
#define reiserfs_sb_state_ok(fs) \
((reiserfs_sb_get_umount (fs->fs_ondisk_sb) == FS_CLEANLY_UMOUNTED) && \
(reiserfs_sb_get_state (fs->fs_ondisk_sb) == FS_CONSISTENT))
/* prejournalled reiserfs had signature in the other place in super block */
#define REISERFS_SUPER_MAGIC_STRING_OFFSET_NJ 20
/* f_type of struct statfs will be set at this value by statfs(2) */
#define REISERFS_SUPER_MAGIC 0x52654973
/* various reiserfs signatures. We have 3 so far. ReIsErFs for 3.5 format with
standard journal, ReIsEr2Fs for 3.6 (or converted 3.5) and ReIsEr3Fs for
filesystem with non-standard journal (formats are distinguished by
sb_version in that case). Those signatures should be looked for at the
64-th and at the 8-th 1k block of the device */
#define REISERFS_3_5_SUPER_MAGIC_STRING "ReIsErFs"
#define REISERFS_3_6_SUPER_MAGIC_STRING "ReIsEr2Fs"
#define REISERFS_JR_SUPER_MAGIC_STRING "ReIsEr3Fs" /* JR stands for Journal
Relocation */
/* these are possible values for sb_fs_state */
enum reiserfs_state_flags {
/* this is set by mkreiserfs and by reiserfsck */
FS_CONSISTENT = 0x0,
/* this is set by the kernel when fsck is wanted. */
FS_ERROR = 0x1,
/* this is set by fsck when fatal corruption is found */
FS_FATAL = 0x2,
/* this is set by kernel when io error occures */
/* IO_ERROR = 0x4, */
FS_STATE_LAST = 0x5
};
extern int reiserfs_super_35_magic (reiserfs_sb_t * rs);
extern int reiserfs_super_36_magic (reiserfs_sb_t * rs);
extern int reiserfs_super_jr_magic (reiserfs_sb_t * rs);
extern int reiserfs_super_magic (reiserfs_sb_t * rs);
extern int reiserfs_super_format (reiserfs_sb_t * sb);
extern int reiserfs_super_size (reiserfs_sb_t * rs);
extern int reiserfs_super_prejournaled (reiserfs_sb_t * rs);
extern void reiserfs_super_print_state (FILE * fp,
reiserfs_filsys_t * fs);
extern int reiserfs_super_print (FILE * fp,
reiserfs_filsys_t *,
char * file_name,
reiserfs_bh_t * bh,
int short_print);
extern int reiserfs_super_valid(reiserfs_bh_t *bh);
#endif
-160
View File
@@ -1,160 +0,0 @@
/*
* Copyright 2000-2004 by Hans Reiser, licensing governed by
* reiserfsprogs/README
*/
#ifndef REISERFS_TREE_H
#define REISERFS_TREE_H
#include <reiserfs/types.h>
/* Search_by_key fills up the path from the root to the leaf as it
descends the tree looking for the key. It uses reiserfs_buffer_read to
try to find buffers in the cache given their block number. If it
does not find them in the cache it reads them from disk. For each
node reiserfs_tree_search_item finds using reiserfs_buffer_read it then uses
bin_search to look through that node. bin_search will find the
position of the block_number of the next node if it is looking
through an internal node. If it is looking through a leaf node
bin_search will find the position of the item which has key either
equal to given key, or which is the maximal key less than the given
key. */
#define REISERFS_PATH_INIT(var) \
reiserfs_path_t var = {REISERFS_PATH_OFFILL, }
/* Get path element by path and path position. */
#define REISERFS_PATH_ELEM(p_s_path,nr_elem) \
((p_s_path)->path_elements + (nr_elem))
/* Get buffer header at the path by path and path position. */
#define REISERFS_PATH_BUFFER(p_s_path,nr_elem) \
(REISERFS_PATH_ELEM(p_s_path, nr_elem)->pe_buffer)
/* Get position in the element at the path by path and path position. */
#define REISERFS_PATH_POS(p_s_path,nr_elem) \
(REISERFS_PATH_ELEM(p_s_path, nr_elem)->pe_position)
#define REISERFS_PATH_LEAF(p_s_path) \
(REISERFS_PATH_BUFFER((p_s_path), (p_s_path)->path_length))
#define REISERFS_PATH_LEAF_POS(p_s_path) \
(REISERFS_PATH_POS((p_s_path), (p_s_path)->path_length))
#define REISERFS_PATH_IH(p_s_path) \
reiserfs_ih_at(REISERFS_PATH_LEAF(p_s_path), \
REISERFS_PATH_LEAF_POS(p_s_path))
/* in reiserfs_tb_balance leaf has h == 0 in contrast with path structure,
where root has level == 0. That is why we need these defines */
#define REISERFS_PATH_UPBUFFER(p_s_path, h) \
(REISERFS_PATH_BUFFER (p_s_path, p_s_path->path_length - (h)))
/* tb->F[h] or tb->S[0]->b_parent */
#define REISERFS_PATH_UPPARENT(path, h) \
REISERFS_PATH_UPBUFFER (path, (h) + 1)
#define REISERFS_PATH_UPPOS(path, h) \
REISERFS_PATH_POS (path, path->path_length - (h))
/* tb->S[h]->b_item_order */
#define REISERFS_PATH_UPPARENT_POS(path, h) \
REISERFS_PATH_UPPOS(path, h + 1)
#define REISERFS_PATH_LEVEL(p_s_path, n_h) \
((p_s_path)->path_length - (n_h))
#define REISERFS_PATH_ITEM(path) \
((void *) reiserfs_item_at(REISERFS_PATH_LEAF(path), \
REISERFS_PATH_LEAF_POS (path)))
extern int reiserfs_tree_search_entry (reiserfs_filsys_t *fs,
const reiserfs_key_t * key,
reiserfs_path_t * path);
extern int reiserfs_tree_search_position (reiserfs_filsys_t *fs,
const reiserfs_key_t * key,
reiserfs_path_t * path);
extern const reiserfs_key_t * reiserfs_tree_lkey (reiserfs_path_t * path,
reiserfs_filsys_t *fs);
extern const reiserfs_key_t * reiserfs_tree_rkey (reiserfs_path_t * path,
reiserfs_filsys_t *fs);
extern const reiserfs_key_t *reiserfs_tree_next_key (reiserfs_path_t * path,
reiserfs_filsys_t *fs);
extern int reiserfs_tree_delete_entry (reiserfs_filsys_t *,
reiserfs_key_t *);
extern void reiserfs_tree_delete (reiserfs_filsys_t *,
reiserfs_path_t *, int);
extern void reiserfs_tree_delete_unit (reiserfs_filsys_t *,
reiserfs_path_t *, int);
extern void reiserfs_tree_insert_unit (reiserfs_filsys_t *,
reiserfs_path_t * path,
const void * body,
int size);
extern void reiserfs_tree_insert (reiserfs_filsys_t *,
reiserfs_path_t * ,
reiserfs_ih_t *,
const void *);
extern int reiserfs_tree_search_name (reiserfs_filsys_t *,
const reiserfs_key_t * dir,
char * name,
unsigned int * min_gen_counter,
reiserfs_key_t * key);
extern int reiserfs_tree_search_body (reiserfs_filsys_t * fs,
const reiserfs_key_t * key,
reiserfs_path_t * path);
extern int reiserfs_tree_search_item (reiserfs_filsys_t * fs,
const reiserfs_key_t * key,
reiserfs_path_t * path);
extern int reiserfs_tree_scan_name (reiserfs_filsys_t *,
reiserfs_key_t * dir,
char * name,
reiserfs_path_t * path);
extern int reiserfs_tree_insert_entry (reiserfs_filsys_t *,
const reiserfs_key_t * dir,
char * name,
int name_len,
const reiserfs_key_t * key,
__u16 fsck_need);
typedef void (*item_modify_t) (reiserfs_ih_t *, void *item);
extern __u16 reiserfs_tree_root (reiserfs_filsys_t * fs,
item_modify_t modify,
__u16 ih_flags);
extern int reiserfs_tree_create_stat (reiserfs_filsys_t * fs,
reiserfs_path_t * path,
const reiserfs_key_t * key,
item_modify_t modify);
extern void reiserfs_tree_pathrelse (reiserfs_path_t * p_s_search_path);
extern int reiserfs_tree_left_mergeable (reiserfs_filsys_t * s,
reiserfs_path_t * path);
extern int reiserfs_tree_right_mergeable (reiserfs_filsys_t * s,
reiserfs_path_t * path);
extern int reiserfs_tree_node_mergeable (reiserfs_bh_t *left,
reiserfs_bh_t *right);
extern int reiserfs_tree_merge(reiserfs_filsys_t *fs,
reiserfs_path_t *dst_path,
reiserfs_path_t *src_path);
#endif
-202
View File
@@ -1,202 +0,0 @@
/*
* Copyright 2000-2004 by Hans Reiser, licensing governed by
* reiserfsprogs/README
*/
#ifndef REISERFS_TB_H
#define REISERFS_TB_H
/* This temporary structure is used in tree balance algorithms, and
constructed as we go to the extent that its various parts are needed. It
contains arrays of nodes that can potentially be involved in the balancing
of node S, and parameters that define how each of the nodes must be
balanced. Note that in these algorithms for balancing the worst case is to
need to balance the current node S and the left and right neighbors and all
of their parents plus create a new node. We implement S1 balancing for the
leaf nodes and S0 balancing for the internal nodes (S1 and S0 are defined
in our papers.)*/
/* size of the array of buffers to free at end of reiserfs_tb_balance */
#define TB_2FREE_MAX 7
#define TB_FEB_MAX (REISERFS_TREE_HEIGHT_MAX + 1)
/* someday somebody will prefix every field in this struct with tb_ */
struct reiserfs_tb {
reiserfs_filsys_t * tb_fs;
reiserfs_path_t * tb_path;
/* array of left neighbors of nodes in the path */
reiserfs_bh_t * L[REISERFS_TREE_HEIGHT_MAX];
/* array of right neighbors of nodes in the path*/
reiserfs_bh_t * R[REISERFS_TREE_HEIGHT_MAX];
/* array of fathers of the left neighbors */
reiserfs_bh_t * FL[REISERFS_TREE_HEIGHT_MAX];
/* array of fathers of the right neighbors */
reiserfs_bh_t * FR[REISERFS_TREE_HEIGHT_MAX];
/* array of common parents of center node and its left neighbor */
reiserfs_bh_t * CFL[REISERFS_TREE_HEIGHT_MAX];
/* array of common parents of center node and its right neighbor */
reiserfs_bh_t * CFR[REISERFS_TREE_HEIGHT_MAX];
/* array of blocknr's that are free and are the nearest to the left
node that are usable for writing dirty formatted leaves, using
the write_next_to algorithm. */
/*unsigned long free_and_near[MAX_DIRTIABLE];*/
/* array of empty buffers. Number of buffers in array equals cur_blknum. */
reiserfs_bh_t * FEB[TB_FEB_MAX];
reiserfs_bh_t * used[TB_FEB_MAX];
/* array of number of items which must be shifted to the left in order to
balance the current node; for leaves includes item that will be partially
shifted; for internal nodes, it is the number of child pointers rather
than items. It includes the new item being created. For preserve_shifted
purposes the code sometimes subtracts one from this number to get the
number of currently existing items being shifted, and even more often
for leaves it subtracts one to get the number of wholly shifted items
for other purposes. */
short int lnum[REISERFS_TREE_HEIGHT_MAX];
/* substitute right for left in comment above */
short int rnum[REISERFS_TREE_HEIGHT_MAX];
/* array indexed by height h mapping the key delimiting L[h] and
S[h] to its item number within the node CFL[h] */
short int lkey[REISERFS_TREE_HEIGHT_MAX];
/* substitute r for l in comment above */
short int rkey[REISERFS_TREE_HEIGHT_MAX];
/* the number of bytes by we are trying to add or remove from S[h].
A negative value means removing. */
short int insert_size[REISERFS_TREE_HEIGHT_MAX];
/* number of nodes that will replace node S[h] after balancing on the level
h of the tree. If 0 then S is being deleted, if 1 then S is remaining
and no new nodes are being created, if 2 or 3 then 1 or 2 new nodes is
being created */
short int blknum[REISERFS_TREE_HEIGHT_MAX];
/* fields that are used only for balancing leaves of the tree */
/* number of empty blocks having been already allocated */
short int cur_blknum;
/* number of items that fall into left most node when S[0] splits */
short int s0num;
/* number of items that fall into first new node when S[0] splits */
short int s1num;
/* number of items that fall into second new node when S[0] splits */
short int s2num;
/* number of bytes which can flow to the left neighbor from the left */
short int lbytes;
/* most liquid item that cannot be shifted from S[0] entirely
if -1 then nothing will be partially shifted */
/* number of bytes which will flow to the right neighbor from the right */
short int rbytes;
/* number of bytes which flow to the first new node when S[0] splits
note: if S[0] splits into 3 nodes, then items do not need to be cut */
short int s1bytes;
short int s2bytes;
/* buffers which are to be freed after reiserfs_tb_balance finishes
by reiserfs_unfix_nodes */
reiserfs_bh_t * buf_to_free[TB_2FREE_MAX];
/* kmalloced memory. Used to create virtual node and keep map of dirtied
bitmap blocks */
char * vn_buf;
/* size of the vn_buf */
int vn_buf_size;
/* VN starts after bitmap of bitmap blocks */
struct reiserfs_virtual_node * tb_vn;
};
typedef struct reiserfs_tb reiserfs_tb_t;
enum tb_return {
CARRY_ON = 0x0,
NO_DISK_SPACE = 0x3,
IO_ERROR = 0x4,
NO_BALANCING_NEEDED = 0x5,
ITEM_FOUND = 0x6,
ITEM_NOT_FOUND = 0x7,
POSITION_FOUND = 0x8,
POSITION_NOT_FOUND = 0x9,
GOTO_PREVIOUS_ITEM = 0xa,
POSITION_FOUND_INVISIBLE= 0xb,
FILE_NOT_FOUND = 0xc,
DIRECTORY_NOT_FOUND = 0xd,
DIRECTORY_FOUND = 0xf,
LAST_SEARCH
};
/* These are modes of balancing */
/* When inserting an item. */
#define M_INSERT 'i'
/* When inserting into (directories only) or appending onto an already
existant item. */
#define M_PASTE 'p'
/* When deleting an item. */
#define M_DELETE 'd'
/* When truncating an item or removing an entry from a (directory) item. */
#define M_CUT 'c'
/* used when balancing on leaf level skipped (in reiserfsck) */
#define M_INTERNAL 'n'
#define FIRST_TO_LAST 0
#define LAST_TO_FIRST 1
/* used in reiserfs_tb_balance for passing parent of node information that
has been gotten from tb struct */
struct reiserfs_bufinfo {
reiserfs_bh_t * bi_bh;
reiserfs_bh_t * bi_parent;
int bi_position;
};
typedef struct reiserfs_bufinfo reiserfs_bufinfo_t;
extern void reiserfs_tb_attach_new (reiserfs_bufinfo_t * bi);
extern reiserfs_bh_t * reiserfs_tb_FEB (reiserfs_tb_t *tb);
extern int reiserfs_tb_lpos (reiserfs_tb_t * tb, int h);
extern int reiserfs_tb_rpos (reiserfs_tb_t * tb, int h);
extern void reiserfs_tb_balance (reiserfs_tb_t * tb,
reiserfs_ih_t * ih,
const char * body,
int flag,
int zeros_num);
extern void reiserfs_tb_init (reiserfs_tb_t * tb,
reiserfs_filsys_t *,
reiserfs_path_t * path,
int size);
extern void reiserfs_tb_print_path (reiserfs_tb_t * tb,
reiserfs_path_t * path);
#endif
-297
View File
@@ -1,297 +0,0 @@
/*
* Copyright 2000-2004 by Hans Reiser, licensing governed by
* reiserfsprogs/README
*/
#ifndef REISERFS_TYPES_H
#define REISERFS_TYPES_H
#include "misc/types.h"
#include "misc/swab.h"
struct reiserfs_bitmap {
unsigned long bm_byte_size;
unsigned long bm_bit_size;
char * bm_map;
unsigned long bm_set_bits;
int bm_dirty; /* used for fetched bitmap */
unsigned long bm_first_zero;
};
typedef struct reiserfs_bitmap reiserfs_bitmap_t;
typedef struct reiserfs_bh reiserfs_bh_t;
struct reiserfs_bh {
unsigned long b_blocknr;
int b_dev;
unsigned long b_size;
char * b_data;
unsigned long b_state;
unsigned int b_count;
unsigned int b_list ;
void (*b_start_io) (unsigned long);
void (*b_end_io)(reiserfs_bh_t *bh, int uptodate);
reiserfs_bh_t * b_next;
reiserfs_bh_t * b_prev;
reiserfs_bh_t * b_hash_next;
reiserfs_bh_t * b_hash_prev;
};
/* magic string to find desc blocks in the journal */
#define JOURNAL_DESC_MAGIC "ReIsErLB"
struct reiserfs_journal_param {
/* where does journal start from on its device */
__u32 jp_start;
/* journal device st_rdev */
__u32 jp_dev;
/* size of the journal on FS creation. used to make sure
they don't overflow it */
__u32 jp_size;
/* max number of blocks in a transaction. */
__u32 jp_tlen;
/* random value made on fs creation (this was sb_journal_block_count) */
__u32 jp_magic;
/* max number of blocks to batch into a trans */
__u32 jp_max_batch;
/* in seconds, how old can an async commit be */
__u32 jp_commit_age;
/* in seconds, how old can a transaction be */
__u32 jp_trans_age;
};
typedef struct reiserfs_journal_param reiserfs_journal_param_t;
/* this header block gets written whenever a transaction is considered fully
** flushed, and is more recent than the last fully flushed transaction. fully
** flushed means all the log blocks and all the real blocks are on disk, and
** this transaction does not need to be replayed. */
struct reiserfs_journal_header {
/* id of last fully flushed transaction */
__u32 jh_last_flush_trans_id ;
/* offset in the log of where to start replay after a crash */
__u32 jh_flush_offset ;
__u32 jh_mount_id ;
reiserfs_journal_param_t jh_journal;
/* the mount id of the fs during the last reiserfsck --check. */
__u32 jh_last_check_mount_id;
};
/* this is the super from 3.5.X */
struct reiserfs_super_block_v1
{
__u32 sb_block_count; /* 0 number of block on data device */
__u32 sb_free_blocks; /* 4 free blocks count */
__u32 sb_root_block; /* 8 root of the tree */
reiserfs_journal_param_t sb_journal; /* 12 */
__u16 sb_blocksize; /* 44 */
__u16 sb_oid_maxsize; /* 46 max size of object id array, see
get_objectid() commentary */
__u16 sb_oid_cursize; /* 48 current size of object id array */
__u16 sb_umount_state; /* 50 this is set to 1 when filesystem was
umounted, to 2 - when not */
char s_magic[10]; /* 52 reiserfs magic string indicates that
file system is reiserfs: "ReIsErFs" or
"ReIsEr2Fs" or "ReIsEr3Fs" */
__u16 sb_fs_state; /* 62 it is set to used by fsck to mark which phase of
rebuilding is done (used for fsck debugging) */
__u32 sb_hash_function_code;/* 64 code of fuction which was/is/will be
used to sort names in a directory. See
codes in above */
__u16 sb_tree_height; /* 68 height of filesytem tree. Tree
consisting of only one root block has 2
here */
__u16 sb_bmap_nr; /* 70 amount of bitmap blocks needed to
address each block of file system */
__u16 sb_version; /* 72 this field is only reliable on
filesystem with non-standard journal */
__u16 sb_reserved_for_journal; /* 74 size in blocks of journal area on
main device, we need to keep after
non-standard journal relocation */
};
typedef struct reiserfs_super_block_v1 reiserfs_sb_v1_t;
/* Structure of super block on disk */
struct reiserfs_super_block {
/* 0 */ reiserfs_sb_v1_t s_v1;
/* 76 */ __u32 sb_inode_generation;
/* Right now used only by inode-attributes, if enabled */
/* 80 */ __u32 s_flags;
/* filesystem unique identifier */
/* 84 */ unsigned char s_uuid[16];
/* filesystem volume label */
/*100 */ unsigned char s_label[16];
/* zero filled by mkreiserfs and reiserfs_convert_objectid_map_v1()
* so any additions must be updated there as well. */
/*116 */ char s_unused[88];
/*204*/
} __attribute__ ((__packed__));;
typedef struct reiserfs_super_block reiserfs_sb_t;
typedef __u32 (*hashf_t) (const char *, int);
typedef struct reiserfs_filsys reiserfs_filsys_t;
struct reiserfs_filsys {
unsigned int fs_blocksize;
int fs_format; /* on-disk format version */
hashf_t hash; /* pointer to function which is used to sort
names in directory. It is set by
reiserfs_fs_open if it is set in the super
block, otherwise it is set by first
reiserfs_hash_correct */
char fs_file_name[4096]; /* file name of underlying device */
int fs_dev; /* descriptor of opened block device file */
reiserfs_bh_t * fs_super_bh; /* buffer containing super block */
reiserfs_sb_t * fs_ondisk_sb; /* pointer to its b_data */
reiserfs_bitmap_t * fs_bitmap2; /* ondisk bitmap after
reiserfs_bitmap_open */
/* opened journal fields */
char fs_j_file_name[4096]; /* file name of relocated journal device */
int fs_journal_dev; /* descriptor of opened journal device */
reiserfs_bh_t * fs_jh_bh; /* buffer containing journal header */
/* badblocks */
reiserfs_bitmap_t * fs_badblocks_bm;
int fs_dirt;
int fs_flags;
void * fs_vp;
int (*block_allocator) (reiserfs_filsys_t * fs,
unsigned long * free_blocknrs,
unsigned long start, int amount_needed);
int (*block_deallocator) (reiserfs_filsys_t * fs, unsigned long block);
__u16 lost_format;
};
#define REISERFS_TREE_HEIGHT_MAX 6
#define REISERFS_PATH_OFFINIT 2
#define REISERFS_PATH_OFFILL 1
#define REISERFS_PATH_MAX (REISERFS_TREE_HEIGHT_MAX + \
REISERFS_PATH_OFFINIT)
struct reiserfs_path_element {
/* Pointer to the buffer at the path in the tree. */
reiserfs_bh_t * pe_buffer;
/* Position in the tree node which is placed in the buffer above. */
int pe_position;
};
typedef struct reiserfs_path_element reiserfs_path_element_t;
/* We need to keep track of who the ancestors of nodes are. When we
perform a search we record which nodes were visited while
descending the tree looking for the node we searched for. This list
of nodes is called the path. This information is used while
performing balancing. Note that this path information may become
invalid, and this means we must check it when using it to see if it
is still valid. You'll need to read reiserfs_tree_search_item and the
comments in it, especially about decrement_counters_in_path(),
to understand this structure. */
struct reiserfs_path {
/* Length of the array above. */
unsigned int path_length;
/* Array of the path elements. */
reiserfs_path_element_t path_elements[REISERFS_PATH_MAX];
int pos_in_item;
};
typedef struct reiserfs_path reiserfs_path_t;
struct reiserfs_koff_v1 {
__u32 k_offset;
__u32 k_uniqueness;
} __attribute__ ((__packed__));
struct reiserfs_koff_v2 {
#if __BYTE_ORDER == __LITTLE_ENDIAN
__u64 k_offset:60;
__u64 k_type: 4;
#elif __BYTE_ORDER == __BIG_ENDIAN
__u64 k_type: 4;
__u64 k_offset:60;
#else
# error "nuxi/pdp-endian archs are not supported"
#endif
} __attribute__ ((__packed__));
/* Key of the object determines object's location in the tree,
composed of 4 components */
struct reiserfs_key {
/* packing locality: by default parent directory object id */
__u32 k2_dir_id;
/* object identifier */
__u32 k2_objectid;
union {
struct reiserfs_koff_v1 k2_offset_v1;
struct reiserfs_koff_v2 k2_offset_v2;
} __attribute__ ((__packed__)) u;
} __attribute__ ((__packed__));
typedef struct reiserfs_key reiserfs_key_t;
/* Everything in the filesystem is stored as a set of items. The item head
contains the key of the item, its free space (for extent items) and
specifies the location of the item itself within the block. */
struct reiserfs_ih {
reiserfs_key_t ih_key; /* Everything in the tree is found by searching for it
based on its key.*/
union {
__u16 ih2_free_space; /* The free space in the last unformatted node
of an extent item if this is an extent
item. This equals 0xFFFF iff this is a direct
item or stat data item. Note that the key, not
this field, is used to determine the item
type, and thus which field this union
contains. */
__u16 ih2_entry_count; /* Iff this is a directory item, this field
equals the number of directory entries in
the directory item. */
} __attribute__ ((__packed__)) u;
__u16 ih2_item_len; /* total size of the item body */
__u16 ih2_item_location; /* an offset to the item body within the
block */
__u16 ih_format; /* key format is stored in bits 0-11 of this item
flags are stored in bits 12-15 */
#if 0
struct {
__u16 key_format : 12; /* KEY_FORMAT_1 or KEY_FORMAT_2. This is not
necessary, but we have space, let use it */
__u16 flags : 4; /* fsck set here its flag (reachable/unreachable) */
} __attribute__ ((__packed__)) ih2_format;
#endif
} __attribute__ ((__packed__));
typedef struct reiserfs_ih reiserfs_ih_t;
typedef int (*unfm_func_t) (reiserfs_filsys_t *, __u32);
#endif
File diff suppressed because it is too large. Load diff
+412
View File
@@ -0,0 +1,412 @@
/*
* Copyright 2000-2004 by Hans Reiser, licensing governed by
* reiserfsprogs/README
*/
#ifndef REISERFSPROGS_LIB_H
#define REISERFSPROGS_LIB_H
#define BADBLOCK_DIRID 1
#define BADBLOCK_OBJID (__u32)-1
typedef struct reiserfs_filsys reiserfs_filsys_t;
#include "reiserfs_fs.h"
struct _bitmap {
unsigned long bm_byte_size;
unsigned long bm_bit_size;
char * bm_map;
unsigned long bm_set_bits;
int bm_dirty; /* used for fetched bitmap */
};
typedef struct _bitmap reiserfs_bitmap_t;
typedef __u32 (*hashf_t) (const char *, int);
struct reiserfs_filsys {
unsigned int fs_blocksize;
int fs_format; /* on-disk format version */
hashf_t fs_hash_function; /* pointer to function which is used to sort
names in directory. It is set by
reiserfs_open if it is set in the super
block, otherwise it is set by first
is_properly_hashed */
char * fs_file_name; /* file name of underlying device */
int fs_dev; /* descriptor of opened block device file */
struct buffer_head * fs_super_bh; /* buffer containing super block */
struct reiserfs_super_block * fs_ondisk_sb; /* pointer to its b_data */
reiserfs_bitmap_t * fs_bitmap2; /* ondisk bitmap after
reiserfs_open_ondisk_bitmap */
/* opened journal fields */
char * fs_j_file_name; /* file name of relocated journal device */
int fs_journal_dev; /* descriptor of opened journal device */
struct buffer_head * fs_jh_bh; /* buffer containing journal header */
/* badblocks */
reiserfs_bitmap_t * fs_badblocks_bm;
int fs_dirt;
int fs_flags;
void * fs_vp;
int (*block_allocator) (reiserfs_filsys_t * fs,
unsigned long * free_blocknrs,
unsigned long start, int amount_needed);
int (*block_deallocator) (reiserfs_filsys_t * fs, unsigned long block);
};
struct _transaction {
unsigned long mount_id;
unsigned long trans_id;
unsigned long desc_blocknr;
unsigned long trans_len;
unsigned long commit_blocknr;
unsigned long next_trans_offset;
};
typedef struct _transaction reiserfs_trans_t;
/* reiserfslib.c */
void init_tb_struct (struct tree_balance * tb, reiserfs_filsys_t *, struct path * path, int size);
reiserfs_filsys_t * reiserfs_open (char * filename, int flags, int * error, void * vp, int skip_check);
reiserfs_filsys_t * reiserfs_create (char * filename, int version, unsigned long block_count,
int block_size, int default_journal, int new_format);
void reiserfs_flush (reiserfs_filsys_t *);
void reiserfs_free (reiserfs_filsys_t *);
void reiserfs_close (reiserfs_filsys_t *);
void reiserfs_reopen (reiserfs_filsys_t *, int flags);
int is_opened_rw (reiserfs_filsys_t * fs);
/*
void reiserfs_read_bitmap_blocks (reiserfs_filsys_t *);
void reiserfs_free_bitmap_blocks (reiserfs_filsys_t *);
*/
int no_reiserfs_found (reiserfs_filsys_t *);
int block_size_ok(int blocksize, int force);
int is_block_count_correct (unsigned long block_of_super_block, unsigned int block_size,
unsigned long block_count, unsigned long journal_size);
//unsigned long min_block_amount (int block_size, unsigned long journal_size);
unsigned long get_size_of_journal_or_reserved_area (struct reiserfs_super_block * sb);
int reiserfs_new_blocknrs (reiserfs_filsys_t *,
unsigned long * free_blocknrs, unsigned long start,
int amount_needed);
int reiserfs_free_block (reiserfs_filsys_t *, unsigned long block);
int spread_bitmaps (reiserfs_filsys_t *);
int filesystem_dirty (reiserfs_filsys_t *);
void mark_filesystem_dirty (reiserfs_filsys_t *);
void reiserfs_paste_into_item (reiserfs_filsys_t *, struct path * path,
const void * body, int size);
void reiserfs_insert_item (reiserfs_filsys_t *, struct path * path,
struct item_head * ih, const void * body);
int reiserfs_locate_entry (reiserfs_filsys_t *, struct key * dir, char * name,
struct path * path);
int reiserfs_find_entry (reiserfs_filsys_t *, struct key * dir, char * name,
unsigned int * min_gen_counter, struct key * key);
int reiserfs_add_entry (reiserfs_filsys_t *, struct key * dir, char * name, int name_len,
struct key * key, __u16 fsck_need);
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,
struct path * path);
int reiserfs_search_by_key_4 (reiserfs_filsys_t *, struct key * key,
struct path * path);
int reiserfs_search_by_entry_key (reiserfs_filsys_t *, struct key * key,
struct path * path);
int usearch_by_position (reiserfs_filsys_t *, struct key * key, int version, struct path * path);
struct key * reiserfs_next_key (struct path * path);
void copy_key (void * to, void * from);
void copy_short_key (void * to, void * from);
void copy_item_head(void * p_v_to, void * p_v_from);
int comp_keys (const void * k1, const void * k2);
int comp_keys_3 (const void * k1, const void * k2);
int comp_short_keys (const void * p_s_key1, const void * p_s_key2);
int comp_items (struct item_head * p_s_ih, struct path * p_s_path);
__u32 hash_value (hashf_t func, char * name, int namelen);
int create_dir_sd (reiserfs_filsys_t * fs,
struct path * path, struct key * key,
void (*modify_item)(struct item_head *, void *));
void make_sure_root_dir_exists (reiserfs_filsys_t * fs,
void (*modyfy_item)(struct item_head *, void *),
int ih_flags);
typedef void (*badblock_func_t) (reiserfs_filsys_t *fs,
struct path *badblock_path,
void *data);
void mark_badblock(reiserfs_filsys_t *fs, struct path *badblock_path, void *data);
int create_badblock_bitmap (reiserfs_filsys_t * fs, char * badblocks_file);
void add_badblock_list (reiserfs_filsys_t * fs, int no_badblock_in_tree_yet);
void badblock_list(reiserfs_filsys_t * fs, badblock_func_t action, void *data);
#define reiserfs_fs_bmap_nr(fs) reiserfs_bmap_nr(get_sb_block_count(fs->fs_ondisk_sb), fs->fs_blocksize)
#define reiserfs_bmap_nr(count, blk_size) ((count - 1) / (blk_size * 8) + 1)
#define reiserfs_bmap_over(nr) (nr > ((1LL << 16) - 1))
extern struct key root_dir_key;
extern struct key parent_root_dir_key;
extern struct key lost_found_dir_key;
extern __u16 root_dir_format;
extern __u16 lost_found_dir_format;
/* bitmap.c */
int reiserfs_open_ondisk_bitmap (reiserfs_filsys_t *);
int reiserfs_create_ondisk_bitmap (reiserfs_filsys_t *);
void reiserfs_free_ondisk_bitmap (reiserfs_filsys_t *);
void reiserfs_close_ondisk_bitmap (reiserfs_filsys_t *);
int reiserfs_flush_to_ondisk_bitmap (reiserfs_bitmap_t * bm, reiserfs_filsys_t * fs);
unsigned int reiserfs_calc_bmap_nr(reiserfs_filsys_t *fs, unsigned int blocks);
reiserfs_bitmap_t * reiserfs_create_bitmap (unsigned int bit_count);
int reiserfs_expand_bitmap (reiserfs_bitmap_t * bm, unsigned int bit_count);
void reiserfs_shrink_bitmap (reiserfs_bitmap_t * bm, unsigned int bit_count);
void reiserfs_delete_bitmap (reiserfs_bitmap_t * bm);
void reiserfs_bitmap_copy (reiserfs_bitmap_t * to, reiserfs_bitmap_t * from);
int reiserfs_bitmap_compare (reiserfs_bitmap_t * bm1, reiserfs_bitmap_t * bm2);
void reiserfs_bitmap_disjunction (reiserfs_bitmap_t * disk, reiserfs_bitmap_t * cont);
void reiserfs_bitmap_delta (reiserfs_bitmap_t * base, reiserfs_bitmap_t * exclude);
void reiserfs_bitmap_set_bit (reiserfs_bitmap_t * bm, unsigned int bit_number);
void reiserfs_bitmap_clear_bit (reiserfs_bitmap_t * bm, unsigned int bit_number);
int reiserfs_bitmap_test_bit (reiserfs_bitmap_t * bm, unsigned int bit_number);
int reiserfs_bitmap_find_zero_bit (reiserfs_bitmap_t * bm, unsigned long * start);
/*int reiserfs_fetch_ondisk_bitmap (reiserfs_bitmap_t * bm, reiserfs_filsys_t *);*/
/*int reiserfs_flush_bitmap (reiserfs_bitmap_t * bm, reiserfs_filsys_t *);*/
void reiserfs_bitmap_zero (reiserfs_bitmap_t * bm);
void reiserfs_bitmap_fill (reiserfs_bitmap_t * bm);
unsigned int reiserfs_bitmap_ones (reiserfs_bitmap_t * bm);
unsigned int reiserfs_bitmap_zeros (reiserfs_bitmap_t * bm);
FILE * open_file(char * filename, char * option);
void close_file(FILE * fp);
void reiserfs_bitmap_save (FILE * fp, reiserfs_bitmap_t * bm);
/* this probably should be in fsck */
void reiserfs_begin_stage_info_save(FILE * file, unsigned long stage);
void reiserfs_end_stage_info_save(FILE * file);
int is_stage_magic_correct (FILE * fp);
//void reiserfs_stage_info_save(struct fsck_data *, FILE * file);
reiserfs_bitmap_t * reiserfs_bitmap_load (FILE * fp);
void reiserfs_bitmap_invert (reiserfs_bitmap_t * bm);
int reiserfs_remove_entry (reiserfs_filsys_t *, struct key * key);
/* node_formats.c */
#define THE_LEAF 1
#define THE_INTERNAL 2
#define THE_SUPER 3
#define THE_JDESC 4
#define HAS_IH_ARRAY 5
#define THE_UNKNOWN 6
int is_blocksize_correct (unsigned int blocksize);
int is_reiserfs_3_5_magic_string (struct reiserfs_super_block * rs);
int is_reiserfs_3_6_magic_string (struct reiserfs_super_block * rs);
int is_reiserfs_jr_magic_string (struct reiserfs_super_block * rs);
int does_look_like_super_block (struct reiserfs_super_block * rs);
int is_any_reiserfs_magic_string (struct reiserfs_super_block * rs);
int get_reiserfs_format (struct reiserfs_super_block * sb);
int reiserfs_super_block_size (struct reiserfs_super_block * rs);
/*int magic_2_version (struct reiserfs_super_block * rs);*/
int is_prejournaled_reiserfs (struct reiserfs_super_block * rs);
int who_is_this (char * buf, int blocksize);
int leaf_count_ih(char * buf, int blocksize);
int leaf_free_space_estimate(char * buf, int blocksize);
int is_a_leaf(char * buf, int blocksize);
int leaf_item_number_estimate(struct buffer_head * bh);
char * which_block (int code);
int get_journal_size (reiserfs_filsys_t *);
int not_data_block (reiserfs_filsys_t *, unsigned long block);
int not_journalable (reiserfs_filsys_t *, unsigned long block);
int block_of_bitmap (reiserfs_filsys_t *, unsigned long block);
int block_of_journal (reiserfs_filsys_t *, unsigned long block);
int is_tree_node (struct buffer_head * bh, int level);
int is_properly_hashed (reiserfs_filsys_t *,
char * name, int namelen, __u32 offset);
int dir_entry_bad_location (struct reiserfs_de_head * deh,
struct item_head * ih, int first);
void make_dir_stat_data (int blocksize, int key_format,
__u32 dirid, __u32 objectid,
struct item_head * ih, void * sd);
void make_empty_dir_item_v1 (char * body, __u32 dirid, __u32 objid,
__u32 par_dirid, __u32 par_objid);
void make_empty_dir_item (char * body, __u32 dirid, __u32 objid,
__u32 par_dirid, __u32 par_objid);
int reiserfs_is_fs_consistent (reiserfs_filsys_t * fs);
typedef void (*item_action_t) (struct buffer_head * bh, struct item_head * ih);
typedef void (*item_head_action_t) (struct item_head * ih);
void for_every_item (struct buffer_head * bh, item_head_action_t action,
item_action_t * actions);
int key_format (const struct key * key);
unsigned long long get_offset (const struct key * key);
int uniqueness2type (__u32 uniqueness);
__u32 type2uniqueness (int type);
int get_type (const struct key * key);
char * key_of_what (const struct key * key);
int type_unknown (struct key * key);
void set_type (int format, struct key * key, int type);
void set_offset (int format, struct key * key, loff_t offset);
void set_type_and_offset (int format, struct key * key, loff_t offset, int type);
typedef int (*check_unfm_func_t) (reiserfs_filsys_t *, __u32);
int is_it_bad_item (reiserfs_filsys_t *, struct item_head *, char *,
check_unfm_func_t, int bad_dir);
#define hash_func_is_unknown(fs) ((fs)->fs_hash_function == 0)
#define reiserfs_hash(fs) ((fs)->fs_hash_function)
int known_hashes (void);
char *code2name (unsigned int code);
int func2code (hashf_t func);
hashf_t code2func (unsigned int code);
hashf_t name2func (char * hash);
int find_hash_in_use (char * name, int namelen, __u32 deh_offset, unsigned int code_to_try_first);
int entry_length (struct item_head * ih, struct reiserfs_de_head * deh,
int pos_in_item);
char * name_in_entry (struct reiserfs_de_head * deh, int pos_in_item);
int name_in_entry_length (struct item_head * ih,
struct reiserfs_de_head * deh, int pos_in_item);
int name_length (char * name, int key_format);
/* access to stat data fields */
void get_set_sd_field (int field, struct item_head * ih, void * sd,
void * value, int set);
#define GET_SD_MODE 0
#define GET_SD_SIZE 1
#define GET_SD_NLINK 2
#define GET_SD_BLOCKS 3
#define GET_SD_FIRST_DIRECT_BYTE 4
#define get_sd_mode(ih,sd,pmode) get_set_sd_field (GET_SD_MODE, ih, sd, pmode, 0/*get*/)
#define set_sd_mode(ih,sd,pmode) get_set_sd_field (GET_SD_MODE, ih, sd, pmode, 1/*set*/)
#define get_sd_size(ih,sd,psize) get_set_sd_field (GET_SD_SIZE, ih, sd, psize, 0/*get*/)
#define set_sd_size(ih,sd,psize) get_set_sd_field (GET_SD_SIZE, ih, sd, psize, 1/*set*/)
#define get_sd_blocks(ih,sd,pblocks) get_set_sd_field (GET_SD_BLOCKS, ih, sd, pblocks, 0/*get*/)
#define set_sd_blocks(ih,sd,pblocks) get_set_sd_field (GET_SD_BLOCKS, ih, sd, pblocks, 1/*set*/)
//#define get_sd_rdev(ih,sd,pblocks) get_set_sd_field (GET_SD_RDEV, ih, sd, pblocks, 0/*get*/)
//#define set_sd_rdev(ih,sd,pblocks) get_set_sd_field (GET_SD_RDEV, ih, sd, pblocks, 1/*set*/)
//#define get_sd_generation(ih,sd,pblocks) get_set_sd_field (GET_SD_GENER, ih, sd, pblocks, 0/*get*/)
//#define set_sd_generation(ih,sd,pblocks) get_set_sd_field (GET_SD_GENER, ih, sd, pblocks, 1/*set*/)
#define get_sd_nlink(ih,sd,pnlink) get_set_sd_field (GET_SD_NLINK, ih, sd, pnlink, 0/*get*/)
#define set_sd_nlink(ih,sd,pnlink) get_set_sd_field (GET_SD_NLINK, ih, sd, pnlink, 1/*set*/)
#define get_sd_first_direct_byte(ih,sd,pfdb) get_set_sd_field (GET_SD_FIRST_DIRECT_BYTE, ih, sd, pfdb, 0/*get*/)
#define set_sd_first_direct_byte(ih,sd,pfdb) get_set_sd_field (GET_SD_FIRST_DIRECT_BYTE, ih, sd, pfdb, 1/*set*/)
int is_objectid_used (reiserfs_filsys_t * fs, __u32 objectid);
void mark_objectid_used (reiserfs_filsys_t * fs, __u32 objectid);
/* journal.c */
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);
int replay_one_transaction (reiserfs_filsys_t *, reiserfs_trans_t *);
typedef void (*action_on_trans_t) (reiserfs_filsys_t *, reiserfs_trans_t *);
void for_each_transaction (reiserfs_filsys_t *, action_on_trans_t);
typedef void (*action_on_block_t) (reiserfs_filsys_t *, reiserfs_trans_t *,
unsigned int index,
unsigned long in_journal,
unsigned long in_place);
void for_each_block (reiserfs_filsys_t * fs, reiserfs_trans_t * trans,
action_on_block_t action);
int reiserfs_open_journal (reiserfs_filsys_t *, char *, int flags);
int reiserfs_journal_params_check(reiserfs_filsys_t *fs);
int reiserfs_create_journal (reiserfs_filsys_t * fs, char * j_filename,
unsigned long offset, unsigned long len,
int transaction_max_size, int force);
int reiserfs_journal_opened (reiserfs_filsys_t *);
void reiserfs_flush_journal (reiserfs_filsys_t * fs);
void reiserfs_free_journal (reiserfs_filsys_t * fs);
void reiserfs_close_journal (reiserfs_filsys_t *);
void reiserfs_reopen_journal (reiserfs_filsys_t * fs, int flag);
__u32 advise_journal_max_trans_age (void);
__u32 advise_journal_max_commit_age (void);
__u32 advise_journal_max_batch (unsigned long journal_trans_max);
__u32 advise_journal_max_trans_len (__u32 desired, __u32 journal_size, int blocksize, int verbose);
/* prints.c */
void print_indirect_item (FILE * fp, struct buffer_head * bh, int item_num);
void print_block (FILE * fp, reiserfs_filsys_t *, struct buffer_head * bh, ...);//int print_mode, int first, int last);
int print_super_block (FILE * fp, reiserfs_filsys_t *, char * file_name, struct buffer_head * bh, int short_print);
void print_journal (reiserfs_filsys_t *);
void print_journal_header (reiserfs_filsys_t * fs);
void reiserfs_warning (FILE * fp, const char * fmt, ...);
char ftypelet (mode_t mode);
void reiserfs_print_item (FILE * fp, struct buffer_head * bh,
struct item_head * ih);
void print_filesystem_state (FILE * fp, reiserfs_filsys_t * fs);
void print_one_transaction (reiserfs_filsys_t * fs, reiserfs_trans_t * trans);
void print_journal_params (FILE * fp, struct journal_params * jp);
char * get_reiserfs_version (__u16 version);
int can_we_format_it (char * device_name, int force);
#define reiserfs_panic(fmt, list...) \
{\
fflush (stdout);\
fprintf (stderr, "%s %d %s\n", __FILE__, __LINE__, __FUNCTION__);\
reiserfs_warning (stderr, (const char *)fmt, ## list);\
reiserfs_warning (stderr, "\n" );\
abort ();\
}
#define reiserfs_exit(val, fmt, list...) \
{\
fflush (stdout);\
reiserfs_warning (stderr, (const char *)fmt, ## list);\
reiserfs_warning (stderr, "\n" );\
exit (val);\
}
#define check_forcing_ask_confirmation(force) \
if (force < 1) {\
/* avoid formatting it without being forced */\
reiserfs_warning (stderr, "Use -f to force over\n");\
return 0;\
}\
if (force < 2) {\
if (!user_confirmed (stderr, "Continue (y/n):", "y\n"))\
return 0;\
}\
#endif /* REISERFSPROGS_LIB_H */
+8 -17
View File
@@ -3,8 +3,11 @@
* reiserfsprogs/README
*/
#ifndef MISC_SWAB_H
#define MISC_SWAB_H
#ifndef REISERFSPROGS_SWAB_H
#define REISERFSPROGS_SWAB_H
#include <endian.h>
#include <asm/types.h>
#define __swab16(x) \
({ \
@@ -39,7 +42,7 @@
})
#ifndef WORDS_BIGENDIAN
#if __BYTE_ORDER == __LITTLE_ENDIAN
# define cpu_to_le16(val) (val)
# define le16_to_cpu(val) (val)
@@ -48,7 +51,7 @@
# define cpu_to_le64(val) (val)
# define le64_to_cpu(val) (val)
#elif defined(WORDS_BIGENDIAN)
#elif __BYTE_ORDER == __BIG_ENDIAN
# define cpu_to_le16(val) __swab16(val)
# define le16_to_cpu(val) __swab16(val)
@@ -61,16 +64,4 @@
# error "nuxi/pdp-endian archs are not supported"
#endif
#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)
#define get_le16(p,field) get_leXX (16, p, field)
#define set_le16(p,field,val) set_leXX (16, p, field, val)
#define get_le32(p,field) get_leXX (32, p, field)
#define set_le32(p,field,val) set_leXX (32, p, field, val)
#define get_le64(p,field) get_leXX (64, p, field)
#define set_le64(p,field,val) set_leXX (64, p, field, val)
#endif /* MISC_SWAB_H */
#endif /* REISERFS_SWAB_H */
-1
View File
@@ -1 +0,0 @@
noinst_HEADERS = badblock.h misc.h print.h device.h mntent.h
-337
View File
@@ -1,337 +0,0 @@
# Makefile.in generated by automake 1.9.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ../..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = include/util
DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
SOURCES =
DIST_SOURCES =
HEADERS = $(noinst_HEADERS)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
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@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PROGS_LDFLAGS = @PROGS_LDFLAGS@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
UUID_LIBS = @UUID_LIBS@
VERSION = @VERSION@
ac_ct_CC = @ac_ct_CC@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
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@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
noinst_HEADERS = badblock.h misc.h print.h device.h mntent.h
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/util/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu include/util/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
uninstall-info-am:
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(HEADERS)
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am:
install-exec-am:
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-info-am
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
ctags distclean distclean-generic distclean-tags distdir dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-exec install-exec-am \
install-info install-info-am install-man install-strip \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
pdf-am ps ps-am tags uninstall uninstall-am uninstall-info-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
-14
View File
@@ -1,14 +0,0 @@
/*
* Copyright 2000-2004 by Hans Reiser, licensing governed by
* reiserfsprogs/README
*/
#ifndef UTIL_BADBLOCK_H
#define UTIL_BADBLOCK_H
#include "reiserfs/libreiserfs.h"
extern int util_badblock_load (reiserfs_filsys_t * fs,
char * badblocks_file);
#endif
-72
View File
@@ -1,72 +0,0 @@
/*
* Copyright 1996-2004 by Hans Reiser, licensing governed by
* reiserfsprogs/README
*/
#ifndef UTIL_DEVICE_H
#define UTIL_DEVICE_H
#include "misc/types.h"
#include <linux/major.h>
#include <sys/types.h>
#include <stdio.h>
#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 || \
((maj) >= SCSI_DISK1_MAJOR && (maj) <= SCSI_DISK7_MAJOR))
#endif /* SCSI_DISK_MAJOR */
#ifndef SCSI_BLK_MAJOR
#define SCSI_BLK_MAJOR(maj) (SCSI_DISK_MAJOR(maj) || (maj) == SCSI_CDROM_MAJOR)
#endif /* SCSI_BLK_MAJOR */
#ifndef IDE_DISK_MAJOR
#ifdef IDE9_MAJOR
#define IDE_DISK_MAJOR(maj) ((maj) == IDE0_MAJOR || (maj) == IDE1_MAJOR || \
(maj) == IDE2_MAJOR || (maj) == IDE3_MAJOR || \
(maj) == IDE4_MAJOR || (maj) == IDE5_MAJOR || \
(maj) == IDE6_MAJOR || (maj) == IDE7_MAJOR || \
(maj) == IDE8_MAJOR || (maj) == IDE9_MAJOR)
#else
#define IDE_DISK_MAJOR(maj) ((maj) == IDE0_MAJOR || (maj) == IDE1_MAJOR || \
(maj) == IDE2_MAJOR || (maj) == IDE3_MAJOR || \
(maj) == IDE4_MAJOR || (maj) == IDE5_MAJOR)
#endif /* IDE9_MAJOR */
#endif /* IDE_DISK_MAJOR */
typedef enum mount_flags {
MF_NOT_MOUNTED = 0x0,
MF_RO = 0x1,
MF_RW = 0x2
} mount_flags_t;
extern FILE * util_file_open (char * filename, char * option);
typedef struct util_device_dma {
int fd;
int support_type;
int dma;
__u64 speed;
dev_t st_rdev;
} util_device_dma_t;
extern int util_device_dma_prep(util_device_dma_t *dma_info);
extern int util_device_get_dma(util_device_dma_t *dma_info);
extern void util_device_dma_fini(int fd, util_device_dma_t *dma_info);
extern int util_device_formatable (char * device_name, int force);
extern int util_root_mounted(char *device);
extern int util_device_mounted(char *device);
extern int util_file_ro(char *file);
#endif
-30
View File
@@ -1,30 +0,0 @@
/*
* Copyright 1996-2004 by Hans Reiser, licensing governed by
* reiserfsprogs/README
*/
#ifndef UTIL_MISC_H
#define UTIL_MISC_H
#include <stdio.h>
extern void util_misc_progress (FILE * fp,
unsigned long *passed,
unsigned long total,
unsigned int inc,
int forward);
extern void util_misc_speed (FILE *fp,
unsigned long total,
unsigned long passed,
int cursor_pos,
int reset_time);
extern void util_misc_print_name (FILE * fp, char * name, int len);
extern void util_misc_erase_name (FILE * fp, int len);
extern void util_misc_fini_name (FILE *fp);
#endif
-11
View File
@@ -1,11 +0,0 @@
/*
* Copyright 1996-2004 by Hans Reiser, licensing governed by
* reiserfsprogs/README
*/
#ifndef UTIL_MNTENT_H
#define UTIL_MNTENT_H
extern struct mntent *util_mntent(char *device);
#endif
-15
View File
@@ -1,15 +0,0 @@
/*
* Copyright 2000-2004 by Hans Reiser, licensing governed by
* reiserfsprogs/README
*/
#ifndef UTIL_PRINT_H
#define UTIL_PRINT_H
#include <stdio.h>
extern int util_user_confirmed(FILE * fp, char * q, char * yes);
extern void util_print_banner(char *name);
#endif