]> git.ozlabs.org Git - yaboot.git/commitdiff
Commit yaboot 1.3.5-pre1
authorEthan Benson <erbenson@alaska.net>
Tue, 26 Mar 2002 15:11:26 +0000 (15:11 +0000)
committerEthan Benson <erbenson@alaska.net>
Tue, 26 Mar 2002 15:11:26 +0000 (15:11 +0000)
Commit yaboot 1.3.5-pre1.
git-archimport-id: erbenson@alaska.net--public/yaboot--devel--1.3--patch-9

27 files changed:
ChangeLog
Makefile
TODO
changelog
include/bootinfo.h
include/ctype.h
include/debug.h
include/et/com_err.c [deleted file]
include/ext2fs/bitops.h
include/ext2fs/ext2_err.h
include/ext2fs/ext2_io.h
include/ext2fs/ext2fs.h
lib/libext2fs.a
second/cfg.c
second/file.c
second/fs.c
second/fs_ext2.c
second/fs_iso.c
second/fs_of.c
second/fs_reiserfs.c
second/fs_xfs.c
second/iso_util.c
second/partition.c
second/prom.c
second/yaboot.c
util/addnote.c
ybin/ybin

index 6279e5f0b9e063749266e7a4bb069c8a12835128..2abf395b48f1bb8de265b7c66855d4669494c397 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,29 @@
 # tag: automatic-ChangeLog--erbenson@alaska.net--public/yaboot--devel--1.3
 #
 
 # tag: automatic-ChangeLog--erbenson@alaska.net--public/yaboot--devel--1.3
 #
 
+2002-03-26 15:11:26 GMT        Ethan Benson <erbenson@alaska.net>      patch-9
+
+    Summary:
+      Commit yaboot 1.3.5-pre1
+    Revision:
+      yaboot--devel--1.3--patch-9
+
+    Commit yaboot 1.3.5-pre1.
+
+    removed files:
+     include/et/.arch-ids/com_err.c.id include/et/com_err.c
+
+    modified files:
+     ChangeLog Makefile TODO changelog include/bootinfo.h
+     include/ctype.h include/debug.h include/ext2fs/bitops.h
+     include/ext2fs/ext2_err.h include/ext2fs/ext2_io.h
+     include/ext2fs/ext2fs.h lib/libext2fs.a second/cfg.c
+     second/file.c second/fs.c second/fs_ext2.c second/fs_iso.c
+     second/fs_of.c second/fs_reiserfs.c second/fs_xfs.c
+     second/iso_util.c second/partition.c second/prom.c
+     second/yaboot.c util/addnote.c ybin/ybin
+
+
 2002-03-26 15:05:27 GMT        Ethan Benson <erbenson@alaska.net>      patch-8
 
     Summary:
 2002-03-26 15:05:27 GMT        Ethan Benson <erbenson@alaska.net>      patch-8
 
     Summary:
index 068d3e5afa7448602d454eb8c9acf800b383ab04..62dc58a5e3049754b0d58fa1c0d8ae96ad0a6462 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@
 
 include Config
 
 
 include Config
 
-VERSION = 1.3.4
+VERSION = 1.3.5pre1
 # Debug mode (spam/verbose)
 DEBUG = 0
 # make install vars
 # Debug mode (spam/verbose)
 DEBUG = 0
 # make install vars
@@ -114,6 +114,10 @@ elfextract:
 
 mkofboot:
        ln -sf ybin ybin/mkofboot
 
 mkofboot:
        ln -sf ybin ybin/mkofboot
+       @if [ $$(grep '^VERSION=' ybin/ybin | cut -f2 -d=) != ${VERSION} ] ; then       \
+               echo "ybin/ybin: warning: VERSION  mismatch";                           \
+               false;                                                                  \
+       fi
 
 %.o: %.c
        $(CC) $(YBCFLAGS) -c -o $@ $<
 
 %.o: %.c
        $(CC) $(YBCFLAGS) -c -o $@ $<
diff --git a/TODO b/TODO
index c2d7f5a0ef907853c57ca6987dc28d97578a043d..086c9437be235b96a19043f3bfd5098c6301814e 100644 (file)
--- a/TODO
+++ b/TODO
@@ -7,7 +7,10 @@
 
 * Password protection for insecure menu options (MacOS).
 
 
 * Password protection for insecure menu options (MacOS).
 
+* Use system libext2fs instead of shipping a private copy (this is not
+  as simple as it sounds)
+
 * Figure out all the crap with CHRP netbooting, probably have to remove
 * Figure out all the crap with CHRP netbooting, probably have to remove
-  hard-coding of ":0" after a net devuce path
+  hard-coding of ":0" after a net devuce path (done as of 1.3.4?)
 
 * Support for compressed images
 
 * Support for compressed images
index 4c141411b687c96494e2e0662500a1bfde07742d..e4946fa45d06117fa7f9025a71f7a4a919f55d77 100644 (file)
--- a/changelog
+++ b/changelog
@@ -1,3 +1,12 @@
+2001-10-24  Ethan Benson  <erbenson@alaska.net>
+
+       * Version 1.3.5pre1
+
+       * yaboot:
+         - XFS fixes for large partitions (Brendan O'Dea)
+         - Upgrade libext2fs to 1.25, this adds full ext3 support to yaboot.
+         - Reiserfs fixes (Jeff Mahoney)
+
 2001-10-13  Ethan Benson  <erbenson@alaska.net>
 
        * Version 1.3.4
 2001-10-13  Ethan Benson  <erbenson@alaska.net>
 
        * Version 1.3.4
index ffc3f044b0d4a8fdce7fc0ff56b2a1ac54dc702b..c71f380325a0232ced61e2b5dce32d7d34574090 100644 (file)
@@ -41,7 +41,7 @@ struct bi_record {
 
 /* 
  * Local variables:
 
 /* 
  * Local variables:
- * c-file-style: "K&R"
+ * c-file-style: "k&r"
  * c-basic-offset: 5
  * End:
  */
  * c-basic-offset: 5
  * End:
  */
index 9a219dcb2ad7309f6becf204b5f45b20afe7a1d7..5b2f37150de8617d777a6cefb7d4a099b2d7c41a 100644 (file)
@@ -55,7 +55,7 @@ static inline unsigned char __toupper(unsigned char c)
 
 /* 
  * Local variables:
 
 /* 
  * Local variables:
- * c-file-style: "K&R"
+ * c-file-style: "k&r"
  * c-basic-offset: 5
  * End:
  */
  * c-basic-offset: 5
  * End:
  */
index 8683df11d2332ed3a7413adf90ee27803ea1b8f2..8fa1281c3d2e926ca8ffabbb2c3289dfea5c1028 100644 (file)
@@ -46,7 +46,7 @@
 
 /* 
  * Local variables:
 
 /* 
  * Local variables:
- * c-file-style: "K&R"
+ * c-file-style: "k&r"
  * c-basic-offset: 5
  * End:
  */
  * c-basic-offset: 5
  * End:
  */
diff --git a/include/et/com_err.c b/include/et/com_err.c
deleted file mode 100644 (file)
index 81a70cf..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Copyright 1987, 1988 by MIT Student Information Processing Board.
- * 
- * Permission to use, copy, modify, and distribute this software and
- * its documentation for any purpose is hereby granted, provided that
- * the names of M.I.T. and the M.I.T. S.I.P.B. not be used in
- * advertising or publicity pertaining to distribution of the software
- * without specific, written prior permission.  M.I.T. and the
- * M.I.T. S.I.P.B. make no representations about the suitability of
- * this software for any purpose.  It is provided "as is" without
- * express or implied warranty.
- */
-
-#include <stdio.h>
-#include "com_err.h"
-#include "error_table.h"
-#include "internal.h"
-
-#if !defined(__STDC__) && !defined(STDARG_PROTOTYPES)
-#include <varargs.h>
-#define VARARGS
-#endif
-
-static void
-#ifdef __STDC__
-    default_com_err_proc (const char *whoami, errcode_t code, const
-                         char *fmt, va_list args)
-#else
-    default_com_err_proc (whoami, code, fmt, args)
-    const char *whoami;
-    errcode_t code;
-    const char *fmt;
-    va_list args;
-#endif
-{
-    if (whoami) {
-       fputs(whoami, stderr);
-       fputs(": ", stderr);
-    }
-    if (code) {
-       fputs(error_message(code), stderr);
-       fputs(" ", stderr);
-    }
-    if (fmt) {
-        vfprintf (stderr, fmt, args);
-    }
-    /* should do this only on a tty in raw mode */
-    putc('\r', stderr);
-    putc('\n', stderr);
-    fflush(stderr);
-}
-
-#ifdef __STDC__
-typedef void (*errf) (const char *, errcode_t, const char *, va_list);
-#else
-typedef void (*errf) ();
-#endif
-
-errf com_err_hook = default_com_err_proc;
-
-#ifdef __STDC__
-void com_err_va (const char *whoami, errcode_t code, const char *fmt,
-                va_list args)
-#else
-void com_err_va (whoami, code, fmt, args)
-    const char *whoami;
-    errcode_t code;
-    const char *fmt;
-    va_list args;
-#endif
-{
-    (*com_err_hook) (whoami, code, fmt, args);
-}
-
-#ifndef VARARGS
-void com_err (const char *whoami,
-             errcode_t code,
-             const char *fmt, ...)
-{
-#else
-void com_err (va_alist)
-    va_dcl
-{
-    const char *whoami, *fmt;
-    errcode_t code;
-#endif
-    va_list pvar;
-
-    if (!com_err_hook)
-       com_err_hook = default_com_err_proc;
-#ifdef VARARGS
-    va_start (pvar);
-    whoami = va_arg (pvar, const char *);
-    code = va_arg (pvar, errcode_t);
-    fmt = va_arg (pvar, const char *);
-#else
-    va_start(pvar, fmt);
-#endif
-    com_err_va (whoami, code, fmt, pvar);
-    va_end(pvar);
-}
-
-errf set_com_err_hook (new_proc)
-    errf new_proc;
-{
-    errf x = com_err_hook;
-
-    if (new_proc)
-       com_err_hook = new_proc;
-    else
-       com_err_hook = default_com_err_proc;
-
-    return x;
-}
-
-errf reset_com_err_hook () {
-    errf x = com_err_hook;
-    com_err_hook = default_com_err_proc;
-    return x;
-}
index 0361d9bdb3e02d11be11dd56e62d7f7f9e15a5c5..7872b3672ce0d49dbc2ca9cd324c46706adf2aa5 100644 (file)
@@ -35,15 +35,15 @@ extern void ext2fs_warn_bitmap(errcode_t errcode, unsigned long arg,
 extern void ext2fs_warn_bitmap2(ext2fs_generic_bitmap bitmap,
                                int code, unsigned long arg);
 
 extern void ext2fs_warn_bitmap2(ext2fs_generic_bitmap bitmap,
                                int code, unsigned long arg);
 
-extern void ext2fs_mark_block_bitmap(ext2fs_block_bitmap bitmap, blk_t block);
-extern void ext2fs_unmark_block_bitmap(ext2fs_block_bitmap bitmap,
+extern int ext2fs_mark_block_bitmap(ext2fs_block_bitmap bitmap, blk_t block);
+extern int ext2fs_unmark_block_bitmap(ext2fs_block_bitmap bitmap,
                                       blk_t block);
 extern int ext2fs_test_block_bitmap(ext2fs_block_bitmap bitmap, blk_t block);
 
                                       blk_t block);
 extern int ext2fs_test_block_bitmap(ext2fs_block_bitmap bitmap, blk_t block);
 
-extern void ext2fs_mark_inode_bitmap(ext2fs_inode_bitmap bitmap, ino_t inode);
-extern void ext2fs_unmark_inode_bitmap(ext2fs_inode_bitmap bitmap,
-                                      ino_t inode);
-extern int ext2fs_test_inode_bitmap(ext2fs_inode_bitmap bitmap, ino_t inode);
+extern int ext2fs_mark_inode_bitmap(ext2fs_inode_bitmap bitmap, ext2_ino_t inode);
+extern int ext2fs_unmark_inode_bitmap(ext2fs_inode_bitmap bitmap,
+                                      ext2_ino_t inode);
+extern int ext2fs_test_inode_bitmap(ext2fs_inode_bitmap bitmap, ext2_ino_t inode);
 
 extern void ext2fs_fast_mark_block_bitmap(ext2fs_block_bitmap bitmap,
                                          blk_t block);
 
 extern void ext2fs_fast_mark_block_bitmap(ext2fs_block_bitmap bitmap,
                                          blk_t block);
@@ -53,15 +53,15 @@ extern int ext2fs_fast_test_block_bitmap(ext2fs_block_bitmap bitmap,
                                         blk_t block);
 
 extern void ext2fs_fast_mark_inode_bitmap(ext2fs_inode_bitmap bitmap,
                                         blk_t block);
 
 extern void ext2fs_fast_mark_inode_bitmap(ext2fs_inode_bitmap bitmap,
-                                         ino_t inode);
+                                         ext2_ino_t inode);
 extern void ext2fs_fast_unmark_inode_bitmap(ext2fs_inode_bitmap bitmap,
 extern void ext2fs_fast_unmark_inode_bitmap(ext2fs_inode_bitmap bitmap,
-                                           ino_t inode);
+                                           ext2_ino_t inode);
 extern int ext2fs_fast_test_inode_bitmap(ext2fs_inode_bitmap bitmap,
 extern int ext2fs_fast_test_inode_bitmap(ext2fs_inode_bitmap bitmap,
-                                        ino_t inode);
+                                        ext2_ino_t inode);
 extern blk_t ext2fs_get_block_bitmap_start(ext2fs_block_bitmap bitmap);
 extern blk_t ext2fs_get_block_bitmap_start(ext2fs_block_bitmap bitmap);
-extern ino_t ext2fs_get_inode_bitmap_start(ext2fs_inode_bitmap bitmap);
+extern ext2_ino_t ext2fs_get_inode_bitmap_start(ext2fs_inode_bitmap bitmap);
 extern blk_t ext2fs_get_block_bitmap_end(ext2fs_block_bitmap bitmap);
 extern blk_t ext2fs_get_block_bitmap_end(ext2fs_block_bitmap bitmap);
-extern ino_t ext2fs_get_inode_bitmap_end(ext2fs_inode_bitmap bitmap);
+extern ext2_ino_t ext2fs_get_inode_bitmap_end(ext2fs_inode_bitmap bitmap);
 
 extern void ext2fs_mark_block_bitmap_range(ext2fs_block_bitmap bitmap,
                                           blk_t block, int num);
 
 extern void ext2fs_mark_block_bitmap_range(ext2fs_block_bitmap bitmap,
                                           blk_t block, int num);
@@ -105,11 +105,13 @@ extern void ext2fs_set_bitmap_padding(ext2fs_generic_bitmap map);
 #endif
 #endif
 
 #endif
 #endif
 
-#if ((defined __GNUC__) && (defined(__i386__) || defined(__i486__) || \
-                           defined(__i586__)))
+#if ((defined __GNUC__) && !defined(_EXT2_USE_C_VERSIONS_) && \
+     (defined(__i386__) || defined(__i486__) || defined(__i586__)))
 
 #define _EXT2_HAVE_ASM_BITOPS_
 
 #define _EXT2_HAVE_ASM_BITOPS_
