+++ linux-2.6.16.54-0.2.5/fs/ext3/extents.c
@@ -0,0 +1,2264 @@
+/*
-+ * Copyright(c) 2003, 2004, 2005, Cluster File Systems, Inc, info@clusterfs.com
++ * Copyright 2008 Sun Microsystems, Inc.
+ * Written by Alex Tomas <alex@clusterfs.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+}
+
+/*
-+ * returns first allocated block from next leaf or EXT_MAX_BLOCK
++ * returns first allocated block from next leaf or EXT_UNSET_BLOCK
+ */
+static unsigned ext3_ext_next_leaf_block(struct ext3_extents_tree *tree,
+ struct ext3_ext_path *path)
+
+ /* zero-tree has no leaf blocks at all */
+ if (depth == 0)
-+ return EXT_MAX_BLOCK;
++ return EXT_UNSET_BLOCK;
+
+ /* go to index block */
+ depth--;
+ depth--;
+ }
+
-+ return EXT_MAX_BLOCK;
++ return EXT_UNSET_BLOCK;
+}
+
+/*
+ /* probably next leaf has space for us? */
+ fex = EXT_LAST_EXTENT(eh);
+ next = ext3_ext_next_leaf_block(tree, path);
-+ if (newext->ee_block > fex->ee_block && next != EXT_MAX_BLOCK) {
++ if (newext->ee_block > fex->ee_block && next != EXT_UNSET_BLOCK) {
+ ext_debug(tree, "next leaf block - %d\n", next);
+ EXT_ASSERT(!npath);
+ npath = ext3_ext_find_extent(tree, next, NULL);
+ path[depth].p_ext = ex;
+
+ a = ex->ee_block > start ? ex->ee_block : start;
-+ b = ex->ee_block + ex->ee_len - 1 < end ?
-+ ex->ee_block + ex->ee_len - 1 : end;
++ b = (unsigned long long)ex->ee_block + ex->ee_len - 1 <
++ end ? ex->ee_block + ex->ee_len - 1 : end;
+
+ ext_debug(tree, " border %u:%u\n", a, b);
+
if (ext3_should_journal_data(inode))
ret = 3 * (bpp + indirects) + 2;
else
-Index: linux-2.6.16.54-0.2.5/fs/ext3/Makefile
+Index: linux-2.6.18.8/fs/ext3/Makefile
===================================================================
---- linux-2.6.16.54-0.2.5.orig/fs/ext3/Makefile
-+++ linux-2.6.16.54-0.2.5/fs/ext3/Makefile
-@@ -5,7 +5,8 @@
+--- linux-2.6.18.8.orig/fs/ext3/Makefile 2007-07-17 09:18:11.000000000 +0200
++++ linux-2.6.18.8/fs/ext3/Makefile 2007-07-17 11:08:11.000000000 +0200
+@@ -5,7 +5,7 @@
obj-$(CONFIG_EXT3_FS) += ext3.o
ext3-y := balloc.o bitmap.o dir.o file.o fsync.o ialloc.o inode.o iopen.o \
- ioctl.o namei.o super.o symlink.o hash.o resize.o
-+ ioctl.o namei.o super.o symlink.o hash.o resize.o \
-+ extents.o
++ ioctl.o namei.o super.o symlink.o hash.o resize.o extents.o
ext3-$(CONFIG_EXT3_FS_XATTR) += xattr.o xattr_user.o xattr_trusted.o
ext3-$(CONFIG_EXT3_FS_POSIX_ACL) += acl.o
===================================================================
--- /dev/null
+++ linux-2.6.16.54-0.2.5/include/linux/ext3_extents.h
-@@ -0,0 +1,262 @@
+@@ -0,0 +1,263 @@
+/*
-+ * Copyright (c) 2003, Cluster File Systems, Inc, info@clusterfs.com
++ * Copyright 2008 Sun Microsystems, Inc.
+ * Written by Alex Tomas <alex@clusterfs.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+
+
+#define EXT_MAX_BLOCK 0xffffffff
++#define EXT_UNSET_BLOCK 1
+
+
+#define EXT_FIRST_EXTENT(__hdr__) \