Imported reiserfsprogs-3.6.18

This commit is contained in:
Jeff Mahoney committed 2012-10-11 11:30:57 -04:00
1 parent 18057cdad6
commit 3078c83c48
64 files changed
+6508 -1071

No files matched your search

+20 -6
View File
@@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.7.2 from Makefile.am.
# Makefile.in generated by automake 1.7.6 from Makefile.am.
# @configure_input@
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
# Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -35,6 +35,7 @@ POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
host_triplet = @host@
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
@@ -63,7 +64,11 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
@@ -85,12 +90,21 @@ ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
@@ -107,6 +121,7 @@ sysconfdir = @sysconfdir@
target_alias = @target_alias@
noinst_HEADERS = io.h misc.h reiserfs_fs.h reiserfs_lib.h swab.h
subdir = include
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES =
@@ -118,10 +133,10 @@ all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-am
.SUFFIXES:
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu include/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
config.h: stamp-h1
@@ -134,7 +149,7 @@ stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
@rm -f stamp-h1
cd $(top_builddir) && $(SHELL) ./config.status include/config.h
$(srcdir)/config.h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4)
$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOHEADER)
touch $(srcdir)/config.h.in
@@ -232,7 +247,6 @@ check: check-am
all-am: Makefile $(HEADERS) config.h
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
+44
View File
@@ -1,11 +1,20 @@
/* include/config.h.in. Generated from configure.in by autoheader. */
/* Define for enable debug info. */
#undef ENABLE_DEBUG
/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
#undef HAVE_DOPRNT
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* Define to 1 if you have the `getmntent' function. */
#undef HAVE_GETMNTENT
/* Define to 1 if you have the `hasmntopt' function. */
#undef HAVE_HASMNTOPT
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
@@ -21,6 +30,15 @@
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the `memset' function. */
#undef HAVE_MEMSET
/* Define to 1 if you have the `register_printf_function' function. */
#undef HAVE_REGISTER_PRINTF_FUNCTION
/* Define to 1 if you have the `statfs' function. */
#undef HAVE_STATFS
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
@@ -61,6 +79,12 @@
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the `time' function. */
#undef HAVE_TIME
/* Define to 1 if you have the `uname' function. */
#undef HAVE_UNAME
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
@@ -73,6 +97,14 @@
/* gets set when configure --enable-io-failure-emulation */
#undef IO_FAILURE_EMULATION
/* Define to 1 if `major', `minor', and `makedev' are declared in <mkdev.h>.
*/
#undef MAJOR_IN_MKDEV
/* Define to 1 if `major', `minor', and `makedev' are declared in
<sysmacros.h>. */
#undef MAJOR_IN_SYSMACROS
/* Name of package */
#undef PACKAGE
@@ -91,12 +123,24 @@
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* The size of a `blkcnt_t', as computed by sizeof. */
#undef SIZEOF_BLKCNT_T
/* The size of a `off_t', as computed by sizeof. */
#undef SIZEOF_OFF_T
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Version number of package */
#undef VERSION
/* Number of bits in a file offset, on hosts where this is settable. */
#undef _FILE_OFFSET_BITS
/* Define for large files, on AIX-style hosts. */
#undef _LARGE_FILES
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
+16
View File
@@ -3,6 +3,20 @@
* reiserfsprogs/README
*/
#ifndef REISERFSPROGS_IO_H
#define REISERFSPROGS_IO_H
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <stdio.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#include "misc.h"
struct buffer_head {
unsigned long b_blocknr;
int b_dev;
@@ -66,3 +80,5 @@ void do_fsck_rollback (int fd_device, int fd_journal_device, FILE * log);
void flush_buffers (int);
void free_buffers (void);
void invalidate_buffers (int);
#endif
+31 -41
View File
@@ -5,18 +5,29 @@
/* nothing abount reiserfs here */
#ifndef REISERFS_MISC_H
#define REISERFS_MISC_H
#ifndef REISERFSPROGS_MISC_H
#define REISERFSPROGS_MISC_H
#include <endian.h>
#include "swab.h"
#include <linux/major.h>
#include <signal.h>
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdlib.h>
#include <linux/major.h>
#if MAJOR_IN_MKDEV
# include <sys/mkdev.h>
#elif MAJOR_IN_SYSMACROS
# include <sys/sysmacros.h>
#endif
#include "swab.h"
#define POSITION_FOUND 8
#define POSITION_NOT_FOUND 9
@@ -53,7 +64,7 @@ void misc_print_credit(FILE *out);
typedef struct dma_info {
int fd;
struct stat64 stat;
struct stat st;
int support_type;
int dma;
__u64 speed;
@@ -80,45 +91,21 @@ extern inline unsigned long long misc_find_first_zero_bit (const void *vaddr, un
extern inline unsigned long long misc_find_next_zero_bit (const void *vaddr, unsigned long long size, unsigned long long offset);
extern inline unsigned long long misc_find_next_set_bit(const void *vaddr, unsigned long long size, unsigned long long offset);
extern inline unsigned long long misc_find_first_set_bit (const void *vaddr, unsigned long long size);
#if __BYTE_ORDER == __LITTLE_ENDIAN
# define cpu_to_le16(val) (val)
# define le16_to_cpu(val) (val)
# define cpu_to_le32(val) (val)
# define le32_to_cpu(val) (val)
# define cpu_to_le64(val) (val)
# define le64_to_cpu(val) (val)
#elif __BYTE_ORDER == __BIG_ENDIAN
# define cpu_to_le16(val) __swab16(val)
# define le16_to_cpu(val) __swab16(val)
# define cpu_to_le32(val) __swab32(val)
# define le32_to_cpu(val) __swab32(val)
# define cpu_to_le64(val) __swab64(val)
# define le64_to_cpu(val) __swab64(val)
#else
# error "nuxi/pdp-endian archs are not supported"
#endif
#define STAT_FIELD_H(Field, Type) \
inline Type misc_device_##Field(char *device);
STAT_FIELD_H(mode, mode_t);
STAT_FIELD_H(rdev, dev_t);
STAT_FIELD_H(size, off64_t);
STAT_FIELD_H(blocks, blkcnt64_t);
STAT_FIELD_H(size, off_t);
STAT_FIELD_H(blocks, blkcnt_t);
/* these are to access bitfield in endian safe manner */
__u16 mask16 (int from, int count);
__u32 mask32 (int from, int count);
__u64 mask64 (int from, int count);
int reiserfs_bin_search (void * key, void * base, __u32 num, int width,
__u32 *ppos, comparison_fn_t comp_func);
__u32 *ppos, __compar_fn_t comp_func);
struct block_handler {
__u32 blocknr;
@@ -168,10 +155,12 @@ int blockdev_list_compare (const void * block1, const void * block2);
return tmp;
#ifndef MAJOR
#define MAJOR(rdev) ((rdev)>>8)
#define MINOR(rdev) ((rdev) & 0xff)
#endif /* MAJOR */
#ifndef major
#define major(rdev) ((rdev)>>8)
#define minor(rdev) ((rdev) & 0xff)
#endif /* major */
#ifndef SCSI_DISK_MAJOR
#define SCSI_DISK_MAJOR(maj) ((maj) == SCSI_DISK0_MAJOR || \
@@ -196,4 +185,5 @@ int blockdev_list_compare (const void * block1, const void * block2);
#endif /* IDE9_MAJOR */
#endif /* IDE_DISK_MAJOR */
#endif /* REISERFS_MISC_H */
+16 -7
View File
@@ -29,12 +29,17 @@
*/
#ifndef REISERFSPROGS_FS_H
#define REISERFSPRIGS_FS_H
#ifndef NO_EXTERN_INLINE
# define extern_inline extern inline
#else
# define extern_inline
#endif
#include <asm/unaligned.h>
#define get_leXX(xx,p,field) (le##xx##_to_cpu ((p)->field))
#define set_leXX(xx,p,field,val) do { (p)->field = cpu_to_le##xx(val); } while (0)
@@ -1420,6 +1425,16 @@ struct buffer_info {
( get_offset(&(p_s_ih)->ih_key) <= (n_offset) && \
get_offset(&(p_s_ih)->ih_key) + get_bytes_number(p_s_ih,n_blocksize) > (n_offset) )
/* these operate on indirect items, where you've got an array of ints
** at a possibly unaligned location. These are a noop on ia32
**
** p is the array of __u32, i is the index into the array, v is the value
** to store there.
*/
#define d32_get(p, i) le32_to_cpu(get_unaligned((p) + (i)))
#define d32_put(p, i, v) put_unaligned(cpu_to_le32(v), (p) + (i))
/* get the item header */
#define B_N_PITEM_HEAD(bh,item_num) ( (struct item_head * )((bh)->b_data + BLKH_SIZE) + (item_num) )
@@ -1446,13 +1461,6 @@ struct buffer_info {
#define MAX_DIRECT_ITEM_LEN(size) ((size) - BLKH_SIZE - 2*IH_SIZE - SD_SIZE - UNFM_P_SIZE)
#define MAX_INDIRECT_ITEM_LEN(size) MAX_ITEM_LEN(size)
/* indirect items consist of entries which contain blocknrs, pos
indicates which entry, and B_I_POS_UNFM_POINTER resolves to the
blocknr contained by the entry pos points to */
#define B_I_POS_UNFM_POINTER(bh,ih,pos) (*(((__u32 *)B_I_PITEM(bh,ih)) + (pos)))
/***************************************************************************/
/* FUNCTION DECLARATIONS */
/***************************************************************************/
@@ -1560,6 +1568,7 @@ extern unsigned int get_journal_new_start_must (reiserfs_filsys_t * fs);
extern unsigned int get_journal_start_must (reiserfs_filsys_t * fs);
/*extern hashf_t hashes [];*/
#endif
/*
* Local variables:
+3 -9
View File
@@ -3,9 +3,8 @@
* reiserfsprogs/README
*/
#ifndef REISERFS_LIB_H
#define REISERFS_LIB_H
#ifndef REISERFSPROGS_LIB_H
#define REISERFSPROGS_LIB_H
#define BADBLOCK_DIRID 1
#define BADBLOCK_OBJID (__u32)-1
@@ -118,9 +117,6 @@ int reiserfs_find_entry (reiserfs_filsys_t *, struct key * dir, char * name,
int reiserfs_add_entry (reiserfs_filsys_t *, struct key * dir, char * name, int name_len,
struct key * key, __u16 fsck_need);
/*int reiserfs_bin_search (void * key, void * base, int num, int width,
int *ppos, comparison_fn_t comp_func);*/
struct key * uget_lkey (struct path * path);
struct key * uget_rkey (struct path * path);
int reiserfs_search_by_key_3 (reiserfs_filsys_t *, struct key * key,
@@ -407,6 +403,4 @@ int can_we_format_it (char * device_name, int force);
}\
#endif /* REISERFS_LIB_H */
#endif /* REISERFSPROGS_LIB_H */
+54 -11
View File
@@ -3,22 +3,65 @@
* reiserfsprogs/README
*/
#ifndef _REISERFS_SWAB_H_
#define _REISERFS_SWAB_H_
#ifndef REISERFSPROGS_SWAB_H
#define REISERFSPROGS_SWAB_H
#include <endian.h>
#include <asm/types.h>
#if __BYTE_ORDER == __BIG_ENDIAN
#define __swab16(x) \
({ \
__u16 __x = (x); \
((__u16)( \
(((__u16)(__x) & (__u16)0x00ffU) << 8) | \
(((__u16)(__x) & (__u16)0xff00U) >> 8) )); \
})
#define extern static
#define __BYTEORDER_HAS_U64__
#include <linux/byteorder/swab.h>
#undef extern
#define __swab32(x) \
({ \
__u32 __x = (x); \
((__u32)( \
(((__u32)(__x) & (__u32)0x000000ffUL) << 24) | \
(((__u32)(__x) & (__u32)0x0000ff00UL) << 8) | \
(((__u32)(__x) & (__u32)0x00ff0000UL) >> 8) | \
(((__u32)(__x) & (__u32)0xff000000UL) >> 24) )); \
})
#define __swab64(x) \
({ \
__u64 __x = (x); \
((__u64)( \
(__u64)(((__u64)(__x) & (__u64)0x00000000000000ffULL) << 56) | \
(__u64)(((__u64)(__x) & (__u64)0x000000000000ff00ULL) << 40) | \
(__u64)(((__u64)(__x) & (__u64)0x0000000000ff0000ULL) << 24) | \
(__u64)(((__u64)(__x) & (__u64)0x00000000ff000000ULL) << 8) | \
(__u64)(((__u64)(__x) & (__u64)0x000000ff00000000ULL) >> 8) | \
(__u64)(((__u64)(__x) & (__u64)0x0000ff0000000000ULL) >> 24) | \
(__u64)(((__u64)(__x) & (__u64)0x00ff000000000000ULL) >> 40) | \
(__u64)(((__u64)(__x) & (__u64)0xff00000000000000ULL) >> 56) )); \
})
#if __BYTE_ORDER == __LITTLE_ENDIAN
# define cpu_to_le16(val) (val)
# define le16_to_cpu(val) (val)
# define cpu_to_le32(val) (val)
# define le32_to_cpu(val) (val)
# define cpu_to_le64(val) (val)
# define le64_to_cpu(val) (val)
#elif __BYTE_ORDER == __BIG_ENDIAN
# define cpu_to_le16(val) __swab16(val)
# define le16_to_cpu(val) __swab16(val)
# define cpu_to_le32(val) __swab32(val)
# define le32_to_cpu(val) __swab32(val)
# define cpu_to_le64(val) __swab64(val)
# define le64_to_cpu(val) __swab64(val)
#else
#include <linux/byteorder/swab.h>
# error "nuxi/pdp-endian archs are not supported"
#endif
#endif /* _REISERFS_SWAB_H_ */
#endif /* REISERFS_SWAB_H */