-       
+#define _EXT2_HAVE_ASM_SWAB_
+#define _EXT2_HAVE_ASM_FINDBIT_
+
 /*
  * These are done by inline assembly for speed reasons.....
  *
 /*
  * These are done by inline assembly for speed reasons.....
  *
@@ -155,6 +157,84 @@ _INLINE_ int ext2fs_test_bit(int nr, const void * addr)
        return oldbit;
 }
 
        return oldbit;
 }
 
+#if 0
+_INLINE_ int ext2fs_find_first_bit_set(void * addr, unsigned size)
+{
+       int d0, d1, d2;
+       int res;
+
+       if (!size)
+               return 0;
+       /* This looks at memory. Mark it volatile to tell gcc not to move it around */
+       __asm__ __volatile__(
+               "cld\n\t"                            
+               "xorl %%eax,%%eax\n\t"
+               "xorl %%edx,%%edx\n\t"
+               "repe; scasl\n\t"
+               "je 1f\n\t"
+               "movl -4(%%edi),%%eax\n\t"
+               "subl $4,%%edi\n\t"
+               "bsfl %%eax,%%edx\n"
+               "1:\tsubl %%esi,%%edi\n\t"
+               "shll $3,%%edi\n\t"
+               "addl %%edi,%%edx"
+               :"=d" (res), "=&c" (d0), "=&D" (d1), "=&a" (d2)
+               :"1" ((size + 31) >> 5), "2" (addr), "S" (addr));
+       return res;
+}
+
+_INLINE_ int ext2fs_find_next_bit_set (void * addr, int size, int offset)
+{
+       unsigned long * p = ((unsigned long *) addr) + (offset >> 5);
+       int set = 0, bit = offset & 31, res;
+       
+       if (bit) {
+               /*
+                * Look for zero in first byte
+                */
+               __asm__("bsfl %1,%0\n\t"
+                       "jne 1f\n\t"
+                       "movl $32, %0\n"
+                       "1:"
+                       : "=r" (set)
+                       : "r" (*p >> bit));
+               if (set < (32 - bit))
+                       return set + offset;
+               set = 32 - bit;
+               p++;
+       }
+       /*
+        * No bit found yet, search remaining full bytes for a bit
+        */
+       res = ext2fs_find_first_bit_set(p, size - 32 * (p - (unsigned long *) addr));
+       return (offset + set + res);
+}
+#endif
+
+#ifdef EXT2FS_ENABLE_SWAPFS
+_INLINE_ __u32 ext2fs_swab32(__u32 val)
+{
+#ifdef EXT2FS_REQUIRE_486
+       __asm__("bswap %0" : "=r" (val) : "0" (val));
+#else
+       __asm__("xchgb %b0,%h0\n\t"     /* swap lower bytes     */
+               "rorl $16,%0\n\t"       /* swap words           */
+               "xchgb %b0,%h0"         /* swap higher bytes    */
+               :"=q" (val)
+               : "0" (val));
+#endif
+       return val;
+}
+
+_INLINE_ __u16 ext2fs_swab16(__u16 val)
+{
+       __asm__("xchgb %b0,%h0"         /* swap bytes           */ \
+               : "=q" (val) \
+               :  "0" (val)); \
+               return val;
+}
+#endif
+
 #undef EXT2FS_ADDR
 
 #endif /* i386 */
 #undef EXT2FS_ADDR
 
 #endif /* i386 */
@@ -314,7 +394,7 @@ _INLINE_ int ext2fs_test_bit(int nr, const void *addr)
 
 #endif /* __sparc__ */
 
 
 #endif /* __sparc__ */
 
-#ifndef _EXT2_HAVE_ASM_SWAB
+#if !defined(_EXT2_HAVE_ASM_SWAB_) && defined(EXT2FS_ENABLE_SWAPFS)
 
 _INLINE_ __u16 ext2fs_swab16(__u16 val)
 {
 
 _INLINE_ __u16 ext2fs_swab16(__u16 val)
 {
@@ -329,32 +409,60 @@ _INLINE_ __u32 ext2fs_swab32(__u32 val)
 
 #endif /* !_EXT2_HAVE_ASM_SWAB */
 
 
 #endif /* !_EXT2_HAVE_ASM_SWAB */
 
-_INLINE_ void ext2fs_mark_generic_bitmap(ext2fs_generic_bitmap bitmap,
-                                        __u32 bitno);
-_INLINE_ void ext2fs_unmark_generic_bitmap(ext2fs_generic_bitmap bitmap,
-                                          blk_t bitno);
-_INLINE_ int ext2fs_test_generic_bitmap(ext2fs_generic_bitmap bitmap,
-                                       blk_t bitno);
-
-_INLINE_ void ext2fs_mark_generic_bitmap(ext2fs_generic_bitmap bitmap,
-                                        __u32 bitno)
+#if !defined(_EXT2_HAVE_ASM_FINDBIT_)
+_INLINE_ int ext2fs_find_first_bit_set(void * addr, unsigned size)
 {
 {
-       if ((bitno < bitmap->start) || (bitno > bitmap->end)) {
-               ext2fs_warn_bitmap2(bitmap, EXT2FS_MARK_ERROR, bitno);
-               return;
+       char    *cp = (unsigned char *) addr;
+       int     res = 0, d0;
+
+       if (!size)
+               return 0;
+
+       while ((size > res) && (*cp == 0)) {
+               cp++;
+               res += 8;
        }
        }
-       ext2fs_set_bit(bitno - bitmap->start, bitmap->bitmap);
+       d0 = ffs(*cp);
+       if (d0 == 0)
+               return size;
+       
+       return res + d0 - 1;
 }
 
 }
 
-_INLINE_ void ext2fs_unmark_generic_bitmap(ext2fs_generic_bitmap bitmap,
-                                          blk_t bitno)
+_INLINE_ int ext2fs_find_next_bit_set (void * addr, int size, int offset)
 {
 {
-       if ((bitno < bitmap->start) || (bitno > bitmap->end)) {
-               ext2fs_warn_bitmap2(bitmap, EXT2FS_UNMARK_ERROR, bitno);
-               return;
+       unsigned char * p;
+       int set = 0, bit = offset & 7, res = 0, d0;
+       
+       res = offset >> 3;
+       p = ((unsigned char *) addr) + res;
+       
+       if (bit) {
+               set = ffs(*p & ~((1 << bit) - 1));
+               if (set)
+                       return (offset & ~7) + set - 1;
+               p++;
+               res += 8;
        }
        }
-       ext2fs_clear_bit(bitno - bitmap->start, bitmap->bitmap);
+       while ((size > res) && (*p == 0)) {
+               p++;
+               res += 8;
+       }
+       d0 = ffs(*p);
+       if (d0 == 0)
+               return size;
+
+       return (res + d0 - 1);
 }
 }
+#endif 
+
+/* These two routines moved to gen_bitmap.c */
+extern int ext2fs_mark_generic_bitmap(ext2fs_generic_bitmap bitmap,
+                                        __u32 bitno);
+extern int ext2fs_unmark_generic_bitmap(ext2fs_generic_bitmap bitmap,
+                                          blk_t bitno);
+_INLINE_ int ext2fs_test_generic_bitmap(ext2fs_generic_bitmap bitmap,
+                                       blk_t bitno);
 
 _INLINE_ int ext2fs_test_generic_bitmap(ext2fs_generic_bitmap bitmap,
                                        blk_t bitno)
 
 _INLINE_ int ext2fs_test_generic_bitmap(ext2fs_generic_bitmap bitmap,
                                        blk_t bitno)
@@ -366,16 +474,19 @@ _INLINE_ int ext2fs_test_generic_bitmap(ext2fs_generic_bitmap bitmap,
        return ext2fs_test_bit(bitno - bitmap->start, bitmap->bitmap);
 }
 
        return ext2fs_test_bit(bitno - bitmap->start, bitmap->bitmap);
 }
 
-_INLINE_ void ext2fs_mark_block_bitmap(ext2fs_block_bitmap bitmap,
+_INLINE_ int ext2fs_mark_block_bitmap(ext2fs_block_bitmap bitmap,
                                       blk_t block)
 {
                                       blk_t block)
 {
-       ext2fs_mark_generic_bitmap((ext2fs_generic_bitmap) bitmap, block);
+       return ext2fs_mark_generic_bitmap((ext2fs_generic_bitmap)
+                                      bitmap,
+                                         block);
 }
 
 }
 
-_INLINE_ void ext2fs_unmark_block_bitmap(ext2fs_block_bitmap bitmap,
+_INLINE_ int ext2fs_unmark_block_bitmap(ext2fs_block_bitmap bitmap,
                                         blk_t block)
 {
                                         blk_t block)
 {
-       ext2fs_unmark_generic_bitmap((ext2fs_generic_bitmap) bitmap, block);
+       return ext2fs_unmark_generic_bitmap((ext2fs_generic_bitmap) bitmap, 
+                                           block);
 }
 
 _INLINE_ int ext2fs_test_block_bitmap(ext2fs_block_bitmap bitmap,
 }
 
 _INLINE_ int ext2fs_test_block_bitmap(ext2fs_block_bitmap bitmap,
@@ -385,20 +496,22 @@ _INLINE_ int ext2fs_test_block_bitmap(ext2fs_block_bitmap bitmap,
                                          block);
 }
 
                                          block);
 }
 
