--- defrag-0.73pjm1.orig/e2dump.c
+++ defrag-0.73pjm1/e2dump.c
@@ -742,10 +742,10 @@
 /*            printf("Inode %d has %d blocks out of the group\n",
  *                  inode_no,blocks_out_of_group);
  */           
-         if (blocks_out_of_group == blocks_in_file) {
-            far_files++;
-            far_blocks += blocks_out_of_group;
-         }   
+            if (blocks_out_of_group == blocks_in_file) {
+               far_files++;
+               far_blocks += blocks_out_of_group;
+            }   
 	    else { 
             if (blocks_out_of_group > blocks_in_file) {
                printf("Inode:%lu, file_blocks:%lu, blocks out:%lu\n",
--- defrag-0.73pjm1.orig/frag.8
+++ defrag-0.73pjm1/frag.8
@@ -4,7 +4,7 @@
 .SH NAME
 frag \- simple fragmentation checker
 .SH SYNOPSIS
-.B /etc/frag
+.B /sbin/frag
 .B "[ \-l ] [ \-s [ \-s ]]"
 filename ...
 .SH DESCRIPTION
@@ -66,4 +66,4 @@
 don't cross filesys borders, get filesystem block size at runtime
 .br
 V1.4 by Stephen Tweedie, added indirect block support and improved
-statistic summaries.  Added "-l" switch.
\ No newline at end of file
+statistic summaries.  Added "-l" switch.
--- defrag-0.73pjm1.orig/debian/README.Debian
+++ defrag-0.73pjm1/debian/README.Debian
@@ -0,0 +1,14 @@
+defrag for Debian
+----------------------
+
+Please note that defrag doesn't automatically work out what kind of
+filesystem you're running it on - the `defrag' executable is for
+Minix filesystems only. Please make sure that you use `e2defrag'
+for ext2 filesystems.
+
+I am not building the `edefrag' or `xdefrag' binaries as the kernel no
+longer has support for the extended and xia filesystems. If anyone really
+wants support for either or both of these filesystems then please let me
+know and I will build it in.
+
+ -- Timshel Knoll <timshel@debian.org>  Wed,  4 Jul 2001 21:00:10 +1000
--- defrag-0.73pjm1.orig/debian/changelog
+++ defrag-0.73pjm1/debian/changelog
@@ -0,0 +1,125 @@
+defrag (0.73pjm1-1) unstable; urgency=low
+
+  * New upstream release, by Peter J. Moulder <pjm@bofh.asn.au>:
+    o Builds with current libc6-dev.
+    o Support >1k block sizes (closes: #48458, #62556).
+    o Support sparse_super and ext2 compression.
+    o Reject ext2 filesystems that have unsupported features.
+    o Uses autoconf.
+    o Installs into /usr/sbin instead of /sbin.  (This is more conformant
+      with FHS.)
+    o Minix defrag now called mdefrag.
+    o Manpage symlinks created.
+    o (hopefully this release will be numbered 0.74 after contact with
+      Stephen Tweedie ...)
+  * Lots of packaging changes thanks to Peter as well:
+    o debian/rules:
+      support for DEB_BUILD_OPTIONS (including noopt to disable -O2)
+    o debian/control: Build-Depends: debhelper (>= 2.0.40)
+      Standards-Version 3.5.2
+    o debian/dirs: No longer required, removed ...
+    o debian/docs: INSTALL file removed from package
+  * debian/control:
+    o Architecture: i386 just to be safe for the moment
+    o fixed typo in Build-Depends: dephelper -> debhelper (closes: #102009)
+    o Build-Depends: bzip2 for test suite ...
+  * Fixed reference to '/etc/frag' from frag(8), this now refers
+    to /sbin/frag (closes: #66834, #66835)
+  * These llseek bugs *should* be fixed ... (closes: #19998, #44025, #60868)
+
+ -- Timshel Knoll <timshel@debian.org>  Thu,  5 Jul 2001 00:15:04 +1000
+
+defrag (0.73-2) unstable; urgency=low
+
+  * Packaging taken over by Timshel Knoll <timshel@debian.org>
+  * Re-packaged from scratch. Found pristine sources on web and built
+    with .orig.tar.gz & .diff.gz (0.73-1 was just a .tar.gz)
+    (closes: Bug#44165)
+  * Merged in Adam Heath's changes one by one, with a brief comment for
+    each one.
+  * Policy 3.1.1 (added Build-Depends:) 
+  * Priority: optional (doesn't need to be `extra')
+  * Removed edefrag and xdefrag from the package: the extended and xia
+    filesystems are no longer supported by the kernel.
+  * Incorporated Paul Slootman's alpha diffs (closes: Bug#22209)
+  * Undocumented binary e2dump - filed bug and symlinked.
+
+ -- Timshel Knoll <timshel@debian.org>  Wed, 30 Aug 2000 23:57:50 +1100
+
+defrag (0.73-1.1) frozen unstable; urgency=low
+
+  * nonmaintainer upload for Alpha
+  * compilation of i386 asm segments made conditional, and added alpha code.
+
+ -- Paul Slootman <paul@debian.org>  Mon, 20 Apr 1998 23:05:11 +0200
+
+defrag (0.73-1) frozen unstable; urgency=low
+
+  * Fix for bug 17136 didn't work.  Proper solution is include
+    <sys/param.h> in defrag.h
+  * Fixed problem with llseek, didn't call built in wrapper
+    function.  (Fixes: Bug#19998)
+  * New upstream release.
+
+ -- Adam Heath <adam.heath@usa.net>  Sun, 22 Mar 1998 05:06:43 -0500
+
+defrag (0.70-6) unstable; urgency=low
+
+  * Switched to debhelper.
+
+ -- Adam Heath <adam.heath@usa.net>  Sat, 14 Mar 1998 20:35:28 -0500
+
+defrag (0.70-5) unstable; urgency=low
+
+  * Fix Lintian errors.
+
+ -- Adam Heath <adam.heath@usa.net>  Sun,  8 Mar 1998 23:37:12 -0500
+
+defrag (0.70-4) unstable; urgency=low
+
+  * LLSEEK not declared in libc6 headers.  Added to defrag.h
+      to fix 17135.
+  * Borrowed macros from selectbits.h to allow compilation on
+      non-ix86 machines.  Fixes bug 17136.
+
+ -- Adam Heath <adam.heath@usa.net>  Fri, 16 Jan 1998 01:49:29 -0500
+
+defrag (0.70-3) unstable; urgency=low
+
+  * debstd solves #15445
+  * Bug#15522 supposedly fixed in -1
+
+ -- Adam Heath <adam.heath@usa.net>  Wed, 31 Dec 1997 00:35:12 -0500
+
+defrag (0.70-2) unstable; urgency=low
+
+  * Build with hamm.
+  * debstd solves #9665
+
+ -- Christoph Lameter <clameter@waterf.org>  Thu,  4 Sep 1997 15:47:03 -0700
+
+defrag (0.70-1) unstable stable; urgency=low
+
+  * Added a few comments to README.debian re frequent gotcha's with
+    defrag.
+  * Fixes for >2G partitions.
+  * New upstream release
+
+ -- Christoph Lameter <clameter@waterf.org>  Tue, 19 Aug 1997 15:33:21 -0700
+
+defrag (0.61-1) unstable; urgency=low
+
+  * Upstream update. defrag can now actually be build on a current Linux
+    system!
+
+ -- Christoph Lameter <clameter@waterf.org>  Mon, 10 Feb 1997 19:34:17 -0800
+
+defrag (0.6-1) unstable; urgency=low
+
+  * Initial Release.
+
+ -- Christoph Lameter <clameter@waterf.org>  Tue, 5 Nov 1996 20:09:21 -0800
+
+Local variables:
+mode: debian-changelog
+End:
--- defrag-0.73pjm1.orig/debian/control
+++ defrag-0.73pjm1/debian/control
@@ -0,0 +1,19 @@
+Source: defrag
+Section: admin
+Priority: optional
+Maintainer: Timshel Knoll <timshel@debian.org>
+Standards-Version: 3.5.2
+Build-Depends: debhelper (>= 2.0.0), libncurses-dev, bzip2
+
+Package: defrag
+Architecture: i386
+Depends: ${shlibs:Depends}
+Suggests: file
+Description: ext2, minix and xiafs filesystem defragmenter
+ As a file system is used, data tends to become more and more
+ scattered across the disk, degrading performance.  A disk
+ defragmenter simply re-organises the data on the disk, so that
+ individual files occupy a single sequential set of disk blocks,
+ and all the free space on the disk is collected together in a
+ single region. Thie generally means that reading a whole file
+ is faster, and disk accesses in general are more efficient.
--- defrag-0.73pjm1.orig/debian/copyright
+++ defrag-0.73pjm1/debian/copyright
@@ -0,0 +1,38 @@
+This package was debianized by Christoph Lameter <clameter@waterf.org> on
+Tue, 5 Nov 1996 20:09:21 -0800. It was then taken over by Adam Heath
+<adam.heath@usa.net> on Wed, 31 Dec 1997 00:35:12 -0500, and again by
+Timshel Knoll <timshel@debian.org> on Thu, 24 Aug 2000 00:13:42 +1000.
+
+It was downloaded from ftp://sunsite.unc.edu:/pub/Linux/Incoming,
+	but I can no longer find it there, so it is still available
+	from: http://www.go.dlr.de/linux/src/defrag-0.73.tar.gz
+
+Upstream Author(s): Stephen Tweedie <sct@dcs.ed.ac.uk>, Alexei Vovenko
+		    and Anthony Tong <antoine@eci.com>
+
+Copyright:
+
+    Copyright (C) 1992, 1993, 1994, 1997, 1998 Stephen C. Tweedie
+					       <sct@dcs.ed.ac.uk>
+    Parts Copyright (C) 1992 Remy Card <card@masi.ibpr.fr>
+    Parts Copyright (C) 1992 Linus Torvalds <torvalds@kruuna.helsinki.fi>
+    Parts Copyright (C) 1994 Alexey Vovenko
+    Parts Copyright (C) 1997 Ulrich Habel <espero@b31.hadiko.de>
+    Parts Copyright (C) 2001 Peter J. Moulder <pjm@bofh.asn.au>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+On Debian GNU/Linux systems, the complete text of the GNU General
+Public License can be found in `/usr/share/common-licences/GPL'.
+
+ -- Timshel Knoll <timshel@debian.org>  Thu,  7 Jun 2001 11:53:37 +1000
--- defrag-0.73pjm1.orig/debian/docs
+++ defrag-0.73pjm1/debian/docs
@@ -0,0 +1,5 @@
+AUTHORS
+BUGS
+NEWS
+README
+TODO
--- defrag-0.73pjm1.orig/debian/examples
+++ defrag-0.73pjm1/debian/examples
@@ -0,0 +1 @@
+mkilist.sample
--- defrag-0.73pjm1.orig/debian/rules
+++ defrag-0.73pjm1/debian/rules
@@ -0,0 +1,104 @@
+#!/usr/bin/make -f
+# debian/rules file for defrag
+# modified by from sample debian/rules file by
+# Timshel Knoll <timshel@debian.org>
+#
+# Sample debian/rules that uses debhelper.
+# GNU copyright 1997 to 1999 by Joey Hess.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+# This is the debhelper compatability version to use.
+export DH_COMPAT=1
+
+CFLAGS =
+ifeq (, $(findstring noopt, $(DEB_BUILD_OPTIONS)))
+CFLAGS += -O2
+endif
+ifneq (, $(findstring debug, $(DEB_BUILD_OPTIONS)))
+CFLAGS += -g
+endif
+
+ifeq (, $(findstring nostrip, $(DEB_BUILD_OPTIONS)))
+CFLAGS += -fomit-frame-pointer
+endif
+
+configure: configure-stamp
+configure-stamp:
+	dh_testdir
+	# Add here commands to configure the package.
+
+	CFLAGS="$(CFLAGS)" ./configure --prefix=/usr --mandir=\$${prefix}/share/man
+
+	touch $@
+
+build: configure build-stamp
+build-stamp:
+	dh_testdir
+
+	# Add here commands to compile the package.
+	$(MAKE)
+	$(MAKE) check
+
+	touch $@
+
+clean:
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp configure-stamp
+
+	# Add here commands to clean up after the build process.
+	-$(MAKE) distclean
+
+	dh_clean
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_clean -k
+	dh_installdirs
+
+	# Add here commands to install the package into debian/tmp.
+	$(MAKE) install DESTDIR=`pwd`/debian/tmp
+
+	# We don't want the static version
+	rm -f debian/tmp/usr/sbin/e2defrag.static
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+#	dh_testversion
+	dh_testdir
+	dh_testroot
+#	dh_installdebconf	
+	dh_installdocs
+	dh_installexamples
+#	dh_installmenu
+#	dh_installemacsen
+#	dh_installpam
+#	dh_installinit
+#	dh_installcron
+#	dh_installman
+#	dh_installinfo
+	dh_undocumented e2dump.8
+	dh_installchangelogs ChangeLog
+	dh_link
+	dh_strip
+	dh_compress
+	dh_fixperms
+#	# You may want to make some executables suid here.
+#	dh_suidregister
+#	dh_makeshlibs
+	dh_installdeb
+#	dh_perl
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: configure build clean binary-indep binary-arch binary install
--- defrag-0.73pjm1.orig/include/linux/ext2_fs.h
+++ defrag-0.73pjm1/include/linux/ext2_fs.h
@@ -0,0 +1,628 @@
+/*
+ *  linux/include/linux/ext2_fs.h
+ *
+ * Copyright (C) 1992, 1993, 1994, 1995
+ * Remy Card (card@masi.ibp.fr)
+ * Laboratoire MASI - Institut Blaise Pascal
+ * Universite Pierre et Marie Curie (Paris VI)
+ *
+ *  from
+ *
+ *  linux/include/linux/minix_fs.h
+ *
+ *  Copyright (C) 1991, 1992  Linus Torvalds
+ */
+
+#ifndef _LINUX_EXT2_FS_H
+#define _LINUX_EXT2_FS_H
+
+#include <linux/types.h>
+
+/*
+ * The second extended filesystem constants/structures
+ */
+
+/*
+ * Define EXT2FS_DEBUG to produce debug messages
+ */
+#undef EXT2FS_DEBUG
+
+/*
+ * Define EXT2_PREALLOCATE to preallocate data blocks for expanding files
+ */
+#define EXT2_PREALLOCATE
+#define EXT2_DEFAULT_PREALLOC_BLOCKS	8
+
+/*
+ * The second extended file system version
+ */
+#define EXT2FS_DATE		"95/08/09"
+#define EXT2FS_VERSION		"0.5b"
+
+/*
+ * Debug code
+ */
+#ifdef EXT2FS_DEBUG
+#	define ext2_debug(f, a...)	{ \
+					printk ("EXT2-fs DEBUG (%s, %d): %s:", \
+						__FILE__, __LINE__, __FUNCTION__); \
+				  	printk (f, ## a); \
+					}
+#else
+#	define ext2_debug(f, a...)	/**/
+#endif
+
+/*
+ * Special inodes numbers
+ */
+#define	EXT2_BAD_INO		 1	/* Bad blocks inode */
+#define EXT2_ROOT_INO		 2	/* Root inode */
+#define EXT2_ACL_IDX_INO	 3	/* ACL inode */
+#define EXT2_ACL_DATA_INO	 4	/* ACL inode */
+#define EXT2_BOOT_LOADER_INO	 5	/* Boot loader inode */
+#define EXT2_UNDEL_DIR_INO	 6	/* Undelete directory inode */
+
+/* First non-reserved inode for old ext2 filesystems */
+#define EXT2_GOOD_OLD_FIRST_INO	11
+
+/*
+ * The second extended file system magic number
+ */
+#define EXT2_SUPER_MAGIC	0xEF53
+
+/*
+ * Maximal count of links to a file
+ */
+#define EXT2_LINK_MAX		32000
+
+/*
+ * Macro-instructions used to manage several block sizes
+ */
+#define EXT2_MIN_BLOCK_SIZE		1024
+#define	EXT2_MAX_BLOCK_SIZE		4096
+#define EXT2_MIN_BLOCK_LOG_SIZE		  10
+#ifdef __KERNEL__
+# define EXT2_BLOCK_SIZE(s)		((s)->s_blocksize)
+#else
+# define EXT2_BLOCK_SIZE(s)		(EXT2_MIN_BLOCK_SIZE << (s)->s_log_block_size)
+#endif
+#define EXT2_ACLE_PER_BLOCK(s)		(EXT2_BLOCK_SIZE(s) / sizeof (struct ext2_acl_entry))
+#define	EXT2_ADDR_PER_BLOCK(s)		(EXT2_BLOCK_SIZE(s) / sizeof (__u32))
+#ifdef __KERNEL__
+# define EXT2_BLOCK_SIZE_BITS(s)	((s)->s_blocksize_bits)
+#else
+# define EXT2_BLOCK_SIZE_BITS(s)	((s)->s_log_block_size + 10)
+#endif
+#ifdef __KERNEL__
+#define	EXT2_ADDR_PER_BLOCK_BITS(s)	((s)->u.ext2_sb.s_addr_per_block_bits)
+#define EXT2_INODE_SIZE(s)		((s)->u.ext2_sb.s_inode_size)
+#define EXT2_FIRST_INO(s)		((s)->u.ext2_sb.s_first_ino)
+#else
+#define EXT2_INODE_SIZE(s)	(((s)->s_rev_level == EXT2_GOOD_OLD_REV) ? \
+				 EXT2_GOOD_OLD_INODE_SIZE : \
+				 (s)->s_inode_size)
+#define EXT2_FIRST_INO(s)	(((s)->s_rev_level == EXT2_GOOD_OLD_REV) ? \
+				 EXT2_GOOD_OLD_FIRST_INO : \
+				 (s)->s_first_ino)
+#endif
+
+/*
+ * Macro-instructions used to manage fragments
+ */
+#define EXT2_MIN_FRAG_SIZE		1024
+#define	EXT2_MAX_FRAG_SIZE		4096
+#define EXT2_MIN_FRAG_LOG_SIZE		  10
+#ifdef __KERNEL__
+# define EXT2_FRAG_SIZE(s)		((s)->u.ext2_sb.s_frag_size)
+# define EXT2_FRAGS_PER_BLOCK(s)	((s)->u.ext2_sb.s_frags_per_block)
+#else
+# define EXT2_FRAG_SIZE(s)		(EXT2_MIN_FRAG_SIZE << (s)->s_log_frag_size)
+# define EXT2_FRAGS_PER_BLOCK(s)	(EXT2_BLOCK_SIZE(s) / EXT2_FRAG_SIZE(s))
+#endif
+
+/*
+ * ACL structures
+ */
+struct ext2_acl_header	/* Header of Access Control Lists */
+{
+	__u32	aclh_size;
+	__u32	aclh_file_count;
+	__u32	aclh_acle_count;
+	__u32	aclh_first_acle;
+};
+
+struct ext2_acl_entry	/* Access Control List Entry */
+{
+	__u32	acle_size;
+	__u16	acle_perms;	/* Access permissions */
+	__u16	acle_type;	/* Type of entry */
+	__u16	acle_tag;	/* User or group identity */
+	__u16	acle_pad1;
+	__u32	acle_next;	/* Pointer on next entry for the */
+					/* same inode or on next free entry */
+};
+
+/*
+ * Structure of a blocks group descriptor
+ */
+struct ext2_group_desc
+{
+	__u32	bg_block_bitmap;		/* Blocks bitmap block */
+	__u32	bg_inode_bitmap;		/* Inodes bitmap block */
+	__u32	bg_inode_table;		/* Inodes table block */
+	__u16	bg_free_blocks_count;	/* Free blocks count */
+	__u16	bg_free_inodes_count;	/* Free inodes count */
+	__u16	bg_used_dirs_count;	/* Directories count */
+	__u16	bg_pad;
+	__u32	bg_reserved[3];
+};
+
+/*
+ * Macro-instructions used to manage group descriptors
+ */
+#ifdef __KERNEL__
+# define EXT2_BLOCKS_PER_GROUP(s)	((s)->u.ext2_sb.s_blocks_per_group)
+# define EXT2_DESC_PER_BLOCK(s)		((s)->u.ext2_sb.s_desc_per_block)
+# define EXT2_INODES_PER_GROUP(s)	((s)->u.ext2_sb.s_inodes_per_group)
+# define EXT2_DESC_PER_BLOCK_BITS(s)	((s)->u.ext2_sb.s_desc_per_block_bits)
+#else
+# define EXT2_BLOCKS_PER_GROUP(s)	((s)->s_blocks_per_group)
+# define EXT2_DESC_PER_BLOCK(s)		(EXT2_BLOCK_SIZE(s) / sizeof (struct ext2_group_desc))
+# define EXT2_INODES_PER_GROUP(s)	((s)->s_inodes_per_group)
+#endif
+
+/*
+ * Constants relative to the data blocks
+ */
+#define	EXT2_NDIR_BLOCKS		12
+#define	EXT2_IND_BLOCK			EXT2_NDIR_BLOCKS
+#define	EXT2_DIND_BLOCK			(EXT2_IND_BLOCK + 1)
+#define	EXT2_TIND_BLOCK			(EXT2_DIND_BLOCK + 1)
+#define	EXT2_N_BLOCKS			(EXT2_TIND_BLOCK + 1)
+
+/*
+ * Inode flags
+ */
+#define	EXT2_SECRM_FL			0x00000001 /* Secure deletion */
+#define	EXT2_UNRM_FL			0x00000002 /* Undelete */
+#define	EXT2_COMPR_FL			0x00000004 /* Compress file */
+#define EXT2_SYNC_FL			0x00000008 /* Synchronous updates */
+#define EXT2_IMMUTABLE_FL		0x00000010 /* Immutable file */
+#define EXT2_APPEND_FL			0x00000020 /* writes to file may only append */
+#define EXT2_NODUMP_FL			0x00000040 /* do not dump file */
+#define EXT2_NOATIME_FL			0x00000080 /* do not update atime */
+/* Reserved for compression usage... */
+#define EXT2_DIRTY_FL			0x00000100
+#define EXT2_COMPRBLK_FL		0x00000200 /* One or more compressed clusters */
+#define EXT2_NOCOMP_FL			0x00000400 /* Don't compress */
+#define EXT2_ECOMPR_FL			0x00000800 /* Compression error */
+/* End compression flags --- maybe not all used */	
+#define EXT2_BTREE_FL			0x00001000 /* btree format dir */
+#define EXT2_RESERVED_FL		0x80000000 /* reserved for ext2 lib */
+
+#define EXT2_FL_USER_VISIBLE		0x00001FFF /* User visible flags */
+#define EXT2_FL_USER_MODIFIABLE		0x000000FF /* User modifiable flags */
+
+/*
+ * ioctl commands
+ */
+#define	EXT2_IOC_GETFLAGS		_IOR('f', 1, long)
+#define	EXT2_IOC_SETFLAGS		_IOW('f', 2, long)
+#define	EXT2_IOC_GETVERSION		_IOR('v', 1, long)
+#define	EXT2_IOC_SETVERSION		_IOW('v', 2, long)
+
+/*
+ * Structure of an inode on the disk
+ */
+struct ext2_inode {
+	__u16	i_mode;		/* File mode */
+	__u16	i_uid;		/* Low 16 bits of Owner Uid */
+	__u32	i_size;		/* Size in bytes */
+	__u32	i_atime;	/* Access time */
+	__u32	i_ctime;	/* Creation time */
+	__u32	i_mtime;	/* Modification time */
+	__u32	i_dtime;	/* Deletion Time */
+	__u16	i_gid;		/* Low 16 bits of Group Id */
+	__u16	i_links_count;	/* Links count */
+	__u32	i_blocks;	/* Blocks count */
+	__u32	i_flags;	/* File flags */
+	union {
+		struct {
+			__u32  l_i_reserved1;
+		} linux1;
+		struct {
+			__u32  h_i_translator;
+		} hurd1;
+		struct {
+			__u32  m_i_reserved1;
+		} masix1;
+	} osd1;				/* OS dependent 1 */
+	__u32	i_block[EXT2_N_BLOCKS];/* Pointers to blocks */
+	__u32	i_generation;	/* File version (for NFS) */
+	__u32	i_file_acl;	/* File ACL */
+	__u32	i_dir_acl;	/* Directory ACL */
+	__u32	i_faddr;	/* Fragment address */
+	union {
+		struct {
+			__u8	l_i_frag;	/* Fragment number */
+			__u8	l_i_fsize;	/* Fragment size */
+			__u16	i_pad1;
+			__u16	l_i_uid_high;	/* these 2 fields    */
+			__u16	l_i_gid_high;	/* were reserved2[0] */
+			__u32	l_i_reserved2;
+		} linux2;
+		struct {
+			__u8	h_i_frag;	/* Fragment number */
+			__u8	h_i_fsize;	/* Fragment size */
+			__u16	h_i_mode_high;
+			__u16	h_i_uid_high;
+			__u16	h_i_gid_high;
+			__u32	h_i_author;
+		} hurd2;
+		struct {
+			__u8	m_i_frag;	/* Fragment number */
+			__u8	m_i_fsize;	/* Fragment size */
+			__u16	m_pad1;
+			__u32	m_i_reserved2[2];
+		} masix2;
+	} osd2;				/* OS dependent 2 */
+};
+
+#define i_size_high	i_dir_acl
+
+#if defined(__KERNEL__) || defined(__linux__)
+#define i_reserved1	osd1.linux1.l_i_reserved1
+#define i_frag		osd2.linux2.l_i_frag
+#define i_fsize		osd2.linux2.l_i_fsize
+#define i_uid_low	i_uid
+#define i_gid_low	i_gid
+#define i_uid_high	osd2.linux2.l_i_uid_high
+#define i_gid_high	osd2.linux2.l_i_gid_high
+#define i_reserved2	osd2.linux2.l_i_reserved2
+#endif
+
+#ifdef	__hurd__
+#define i_translator	osd1.hurd1.h_i_translator
+#define i_frag		osd2.hurd2.h_i_frag;
+#define i_fsize		osd2.hurd2.h_i_fsize;
+#define i_uid_high	osd2.hurd2.h_i_uid_high
+#define i_gid_high	osd2.hurd2.h_i_gid_high
+#define i_author	osd2.hurd2.h_i_author
+#endif
+
+#ifdef	__masix__
+#define i_reserved1	osd1.masix1.m_i_reserved1
+#define i_frag		osd2.masix2.m_i_frag
+#define i_fsize		osd2.masix2.m_i_fsize
+#define i_reserved2	osd2.masix2.m_i_reserved2
+#endif
+
+/*
+ * File system states
+ */
+#define	EXT2_VALID_FS			0x0001	/* Unmounted cleanly */
+#define	EXT2_ERROR_FS			0x0002	/* Errors detected */
+
+/*
+ * Mount flags
+ */
+#define EXT2_MOUNT_CHECK		0x0001	/* Do mount-time checks */
+#define EXT2_MOUNT_GRPID		0x0004	/* Create files with directory's group */
+#define EXT2_MOUNT_DEBUG		0x0008	/* Some debugging messages */
+#define EXT2_MOUNT_ERRORS_CONT		0x0010	/* Continue on errors */
+#define EXT2_MOUNT_ERRORS_RO		0x0020	/* Remount fs ro on errors */
+#define EXT2_MOUNT_ERRORS_PANIC		0x0040	/* Panic on errors */
+#define EXT2_MOUNT_MINIX_DF		0x0080	/* Mimics the Minix statfs */
+#define EXT2_MOUNT_NO_UID32		0x0200  /* Disable 32-bit UIDs */
+
+#define clear_opt(o, opt)		o &= ~EXT2_MOUNT_##opt
+#define set_opt(o, opt)			o |= EXT2_MOUNT_##opt
+#define test_opt(sb, opt)		((sb)->u.ext2_sb.s_mount_opt & \
+					 EXT2_MOUNT_##opt)
+/*
+ * Maximal mount counts between two filesystem checks
+ */
+#define EXT2_DFL_MAX_MNT_COUNT		20	/* Allow 20 mounts */
+#define EXT2_DFL_CHECKINTERVAL		0	/* Don't use interval check */
+
+/*
+ * Behaviour when detecting errors
+ */
+#define EXT2_ERRORS_CONTINUE		1	/* Continue execution */
+#define EXT2_ERRORS_RO			2	/* Remount fs read-only */
+#define EXT2_ERRORS_PANIC		3	/* Panic */
+#define EXT2_ERRORS_DEFAULT		EXT2_ERRORS_CONTINUE
+
+/*
+ * Structure of the super block
+ */
+struct ext2_super_block {
+	__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;
+	__u32	s_reserved[204];	/* Padding to the end of the block */
+};
+
+#ifdef __KERNEL__
+#define EXT2_SB(sb)	(&((sb)->u.ext2_sb))
+#else
+/* Assume that user mode programs are passing in an ext2fs superblock, not
+ * a kernel struct super_block.  This will allow us to call the feature-test
+ * macros from user land. */
+#define EXT2_SB(sb)	(sb)
+#endif
+
+/*
+ * Codes for operating systems
+ */
+#define EXT2_OS_LINUX		0
+#define EXT2_OS_HURD		1
+#define EXT2_OS_MASIX		2
+#define EXT2_OS_FREEBSD		3
+#define EXT2_OS_LITES		4
+
+/*
+ * Revision levels
+ */
+#define EXT2_GOOD_OLD_REV	0	/* The good old (original) format */
+#define EXT2_DYNAMIC_REV	1 	/* V2 format w/ dynamic inode sizes */
+
+#define EXT2_CURRENT_REV	EXT2_GOOD_OLD_REV
+#define EXT2_MAX_SUPP_REV	EXT2_DYNAMIC_REV
+
+#define EXT2_GOOD_OLD_INODE_SIZE 128
+
+/*
+ * Feature set definitions
+ */
+
+#define EXT2_HAS_COMPAT_FEATURE(sb,mask)			\
+	( EXT2_SB(sb)->s_es->s_feature_compat & cpu_to_le32(mask) )
+#define EXT2_HAS_RO_COMPAT_FEATURE(sb,mask)			\
+	( EXT2_SB(sb)->s_es->s_feature_ro_compat & cpu_to_le32(mask) )
+#define EXT2_HAS_INCOMPAT_FEATURE(sb,mask)			\
+	( EXT2_SB(sb)->s_es->s_feature_incompat & cpu_to_le32(mask) )
+#define EXT2_SET_COMPAT_FEATURE(sb,mask)			\
+	EXT2_SB(sb)->s_es->s_feature_compat |= cpu_to_le32(mask)
+#define EXT2_SET_RO_COMPAT_FEATURE(sb,mask)			\
+	EXT2_SB(sb)->s_es->s_feature_ro_compat |= cpu_to_le32(mask)
+#define EXT2_SET_INCOMPAT_FEATURE(sb,mask)			\
+	EXT2_SB(sb)->s_es->s_feature_incompat |= cpu_to_le32(mask)
+#define EXT2_CLEAR_COMPAT_FEATURE(sb,mask)			\
+	EXT2_SB(sb)->s_es->s_feature_compat &= ~cpu_to_le32(mask)
+#define EXT2_CLEAR_RO_COMPAT_FEATURE(sb,mask)			\
+	EXT2_SB(sb)->s_es->s_feature_ro_compat &= ~cpu_to_le32(mask)
+#define EXT2_CLEAR_INCOMPAT_FEATURE(sb,mask)			\
+	EXT2_SB(sb)->s_es->s_feature_incompat &= ~cpu_to_le32(mask)
+
+#define EXT2_FEATURE_COMPAT_DIR_PREALLOC	0x0001
+
+#define EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER	0x0001
+#define EXT2_FEATURE_RO_COMPAT_LARGE_FILE	0x0002
+#define EXT2_FEATURE_RO_COMPAT_BTREE_DIR	0x0004
+
+#define EXT2_FEATURE_INCOMPAT_COMPRESSION	0x0001
+#define EXT2_FEATURE_INCOMPAT_FILETYPE		0x0002
+
+#define EXT2_FEATURE_COMPAT_SUPP	0
+#define EXT2_FEATURE_INCOMPAT_SUPP	EXT2_FEATURE_INCOMPAT_FILETYPE
+#define EXT2_FEATURE_RO_COMPAT_SUPP	(EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER| \
+					 EXT2_FEATURE_RO_COMPAT_LARGE_FILE| \
+					 EXT2_FEATURE_RO_COMPAT_BTREE_DIR)
+
+/*
+ * Default values for user and/or group using reserved blocks
+ */
+#define	EXT2_DEF_RESUID		0
+#define	EXT2_DEF_RESGID		0
+
+/*
+ * Structure of a directory entry
+ */
+#define EXT2_NAME_LEN 255
+
+struct ext2_dir_entry {
+	__u32	inode;			/* Inode number */
+	__u16	rec_len;		/* Directory entry length */
+	__u16	name_len;		/* Name length */
+	char	name[EXT2_NAME_LEN];	/* File name */
+};
+
+/*
+ * The new version of the directory entry.  Since EXT2 structures are
+ * stored in intel byte order, and the name_len field could never be
+ * bigger than 255 chars, it's safe to reclaim the extra byte for the
+ * file_type field.
+ */
+struct ext2_dir_entry_2 {
+	__u32	inode;			/* Inode number */
+	__u16	rec_len;		/* Directory entry length */
+	__u8	name_len;		/* Name length */
+	__u8	file_type;
+	char	name[EXT2_NAME_LEN];	/* File name */
+};
+
+/*
+ * Ext2 directory file types.  Only the low 3 bits are used.  The
+ * other bits are reserved for now.
+ */
+#define EXT2_FT_UNKNOWN		0
+#define EXT2_FT_REG_FILE	1
+#define EXT2_FT_DIR		2
+#define EXT2_FT_CHRDEV		3
+#define EXT2_FT_BLKDEV 		4
+#define EXT2_FT_FIFO		5
+#define EXT2_FT_SOCK		6
+#define EXT2_FT_SYMLINK		7
+
+#define EXT2_FT_MAX		8
+
+/*
+ * EXT2_DIR_PAD defines the directory entries boundaries
+ *
+ * NOTE: It must be a multiple of 4
+ */
+#define EXT2_DIR_PAD		 	4
+#define EXT2_DIR_ROUND 			(EXT2_DIR_PAD - 1)
+#define EXT2_DIR_REC_LEN(name_len)	(((name_len) + 8 + EXT2_DIR_ROUND) & \
+					 ~EXT2_DIR_ROUND)
+
+#ifdef __KERNEL__
+/*
+ * Function prototypes
+ */
+
+/*
+ * Ok, these declarations are also in <linux/kernel.h> but none of the
+ * ext2 source programs needs to include it so they are duplicated here.
+ */
+# define NORET_TYPE    /**/
+# define ATTRIB_NORET  __attribute__((noreturn))
+# define NORET_AND     noreturn,
+
+/* acl.c */
+extern int ext2_permission (struct inode *, int);
+
+/* balloc.c */
+extern int ext2_bg_has_super(struct super_block *sb, int group);
+extern unsigned long ext2_bg_num_gdb(struct super_block *sb, int group);
+extern int ext2_new_block (const struct inode *, unsigned long,
+			   __u32 *, __u32 *, int *);
+extern void ext2_free_blocks (const struct inode *, unsigned long,
+			      unsigned long);
+extern unsigned long ext2_count_free_blocks (struct super_block *);
+extern void ext2_check_blocks_bitmap (struct super_block *);
+extern struct ext2_group_desc * ext2_get_group_desc(struct super_block * sb,
+						    unsigned int block_group,
+						    struct buffer_head ** bh);
+
+/* bitmap.c */
+extern unsigned long ext2_count_free (struct buffer_head *, unsigned);
+
+/* dir.c */
+extern int ext2_check_dir_entry (const char *, struct inode *,
+				 struct ext2_dir_entry_2 *, struct buffer_head *,
+				 unsigned long);
+
+/* file.c */
+extern int ext2_read (struct inode *, struct file *, char *, int);
+extern int ext2_write (struct inode *, struct file *, char *, int);
+
+/* fsync.c */
+extern int ext2_sync_file (struct file *, struct dentry *, int);
+extern int ext2_fsync_inode (struct inode *, int);
+
+/* ialloc.c */
+extern struct inode * ext2_new_inode (const struct inode *, int);
+extern void ext2_free_inode (struct inode *);
+extern unsigned long ext2_count_free_inodes (struct super_block *);
+extern void ext2_check_inodes_bitmap (struct super_block *);
+
+/* inode.c */
+
+extern struct buffer_head * ext2_getblk (struct inode *, long, int, int *);
+extern struct buffer_head * ext2_bread (struct inode *, int, int, int *);
+
+extern void ext2_read_inode (struct inode *);
+extern void ext2_write_inode (struct inode *, int);
+extern void ext2_put_inode (struct inode *);
+extern void ext2_delete_inode (struct inode *);
+extern int ext2_sync_inode (struct inode *);
+extern void ext2_discard_prealloc (struct inode *);
+
+/* ioctl.c */
+extern int ext2_ioctl (struct inode *, struct file *, unsigned int,
+		       unsigned long);
+
+/* namei.c */
+extern struct inode_operations ext2_dir_inode_operations;
+
+/* super.c */
+extern void ext2_error (struct super_block *, const char *, const char *, ...)
+	__attribute__ ((format (printf, 3, 4)));
+extern NORET_TYPE void ext2_panic (struct super_block *, const char *,
+				   const char *, ...)
+	__attribute__ ((NORET_AND format (printf, 3, 4)));
+extern void ext2_warning (struct super_block *, const char *, const char *, ...)
+	__attribute__ ((format (printf, 3, 4)));
+extern void ext2_update_dynamic_rev (struct super_block *sb);
+extern void ext2_put_super (struct super_block *);
+extern void ext2_write_super (struct super_block *);
+extern int ext2_remount (struct super_block *, int *, char *);
+extern struct super_block * ext2_read_super (struct super_block *,void *,int);
+extern int ext2_statfs (struct super_block *, struct statfs *);
+
+/* truncate.c */
+extern void ext2_truncate (struct inode *);
+
+/*
+ * Inodes and files operations
+ */
+
+/* dir.c */
+extern struct file_operations ext2_dir_operations;
+
+/* file.c */
+extern struct inode_operations ext2_file_inode_operations;
+extern struct file_operations ext2_file_operations;
+
+/* symlink.c */
+extern struct inode_operations ext2_fast_symlink_inode_operations;
+
+extern struct address_space_operations ext2_aops;
+
+#endif	/* __KERNEL__ */
+
+#endif	/* _LINUX_EXT2_FS_H */
--- defrag-0.73pjm1.orig/include/linux/ext2_fs_i.h
+++ defrag-0.73pjm1/include/linux/ext2_fs_i.h
@@ -0,0 +1,42 @@
+/*
+ *  linux/include/linux/ext2_fs_i.h
+ *
+ * Copyright (C) 1992, 1993, 1994, 1995
+ * Remy Card (card@masi.ibp.fr)
+ * Laboratoire MASI - Institut Blaise Pascal
+ * Universite Pierre et Marie Curie (Paris VI)
+ *
+ *  from
+ *
+ *  linux/include/linux/minix_fs_i.h
+ *
+ *  Copyright (C) 1991, 1992  Linus Torvalds
+ */
+
+#ifndef _LINUX_EXT2_FS_I
+#define _LINUX_EXT2_FS_I
+
+/*
+ * second extended file system inode data in memory
+ */
+struct ext2_inode_info {
+	__u32	i_data[15];
+	__u32	i_flags;
+	__u32	i_faddr;
+	__u8	i_frag_no;
+	__u8	i_frag_size;
+	__u16	i_osync;
+	__u32	i_file_acl;
+	__u32	i_dir_acl;
+	__u32	i_dtime;
+	__u32	not_used_1;	/* FIX: not used/ 2.2 placeholder */
+	__u32	i_block_group;
+	__u32	i_next_alloc_block;
+	__u32	i_next_alloc_goal;
+	__u32	i_prealloc_block;
+	__u32	i_prealloc_count;
+	__u32	i_high_size;
+	int	i_new_inode:1;	/* Is a freshly allocated inode */
+};
+
+#endif	/* _LINUX_EXT2_FS_I */
--- defrag-0.73pjm1.orig/include/linux/ext2_fs_sb.h
+++ defrag-0.73pjm1/include/linux/ext2_fs_sb.h
@@ -0,0 +1,61 @@
+/*
+ *  linux/include/linux/ext2_fs_sb.h
+ *
+ * Copyright (C) 1992, 1993, 1994, 1995
+ * Remy Card (card@masi.ibp.fr)
+ * Laboratoire MASI - Institut Blaise Pascal
+ * Universite Pierre et Marie Curie (Paris VI)
+ *
+ *  from
+ *
+ *  linux/include/linux/minix_fs_sb.h
+ *
+ *  Copyright (C) 1991, 1992  Linus Torvalds
+ */
+
+#ifndef _LINUX_EXT2_FS_SB
+#define _LINUX_EXT2_FS_SB
+
+/*
+ * The following is not needed anymore since the descriptors buffer
+ * heads are now dynamically allocated
+ */
+/* #define EXT2_MAX_GROUP_DESC	8 */
+
+#define EXT2_MAX_GROUP_LOADED	8
+
+/*
+ * second extended-fs super-block data in memory
+ */
+struct ext2_sb_info {
+	unsigned long s_frag_size;	/* Size of a fragment in bytes */
+	unsigned long s_frags_per_block;/* Number of fragments per block */
+	unsigned long s_inodes_per_block;/* Number of inodes per block */
+	unsigned long s_frags_per_group;/* Number of fragments in a group */
+	unsigned long s_blocks_per_group;/* Number of blocks in a group */
+	unsigned long s_inodes_per_group;/* Number of inodes in a group */
+	unsigned long s_itb_per_group;	/* Number of inode table blocks per group */
+	unsigned long s_gdb_count;	/* Number of group descriptor blocks */
+	unsigned long s_desc_per_block;	/* Number of group descriptors per block */
+	unsigned long s_groups_count;	/* Number of groups in the fs */
+	struct buffer_head * s_sbh;	/* Buffer containing the super block */
+	struct ext2_super_block * s_es;	/* Pointer to the super block in the buffer */
+	struct buffer_head ** s_group_desc;
+	unsigned short s_loaded_inode_bitmaps;
+	unsigned short s_loaded_block_bitmaps;
+	unsigned long s_inode_bitmap_number[EXT2_MAX_GROUP_LOADED];
+	struct buffer_head * s_inode_bitmap[EXT2_MAX_GROUP_LOADED];
+	unsigned long s_block_bitmap_number[EXT2_MAX_GROUP_LOADED];
+	struct buffer_head * s_block_bitmap[EXT2_MAX_GROUP_LOADED];
+	unsigned long  s_mount_opt;
+	uid_t s_resuid;
+	gid_t s_resgid;
+	unsigned short s_mount_state;
+	unsigned short s_pad;
+	int s_addr_per_block_bits;
+	int s_desc_per_block_bits;
+	int s_inode_size;
+	int s_first_ino;
+};
+
+#endif	/* _LINUX_EXT2_FS_SB */
--- defrag-0.73pjm1.orig/include/linux/ext_fs_i.h
+++ defrag-0.73pjm1/include/linux/ext_fs_i.h
@@ -0,0 +1,11 @@
+#ifndef _EXT_FS_I
+#define _EXT_FS_I
+
+/*
+ * extended file system inode data in memory
+ */
+struct ext_inode_info {
+	unsigned long i_data[16];
+};
+
+#endif
--- defrag-0.73pjm1.orig/include/linux/ext_fs_sb.h
+++ defrag-0.73pjm1/include/linux/ext_fs_sb.h
@@ -0,0 +1,21 @@
+#ifndef _EXT_FS_SB
+#define _EXT_FS_SB
+
+/*
+ * extended-fs super-block data in memory
+ */
+struct ext_sb_info {
+			unsigned long s_ninodes;
+			unsigned long s_nzones;
+			unsigned long s_firstdatazone;
+			unsigned long s_log_zone_size;
+			unsigned long s_max_size;
+			unsigned long s_firstfreeblocknumber;
+			unsigned long s_freeblockscount;
+			struct buffer_head * s_firstfreeblock;
+			unsigned long s_firstfreeinodenumber;
+			unsigned long s_freeinodescount;
+			struct buffer_head * s_firstfreeinodeblock;
+};
+
+#endif
--- defrag-0.73pjm1.orig/include/linux/minix_fs.h
+++ defrag-0.73pjm1/include/linux/minix_fs.h
@@ -0,0 +1,120 @@
+#ifndef _LINUX_MINIX_FS_H
+#define _LINUX_MINIX_FS_H
+
+/*
+ * The minix filesystem constants/structures
+ */
+
+/*
+ * Thanks to Kees J Bot for sending me the definitions of the new
+ * minix filesystem (aka V2) with bigger inodes and 32-bit block
+ * pointers.
+ */
+
+#define MINIX_ROOT_INO 1
+
+/* Not the same as the bogus LINK_MAX in <linux/limits.h>. Oh well. */
+#define MINIX_LINK_MAX	250
+#define MINIX2_LINK_MAX	65530
+
+#define MINIX_I_MAP_SLOTS	8
+#define MINIX_Z_MAP_SLOTS	64
+#define MINIX_SUPER_MAGIC	0x137F		/* original minix fs */
+#define MINIX_SUPER_MAGIC2	0x138F		/* minix fs, 30 char names */
+#define MINIX2_SUPER_MAGIC	0x2468		/* minix V2 fs */
+#define MINIX2_SUPER_MAGIC2	0x2478		/* minix V2 fs, 30 char names */
+#define MINIX_VALID_FS		0x0001		/* Clean fs. */
+#define MINIX_ERROR_FS		0x0002		/* fs has errors. */
+
+#define MINIX_INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct minix_inode)))
+#define MINIX2_INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct minix2_inode)))
+
+#define MINIX_V1		0x0001		/* original minix fs */
+#define MINIX_V2		0x0002		/* minix V2 fs */
+
+#define INODE_VERSION(inode)	inode->i_sb->u.minix_sb.s_version
+
+/*
+ * This is the original minix inode layout on disk.
+ * Note the 8-bit gid and atime and ctime.
+ */
+struct minix_inode {
+	__u16 i_mode;
+	__u16 i_uid;
+	__u32 i_size;
+	__u32 i_time;
+	__u8  i_gid;
+	__u8  i_nlinks;
+	__u16 i_zone[9];
+};
+
+/*
+ * The new minix inode has all the time entries, as well as
+ * long block numbers and a third indirect block (7+1+1+1
+ * instead of 7+1+1). Also, some previously 8-bit values are
+ * now 16-bit. The inode is now 64 bytes instead of 32.
+ */
+struct minix2_inode {
+	__u16 i_mode;
+	__u16 i_nlinks;
+	__u16 i_uid;
+	__u16 i_gid;
+	__u32 i_size;
+	__u32 i_atime;
+	__u32 i_mtime;
+	__u32 i_ctime;
+	__u32 i_zone[10];
+};
+
+/*
+ * minix super-block data on disk
+ */
+struct minix_super_block {
+	__u16 s_ninodes;
+	__u16 s_nzones;
+	__u16 s_imap_blocks;
+	__u16 s_zmap_blocks;
+	__u16 s_firstdatazone;
+	__u16 s_log_zone_size;
+	__u32 s_max_size;
+	__u16 s_magic;
+	__u16 s_state;
+	__u32 s_zones;
+};
+
+struct minix_dir_entry {
+	__u16 inode;
+	char name[0];
+};
+
+#ifdef __KERNEL__
+
+extern struct inode * minix_new_inode(const struct inode * dir, int * error);
+extern void minix_free_inode(struct inode * inode);
+extern unsigned long minix_count_free_inodes(struct super_block *sb);
+extern int minix_new_block(struct inode * inode);
+extern void minix_free_block(struct inode * inode, int block);
+extern unsigned long minix_count_free_blocks(struct super_block *sb);
+
+extern struct buffer_head * minix_getblk(struct inode *, int, int);
+extern struct buffer_head * minix_bread(struct inode *, int, int);
+
+extern void V1_minix_truncate(struct inode *);
+extern void V2_minix_truncate(struct inode *);
+extern void minix_truncate(struct inode *);
+extern int minix_sync_inode(struct inode *);
+extern int V1_minix_sync_file(struct inode *);
+extern int V2_minix_sync_file(struct inode *);
+extern int V1_minix_get_block(struct inode *, long, struct buffer_head *, int);
+extern int V2_minix_get_block(struct inode *, long, struct buffer_head *, int);
+
+extern struct address_space_operations minix_aops;
+extern struct inode_operations minix_file_inode_operations;
+extern struct inode_operations minix_dir_inode_operations;
+extern struct file_operations minix_file_operations;
+extern struct file_operations minix_dir_operations;
+extern struct dentry_operations minix_dentry_operations;
+
+#endif /* __KERNEL__ */
+
+#endif
--- defrag-0.73pjm1.orig/include/linux/minix_fs_i.h
+++ defrag-0.73pjm1/include/linux/minix_fs_i.h
@@ -0,0 +1,14 @@
+#ifndef _MINIX_FS_I
+#define _MINIX_FS_I
+
+/*
+ * minix fs inode data in memory
+ */
+struct minix_inode_info {
+	union {
+		__u16 i1_data[16];
+		__u32 i2_data[16];
+	} u;
+};
+
+#endif
--- defrag-0.73pjm1.orig/include/linux/minix_fs_sb.h
+++ defrag-0.73pjm1/include/linux/minix_fs_sb.h
@@ -0,0 +1,26 @@
+#ifndef _MINIX_FS_SB
+#define _MINIX_FS_SB
+
+/*
+ * minix super-block data in memory
+ */
+struct minix_sb_info {
+			unsigned long s_ninodes;
+			unsigned long s_nzones;
+			unsigned long s_imap_blocks;
+			unsigned long s_zmap_blocks;
+			unsigned long s_firstdatazone;
+			unsigned long s_log_zone_size;
+			unsigned long s_max_size;
+			int s_dirsize;
+			int s_namelen;
+			int s_link_max;
+			struct buffer_head ** s_imap;
+			struct buffer_head ** s_zmap;
+			struct buffer_head * s_sbh;
+			struct minix_super_block * s_ms;
+			unsigned short s_mount_state;
+			unsigned short s_version;
+};
+
+#endif
--- defrag-0.73pjm1.orig/include/linux/xia_fs.h
+++ defrag-0.73pjm1/include/linux/xia_fs.h
@@ -0,0 +1,121 @@
+#ifndef _XIA_FS_H
+#define _XIA_FS_H
+
+/*
+ * include/linux/xia_fs.h
+ *
+ * Copyright (C) Q. Frank Xia, 1993.
+ *
+ * Based on Linus' minix_fs.h.
+ * Copyright (C) Linus Torvalds, 1991, 1992.
+ */
+
+#define _XIAFS_SUPER_MAGIC 0x012FD16D
+#define _XIAFS_ROOT_INO 1
+#define _XIAFS_BAD_INO  2
+
+#define _XIAFS_NAME_LEN 248
+
+#define _XIAFS_INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof(struct xiafs_inode)))
+
+struct xiafs_inode {		/* 64 bytes */
+    mode_t   i_mode;
+    nlink_t  i_nlinks;
+    uid_t    i_uid;
+    gid_t    i_gid;
+    size_t   i_size;		/* 8 */
+    time_t   i_ctime;
+    time_t   i_atime;
+    time_t   i_mtime;
+    daddr_t  i_zone[8];
+    daddr_t  i_ind_zone;
+    daddr_t  i_dind_zone;
+};
+
+/*
+ * linux super-block data on disk
+ */
+struct xiafs_super_block {
+    u_char  s_boot_segment[512];	/*  1st sector reserved for boot */
+    u_long  s_zone_size;		/*  0: the name says it		 */
+    u_long  s_nzones;			/*  1: volume size, zone aligned */ 
+    u_long  s_ninodes;			/*  2: # of inodes		 */
+    u_long  s_ndatazones;		/*  3: # of data zones		 */
+    u_long  s_imap_zones;		/*  4: # of imap zones           */
+    u_long  s_zmap_zones;		/*  5: # of zmap zones		 */
+    u_long  s_firstdatazone;		/*  6: first data zone           */
+    u_long  s_zone_shift;		/*  7: z size = 1KB << z shift   */
+    u_long  s_max_size;			/*  8: max size of a single file */
+    u_long  s_reserved0;		/*  9: reserved			 */
+    u_long  s_reserved1;		/* 10: 				 */
+    u_long  s_reserved2;		/* 11:				 */
+    u_long  s_reserved3;		/* 12:				 */
+    u_long  s_firstkernzone;		/* 13: first kernel zone	 */
+    u_long  s_kernzones;		/* 14: kernel size in zones	 */
+    u_long  s_magic;			/* 15: magic number for xiafs    */
+};
+
+struct xiafs_direct {
+    ino_t   d_ino;
+    u_short d_rec_len;
+    u_char  d_name_len;
+    char    d_name[_XIAFS_NAME_LEN+1];
+};
+
+#ifdef __KERNEL__
+
+extern int xiafs_lookup(struct inode * dir,const char * name, int len, 
+			struct inode ** result);
+extern int xiafs_create(struct inode * dir,const char * name, int len, int mode,
+		      	struct inode ** result);
+extern int xiafs_mkdir(struct inode * dir, const char * name, int len, int mode);
+extern int xiafs_rmdir(struct inode * dir, const char * name, int len);
+extern int xiafs_unlink(struct inode * dir, const char * name, int len);
+extern int xiafs_symlink(struct inode * inode, const char * name, int len,
+		       	const char * symname);
+extern int xiafs_link(struct inode * oldinode, struct inode * dir, 
+		    	const char * name, int len);
+extern int xiafs_mknod(struct inode * dir, const char * name, int len, 
+		     	int mode, int rdev);
+extern int xiafs_rename(struct inode * old_dir, const char * old_name, 
+		      	int old_len, struct inode * new_dir, 
+		      	const char * new_name, int new_len,
+		      	int must_be_dir);
+extern struct inode * xiafs_new_inode(struct inode * dir);
+extern void xiafs_free_inode(struct inode * inode);
+extern unsigned long xiafs_count_free_inodes(struct super_block *sb);
+extern int xiafs_new_zone(struct super_block * sb, u_long prev_addr);
+extern void xiafs_free_zone(struct super_block * sb, int block);
+extern unsigned long xiafs_count_free_zones(struct super_block *sb);
+
+extern int xiafs_bmap(struct inode *,int);
+
+extern struct buffer_head * xiafs_getblk(struct inode *, int, int);
+extern struct buffer_head * xiafs_bread(struct inode *, int, int);
+
+extern void xiafs_truncate(struct inode *);
+extern void xiafs_put_super(struct super_block *);
+extern struct super_block *xiafs_read_super(struct super_block *,void *,int);
+extern int init_xiafs_fs(void);
+extern void xiafs_read_inode(struct inode *);
+extern void xiafs_write_inode(struct inode *);
+extern void xiafs_put_inode(struct inode *);
+extern void xiafs_statfs(struct super_block *, struct statfs *, int);
+extern int xiafs_sync_inode(struct inode *);
+extern int xiafs_sync_file(struct inode *, struct file *);
+
+extern struct inode_operations xiafs_file_inode_operations;
+extern struct inode_operations xiafs_dir_inode_operations;
+extern struct inode_operations xiafs_symlink_inode_operations;
+
+#endif /* __KERNEL__ */
+
+#endif  /* _XIA_FS_H */
+
+
+
+
+
+
+
+
--- defrag-0.73pjm1.orig/include/linux/xia_fs_i.h
+++ defrag-0.73pjm1/include/linux/xia_fs_i.h
@@ -0,0 +1,19 @@
+#ifndef _XIA_FS_I_H
+#define _XIA_FS_I_H
+
+/*
+ * include/linux/xia_fs_i.h
+ *
+ * Copyright (C) Q. Frank Xia, 1993.
+ * 
+ * Based on Linus' minix_fs_i.h.
+ * Copyright (C) Linus Torvalds, 1991, 1992.
+ */
+
+struct xiafs_inode_info { 		/* for data zone pointers */
+    unsigned long  i_zone[8];
+    unsigned long  i_ind_zone;
+    unsigned long  i_dind_zone;
+};
+
+#endif  /* _XIA_FS_I_H */
--- defrag-0.73pjm1.orig/include/linux/xia_fs_sb.h
+++ defrag-0.73pjm1/include/linux/xia_fs_sb.h
@@ -0,0 +1,36 @@
+#ifndef _XIA_FS_SB_H
+#define _XIA_FS_SB_H
+
+/*
+ * include/linux/xia_fs_sb.h
+ *
+ * Copyright (C) Q. Frank Xia, 1993.
+ *
+ * Based on Linus' minix_fs_sb.h.
+ * Copyright (C) Linus Torvalds, 1991, 1992.
+ */
+
+#define _XIAFS_IMAP_SLOTS 8
+#define _XIAFS_ZMAP_SLOTS 32
+
+struct xiafs_sb_info {
+    u_long   s_nzones;
+    u_long   s_ninodes;
+    u_long   s_ndatazones;
+    u_long   s_imap_zones;
+    u_long   s_zmap_zones;
+    u_long   s_firstdatazone;
+    u_long   s_zone_shift;
+    u_long   s_max_size;				/*  32 bytes */
+    struct buffer_head * s_imap_buf[_XIAFS_IMAP_SLOTS];	/*  32 bytes */
+    struct buffer_head * s_zmap_buf[_XIAFS_ZMAP_SLOTS];	/* 128 bytes */
+    int      s_imap_iznr[_XIAFS_IMAP_SLOTS];		/*  32 bytes */
+    int      s_zmap_zznr[_XIAFS_ZMAP_SLOTS];		/* 128 bytes */
+    u_char   s_imap_cached;			/* flag for cached imap */
+    u_char   s_zmap_cached;			/* flag for cached imap */
+};
+
+#endif /* _XIA_FS_SB_H */
+
+
+
