-Index: linux-2.6.9-full/include/linux/ext3_fs_i.h
+Index: linux-2.6.9/include/linux/ext3_fs_i.h
===================================================================
---- linux-2.6.9-full.orig/include/linux/ext3_fs_i.h 2007-03-28 01:29:38.000000000 +0400
-+++ linux-2.6.9-full/include/linux/ext3_fs_i.h 2007-03-28 15:45:41.000000000 +0400
+--- linux-2.6.9.orig/include/linux/ext3_fs_i.h
++++ linux-2.6.9/include/linux/ext3_fs_i.h
@@ -130,6 +130,10 @@ struct ext3_inode_info {
struct inode vfs_inode;
};
#endif /* _LINUX_EXT3_FS_I */
-Index: linux-2.6.9-full/include/linux/ext3_fs_sb.h
+Index: linux-2.6.9/include/linux/ext3_fs_sb.h
===================================================================
---- linux-2.6.9-full.orig/include/linux/ext3_fs_sb.h 2007-03-28 15:42:16.000000000 +0400
-+++ linux-2.6.9-full/include/linux/ext3_fs_sb.h 2007-03-28 15:45:41.000000000 +0400
+--- linux-2.6.9.orig/include/linux/ext3_fs_sb.h
++++ linux-2.6.9/include/linux/ext3_fs_sb.h
@@ -23,9 +23,16 @@
#define EXT_INCLUDE
#include <linux/blockgroup_lock.h>
/*
* third extended-fs super-block data in memory
-Index: linux-2.6.9-full/include/linux/ext3_fs.h
+Index: linux-2.6.9/include/linux/ext3_fs.h
===================================================================
---- linux-2.6.9-full.orig/include/linux/ext3_fs.h 2007-03-28 15:45:07.000000000 +0400
-+++ linux-2.6.9-full/include/linux/ext3_fs.h 2007-03-28 15:45:41.000000000 +0400
+--- linux-2.6.9.orig/include/linux/ext3_fs.h
++++ linux-2.6.9/include/linux/ext3_fs.h
@@ -389,6 +389,7 @@ struct ext3_inode {
#define EXT3_MOUNT_IOPEN_NOPRIV 0x100000/* Make iopen world-readable */
#define EXT3_MOUNT_EXTENTS 0x200000/* Extents support */
/* Compatibility, for having both ext2_fs.h and ext3_fs.h included at once */
#ifndef clear_opt
-@@ -749,8 +750,9 @@ struct dir_private_info {
+@@ -757,8 +758,9 @@ struct dir_private_info {
extern int ext3_bg_has_super(struct super_block *sb, int group);
extern unsigned long ext3_bg_num_gdb(struct super_block *sb, int group);
extern int ext3_new_block (handle_t *, struct inode *, unsigned long, int *);
extern void ext3_free_blocks_sb (handle_t *, struct super_block *,
unsigned long, unsigned long, int *);
extern unsigned long ext3_count_free_blocks (struct super_block *);
-Index: linux-2.6.9-full/fs/ext3/super.c
+Index: linux-2.6.9/fs/ext3/super.c
===================================================================
---- linux-2.6.9-full.orig/fs/ext3/super.c 2007-03-28 15:42:16.000000000 +0400
-+++ linux-2.6.9-full/fs/ext3/super.c 2007-03-28 15:45:41.000000000 +0400
-@@ -600,6 +600,7 @@ enum {
+--- linux-2.6.9.orig/fs/ext3/super.c
++++ linux-2.6.9/fs/ext3/super.c
+@@ -642,6 +642,7 @@ enum {
Opt_ignore, Opt_barrier, Opt_err, Opt_resize,
Opt_iopen, Opt_noiopen, Opt_iopen_nopriv,
Opt_extents, Opt_noextents, Opt_extdebug,
};
static match_table_t tokens = {
-@@ -653,6 +654,9 @@ static match_table_t tokens = {
+@@ -695,6 +696,9 @@ static match_table_t tokens = {
{Opt_noextents, "noextents"},
{Opt_extdebug, "extdebug"},
{Opt_barrier, "barrier=%u"},
{Opt_err, NULL},
{Opt_resize, "resize"},
};
-@@ -965,6 +969,19 @@ clear_qf_name:
+@@ -1007,6 +1011,19 @@ clear_qf_name:
case Opt_extdebug:
set_opt (sbi->s_mount_opt, EXTDEBUG);
break;
default:
printk (KERN_ERR
"EXT3-fs: Unrecognized mount option \"%s\" "
-@@ -1654,6 +1671,7 @@ static int ext3_fill_super (struct super
+@@ -1696,6 +1713,7 @@ static int ext3_fill_super (struct super
ext3_count_dirs(sb));
ext3_ext_init(sb);
return 0;
-Index: linux-2.6.9-full/fs/ext3/extents.c
+Index: linux-2.6.9/fs/ext3/extents.c
===================================================================
---- linux-2.6.9-full.orig/fs/ext3/extents.c 2007-03-28 01:29:41.000000000 +0400
-+++ linux-2.6.9-full/fs/ext3/extents.c 2007-03-28 15:45:41.000000000 +0400
-@@ -779,7 +779,7 @@ cleanup:
+--- linux-2.6.9.orig/fs/ext3/extents.c
++++ linux-2.6.9/fs/ext3/extents.c
+@@ -820,7 +820,7 @@ cleanup:
for (i = 0; i < depth; i++) {
if (!ablocks[i])
continue;
}
}
kfree(ablocks);
-@@ -1586,7 +1586,7 @@ int ext3_ext_rm_idx(handle_t *handle, st
+@@ -1630,7 +1630,7 @@ int ext3_ext_rm_idx(handle_t *handle, st
path->p_idx->ei_leaf);
bh = sb_find_get_block(tree->inode->i_sb, path->p_idx->ei_leaf);
ext3_forget(handle, 1, tree->inode, bh, path->p_idx->ei_leaf);
return err;
}
-@@ -2071,10 +2071,12 @@ ext3_remove_blocks(struct ext3_extents_t
+@@ -2129,10 +2129,12 @@ ext3_remove_blocks(struct ext3_extents_t
int needed = ext3_remove_blocks_credits(tree, ex, from, to);
handle_t *handle = ext3_journal_start(tree->inode, needed);
struct buffer_head *bh;
if (from >= ex->ee_block && to == ex->ee_block + ex->ee_len - 1) {
/* tail removal */
unsigned long num, start;
-@@ -2086,7 +2088,7 @@ ext3_remove_blocks(struct ext3_extents_t
+@@ -2144,7 +2146,7 @@ ext3_remove_blocks(struct ext3_extents_t
bh = sb_find_get_block(tree->inode->i_sb, start + i);
ext3_forget(handle, 0, tree->inode, bh, start + i);
}
} else if (from == ex->ee_block && to <= ex->ee_block + ex->ee_len - 1) {
printk("strange request: removal %lu-%lu from %u:%u\n",
from, to, ex->ee_block, ex->ee_len);
-@@ -2177,11 +2179,8 @@ int ext3_ext_get_block(handle_t *handle,
+@@ -2235,11 +2237,8 @@ int ext3_ext_get_block(handle_t *handle,
struct ext3_extent *ex;
int goal, newblock, err = 0, depth;
struct ext3_extents_tree tree;
clear_buffer_new(bh_result);
ext3_init_tree_desc(&tree, inode);
-@@ -2253,18 +2252,33 @@ int ext3_ext_get_block(handle_t *handle,
+@@ -2311,18 +2310,36 @@ int ext3_ext_get_block(handle_t *handle,
goto out2;
}
+ ar.goal = ext3_ext_find_goal(inode, path, iblock);
+ ar.logical = iblock;
+ ar.len = allocated;
-+ ar.flags = EXT3_MB_HINT_DATA;
++ if (S_ISREG(inode->i_mode))
++ ar.flags = EXT3_MB_HINT_DATA;
++ else
++ ar.flags = 0;
+ newblock = ext3_mb_new_blocks(handle, &ar, &err);
if (!newblock)
goto out2;
ext_debug(&tree, "allocate new block: goal %d, found %d\n",
-@@ -2274,11 +2288,14 @@ int ext3_ext_get_block(handle_t *handle,
+@@ -2332,11 +2349,14 @@ int ext3_ext_get_block(handle_t *handle,
newex.ee_block = iblock;
newex.ee_start = newblock;
newex.ee_start_hi = 0;
goto out2;
}
-@@ -2287,6 +2304,7 @@ int ext3_ext_get_block(handle_t *handle,
+@@ -2345,6 +2365,7 @@ int ext3_ext_get_block(handle_t *handle,
/* previous routine could use block we allocated */
newblock = newex.ee_start;
set_buffer_new(bh_result);
ext3_ext_put_in_cache(&tree, newex.ee_block, newex.ee_len,
-@@ -2339,6 +2357,9 @@ void ext3_ext_truncate(struct inode * in
+@@ -2397,6 +2418,9 @@ void ext3_ext_truncate(struct inode * in
down(&EXT3_I(inode)->truncate_sem);
ext3_ext_invalidate_cache(&tree);
/*
* TODO: optimization is possible here
* probably we need not scaning at all,
-Index: linux-2.6.9-full/fs/ext3/Makefile
+Index: linux-2.6.9/fs/ext3/Makefile
===================================================================
---- linux-2.6.9-full.orig/fs/ext3/Makefile 2007-03-28 01:29:38.000000000 +0400
-+++ linux-2.6.9-full/fs/ext3/Makefile 2007-03-28 15:45:41.000000000 +0400
+--- linux-2.6.9.orig/fs/ext3/Makefile
++++ linux-2.6.9/fs/ext3/Makefile
@@ -6,7 +6,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-$(CONFIG_EXT3_FS_XATTR) += xattr.o xattr_user.o xattr_trusted.o
ext3-$(CONFIG_EXT3_FS_POSIX_ACL) += acl.o
-Index: linux-2.6.9-full/fs/ext3/xattr.c
+Index: linux-2.6.9/fs/ext3/xattr.c
===================================================================
---- linux-2.6.9-full.orig/fs/ext3/xattr.c 2006-05-18 23:57:04.000000000 +0400
-+++ linux-2.6.9-full/fs/ext3/xattr.c 2007-03-28 15:45:41.000000000 +0400
+--- linux-2.6.9.orig/fs/ext3/xattr.c
++++ linux-2.6.9/fs/ext3/xattr.c
@@ -1281,7 +1281,7 @@ ext3_xattr_set_handle2(handle_t *handle,
new_bh = sb_getblk(sb, block);
if (!new_bh) {
get_bh(bh);
ext3_forget(handle, 1, inode, bh, EXT3_I(inode)->i_file_acl);
} else {
-Index: linux-2.6.9-full/fs/ext3/balloc.c
+Index: linux-2.6.9/fs/ext3/balloc.c
===================================================================
---- linux-2.6.9-full.orig/fs/ext3/balloc.c 2006-03-10 18:20:03.000000000 +0300
-+++ linux-2.6.9-full/fs/ext3/balloc.c 2007-03-28 15:45:41.000000000 +0400
+--- linux-2.6.9.orig/fs/ext3/balloc.c
++++ linux-2.6.9/fs/ext3/balloc.c
@@ -79,7 +79,7 @@ struct ext3_group_desc * ext3_get_group_
*
* Return buffer_head on success or NULL in case of failure.
unsigned long goal, int *errp)
{
struct buffer_head *bitmap_bh = NULL;
-Index: linux-2.6.9-full/fs/ext3/inode.c
+Index: linux-2.6.9/fs/ext3/inode.c
===================================================================
---- linux-2.6.9-full.orig/fs/ext3/inode.c 2007-03-28 01:29:39.000000000 +0400
-+++ linux-2.6.9-full/fs/ext3/inode.c 2007-03-28 15:45:41.000000000 +0400
+--- linux-2.6.9.orig/fs/ext3/inode.c
++++ linux-2.6.9/fs/ext3/inode.c
@@ -572,7 +572,7 @@ static int ext3_alloc_branch(handle_t *h
ext3_journal_forget(handle, branch[i].bh);
}