-_INLINE_ void ext2fs_mark_inode_bitmap(ext2fs_inode_bitmap bitmap,
-                                      ino_t inode)
+_INLINE_ int ext2fs_mark_inode_bitmap(ext2fs_inode_bitmap bitmap,
+                                      ext2_ino_t inode)
 {
 {
-       ext2fs_mark_generic_bitmap((ext2fs_generic_bitmap) bitmap, inode);
+       return ext2fs_mark_generic_bitmap((ext2fs_generic_bitmap) bitmap, 
+                                         inode);
 }
 
 }
 
-_INLINE_ void ext2fs_unmark_inode_bitmap(ext2fs_inode_bitmap bitmap,
-                                        ino_t inode)
+_INLINE_ int ext2fs_unmark_inode_bitmap(ext2fs_inode_bitmap bitmap,
+                                        ext2_ino_t inode)
 {
 {
-       ext2fs_unmark_generic_bitmap((ext2fs_generic_bitmap) bitmap, inode);
+       return ext2fs_unmark_generic_bitmap((ext2fs_generic_bitmap) bitmap, 
+                                    inode);
 }
 
 _INLINE_ int ext2fs_test_inode_bitmap(ext2fs_inode_bitmap bitmap,
 }
 
 _INLINE_ int ext2fs_test_inode_bitmap(ext2fs_inode_bitmap bitmap,
-                                      ino_t inode)
+                                      ext2_ino_t inode)
 {
        return ext2fs_test_generic_bitmap((ext2fs_generic_bitmap) bitmap, 
                                          inode);
 {
        return ext2fs_test_generic_bitmap((ext2fs_generic_bitmap) bitmap, 
                                          inode);
@@ -444,7 +557,7 @@ _INLINE_ int ext2fs_fast_test_block_bitmap(ext2fs_block_bitmap bitmap,
 }
 
 _INLINE_ void ext2fs_fast_mark_inode_bitmap(ext2fs_inode_bitmap bitmap,
 }
 
 _INLINE_ void ext2fs_fast_mark_inode_bitmap(ext2fs_inode_bitmap bitmap,
-                                           ino_t inode)
+                                           ext2_ino_t inode)
 {
 #ifdef EXT2FS_DEBUG_FAST_OPS
        if ((inode < bitmap->start) || (inode > bitmap->end)) {
 {
 #ifdef EXT2FS_DEBUG_FAST_OPS
        if ((inode < bitmap->start) || (inode > bitmap->end)) {
@@ -457,7 +570,7 @@ _INLINE_ void ext2fs_fast_mark_inode_bitmap(ext2fs_inode_bitmap bitmap,
 }
 
 _INLINE_ void ext2fs_fast_unmark_inode_bitmap(ext2fs_inode_bitmap bitmap,
 }
 
 _INLINE_ void ext2fs_fast_unmark_inode_bitmap(ext2fs_inode_bitmap bitmap,
-                                             ino_t inode)
+                                             ext2_ino_t inode)
 {
 #ifdef EXT2FS_DEBUG_FAST_OPS
        if ((inode < bitmap->start) || (inode > bitmap->end)) {
 {
 #ifdef EXT2FS_DEBUG_FAST_OPS
        if ((inode < bitmap->start) || (inode > bitmap->end)) {
@@ -470,7 +583,7 @@ _INLINE_ void ext2fs_fast_unmark_inode_bitmap(ext2fs_inode_bitmap bitmap,
 }
 
 _INLINE_ int ext2fs_fast_test_inode_bitmap(ext2fs_inode_bitmap bitmap,
 }
 
 _INLINE_ int ext2fs_fast_test_inode_bitmap(ext2fs_inode_bitmap bitmap,
-                                          ino_t inode)
+                                          ext2_ino_t inode)
 {
 #ifdef EXT2FS_DEBUG_FAST_OPS
        if ((inode < bitmap->start) || (inode > bitmap->end)) {
 {
 #ifdef EXT2FS_DEBUG_FAST_OPS
        if ((inode < bitmap->start) || (inode > bitmap->end)) {
@@ -487,7 +600,7 @@ _INLINE_ blk_t ext2fs_get_block_bitmap_start(ext2fs_block_bitmap bitmap)
        return bitmap->start;
 }
 
        return bitmap->start;
 }
 
-_INLINE_ ino_t ext2fs_get_inode_bitmap_start(ext2fs_inode_bitmap bitmap)
+_INLINE_ ext2_ino_t ext2fs_get_inode_bitmap_start(ext2fs_inode_bitmap bitmap)
 {
        return bitmap->start;
 }
 {
        return bitmap->start;
 }
@@ -497,7 +610,7 @@ _INLINE_ blk_t ext2fs_get_block_bitmap_end(ext2fs_block_bitmap bitmap)
        return bitmap->end;
 }
 
        return bitmap->end;
 }
 
-_INLINE_ ino_t ext2fs_get_inode_bitmap_end(ext2fs_inode_bitmap bitmap)
+_INLINE_ ext2_ino_t ext2fs_get_inode_bitmap_end(ext2fs_inode_bitmap bitmap)
 {
        return bitmap->end;
 }
 {
        return bitmap->end;
 }
@@ -597,7 +710,6 @@ _INLINE_ void ext2fs_fast_unmark_block_bitmap_range(ext2fs_block_bitmap bitmap,
        for (i=0; i < num; i++)
                ext2fs_clear_bit(block + i - bitmap->start, bitmap->bitmap);
 }
        for (i=0; i < num; i++)
                ext2fs_clear_bit(block + i - bitmap->start, bitmap->bitmap);
 }
-
 #undef _INLINE_
 #endif
 
 #undef _INLINE_
 #endif
 
index e986a5cc3ea534c15025f00c3f1635515d97b9af..ab0a58594502c8c7cbfbc68d6d8e406b502179d8 100644 (file)
@@ -19,7 +19,7 @@
 #define EXT2_ET_MAGIC_ICOUNT                     (2133571341L)
 #define EXT2_ET_MAGIC_PQ_IO_CHANNEL              (2133571342L)
 #define EXT2_ET_MAGIC_EXT2_FILE                  (2133571343L)
 #define EXT2_ET_MAGIC_ICOUNT                     (2133571341L)
 #define EXT2_ET_MAGIC_PQ_IO_CHANNEL              (2133571342L)
 #define EXT2_ET_MAGIC_EXT2_FILE                  (2133571343L)
-#define EXT2_ET_MAGIC_RESERVED_7                 (2133571344L)
+#define EXT2_ET_MAGIC_E2IMAGE                    (2133571344L)
 #define EXT2_ET_MAGIC_RESERVED_8                 (2133571345L)
 #define EXT2_ET_MAGIC_RESERVED_9                 (2133571346L)
 #define EXT2_ET_BAD_MAGIC                        (2133571347L)
 #define EXT2_ET_MAGIC_RESERVED_8                 (2133571345L)
 #define EXT2_ET_MAGIC_RESERVED_9                 (2133571346L)
 #define EXT2_ET_BAD_MAGIC                        (2133571347L)
 #define EXT2_ET_UNIMPLEMENTED                    (2133571408L)
 #define EXT2_ET_CANCEL_REQUESTED                 (2133571409L)
 #define EXT2_ET_FILE_TOO_BIG                     (2133571410L)
 #define EXT2_ET_UNIMPLEMENTED                    (2133571408L)
 #define EXT2_ET_CANCEL_REQUESTED                 (2133571409L)
 #define EXT2_ET_FILE_TOO_BIG                     (2133571410L)
+#define EXT2_ET_JOURNAL_NOT_BLOCK                (2133571411L)
+#define EXT2_ET_NO_JOURNAL_SB                    (2133571412L)
+#define EXT2_ET_JOURNAL_TOO_SMALL                (2133571413L)
+#define EXT2_ET_JOURNAL_UNSUPP_VERSION           (2133571414L)
+#define EXT2_ET_LOAD_EXT_JOURNAL                 (2133571415L)
 extern void initialize_ext2_error_table(void);
 #define ERROR_TABLE_BASE_ext2 (2133571328L)
 
 extern void initialize_ext2_error_table(void);
 #define ERROR_TABLE_BASE_ext2 (2133571328L)
 
index 9568866964cf201b039d6d717025fe821f318791..b9ba0b6a240009d923d976a948b5e7b37075464c 100644 (file)
@@ -27,6 +27,8 @@ ext2_loff_t ext2fs_llseek (int, ext2_loff_t, int);
 typedef struct struct_io_manager *io_manager;
 typedef struct struct_io_channel *io_channel;
 
 typedef struct struct_io_manager *io_manager;
 typedef struct struct_io_channel *io_channel;
 
+#define CHANNEL_FLAGS_WRITETHROUGH     0x01
+
 struct struct_io_channel {
        errcode_t       magic;
        io_manager      manager;
 struct struct_io_channel {
        errcode_t       magic;
        io_manager      manager;
@@ -47,7 +49,8 @@ struct struct_io_channel {
                                       int actual_bytes_written,
                                       errcode_t error);
        int             refcount;
                                       int actual_bytes_written,
                                       errcode_t error);
        int             refcount;
-       int             reserved[15];
+       int             flags;
+       int             reserved[14];
        void            *private_data;
        void            *app_data;
 };
        void            *private_data;
        void            *app_data;
 };
@@ -63,7 +66,9 @@ struct struct_io_manager {
        errcode_t (*write_blk)(io_channel channel, unsigned long block,
                               int count, const void *data);
        errcode_t (*flush)(io_channel channel);
        errcode_t (*write_blk)(io_channel channel, unsigned long block,
                               int count, const void *data);
        errcode_t (*flush)(io_channel channel);
-       int             reserved[16];
+       errcode_t (*write_byte)(io_channel channel, unsigned long offset,
+                               int count, const void *data);
+       int             reserved[15];
 };
 
 #define IO_FLAG_RW     1
 };
 
 #define IO_FLAG_RW     1
@@ -76,6 +81,7 @@ struct struct_io_manager {
 #define io_channel_read_blk(c,b,n,d)   ((c)->manager->read_blk((c),b,n,d))
 #define io_channel_write_blk(c,b,n,d)  ((c)->manager->write_blk((c),b,n,d))
 #define io_channel_flush(c)            ((c)->manager->flush((c)))
 #define io_channel_read_blk(c,b,n,d)   ((c)->manager->read_blk((c),b,n,d))
 #define io_channel_write_blk(c,b,n,d)  ((c)->manager->write_blk((c),b,n,d))
 #define io_channel_flush(c)            ((c)->manager->flush((c)))
+#define io_channel_write_byte(c,b,n,d) ((c)->manager->write_byte((c),b,n,d))
 #define io_channel_bumpcount(c)                ((c)->refcount++)
        
 /* unix_io.c */
 #define io_channel_bumpcount(c)                ((c)->refcount++)
        
 /* unix_io.c */
index 474c947681cd3a5ce84c68d10787f825a0b9fb7b..bce274741f31635d7404ea9737914b8f73e9e044 100644 (file)
 #ifndef _EXT2FS_EXT2FS_H
 #define _EXT2FS_EXT2FS_H
 
 #ifndef _EXT2FS_EXT2FS_H
 #define _EXT2FS_EXT2FS_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /*
  * Non-GNU C compilers won't necessarily understand inline
  */
 /*
  * Non-GNU C compilers won't necessarily understand inline
  */
 #define NO_INLINE_FUNCS
 #endif
 
 #define NO_INLINE_FUNCS
 #endif
 
+/*
+ * Build in support for byte-swapping filesystems if we the feature
+ * has been configured or if we're being built on a CPU architecture
+ * with a non-native byte order.
+ */
+#if defined(ENABLE_SWAPFS) || defined(WORDS_BIGENDIAN)
+#define EXT2FS_ENABLE_SWAPFS
+#endif
+
 /*
  * Where the master copy of the superblock is located, and how big
  * superblocks are supposed to be.  We define SUPERBLOCK_SIZE because
 /*
  * Where the master copy of the superblock is located, and how big
  * superblocks are supposed to be.  We define SUPERBLOCK_SIZE because
  * The last ext2fs revision level that this version of the library is
  * able to support.
  */
  * The last ext2fs revision level that this version of the library is
  * able to support.
  */
-#define EXT2_LIB_CURRENT_REV   0
+#define EXT2_LIB_CURRENT_REV   EXT2_DYNAMIC_REV
 
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #endif
 
 
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #endif
 
-#include <stdlib.h>
+#include "stdlib.h"
 
 #if EXT2_FLAT_INCLUDES
 #include "e2_types.h"
 #else
 
 #if EXT2_FLAT_INCLUDES
 #include "e2_types.h"
 #else
-#include <types.h>
-#if defined(__GNUC__) && defined(__STRICT_ANSI__) && \
-       (((~0UL) == 0xffffffff) || defined(__i386__))
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
-#endif
-#endif
+#include "types.h" /* use yaboot's types.h */
+#endif /* EXT2_FLAT_INCLUDES */
 
 
+typedef __u32          ext2_ino_t;
 typedef __u32          blk_t;
 typedef __u32          dgrp_t;
 typedef __u32          ext2_off_t;
 typedef __u32          blk_t;
 typedef __u32          dgrp_t;
 typedef __u32          ext2_off_t;
@@ -121,7 +130,7 @@ typedef struct ext2_struct_badblocks_iterate *badblocks_iterate;
  * ext2_dblist structure and abstractions (see dblist.c)
  */
 struct ext2_db_entry {
  * ext2_dblist structure and abstractions (see dblist.c)
  */
 struct ext2_db_entry {
-       ino_t   ino;
+       ext2_ino_t      ino;
        blk_t   blk;
        int     blockcnt;
 };
        blk_t   blk;
        int     blockcnt;
 };
@@ -149,9 +158,8 @@ typedef struct ext2_file *ext2_file_t;
 #define EXT2_SEEK_END  2
 
 /*
 #define EXT2_SEEK_END  2
 
 /*
- * Flags for the ext2_filsys structure
+ * Flags for the ext2_filsys structure and for ext2fs_open()
  */
  */
-
 #define EXT2_FLAG_RW                   0x01
 #define EXT2_FLAG_CHANGED              0x02
 #define EXT2_FLAG_DIRTY                        0x04
 #define EXT2_FLAG_RW                   0x01
 #define EXT2_FLAG_CHANGED              0x02
 #define EXT2_FLAG_DIRTY                        0x04
@@ -163,6 +171,9 @@ typedef struct ext2_file *ext2_file_t;
 #define EXT2_FLAG_SWAP_BYTES_WRITE     0x100
 #define EXT2_FLAG_MASTER_SB_ONLY       0x200
 #define EXT2_FLAG_FORCE                        0x400
 #define EXT2_FLAG_SWAP_BYTES_WRITE     0x100
 #define EXT2_FLAG_MASTER_SB_ONLY       0x200
 #define EXT2_FLAG_FORCE                        0x400
+#define EXT2_FLAG_SUPER_ONLY           0x800
+#define EXT2_FLAG_JOURNAL_DEV_OK       0x1000
+#define EXT2_FLAG_IMAGE_FILE           0x2000
 
 /*
  * Special flag in the ext2 inode i_flag field that means that this is
 
 /*
  * Special flag in the ext2 inode i_flag field that means that this is
@@ -170,6 +181,13 @@ typedef struct ext2_file *ext2_file_t;
  */
 #define EXT2_NEW_INODE_FL      0x80000000
 
  */
 #define EXT2_NEW_INODE_FL      0x80000000
 
+/*
+ * Flags for mkjournal
+ *
+ * EXT2_MKJOURNAL_V1_SUPER     Make a (deprecated) V1 journal superblock
+ */
+#define EXT2_MKJOURNAL_V1_SUPER        0x0000001
+
 struct struct_ext2_filsys {
        errcode_t                       magic;
        io_channel                      io;
 struct struct_ext2_filsys {
        errcode_t                       magic;
        io_channel                      io;
@@ -184,20 +202,22 @@ struct struct_ext2_filsys {
        int                             inode_blocks_per_group;
        ext2fs_inode_bitmap             inode_map;
        ext2fs_block_bitmap             block_map;
        int                             inode_blocks_per_group;
        ext2fs_inode_bitmap             inode_map;
        ext2fs_block_bitmap             block_map;
-       errcode_t (*get_blocks)(ext2_filsys fs, ino_t ino, blk_t *blocks);
-       errcode_t (*check_directory)(ext2_filsys fs, ino_t ino);
+       errcode_t (*get_blocks)(ext2_filsys fs, ext2_ino_t ino, blk_t *blocks);
+       errcode_t (*check_directory)(ext2_filsys fs, ext2_ino_t ino);
        errcode_t (*write_bitmaps)(ext2_filsys fs);
        errcode_t (*write_bitmaps)(ext2_filsys fs);
-       errcode_t (*read_inode)(ext2_filsys fs, ino_t ino,
+       errcode_t (*read_inode)(ext2_filsys fs, ext2_ino_t ino,
                                struct ext2_inode *inode);
                                struct ext2_inode *inode);
-       errcode_t (*write_inode)(ext2_filsys fs, ino_t ino,
+       errcode_t (*write_inode)(ext2_filsys fs, ext2_ino_t ino,
                                struct ext2_inode *inode);
        badblocks_list                  badblocks;
        ext2_dblist                     dblist;
        __u32                           stride; /* for mke2fs */
                                struct ext2_inode *inode);
        badblocks_list                  badblocks;
        ext2_dblist                     dblist;
        __u32                           stride; /* for mke2fs */
+       struct ext2_super_block *       orig_super;
+       struct ext2_image_hdr *         image_header;
        /*
         * Reserved for future expansion
         */
        /*
         * Reserved for future expansion
         */
-       __u32                           reserved[11];
+       __u32                           reserved[9];
 
        /*
         * Reserved for the use of the calling application.
 
        /*
         * Reserved for the use of the calling application.
@@ -357,6 +377,12 @@ typedef struct ext2_icount *ext2_icount_t;
  */
 #define BMAP_ALLOC     1
 
  */
 #define BMAP_ALLOC     1
 
+/*
+ * Flags for imager.c functions
+ */
+#define IMAGER_FLAG_INODEMAP   1
+#define IMAGER_FLAG_SPARSEWRITE        2
+
 /*
  * For checking structure magic numbers...
  */
 /*
  * For checking structure magic numbers...
  */
@@ -366,121 +392,36 @@ typedef struct ext2_icount *ext2_icount_t;
 
 
 /*
 
 
 /*
- * The ext2fs library private definition of the ext2 superblock, so we
- * don't have to depend on the kernel's definition of the superblock,
- * which might not have the latest features.
- */
-struct ext2fs_sb {
-       __u32   s_inodes_count;         /* Inodes count */
-       __u32   s_blocks_count;         /* Blocks count */
-       __u32   s_r_blocks_count;       /* Reserved blocks count */
-       __u32   s_free_blocks_count;    /* Free blocks count */
-       __u32   s_free_inodes_count;    /* Free inodes count */
-       __u32   s_first_data_block;     /* First Data Block */
-       __u32   s_log_block_size;       /* Block size */
-       __s32   s_log_frag_size;        /* Fragment size */
-       __u32   s_blocks_per_group;     /* # Blocks per group */
-       __u32   s_frags_per_group;      /* # Fragments per group */
-       __u32   s_inodes_per_group;     /* # Inodes per group */
-       __u32   s_mtime;                /* Mount time */
-       __u32   s_wtime;                /* Write time */
-       __u16   s_mnt_count;            /* Mount count */
-       __s16   s_max_mnt_count;        /* Maximal mount count */
-       __u16   s_magic;                /* Magic signature */
-       __u16   s_state;                /* File system state */
-       __u16   s_errors;               /* Behaviour when detecting errors */
-       __u16   s_minor_rev_level;      /* minor revision level */
-       __u32   s_lastcheck;            /* time of last check */
-       __u32   s_checkinterval;        /* max. time between checks */
-       __u32   s_creator_os;           /* OS */
-       __u32   s_rev_level;            /* Revision level */
-       __u16   s_def_resuid;           /* Default uid for reserved blocks */
-       __u16   s_def_resgid;           /* Default gid for reserved blocks */
-       /*
-        * These fields are for EXT2_DYNAMIC_REV superblocks only.
-        *
-        * Note: the difference between the compatible feature set and
-        * the incompatible feature set is that if there is a bit set
-        * in the incompatible feature set that the kernel doesn't
-        * know about, it should refuse to mount the filesystem.
-        * 
-        * e2fsck's requirements are more strict; if it doesn't know
-        * about a feature in either the compatible or incompatible
-        * feature set, it must abort and not try to meddle with
-        * things it doesn't understand...
-        */
-       __u32   s_first_ino;            /* First non-reserved inode */
-       __u16   s_inode_size;           /* size of inode structure */
-       __u16   s_block_group_nr;       /* block group # of this superblock */
-       __u32   s_feature_compat;       /* compatible feature set */
-       __u32   s_feature_incompat;     /* incompatible feature set */
-       __u32   s_feature_ro_compat;    /* readonly-compatible feature set */
-       __u8    s_uuid[16];             /* 128-bit uuid for volume */
-       char    s_volume_name[16];      /* volume name */
-       char    s_last_mounted[64];     /* directory where last mounted */
-       __u32   s_algorithm_usage_bitmap; /* For compression */
-       /*
-        * Performance hints.  Directory preallocation should only
-        * happen if the EXT2_COMPAT_PREALLOC flag is on.
-        */
-       __u8    s_prealloc_blocks;      /* Nr of blocks to try to preallocate*/
-       __u8    s_prealloc_dir_blocks;  /* Nr to preallocate for dirs */
-       __u16   s_padding1;
-       /* 
-        * Journaling support.
-        */
-       __u8    s_journal_uuid[16];     /* uuid of journal superblock */
-       __u32   s_journal_inum;         /* inode number of journal file */
-       
-       __u32   s_reserved[199];        /* Padding to the end of the block */
-};
+ * For ext2 compression support
+ */
+#define EXT2FS_COMPRESSED_BLKADDR ((blk_t) 0xffffffff)
+#define HOLE_BLKADDR(_b) ((_b) == 0 || (_b) == EXT2FS_COMPRESSED_BLKADDR)
 
 /*
 
 /*
- * Feature set definitions (that might not be in ext2_fs.h
+ * Features supported by this version of the library
  */
  */
-
-#ifndef EXT2_FEATURE_COMPAT_DIR_PREALLOC
-#define EXT2_FEATURE_COMPAT_DIR_PREALLOC       0x0001
-#endif
-
-#ifndef EXT2_FEATURE_COMPAT_IMAGIC_INODES /* for AFS, etc. */
-#define EXT2_FEATURE_COMPAT_IMAGIC_INODES              0x0002
-#define EXT2_IMAGIC_FL         0x00002000
-#endif
-
-#ifndef EXT3_FEATURE_COMPAT_HAS_JOURNAL
-#define EXT3_FEATURE_COMPAT_HAS_JOURNAL                0x0004
-#endif
-
-#ifndef EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER
-#define EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER    0x0001
-#endif
-
-#ifndef EXT2_FEATURE_RO_COMPAT_LARGE_FILE
-#define EXT2_FEATURE_RO_COMPAT_LARGE_FILE      0x0002
-#define i_size_high i_dir_acl
-#endif
-
-#ifndef EXT2_FEATURE_RO_COMPAT_BTREE_DIR
-#define EXT2_FEATURE_RO_COMPAT_BTREE_DIR       0x0004
-#endif
-
-#ifndef EXT2_FEATURE_INCOMPAT_COMPRESSION
-#define EXT2_FEATURE_INCOMPAT_COMPRESSION      0x0001
-#endif
-
-#ifndef EXT2_FEATURE_INCOMPAT_FILETYPE
-#define EXT2_FEATURE_INCOMPAT_FILETYPE 0x0002
-#endif
-
-#ifndef EXT3_FEATURE_INCOMPAT_RECOVER 
-#define EXT3_FEATURE_INCOMPAT_RECOVER  0x0004 /* Needs recovery */
-#endif
-
 #define EXT2_LIB_FEATURE_COMPAT_SUPP   (EXT2_FEATURE_COMPAT_DIR_PREALLOC|\
                                         EXT2_FEATURE_COMPAT_IMAGIC_INODES|\
 #define EXT2_LIB_FEATURE_COMPAT_SUPP   (EXT2_FEATURE_COMPAT_DIR_PREALLOC|\
                                         EXT2_FEATURE_COMPAT_IMAGIC_INODES|\
-                                        EXT3_FEATURE_COMPAT_HAS_JOURNAL)
-#define EXT2_LIB_FEATURE_INCOMPAT_SUPP EXT2_FEATURE_INCOMPAT_FILETYPE
+                                        EXT3_FEATURE_COMPAT_HAS_JOURNAL|\
+                                        EXT2_FEATURE_COMPAT_EXT_ATTR)
+
+/* This #ifdef is temporary until compression is fully supported */
+#ifdef ENABLE_COMPRESSION
+#ifndef I_KNOW_THAT_COMPRESSION_IS_EXPERIMENTAL
+/* If the below warning bugs you, then have
+   `CPPFLAGS=-DI_KNOW_THAT_COMPRESSION_IS_EXPERIMENTAL' in your
+   environment at configure time. */
+ #warning "Compression support is experimental"
+#endif
+#define EXT2_LIB_FEATURE_INCOMPAT_SUPP (EXT2_FEATURE_INCOMPAT_FILETYPE|\
+                                        EXT2_FEATURE_INCOMPAT_COMPRESSION|\
+                                        EXT3_FEATURE_INCOMPAT_JOURNAL_DEV|\
+                                        EXT3_FEATURE_INCOMPAT_RECOVER)
+#else
+#define EXT2_LIB_FEATURE_INCOMPAT_SUPP (EXT2_FEATURE_INCOMPAT_FILETYPE|\
+                                        EXT3_FEATURE_INCOMPAT_JOURNAL_DEV|\
+                                        EXT3_FEATURE_INCOMPAT_RECOVER)
+#endif
 #define EXT2_LIB_FEATURE_RO_COMPAT_SUPP        (EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER|\
                                         EXT2_FEATURE_RO_COMPAT_LARGE_FILE)
 /*
 #define EXT2_LIB_FEATURE_RO_COMPAT_SUPP        (EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER|\
                                         EXT2_FEATURE_RO_COMPAT_LARGE_FILE)
 /*
@@ -488,8 +429,8 @@ struct ext2fs_sb {
  */
 
 /* alloc.c */
  */
 
 /* alloc.c */
-extern errcode_t ext2fs_new_inode(ext2_filsys fs, ino_t dir, int mode,
-                                 ext2fs_inode_bitmap map, ino_t *ret);
+extern errcode_t ext2fs_new_inode(ext2_filsys fs, ext2_ino_t dir, int mode,
+                                 ext2fs_inode_bitmap map, ext2_ino_t *ret);
 extern errcode_t ext2fs_new_block(ext2_filsys fs, blk_t goal,
                                  ext2fs_block_bitmap map, blk_t *ret);
 extern errcode_t ext2fs_get_free_blocks(ext2_filsys fs, blk_t start,
 extern errcode_t ext2fs_new_block(ext2_filsys fs, blk_t goal,
                                  ext2fs_block_bitmap map, blk_t *ret);
 extern errcode_t ext2fs_get_free_blocks(ext2_filsys fs, blk_t start,
@@ -519,6 +460,8 @@ extern int ext2fs_badblocks_list_iterate(ext2_badblocks_iterate iter,
 extern void ext2fs_badblocks_list_iterate_end(ext2_badblocks_iterate iter);
 extern errcode_t ext2fs_badblocks_copy(ext2_badblocks_list src,
                                       ext2_badblocks_list *dest);
 extern void ext2fs_badblocks_list_iterate_end(ext2_badblocks_iterate iter);
 extern errcode_t ext2fs_badblocks_copy(ext2_badblocks_list src,
                                       ext2_badblocks_list *dest);
+extern int ext2fs_badblocks_equal(ext2_badblocks_list bb1,
+                                 ext2_badblocks_list bb2);
 
 /* bb_compat */
 extern errcode_t badblocks_list_create(badblocks_list *ret, int size);
 
 /* bb_compat */
 extern errcode_t badblocks_list_create(badblocks_list *ret, int size);
@@ -551,7 +494,7 @@ extern errcode_t ext2fs_allocate_inode_bitmap(ext2_filsys fs,
                                              const char *descr,
                                              ext2fs_inode_bitmap *ret);
 extern errcode_t ext2fs_fudge_inode_bitmap_end(ext2fs_inode_bitmap bitmap,
                                              const char *descr,
                                              ext2fs_inode_bitmap *ret);
 extern errcode_t ext2fs_fudge_inode_bitmap_end(ext2fs_inode_bitmap bitmap,
-                                              ino_t end, ino_t *oend);
+                                              ext2_ino_t end, ext2_ino_t *oend);
 extern errcode_t ext2fs_fudge_block_bitmap_end(ext2fs_block_bitmap bitmap,
                                               blk_t end, blk_t *oend);
 extern void ext2fs_clear_inode_bitmap(ext2fs_inode_bitmap bitmap);
 extern errcode_t ext2fs_fudge_block_bitmap_end(ext2fs_block_bitmap bitmap,
                                               blk_t end, blk_t *oend);
 extern void ext2fs_clear_inode_bitmap(ext2fs_inode_bitmap bitmap);
@@ -561,7 +504,7 @@ extern errcode_t ext2fs_write_bitmaps(ext2_filsys fs);
 
 /* block.c */
 extern errcode_t ext2fs_block_iterate(ext2_filsys fs,
 
 /* block.c */
 extern errcode_t ext2fs_block_iterate(ext2_filsys fs,
-                                     ino_t     ino,
+                                     ext2_ino_t        ino,
                                      int       flags,
                                      char *block_buf,
                                      int (*func)(ext2_filsys fs,
                                      int       flags,
                                      char *block_buf,
                                      int (*func)(ext2_filsys fs,
@@ -570,7 +513,7 @@ extern errcode_t ext2fs_block_iterate(ext2_filsys fs,
                                                  void  *priv_data),
                                      void *priv_data);
 errcode_t ext2fs_block_iterate2(ext2_filsys fs,
                                                  void  *priv_data),
                                      void *priv_data);
 errcode_t ext2fs_block_iterate2(ext2_filsys fs,
-                               ino_t   ino,
+                               ext2_ino_t      ino,
                                int     flags,
                                char *block_buf,
                                int (*func)(ext2_filsys fs,
                                int     flags,
                                char *block_buf,
                                int (*func)(ext2_filsys fs,
@@ -582,7 +525,7 @@ errcode_t ext2fs_block_iterate2(ext2_filsys fs,
                                void *priv_data);
 
 /* bmap.c */
                                void *priv_data);
 
 /* bmap.c */
-extern errcode_t ext2fs_bmap(ext2_filsys fs, ino_t ino,
+extern errcode_t ext2fs_bmap(ext2_filsys fs, ext2_ino_t ino,
                             struct ext2_inode *inode, 
                             char *block_buf, int bmap_flags,
                             blk_t block, blk_t *phys_blk);
                             struct ext2_inode *inode, 
                             char *block_buf, int bmap_flags,
                             blk_t block, blk_t *phys_blk);
@@ -603,6 +546,7 @@ extern errcode_t ext2fs_check_desc(ext2_filsys fs);
 extern errcode_t ext2fs_close(ext2_filsys fs);
 extern errcode_t ext2fs_flush(ext2_filsys fs);
 extern int ext2fs_bg_has_super(ext2_filsys fs, int group_block);
 extern errcode_t ext2fs_close(ext2_filsys fs);
 extern errcode_t ext2fs_flush(ext2_filsys fs);
 extern int ext2fs_bg_has_super(ext2_filsys fs, int group_block);
+extern void ext2fs_update_dynamic_rev(ext2_filsys fs);
 
 /* cmp_bitmaps.c */
 extern errcode_t ext2fs_compare_block_bitmap(ext2fs_block_bitmap bm1,
 
 /* cmp_bitmaps.c */
 extern errcode_t ext2fs_compare_block_bitmap(ext2fs_block_bitmap bm1,
@@ -612,15 +556,15 @@ extern errcode_t ext2fs_compare_inode_bitmap(ext2fs_inode_bitmap bm1,
 
 /* dblist.c */
 
 
 /* dblist.c */
 
-extern errcode_t ext2fs_get_num_dirs(ext2_filsys fs, ino_t *ret_num_dirs);
+extern errcode_t ext2fs_get_num_dirs(ext2_filsys fs, ext2_ino_t *ret_num_dirs);
 extern errcode_t ext2fs_init_dblist(ext2_filsys fs, ext2_dblist *ret_dblist);
 extern errcode_t ext2fs_init_dblist(ext2_filsys fs, ext2_dblist *ret_dblist);
-extern errcode_t ext2fs_add_dir_block(ext2_dblist dblist, ino_t ino,
+extern errcode_t ext2fs_add_dir_block(ext2_dblist dblist, ext2_ino_t ino,
                                      blk_t blk, int blockcnt);
 extern errcode_t ext2fs_dblist_iterate(ext2_dblist dblist,
        int (*func)(ext2_filsys fs, struct ext2_db_entry *db_info,
                    void        *priv_data),
        void *priv_data);
                                      blk_t blk, int blockcnt);
 extern errcode_t ext2fs_dblist_iterate(ext2_dblist dblist,
        int (*func)(ext2_filsys fs, struct ext2_db_entry *db_info,
                    void        *priv_data),
        void *priv_data);
-extern errcode_t ext2fs_set_dir_block(ext2_dblist dblist, ino_t ino,
+extern errcode_t ext2fs_set_dir_block(ext2_dblist dblist, ext2_ino_t ino,
                                      blk_t blk, int blockcnt);
 extern errcode_t ext2fs_copy_dblist(ext2_dblist src,
                                    ext2_dblist *dest);
                                      blk_t blk, int blockcnt);
 extern errcode_t ext2fs_copy_dblist(ext2_dblist src,
                                    ext2_dblist *dest);
@@ -631,7 +575,7 @@ extern errcode_t
        ext2fs_dblist_dir_iterate(ext2_dblist dblist,
                                  int   flags,
                                  char  *block_buf,
        ext2fs_dblist_dir_iterate(ext2_dblist dblist,
                                  int   flags,
                                  char  *block_buf,
-                                 int (*func)(ino_t     dir,
+                                 int (*func)(ext2_ino_t        dir,
                                              int               entry,
                                              struct ext2_dir_entry *dirent,
                                              int       offset,
                                              int               entry,
                                              struct ext2_dir_entry *dirent,
                                              int       offset,
@@ -648,7 +592,7 @@ extern errcode_t ext2fs_write_dir_block(ext2_filsys fs, blk_t block,
 
 /* dir_iterate.c */
 extern errcode_t ext2fs_dir_iterate(ext2_filsys fs, 
 
 /* dir_iterate.c */
 extern errcode_t ext2fs_dir_iterate(ext2_filsys fs, 
-                             ino_t dir,
+                             ext2_ino_t dir,
                              int flags,
                              char *block_buf,
                              int (*func)(struct ext2_dir_entry *dirent,
                              int flags,
                              char *block_buf,
                              int (*func)(struct ext2_dir_entry *dirent,
@@ -662,10 +606,14 @@ extern errcode_t ext2fs_dir_iterate(ext2_filsys fs,
 extern errcode_t ext2fs_dup_handle(ext2_filsys src, ext2_filsys *dest);
 
 /* expanddir.c */
 extern errcode_t ext2fs_dup_handle(ext2_filsys src, ext2_filsys *dest);
 
 /* expanddir.c */
-extern errcode_t ext2fs_expand_dir(ext2_filsys fs, ino_t dir);
+extern errcode_t ext2fs_expand_dir(ext2_filsys fs, ext2_ino_t dir);
 
 
+/* ext_attr.c */
+void ext2fs_swap_ext_attr(ext2_filsys fs, char *to, char *from);
+extern errcode_t ext2fs_read_ext_attr(ext2_filsys fs, blk_t block, void *buf);
+extern errcode_t ext2fs_write_ext_attr(ext2_filsys fs, blk_t block, void *buf); 
 /* fileio.c */
 /* fileio.c */
-extern errcode_t ext2fs_file_open(ext2_filsys fs, ino_t ino,
+extern errcode_t ext2fs_file_open(ext2_filsys fs, ext2_ino_t ino,
                                  int flags, ext2_file_t *ret);
 extern ext2_filsys ext2fs_file_get_fs(ext2_file_t file);
 extern errcode_t ext2fs_file_close(ext2_file_t file);
                                  int flags, ext2_file_t *ret);
 extern ext2_filsys ext2fs_file_get_fs(ext2_file_t file);
 extern errcode_t ext2fs_file_close(ext2_file_t file);
@@ -678,6 +626,14 @@ extern errcode_t ext2fs_file_lseek(ext2_file_t file, ext2_off_t offset,
 extern ext2_off_t ext2fs_file_get_size(ext2_file_t file);
 extern errcode_t ext2fs_file_set_size(ext2_file_t file, ext2_off_t size);
 
 extern ext2_off_t ext2fs_file_get_size(ext2_file_t file);
 extern errcode_t ext2fs_file_set_size(ext2_file_t file, ext2_off_t size);
 
+/* finddev.c */
+#if 0 /* broken in yaboot build env */
+extern char *ext2fs_find_block_device(dev_t device);
+#endif
+
+/* flushb.c */
+extern errcode_t ext2fs_sync_device(int fd, int flushb);
+
 /* freefs.c */
 extern void ext2fs_free(ext2_filsys fs);
 extern void ext2fs_free_generic_bitmap(ext2fs_inode_bitmap bitmap);
 /* freefs.c */
 extern void ext2fs_free(ext2_filsys fs);
 extern void ext2fs_free_generic_bitmap(ext2fs_inode_bitmap bitmap);
@@ -690,16 +646,25 @@ extern void ext2fs_badblocks_list_free(badblocks_list bb);
 extern errcode_t ext2fs_get_device_size(const char *file, int blocksize,
                                        blk_t *retblocks);
 
 extern errcode_t ext2fs_get_device_size(const char *file, int blocksize,
                                        blk_t *retblocks);
 
+/* imager.c */
+extern errcode_t ext2fs_image_inode_write(ext2_filsys fs, int fd, int flags);
+extern errcode_t ext2fs_image_inode_read(ext2_filsys fs, int fd, int flags);
+extern errcode_t ext2fs_image_super_write(ext2_filsys fs, int fd, int flags);
+extern errcode_t ext2fs_image_super_read(ext2_filsys fs, int fd, int flags);
+extern errcode_t ext2fs_image_bitmap_write(ext2_filsys fs, int fd, int flags);
+extern errcode_t ext2fs_image_bitmap_read(ext2_filsys fs, int fd, int flags);
+
 /* initialize.c */
 extern errcode_t ext2fs_initialize(const char *name, int flags,
                                   struct ext2_super_block *param,
                                   io_manager manager, ext2_filsys *ret_fs);
 
 /* inode.c */
 /* initialize.c */
 extern errcode_t ext2fs_initialize(const char *name, int flags,
                                   struct ext2_super_block *param,
                                   io_manager manager, ext2_filsys *ret_fs);
 
 /* inode.c */
+extern errcode_t ext2fs_flush_icache(ext2_filsys fs);
 extern errcode_t ext2fs_open_inode_scan(ext2_filsys fs, int buffer_blocks,
                                  ext2_inode_scan *ret_scan);
 extern void ext2fs_close_inode_scan(ext2_inode_scan scan);
 extern errcode_t ext2fs_open_inode_scan(ext2_filsys fs, int buffer_blocks,
                                  ext2_inode_scan *ret_scan);
 extern void ext2fs_close_inode_scan(ext2_inode_scan scan);
-extern errcode_t ext2fs_get_next_inode(ext2_inode_scan scan, ino_t *ino,
+extern errcode_t ext2fs_get_next_inode(ext2_inode_scan scan, ext2_ino_t *ino,
                               struct ext2_inode *inode);
 extern errcode_t ext2fs_inode_scan_goto_blockgroup(ext2_inode_scan scan,
                                                   int  group);
                               struct ext2_inode *inode);
 extern errcode_t ext2fs_inode_scan_goto_blockgroup(ext2_inode_scan scan,
                                                   int  group);
@@ -712,12 +677,12 @@ extern void ext2fs_set_inode_callback
         void *done_group_data);
 extern int ext2fs_inode_scan_flags(ext2_inode_scan scan, int set_flags,
                                   int clear_flags);
         void *done_group_data);
 extern int ext2fs_inode_scan_flags(ext2_inode_scan scan, int set_flags,
                                   int clear_flags);
-extern errcode_t ext2fs_read_inode (ext2_filsys fs, ino_t ino,
+extern errcode_t ext2fs_read_inode (ext2_filsys fs, ext2_ino_t ino,
                            struct ext2_inode * inode);
                            struct ext2_inode * inode);
-extern errcode_t ext2fs_write_inode(ext2_filsys fs, ino_t ino,
+extern errcode_t ext2fs_write_inode(ext2_filsys fs, ext2_ino_t ino,
                            struct ext2_inode * inode);
                            struct ext2_inode * inode);
-extern errcode_t ext2fs_get_blocks(ext2_filsys fs, ino_t ino, blk_t *blocks);
-extern errcode_t ext2fs_check_directory(ext2_filsys fs, ino_t ino);
+extern errcode_t ext2fs_get_blocks(ext2_filsys fs, ext2_ino_t ino, blk_t *blocks);
+extern errcode_t ext2fs_check_directory(ext2_filsys fs, ext2_ino_t ino);
 
 /* icount.c */
 extern void ext2fs_free_icount(ext2_icount_t icount);
 
 /* icount.c */
 extern void ext2fs_free_icount(ext2_icount_t icount);
@@ -725,69 +690,83 @@ extern errcode_t ext2fs_create_icount2(ext2_filsys fs, int flags, int size,
                                       ext2_icount_t hint, ext2_icount_t *ret);
 extern errcode_t ext2fs_create_icount(ext2_filsys fs, int flags, int size,
                                      ext2_icount_t *ret);
                                       ext2_icount_t hint, ext2_icount_t *ret);
 extern errcode_t ext2fs_create_icount(ext2_filsys fs, int flags, int size,
                                      ext2_icount_t *ret);
-extern errcode_t ext2fs_icount_fetch(ext2_icount_t icount, ino_t ino,
+extern errcode_t ext2fs_icount_fetch(ext2_icount_t icount, ext2_ino_t ino,
                                     __u16 *ret);
                                     __u16 *ret);
-extern errcode_t ext2fs_icount_increment(ext2_icount_t icount, ino_t ino,
+extern errcode_t ext2fs_icount_increment(ext2_icount_t icount, ext2_ino_t ino,
                                         __u16 *ret);
                                         __u16 *ret);
-extern errcode_t ext2fs_icount_decrement(ext2_icount_t icount, ino_t ino,
+extern errcode_t ext2fs_icount_decrement(ext2_icount_t icount, ext2_ino_t ino,
                                         __u16 *ret);
                                         __u16 *ret);
-extern errcode_t ext2fs_icount_store(ext2_icount_t icount, ino_t ino,
+extern errcode_t ext2fs_icount_store(ext2_icount_t icount, ext2_ino_t ino,
                                     __u16 count);
                                     __u16 count);
-extern ino_t ext2fs_get_icount_size(ext2_icount_t icount);
-#if 0
+extern ext2_ino_t ext2fs_get_icount_size(ext2_icount_t icount);
 errcode_t ext2fs_icount_validate(ext2_icount_t icount, FILE *);
 errcode_t ext2fs_icount_validate(ext2_icount_t icount, FILE *);
-#endif
 
 /* ismounted.c */
 extern errcode_t ext2fs_check_if_mounted(const char *file, int *mount_flags);
 
 /* ismounted.c */
 extern errcode_t ext2fs_check_if_mounted(const char *file, int *mount_flags);
+extern errcode_t ext2fs_check_mount_point(const char *device, int *mount_flags,
+                                         char *mtpt, int mtlen);
 
 /* namei.c */
 
 /* namei.c */
-extern errcode_t ext2fs_lookup(ext2_filsys fs, ino_t dir, const char *name,
-                        int namelen, char *buf, ino_t *inode);
-extern errcode_t ext2fs_namei(ext2_filsys fs, ino_t root, ino_t cwd,
-                       const char *name, ino_t *inode);
-errcode_t ext2fs_namei_follow(ext2_filsys fs, ino_t root, ino_t cwd,
-                             const char *name, ino_t *inode);
-extern errcode_t ext2fs_follow_link(ext2_filsys fs, ino_t root, ino_t cwd,
-                       ino_t inode, ino_t *res_inode);
+extern errcode_t ext2fs_lookup(ext2_filsys fs, ext2_ino_t dir, const char *name,
+                        int namelen, char *buf, ext2_ino_t *inode);
+extern errcode_t ext2fs_namei(ext2_filsys fs, ext2_ino_t root, ext2_ino_t cwd,
+                       const char *name, ext2_ino_t *inode);
+errcode_t ext2fs_namei_follow(ext2_filsys fs, ext2_ino_t root, ext2_ino_t cwd,
+                             const char *name, ext2_ino_t *inode);
+extern errcode_t ext2fs_follow_link(ext2_filsys fs, ext2_ino_t root, ext2_ino_t cwd,
+                       ext2_ino_t inode, ext2_ino_t *res_inode);
 
 /* native.c */
 int ext2fs_native_flag(void);
 
 /* newdir.c */
 
 /* native.c */
 int ext2fs_native_flag(void);
 
 /* newdir.c */
-extern errcode_t ext2fs_new_dir_block(ext2_filsys fs, ino_t dir_ino,
-                               ino_t parent_ino, char **block);
+extern errcode_t ext2fs_new_dir_block(ext2_filsys fs, ext2_ino_t dir_ino,
+                               ext2_ino_t parent_ino, char **block);
 
 /* mkdir.c */
 
 /* mkdir.c */
-extern errcode_t ext2fs_mkdir(ext2_filsys fs, ino_t parent, ino_t inum,
+extern errcode_t ext2fs_mkdir(ext2_filsys fs, ext2_ino_t parent, ext2_ino_t inum,
                              const char *name);
 
                              const char *name);
 
+/* mkjournal.c */
+extern errcode_t ext2fs_create_journal_superblock(ext2_filsys fs,
+                                                 __u32 size, int flags,
+                                                 char  **ret_jsb);
+extern errcode_t ext2fs_add_journal_device(ext2_filsys fs,
+                                          ext2_filsys journal_dev);
+extern errcode_t ext2fs_add_journal_inode(ext2_filsys fs, blk_t size,
+                                         int flags);
+
 /* openfs.c */
 extern errcode_t ext2fs_open(const char *name, int flags, int superblock,
                             int block_size, io_manager manager,
                             ext2_filsys *ret_fs);
 
 /* get_pathname.c */
 /* openfs.c */
 extern errcode_t ext2fs_open(const char *name, int flags, int superblock,
                             int block_size, io_manager manager,
                             ext2_filsys *ret_fs);
 
 /* get_pathname.c */
-extern errcode_t ext2fs_get_pathname(ext2_filsys fs, ino_t dir, ino_t ino,
+extern errcode_t ext2fs_get_pathname(ext2_filsys fs, ext2_ino_t dir, ext2_ino_t ino,
                               char **name);
 
 /* link.c */
                               char **name);
 
 /* link.c */
-errcode_t ext2fs_link(ext2_filsys fs, ino_t dir, const char *name,
-                     ino_t ino, int flags);
-errcode_t ext2fs_unlink(ext2_filsys fs, ino_t dir, const char *name,
-                       ino_t ino, int flags);
+errcode_t ext2fs_link(ext2_filsys fs, ext2_ino_t dir, const char *name,
+                     ext2_ino_t ino, int flags);
+errcode_t ext2fs_unlink(ext2_filsys fs, ext2_ino_t dir, const char *name,
+                       ext2_ino_t ino, int flags);
 
 /* read_bb.c */
 extern errcode_t ext2fs_read_bb_inode(ext2_filsys fs,
                                      ext2_badblocks_list *bb_list);
 
 /* read_bb_file.c */
 
 /* read_bb.c */
 extern errcode_t ext2fs_read_bb_inode(ext2_filsys fs,
                                      ext2_badblocks_list *bb_list);
 
 /* read_bb_file.c */
-#if 0
+extern errcode_t ext2fs_read_bb_FILE2(ext2_filsys fs, FILE *f, 
+                                     ext2_badblocks_list *bb_list,
+                                     void *private,
+                                     void (*invalid)(ext2_filsys fs,
+                                                     blk_t blk,
+                                                     char *badstr,
+                                                     void *private));
 extern errcode_t ext2fs_read_bb_FILE(ext2_filsys fs, FILE *f, 
                                     ext2_badblocks_list *bb_list,
                                     void (*invalid)(ext2_filsys fs,
                                                     blk_t blk));
 extern errcode_t ext2fs_read_bb_FILE(ext2_filsys fs, FILE *f, 
                                     ext2_badblocks_list *bb_list,
                                     void (*invalid)(ext2_filsys fs,
                                                     blk_t blk));
-#endif
 
 /* rs_bitmap.c */
 extern errcode_t ext2fs_resize_generic_bitmap(__u32 new_end,
 
 /* rs_bitmap.c */
 extern errcode_t ext2fs_resize_generic_bitmap(__u32 new_end,
@@ -814,6 +793,12 @@ extern int ext2fs_parse_version_string(const char *ver_string);
 extern int ext2fs_get_library_version(const char **ver_string,
                                      const char **date_string);
 
 extern int ext2fs_get_library_version(const char **ver_string,
                                      const char **date_string);
 
+/* write_bb_file.c */
+extern errcode_t ext2fs_write_bb_FILE(ext2_badblocks_list bb_list,
+                                     unsigned int flags,
+                                     FILE *f);
+
+
 /* inline functions */
 extern errcode_t ext2fs_get_mem(unsigned long size, void **ptr);
 extern errcode_t ext2fs_free_mem(void **ptr);
 /* inline functions */
 extern errcode_t ext2fs_get_mem(unsigned long size, void **ptr);
 extern errcode_t ext2fs_free_mem(void **ptr);
@@ -830,7 +815,7 @@ extern void ext2fs_mark_bb_dirty(ext2_filsys fs);
 extern int ext2fs_test_ib_dirty(ext2_filsys fs);
 extern int ext2fs_test_bb_dirty(ext2_filsys fs);
 extern int ext2fs_group_of_blk(ext2_filsys fs, blk_t blk);
 extern int ext2fs_test_ib_dirty(ext2_filsys fs);
 extern int ext2fs_test_bb_dirty(ext2_filsys fs);
 extern int ext2fs_group_of_blk(ext2_filsys fs, blk_t blk);
-extern int ext2fs_group_of_ino(ext2_filsys fs, ino_t ino);
+extern int ext2fs_group_of_ino(ext2_filsys fs, ext2_ino_t ino);
 
 /*
  * The actual inlined functions definitions themselves...
 
 /*
  * The actual inlined functions definitions themselves...
@@ -979,11 +964,15 @@ _INLINE_ int ext2fs_group_of_blk(ext2_filsys fs, blk_t blk)
 /*
  * Return the group # of an inode number
  */
 /*
  * Return the group # of an inode number
  */
-_INLINE_ int ext2fs_group_of_ino(ext2_filsys fs, ino_t ino)
+_INLINE_ int ext2fs_group_of_ino(ext2_filsys fs, ext2_ino_t ino)
 {
        return (ino - 1) / fs->super->s_inodes_per_group;
 }
 #undef _INLINE_
 #endif
 
 {
        return (ino - 1) / fs->super->s_inodes_per_group;
 }
 #undef _INLINE_
 #endif
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _EXT2FS_EXT2FS_H */
 #endif /* _EXT2FS_EXT2FS_H */
index a6889b6e4cafc164dce451b1d712a3c7e71d85b1..741a1da46143b5100e5338dce4de69569df4fb68 100644 (file)
Binary files a/lib/libext2fs.a and b/lib/libext2fs.a differ
index 62085e0db4402d846510c63182f01c31d0cb32fe..ed58e382bc881f91b3c37ddf1c93e9b6b9bbe998 100644 (file)
@@ -455,7 +455,7 @@ char *cfg_get_default (void)
 
 /* 
  * Local variables:
 
 /* 
  * Local variables:
- * c-file-style: "K&R"
+ * c-file-style: "k&r"
  * c-basic-offset: 5
  * End:
  */
  * c-basic-offset: 5
  * End:
  */
index 763e3e6ccd3761a90e5004d2975611511e51b9bd..3c98be1e7f46bd16a89b0dc915c9bd4f2afe173d 100644 (file)
@@ -213,7 +213,7 @@ int open_file(const struct boot_fspec_t* spec, struct boot_file_t* file)
 
 /* 
  * Local variables:
 
 /* 
  * Local variables:
- * c-file-style: "K&R"
+ * c-file-style: "k&r"
  * c-basic-offset: 5
  * End:
  */
  * c-basic-offset: 5
  * End:
  */
index e08f66cfcaa31f352134ddc92d7648528dd3040c..f54f424a1f7aa52d35f852ffbf3a03d44997fcca 100644 (file)
@@ -67,7 +67,7 @@ fs_open(struct boot_file_t *file, const char *dev_name,
 
 /* 
  * Local variables:
 
 /* 
  * Local variables:
- * c-file-style: "K&R"
+ * c-file-style: "k&r"
  * c-basic-offset: 5
  * End:
  */
  * c-basic-offset: 5
  * End:
  */
index 2f2bada89701c5059d5813015d746525217ed7ea..b2ef127fa8abd95086c4a4410db887136efa0d3e 100644 (file)
@@ -623,7 +623,7 @@ static errcode_t linux_flush (io_channel channel)
 
 /* 
  * Local variables:
 
 /* 
  * Local variables:
- * c-file-style: "K&R"
+ * c-file-style: "k&r"
  * c-basic-offset: 5
  * End:
  */
  * c-basic-offset: 5
  * End:
  */
index 2fe3df1a01d9fe8f8651ce3fb67b55bedf9c7d37..e1435490bd0b74d2d85cdbed45d248b5dc088d4c 100644 (file)
@@ -78,7 +78,7 @@ iso_close(    struct boot_file_t*     file)
 
 /* 
  * Local variables:
 
 /* 
  * Local variables:
- * c-file-style: "K&R"
+ * c-file-style: "k&r"
  * c-basic-offset: 5
  * End:
  */
  * c-basic-offset: 5
  * End:
  */
index 7b7f169684537be79361b6128fa437207dfb2d6e..a316cd1179c47772b76eb553af77ebbaebe86052 100644 (file)
@@ -232,7 +232,7 @@ of_close(struct boot_file_t* file)
 
 /* 
  * Local variables:
 
 /* 
  * Local variables:
- * c-file-style: "K&R"
+ * c-file-style: "k&r"
  * c-basic-offset: 5
  * End:
  */
  * c-basic-offset: 5
  * End:
  */
index fd5c0794b7a005db30c82d8484cb1637fe78fafe..969ea4d757761847966737f5886591ab87881454 100644 (file)
@@ -75,7 +75,7 @@ reiserfs_open( struct boot_file_t *file, const char *dev_name,
      if (part)
      {
          DEBUG_F( "Determining offset for partition %d\n", part->part_number );
      if (part)
      {
          DEBUG_F( "Determining offset for partition %d\n", part->part_number );
-         INFO->partition_offset = ((__u64)(part->part_start)) * ((__u64)part->blocksize);
+         INFO->partition_offset = ((uint64_t)part->part_start) * part->blocksize;
          DEBUG_F( "%Lu = %lu * %hu\n", INFO->partition_offset,
                   part->part_start,
                   part->blocksize );
          DEBUG_F( "%Lu = %lu * %hu\n", INFO->partition_offset,
                   part->part_start,
                   part->blocksize );
@@ -168,8 +168,8 @@ read_disk_block( struct boot_file_t *file, __u32 block, __u32 start,
 {
      __u16 fs_blocksize = INFO->blocksize == 0 ? REISERFS_OLD_BLOCKSIZE
          : INFO->blocksize;
 {
      __u16 fs_blocksize = INFO->blocksize == 0 ? REISERFS_OLD_BLOCKSIZE
          : INFO->blocksize;
-     unsigned long long pos = block * fs_blocksize;
-     pos += INFO->partition_offset + start;
+     unsigned long long pos = (unsigned long long)block * (unsigned long long)fs_blocksize;
+     pos += (unsigned long long)INFO->partition_offset + (unsigned long long)start;
      DEBUG_F( "Reading %u bytes, starting at block %u, disk offset %Lu\n",
              length, block, pos );
      if (!prom_lseek( file->of_device, pos )) {
      DEBUG_F( "Reading %u bytes, starting at block %u, disk offset %Lu\n",
              length, block, pos );
      if (!prom_lseek( file->of_device, pos )) {
@@ -525,6 +525,7 @@ read_tree_node( __u32 blockNr, __u16 depth )
 {
      char *cache = CACHE(depth);
      int num_cached = INFO->cached_slots;
 {
      char *cache = CACHE(depth);
      int num_cached = INFO->cached_slots;
+     errnum = 0;
 
      if ( depth < num_cached )
      {
 
      if ( depth < num_cached )
      {
@@ -670,7 +671,7 @@ search_stat( __u32 dir_id, __u32 objectid )
      int nr_item;
      int i;
      struct item_head *ih;
      int nr_item;
      int i;
      struct item_head *ih;
-
+     errnum = 0;
 
      DEBUG_F( "search_stat:\n  key %u:%u:0:0\n", le32_to_cpu(dir_id),
              le32_to_cpu(objectid) );
 
      DEBUG_F( "search_stat:\n  key %u:%u:0:0\n", le32_to_cpu(dir_id),
              le32_to_cpu(objectid) );
@@ -744,7 +745,7 @@ reiserfs_read_data( char *buf, __u32 len )
      __u32 offset;
      __u32 to_read;
      char *prev_buf = buf;
      __u32 offset;
      __u32 to_read;
      char *prev_buf = buf;
-
+     errnum = 0;
 
      DEBUG_F( "reiserfs_read_data: INFO->file->pos=%Lu len=%u, offset=%Lu\n",
              INFO->file->pos, len, (__u64) IH_KEY_OFFSET(INFO->current_ih) - 1 );
 
      DEBUG_F( "reiserfs_read_data: INFO->file->pos=%Lu len=%u, offset=%Lu\n",
              INFO->file->pos, len, (__u64) IH_KEY_OFFSET(INFO->current_ih) - 1 );
@@ -834,6 +835,7 @@ reiserfs_open_file( char *dirname )
      char linkbuf[PATH_MAX];   /* buffer for following symbolic links */
      int link_count = 0;
      int mode;
      char linkbuf[PATH_MAX];   /* buffer for following symbolic links */
      int link_count = 0;
      int mode;
+     errnum = 0;
 
      dir_id = cpu_to_le32(REISERFS_ROOT_PARENT_OBJECTID);
      objectid = cpu_to_le32(REISERFS_ROOT_OBJECTID);
 
      dir_id = cpu_to_le32(REISERFS_ROOT_PARENT_OBJECTID);
      objectid = cpu_to_le32(REISERFS_ROOT_OBJECTID);
@@ -1046,7 +1048,7 @@ uniqueness2type (__u32 uniqueness)
 
 /* 
  * Local variables:
 
 /* 
  * Local variables:
- * c-file-style: "K&R"
+ * c-file-style: "k&r"
  * c-basic-offset: 5
  * End:
  */
  * c-basic-offset: 5
  * End:
  */
index 98684a20ce36def600b5848243f4ca539e08bbb8..14793bbc73659e46f6dddba4682b2de2129beec6 100644 (file)
@@ -54,7 +54,7 @@ struct fs_t xfs_filesystem = {
 
 struct boot_file_t *xfs_file;
 static char FSYS_BUF[32768];
 
 struct boot_file_t *xfs_file;
 static char FSYS_BUF[32768];
-__u64 partition_offset;
+uint64_t partition_offset;
 int errnum;
 
 static int
 int errnum;
 
 static int
@@ -69,7 +69,7 @@ xfs_open(struct boot_file_t *file, const char *dev_name,
        if (part)
        {
                DEBUG_F("Determining offset for partition %d\n", part->part_number);
        if (part)
        {
                DEBUG_F("Determining offset for partition %d\n", part->part_number);
-               partition_offset = ((__u64)(part->part_start)) * ((__u64)part->blocksize);
+               partition_offset = ((uint64_t) part->part_start) * part->blocksize;
                DEBUG_F("%Lu = %lu * %hu\n", partition_offset,
                        part->part_start,
                        part->blocksize);
                DEBUG_F("%Lu = %lu * %hu\n", partition_offset,
                        part->part_start,
                        part->blocksize);
@@ -145,12 +145,12 @@ xfs_close(struct boot_file_t *file)
 }
 
 static int
 }
 
 static int
-read_disk_block(struct boot_file_t *file, __u32 block, __u32 start,
-               __u32 length, void *buf)
+read_disk_block(struct boot_file_t *file, uint64_t block, int start,
+               int length, void *buf)
 {
 {
-       unsigned long long pos = block * 512;
+       uint64_t pos = block * 512;
        pos += partition_offset + start;
        pos += partition_offset + start;
-       DEBUG_F("Reading %u bytes, starting at block %u, disk offset %Lu\n",
+       DEBUG_F("Reading %d bytes, starting at block %Lu, disk offset %Lu\n",
                length, block, pos);
        if (!prom_lseek(file->of_device, pos)) {
                DEBUG_F("prom_lseek failed\n");
                length, block, pos);
        if (!prom_lseek(file->of_device, pos)) {
                DEBUG_F("prom_lseek failed\n");
@@ -234,24 +234,9 @@ ino2offset (xfs_ino_t ino)
 }
 
 /* XFS is big endian, powerpc is big endian */
 }
 
 /* XFS is big endian, powerpc is big endian */
-
-static inline __const__ __uint16_t
-le16 (__uint16_t x)
-{
-       return x;
-}
-
-static inline __const__ __uint32_t
-le32 (__uint32_t x)
-{
-       return x;
-}
-
-static inline __const__ __uint64_t
-le64 (__uint64_t x)
-{
-       return x;
-}
+#define le16(x) (x)
+#define le32(x) (x)
+#define le64(x) (x)
 
 static xfs_fsblock_t
 xt_start (xfs_bmbt_rec_32_t *r)
 
 static xfs_fsblock_t
 xt_start (xfs_bmbt_rec_32_t *r)
@@ -795,7 +780,7 @@ xfs_dir (char *dirname)
 
 /* 
  * Local variables:
 
 /* 
  * Local variables:
- * c-file-style: "K&R"
+ * c-file-style: "k&r"
  * c-basic-offset: 8
  * End:
  */
  * c-basic-offset: 8
  * End:
  */
index c5da5326add87e2860e4e23aabda575d22d27ecf..134163ba3361021bcbe819e0b9a616cb0048a932 100644 (file)
@@ -86,7 +86,7 @@ isonum_733 (char * p)
 
 /* 
  * Local variables:
 
 /* 
  * Local variables:
- * c-file-style: "K&R"
+ * c-file-style: "k&r"
  * c-basic-offset: 8
  * End:
  */
  * c-basic-offset: 8
  * End:
  */
index ea84ee23f8817f26cc713596b94f64cdbb208eee..3055a5a4c494dde4e27dbc510c1ed36dd1932e30 100644 (file)
@@ -323,7 +323,7 @@ swab32(unsigned long value)
 
 /* 
  * Local variables:
 
 /* 
  * Local variables:
- * c-file-style: "K&R"
+ * c-file-style: "k&r"
  * c-basic-offset: 5
  * End:
  */
  * c-basic-offset: 5
  * End:
  */
index 209dd87d777fcf52d99b91d28541751578480781..037c7380a3ecff5af548e55a21348fed7e3edf02 100644 (file)
@@ -628,7 +628,7 @@ prom_pause(void)
 
 /* 
  * Local variables:
 
 /* 
  * Local variables:
- * c-file-style: "K&R"
+ * c-file-style: "k&r"
  * c-basic-offset: 5
  * End:
  */
  * c-basic-offset: 5
  * End:
  */
index 727c72525b3d657c2bcdda0a6ef63f3ca9daedb7..68440aa1481294b92562b623c33e221df563a851 100644 (file)
@@ -1436,7 +1436,7 @@ yaboot_main(void)
 
 /* 
  * Local variables:
 
 /* 
  * Local variables:
- * c-file-style: "K&R"
+ * c-file-style: "k&r"
  * c-basic-offset: 5
  * End:
  */
  * c-basic-offset: 5
  * End:
  */
index 1ae16360dfc658ad4b96288f99e418b5bd0e9281..23022a71da16bca7fff1a555a69dc4f19dfebcad 100644 (file)
@@ -165,7 +165,7 @@ nospace:
 
 /* 
  * Local variables:
 
 /* 
  * Local variables:
- * c-file-style: "K&R"
+ * c-file-style: "k&r"
  * c-basic-offset: 5
  * End:
  */
  * c-basic-offset: 5
  * End:
  */
index 241d2419739ba228dd91a1a6789adf3c997b8db3..0a018561508a266c7a398af1209a91d05a230345 100755 (executable)
--- a/ybin/ybin
+++ b/ybin/ybin
@@ -28,7 +28,7 @@ if [ -n "$PATH_PREFIX" ] ; then
 fi
 PRG="${0##*/}"
 SIGINT="$PRG: Interrupt caught ... exiting"
 fi
 PRG="${0##*/}"
 SIGINT="$PRG: Interrupt caught ... exiting"
-VERSION=1.3.4
+VERSION=1.3.5pre1
 DEBUG=0
 VERBOSE=0
 TMP="${TMPDIR:-/tmp}"
 DEBUG=0
 VERBOSE=0
 TMP="${TMPDIR:-/tmp}"