+++ linux-2.6.18.8/fs/ext3/extents.c 2007-07-17 11:08:59.000000000 +0200
@@ -0,0 +1,2276 @@
+/*
-+ * Copyright 2008, Sun Microsystems, Inc.
++ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Written by Alex Tomas <alex@clusterfs.com>
+ *
+ * Architecture independence:
--- linux-2.6.18.8.orig/fs/ext3/inode.c 2007-07-17 09:18:12.000000000 +0200
+++ linux-2.6.18.8/fs/ext3/inode.c 2007-07-17 11:08:11.000000000 +0200
@@ -40,8 +40,6 @@
- #include "iopen.h"
+ #include "xattr.h"
#include "acl.h"
-static int ext3_writepage_trans_blocks(struct inode *inode);
depth = ext3_block_to_path(inode,iblock,offsets,&blocks_to_boundary);
@@ -984,12 +983,10 @@ static int ext3_get_block(struct inode *
+ started = 1;
+ }
- get_block:
- if (ret == 0) {
-- ret = ext3_get_blocks_handle(handle, inode, iblock,
-+ ret = ext3_get_blocks_wrap(handle, inode, iblock,
+- ret = ext3_get_blocks_handle(handle, inode, iblock,
++ ret = ext3_get_blocks_wrap(handle, inode, iblock,
max_blocks, bh_result, create, 0);
-- if (ret > 0) {
-- bh_result->b_size = (ret << inode->i_blkbits);
-+ if (ret > 0)
- ret = 0;
-- }
- }
- return ret;
- }
+- if (ret > 0) {
+- bh_result->b_size = (ret << inode->i_blkbits);
++ if (ret > 0)
+ ret = 0;
+- }
+ if (started)
+ ext3_journal_stop(handle);
+ out:
@@ -1008,7 +1005,7 @@ struct buffer_head *ext3_getblk(handle_t
dummy.b_state = 0;
dummy.b_blocknr = -1000;
@@ -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 \
+ ext3-y := balloc.o bitmap.o dir.o file.o fsync.o ialloc.o inode.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
+++ linux-2.6.18.8/include/linux/ext3_extents.h 2007-07-17 09:18:14.000000000 +0200
@@ -0,0 +1,232 @@
+/*
-+ * Copyright 2008 Sun Microsystems, Inc.
++ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Written by Alex Tomas <alex@clusterfs.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+do { \
+ if (test_opt(inode->i_sb, EXTDEBUG)) \
+ printk(fmt, ##a); \
-+} while (0);
++} while (0)
+#else
+#define ext_debug(inode,fmt,a...)
+#endif
/*
@@ -373,6 +374,8 @@ struct ext3_inode {
+ #define EXT3_MOUNT_QUOTA 0x80000 /* Some quota option set */
+ #define EXT3_MOUNT_USRQUOTA 0x100000 /* "old" user quota */
#define EXT3_MOUNT_GRPQUOTA 0x200000 /* "old" group quota */
- #define EXT3_MOUNT_IOPEN 0x400000 /* Allow access via iopen */
- #define EXT3_MOUNT_IOPEN_NOPRIV 0x800000/* Make iopen world-readable */
+#define EXT3_MOUNT_EXTENTS 0x2000000/* Extents support */
+#define EXT3_MOUNT_EXTDEBUG 0x4000000/* Extents debug */
EXT3_FEATURE_RO_COMPAT_LARGE_FILE| \
EXT3_FEATURE_RO_COMPAT_BTREE_DIR)
@@ -816,6 +821,9 @@ extern int ext3_get_inode_loc(struct ino
- extern void ext3_truncate (struct inode *);
- extern void ext3_set_inode_flags(struct inode *);
extern void ext3_set_aops(struct inode *inode);
+ extern int ext3_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
+ u64 start, u64 len);
+extern int ext3_writepage_trans_blocks(struct inode *);
+extern int ext3_block_truncate_page(handle_t *handle, struct page *page,
+ struct address_space *mapping, loff_t from);