b=15459
i=adilger
i=bzzz
disable preallocation for non-regular files.
although our patchsets only enable extents on regular files, we should prevent
crashing.
tbd Sun Microsystems, Inc.
* version 3.0.6
tbd Sun Microsystems, Inc.
* version 3.0.6
+Severity : normal
+Bugzilla : 15459
+Description: migrate ldiskfs - ldiskfs2 (extents on directories)
+Details : disable preallocation for non-regular files.
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
Index: linux-2.6.18.8/include/linux/ext3_fs_i.h
===================================================================
Index: linux-2.6.18.8/include/linux/ext3_fs_i.h
===================================================================
---- linux-2.6.18.8.orig/include/linux/ext3_fs_i.h 2007-07-17 09:18:14.000000000 +0200
-+++ linux-2.6.18.8/include/linux/ext3_fs_i.h 2007-07-17 09:18:53.000000000 +0200
+--- linux-2.6.18.8.orig/include/linux/ext3_fs_i.h
++++ linux-2.6.18.8/include/linux/ext3_fs_i.h
@@ -154,6 +154,10 @@ struct ext3_inode_info {
struct inode vfs_inode;
@@ -154,6 +154,10 @@ struct ext3_inode_info {
struct inode vfs_inode;
#endif /* _LINUX_EXT3_FS_I */
Index: linux-2.6.18.8/include/linux/ext3_fs_sb.h
===================================================================
#endif /* _LINUX_EXT3_FS_I */
Index: linux-2.6.18.8/include/linux/ext3_fs_sb.h
===================================================================
---- linux-2.6.18.8.orig/include/linux/ext3_fs_sb.h 2007-07-17 09:18:14.000000000 +0200
-+++ linux-2.6.18.8/include/linux/ext3_fs_sb.h 2007-07-17 09:18:53.000000000 +0200
+--- linux-2.6.18.8.orig/include/linux/ext3_fs_sb.h
++++ linux-2.6.18.8/include/linux/ext3_fs_sb.h
@@ -21,8 +21,15 @@
#include <linux/wait.h>
#include <linux/blockgroup_lock.h>
@@ -21,8 +21,15 @@
#include <linux/wait.h>
#include <linux/blockgroup_lock.h>
* third extended-fs super-block data in memory
Index: linux-2.6.18.8/include/linux/ext3_fs.h
===================================================================
* third extended-fs super-block data in memory
Index: linux-2.6.18.8/include/linux/ext3_fs.h
===================================================================
---- linux-2.6.18.8.orig/include/linux/ext3_fs.h 2007-07-17 09:18:14.000000000 +0200
-+++ linux-2.6.18.8/include/linux/ext3_fs.h 2007-07-17 09:18:53.000000000 +0200
+--- linux-2.6.18.8.orig/include/linux/ext3_fs.h
++++ linux-2.6.18.8/include/linux/ext3_fs.h
@@ -17,6 +17,7 @@
#define _LINUX_EXT3_FS_H
@@ -17,6 +17,7 @@
#define _LINUX_EXT3_FS_H
int ext3_forget(handle_t *handle, int is_metadata, struct inode *inode,
Index: linux-2.6.18.8/fs/ext3/super.c
===================================================================
int ext3_forget(handle_t *handle, int is_metadata, struct inode *inode,
Index: linux-2.6.18.8/fs/ext3/super.c
===================================================================
---- linux-2.6.18.8.orig/fs/ext3/super.c 2007-07-17 09:18:14.000000000 +0200
-+++ linux-2.6.18.8/fs/ext3/super.c 2007-07-17 09:18:53.000000000 +0200
+--- linux-2.6.18.8.orig/fs/ext3/super.c
++++ linux-2.6.18.8/fs/ext3/super.c
@@ -688,6 +688,7 @@ enum {
Opt_iopen, Opt_noiopen, Opt_iopen_nopriv,
Opt_grpquota,
@@ -688,6 +688,7 @@ enum {
Opt_iopen, Opt_noiopen, Opt_iopen_nopriv,
Opt_grpquota,
return 0;
Index: linux-2.6.18.8/fs/ext3/extents.c
===================================================================
return 0;
Index: linux-2.6.18.8/fs/ext3/extents.c
===================================================================
---- linux-2.6.18.8.orig/fs/ext3/extents.c 2007-07-17 09:18:14.000000000 +0200
-+++ linux-2.6.18.8/fs/ext3/extents.c 2007-07-17 09:18:53.000000000 +0200
-@@ -795,7 +795,7 @@ cleanup:
+--- linux-2.6.18.8.orig/fs/ext3/extents.c
++++ linux-2.6.18.8/fs/ext3/extents.c
+@@ -801,7 +801,7 @@ cleanup:
for (i = 0; i < depth; i++) {
if (!ablocks[i])
continue;
for (i = 0; i < depth; i++) {
if (!ablocks[i])
continue;
-@@ -1613,7 +1613,7 @@ int ext3_ext_rm_idx(handle_t *handle, st
+@@ -1619,7 +1619,7 @@ int ext3_ext_rm_idx(handle_t *handle, st
ext_debug(inode, "index is empty, remove it, free block %lu\n", leaf);
bh = sb_find_get_block(inode->i_sb, leaf);
ext3_forget(handle, 1, inode, bh, leaf);
ext_debug(inode, "index is empty, remove it, free block %lu\n", leaf);
bh = sb_find_get_block(inode->i_sb, leaf);
ext3_forget(handle, 1, inode, bh, leaf);
-@@ -1672,7 +1672,7 @@ static int ext3_remove_blocks(handle_t *
+@@ -1678,7 +1678,7 @@ static int ext3_remove_blocks(handle_t *
unsigned long from, unsigned long to)
{
struct buffer_head *bh;
unsigned long from, unsigned long to)
{
struct buffer_head *bh;
-@@ -1690,6 +1690,8 @@ static int ext3_remove_blocks(handle_t *
+@@ -1696,6 +1696,8 @@ static int ext3_remove_blocks(handle_t *
spin_unlock(&sbi->s_ext_stats_lock);
}
#endif
spin_unlock(&sbi->s_ext_stats_lock);
}
#endif
if (from >= le32_to_cpu(ex->ee_block)
&& to == le32_to_cpu(ex->ee_block) + le16_to_cpu(ex->ee_len) - 1) {
/* tail removal */
if (from >= le32_to_cpu(ex->ee_block)
&& to == le32_to_cpu(ex->ee_block) + le16_to_cpu(ex->ee_len) - 1) {
/* tail removal */
-@@ -1701,7 +1703,7 @@ static int ext3_remove_blocks(handle_t *
+@@ -1707,7 +1709,7 @@ static int ext3_remove_blocks(handle_t *
bh = sb_find_get_block(inode->i_sb, start + i);
ext3_forget(handle, 0, inode, bh, start + i);
}
bh = sb_find_get_block(inode->i_sb, start + i);
ext3_forget(handle, 0, inode, bh, start + i);
}
} else if (from == le32_to_cpu(ex->ee_block)
&& to <= le32_to_cpu(ex->ee_block) + le16_to_cpu(ex->ee_len) - 1) {
printk("strange request: removal %lu-%lu from %u:%u\n",
} else if (from == le32_to_cpu(ex->ee_block)
&& to <= le32_to_cpu(ex->ee_block) + le16_to_cpu(ex->ee_len) - 1) {
printk("strange request: removal %lu-%lu from %u:%u\n",
-@@ -2034,7 +2036,7 @@ int ext3_ext_get_blocks(handle_t *handle
+@@ -2040,7 +2042,7 @@ int ext3_ext_get_blocks(handle_t *handle
struct ext3_extent newex, *ex;
int goal, newblock, err = 0, depth;
unsigned long allocated = 0;
struct ext3_extent newex, *ex;
int goal, newblock, err = 0, depth;
unsigned long allocated = 0;
__clear_bit(BH_New, &bh_result->b_state);
ext_debug(inode, "blocks %d/%lu requested for inode %u\n", (int) iblock,
__clear_bit(BH_New, &bh_result->b_state);
ext_debug(inode, "blocks %d/%lu requested for inode %u\n", (int) iblock,
-@@ -2116,18 +2118,33 @@ int ext3_ext_get_blocks(handle_t *handle
+@@ -2122,18 +2124,36 @@ int ext3_ext_get_blocks(handle_t *handle
if (S_ISREG(inode->i_mode) && (!EXT3_I(inode)->i_block_alloc_info))
ext3_init_block_alloc_info(inode);
if (S_ISREG(inode->i_mode) && (!EXT3_I(inode)->i_block_alloc_info))
ext3_init_block_alloc_info(inode);
+ ar.goal = ext3_ext_find_goal(inode, path, iblock);
+ ar.logical = iblock;
+ ar.len = allocated;
+ 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(inode, "allocate new block: goal %d, found %d/%lu\n",
+ newblock = ext3_mb_new_blocks(handle, &ar, &err);
if (!newblock)
goto out2;
ext_debug(inode, "allocate new block: goal %d, found %d/%lu\n",
-@@ -2137,12 +2154,16 @@ int ext3_ext_get_blocks(handle_t *handle
+@@ -2143,12 +2163,16 @@ int ext3_ext_get_blocks(handle_t *handle
newex.ee_block = cpu_to_le32(iblock);
newex.ee_start = cpu_to_le32(newblock);
newex.ee_start_hi = 0;
newex.ee_block = cpu_to_le32(iblock);
newex.ee_start = cpu_to_le32(newblock);
newex.ee_start_hi = 0;
-@@ -2151,6 +2172,7 @@ int ext3_ext_get_blocks(handle_t *handle
+@@ -2157,6 +2181,7 @@ int ext3_ext_get_blocks(handle_t *handle
/* previous routine could use block we allocated */
newblock = le32_to_cpu(newex.ee_start);
/* previous routine could use block we allocated */
newblock = le32_to_cpu(newex.ee_start);
__set_bit(BH_New, &bh_result->b_state);
ext3_ext_put_in_cache(inode, iblock, allocated, newblock,
__set_bit(BH_New, &bh_result->b_state);
ext3_ext_put_in_cache(inode, iblock, allocated, newblock,
-@@ -2202,6 +2224,9 @@ void ext3_ext_truncate(struct inode * in
+@@ -2208,6 +2233,9 @@ void ext3_ext_truncate(struct inode * in
mutex_lock(&EXT3_I(inode)->truncate_mutex);
ext3_ext_invalidate_cache(inode);
mutex_lock(&EXT3_I(inode)->truncate_mutex);
ext3_ext_invalidate_cache(inode);
* probably we need not scaning at all,
Index: linux-2.6.18.8/fs/ext3/Makefile
===================================================================
* probably we need not scaning at all,
Index: linux-2.6.18.8/fs/ext3/Makefile
===================================================================
---- linux-2.6.18.8.orig/fs/ext3/Makefile 2007-07-17 09:18:14.000000000 +0200
-+++ linux-2.6.18.8/fs/ext3/Makefile 2007-07-17 09:18:53.000000000 +0200
+--- linux-2.6.18.8.orig/fs/ext3/Makefile
++++ linux-2.6.18.8/fs/ext3/Makefile
@@ -5,7 +5,7 @@
obj-$(CONFIG_EXT3_FS) += ext3.o
@@ -5,7 +5,7 @@
obj-$(CONFIG_EXT3_FS) += ext3.o
ext3-$(CONFIG_EXT3_FS_POSIX_ACL) += acl.o
Index: linux-2.6.18.8/fs/ext3/xattr.c
===================================================================
ext3-$(CONFIG_EXT3_FS_POSIX_ACL) += acl.o
Index: linux-2.6.18.8/fs/ext3/xattr.c
===================================================================
---- linux-2.6.18.8.orig/fs/ext3/xattr.c 2007-02-24 00:52:30.000000000 +0100
-+++ linux-2.6.18.8/fs/ext3/xattr.c 2007-07-17 09:18:53.000000000 +0200
+--- linux-2.6.18.8.orig/fs/ext3/xattr.c
++++ linux-2.6.18.8/fs/ext3/xattr.c
@@ -484,7 +484,7 @@ ext3_xattr_release_block(handle_t *handl
ea_bdebug(bh, "refcount now=0; freeing");
if (ce)
@@ -484,7 +484,7 @@ ext3_xattr_release_block(handle_t *handl
ea_bdebug(bh, "refcount now=0; freeing");
if (ce)
}
Index: linux-2.6.18.8/fs/ext3/balloc.c
===================================================================
}
Index: linux-2.6.18.8/fs/ext3/balloc.c
===================================================================
---- linux-2.6.18.8.orig/fs/ext3/balloc.c 2007-02-24 00:52:30.000000000 +0100
-+++ linux-2.6.18.8/fs/ext3/balloc.c 2007-07-17 09:18:53.000000000 +0200
+--- linux-2.6.18.8.orig/fs/ext3/balloc.c
++++ linux-2.6.18.8/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.
@@ -79,7 +79,7 @@ struct ext3_group_desc * ext3_get_group_
*
* Return buffer_head on success or NULL in case of failure.
unsigned long count = 1;
Index: linux-2.6.18.8/fs/ext3/inode.c
===================================================================
unsigned long count = 1;
Index: linux-2.6.18.8/fs/ext3/inode.c
===================================================================
---- linux-2.6.18.8.orig/fs/ext3/inode.c 2007-07-17 09:18:14.000000000 +0200
-+++ linux-2.6.18.8/fs/ext3/inode.c 2007-07-17 09:18:53.000000000 +0200
+--- linux-2.6.18.8.orig/fs/ext3/inode.c
++++ linux-2.6.18.8/fs/ext3/inode.c
@@ -560,7 +560,7 @@ static int ext3_alloc_blocks(handle_t *h
return ret;
failed_out:
@@ -560,7 +560,7 @@ static int ext3_alloc_blocks(handle_t *h
return ret;
failed_out:
/*
Index: linux-2.6.18.8/fs/ext3/mballoc.c
===================================================================
/*
Index: linux-2.6.18.8/fs/ext3/mballoc.c
===================================================================
---- linux-2.6.18.8.orig/fs/ext3/mballoc.c 2007-07-17 09:18:14.000000000 +0200
-+++ linux-2.6.18.8/fs/ext3/mballoc.c 2007-07-17 09:23:56.000000000 +0200
+--- linux-2.6.18.8.orig/fs/ext3/mballoc.c
++++ linux-2.6.18.8/fs/ext3/mballoc.c
@@ -350,8 +350,8 @@ struct ext3_prealloc_space {
spinlock_t pa_lock;
atomic_t pa_count;
@@ -350,8 +350,8 @@ struct ext3_prealloc_space {
spinlock_t pa_lock;
atomic_t pa_count;
+ fex->fe_start
+ le32_to_cpu(EXT3_SB(sb)->s_es->s_first_data_block);
return block;
+ fex->fe_start
+ le32_to_cpu(EXT3_SB(sb)->s_es->s_first_data_block);
return block;
-@@ -3174,7 +3174,7 @@ void ext3_mb_collect_stats(struct ext3_a
+@@ -3202,7 +3202,7 @@ void ext3_mb_collect_stats(struct ext3_a
void ext3_mb_use_inode_pa(struct ext3_allocation_context *ac,
struct ext3_prealloc_space *pa)
{
void ext3_mb_use_inode_pa(struct ext3_allocation_context *ac,
struct ext3_prealloc_space *pa)
{
/* found preallocated blocks, use them */
start = pa->pa_pstart + (ac->ac_o_ex.fe_logical - pa->pa_lstart);
/* found preallocated blocks, use them */
start = pa->pa_pstart + (ac->ac_o_ex.fe_logical - pa->pa_lstart);
-@@ -4027,13 +4027,13 @@ int ext3_mb_discard_preallocations(struc
+@@ -4053,13 +4053,13 @@ int ext3_mb_discard_preallocations(struc
* it tries to use preallocation first, then falls back
* to usual allocation
*/
* it tries to use preallocation first, then falls back
* to usual allocation
*/
int freed, inquota;
sb = ar->inode->i_sb;
int freed, inquota;
sb = ar->inode->i_sb;
-@@ -4044,8 +4044,8 @@ unsigned long ext3_mb_new_blocks(handle_
+@@ -4070,8 +4070,8 @@ unsigned long ext3_mb_new_blocks(handle_
if (ext3_mballoc_warning++ == 0)
printk(KERN_ERR "EXT3-fs: multiblock request with "
"mballoc disabled!\n");
if (ext3_mballoc_warning++ == 0)
printk(KERN_ERR "EXT3-fs: multiblock request with "
"mballoc disabled!\n");
-@@ -4109,11 +4109,11 @@ out:
+@@ -4135,11 +4135,11 @@ out:
}
EXPORT_SYMBOL(ext3_mb_new_blocks);
}
EXPORT_SYMBOL(ext3_mb_new_blocks);
if (!test_opt(inode->i_sb, MBALLOC)) {
ret = ext3_new_block_old(handle, inode, goal, errp);
if (!test_opt(inode->i_sb, MBALLOC)) {
ret = ext3_new_block_old(handle, inode, goal, errp);
-@@ -4228,8 +4228,8 @@ int ext3_mb_free_metadata(handle_t *hand
+@@ -4254,8 +4254,8 @@ int ext3_mb_free_metadata(handle_t *hand
* Main entry point into mballoc to free blocks
*/
void ext3_mb_free_blocks(handle_t *handle, struct inode *inode,
* Main entry point into mballoc to free blocks
*/
void ext3_mb_free_blocks(handle_t *handle, struct inode *inode,
-Index: linux-2.6.18.8/include/linux/ext3_fs_i.h
+Index: linux-2.6.22.19/include/linux/ext3_fs_i.h
===================================================================
===================================================================
---- linux-2.6.18.8.orig/include/linux/ext3_fs_i.h 2007-07-17 09:18:14.000000000 +0200
-+++ linux-2.6.18.8/include/linux/ext3_fs_i.h 2007-07-17 09:18:53.000000000 +0200
+--- linux-2.6.22.19.orig/include/linux/ext3_fs_i.h
++++ linux-2.6.22.19/include/linux/ext3_fs_i.h
@@ -154,6 +154,10 @@ struct ext3_inode_info {
struct inode vfs_inode;
@@ -154,6 +154,10 @@ struct ext3_inode_info {
struct inode vfs_inode;
};
#endif /* _LINUX_EXT3_FS_I */
};
#endif /* _LINUX_EXT3_FS_I */
-Index: linux-2.6.18.8/include/linux/ext3_fs_sb.h
+Index: linux-2.6.22.19/include/linux/ext3_fs_sb.h
===================================================================
===================================================================
---- linux-2.6.18.8.orig/include/linux/ext3_fs_sb.h 2007-07-17 09:18:14.000000000 +0200
-+++ linux-2.6.18.8/include/linux/ext3_fs_sb.h 2007-07-17 09:18:53.000000000 +0200
+--- linux-2.6.22.19.orig/include/linux/ext3_fs_sb.h
++++ linux-2.6.22.19/include/linux/ext3_fs_sb.h
@@ -21,8 +21,15 @@
#include <linux/wait.h>
#include <linux/blockgroup_lock.h>
@@ -21,8 +21,15 @@
#include <linux/wait.h>
#include <linux/blockgroup_lock.h>
/*
* third extended-fs super-block data in memory
/*
* third extended-fs super-block data in memory
-Index: linux-2.6.18.8/include/linux/ext3_fs.h
+Index: linux-2.6.22.19/include/linux/ext3_fs.h
===================================================================
===================================================================
---- linux-2.6.18.8.orig/include/linux/ext3_fs.h 2007-07-17 09:18:14.000000000 +0200
-+++ linux-2.6.18.8/include/linux/ext3_fs.h 2007-07-17 09:18:53.000000000 +0200
+--- linux-2.6.22.19.orig/include/linux/ext3_fs.h
++++ linux-2.6.22.19/include/linux/ext3_fs.h
@@ -17,6 +17,7 @@
#define _LINUX_EXT3_FS_H
@@ -17,6 +17,7 @@
#define _LINUX_EXT3_FS_H
#include <linux/magic.h>
/*
#include <linux/magic.h>
/*
struct ext3_allocation_request {
struct inode *inode; /* target inode for block we're allocating */
struct ext3_allocation_request {
struct inode *inode; /* target inode for block we're allocating */
unsigned long len; /* how many blocks we want to allocate */
unsigned long flags; /* flags. see above EXT3_MB_HINT_* */
};
unsigned long len; /* how many blocks we want to allocate */
unsigned long flags; /* flags. see above EXT3_MB_HINT_* */
};
-@@ -400,6 +401,7 @@ struct ext3_inode {
+@@ -414,6 +415,7 @@ struct ext3_inode {
#define EXT3_MOUNT_IOPEN_NOPRIV 0x800000/* Make iopen world-readable */
#define EXT3_MOUNT_EXTENTS 0x2000000/* Extents support */
#define EXT3_MOUNT_EXTDEBUG 0x4000000/* Extents debug */
#define EXT3_MOUNT_IOPEN_NOPRIV 0x800000/* Make iopen world-readable */
#define EXT3_MOUNT_EXTENTS 0x2000000/* Extents support */
#define EXT3_MOUNT_EXTDEBUG 0x4000000/* Extents debug */
/* Compatibility, for having both ext2_fs.h and ext3_fs.h included at once */
#ifndef clear_opt
/* Compatibility, for having both ext2_fs.h and ext3_fs.h included at once */
#ifndef clear_opt
-@@ -787,12 +789,12 @@ ext3_group_first_block_no(struct super_b
+@@ -801,12 +803,12 @@ ext3_group_first_block_no(struct super_b
/* balloc.c */
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);
/* balloc.c */
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 void ext3_free_blocks_sb (handle_t *handle, struct super_block *sb,
ext3_fsblk_t block, unsigned long count,
unsigned long *pdquot_freed_blocks);
extern void ext3_free_blocks_sb (handle_t *handle, struct super_block *sb,
ext3_fsblk_t block, unsigned long count,
unsigned long *pdquot_freed_blocks);
-@@ -836,15 +838,45 @@ extern long ext3_mb_stats;
+@@ -850,15 +852,45 @@ extern long ext3_mb_stats;
extern long ext3_mb_max_to_scan;
extern int ext3_mb_init(struct super_block *, int);
extern int ext3_mb_release(struct super_block *);
extern long ext3_mb_max_to_scan;
extern int ext3_mb_init(struct super_block *, int);
extern int ext3_mb_release(struct super_block *);
/* inode.c */
int ext3_forget(handle_t *handle, int is_metadata, struct inode *inode,
/* inode.c */
int ext3_forget(handle_t *handle, int is_metadata, struct inode *inode,
-Index: linux-2.6.18.8/fs/ext3/super.c
+Index: linux-2.6.22.19/fs/ext3/super.c
===================================================================
===================================================================
---- linux-2.6.18.8.orig/fs/ext3/super.c 2007-07-17 09:18:14.000000000 +0200
-+++ linux-2.6.18.8/fs/ext3/super.c 2007-07-17 09:18:53.000000000 +0200
-@@ -688,6 +688,7 @@ enum {
+--- linux-2.6.22.19.orig/fs/ext3/super.c
++++ linux-2.6.22.19/fs/ext3/super.c
+@@ -685,6 +685,7 @@ enum {
Opt_iopen, Opt_noiopen, Opt_iopen_nopriv,
Opt_grpquota,
Opt_extents, Opt_noextents, Opt_extdebug,
Opt_iopen, Opt_noiopen, Opt_iopen_nopriv,
Opt_grpquota,
Opt_extents, Opt_noextents, Opt_extdebug,
};
static match_table_t tokens = {
};
static match_table_t tokens = {
-@@ -743,6 +744,9 @@ static match_table_t tokens = {
+@@ -740,6 +741,9 @@ static match_table_t tokens = {
{Opt_extents, "extents"},
{Opt_noextents, "noextents"},
{Opt_extdebug, "extdebug"},
{Opt_extents, "extents"},
{Opt_noextents, "noextents"},
{Opt_extdebug, "extdebug"},
{Opt_err, NULL},
{Opt_resize, "resize"},
};
{Opt_err, NULL},
{Opt_resize, "resize"},
};
-@@ -1096,6 +1100,19 @@ clear_qf_name:
+@@ -1093,6 +1097,19 @@ clear_qf_name:
case Opt_extdebug:
set_opt (sbi->s_mount_opt, EXTDEBUG);
break;
case Opt_extdebug:
set_opt (sbi->s_mount_opt, EXTDEBUG);
break;
default:
printk (KERN_ERR
"EXT3-fs: Unrecognized mount option \"%s\" "
default:
printk (KERN_ERR
"EXT3-fs: Unrecognized mount option \"%s\" "
-@@ -1826,6 +1843,7 @@ static int ext3_fill_super (struct super
+@@ -1832,6 +1849,7 @@ static int ext3_fill_super (struct super
"writeback");
ext3_ext_init(sb);
"writeback");
ext3_ext_init(sb);
-Index: linux-2.6.18.8/fs/ext3/extents.c
+Index: linux-2.6.22.19/fs/ext3/extents.c
===================================================================
===================================================================
---- linux-2.6.18.8.orig/fs/ext3/extents.c 2007-07-17 09:18:14.000000000 +0200
-+++ linux-2.6.18.8/fs/ext3/extents.c 2007-07-17 09:18:53.000000000 +0200
-@@ -795,7 +795,7 @@ cleanup:
+--- linux-2.6.22.19.orig/fs/ext3/extents.c
++++ linux-2.6.22.19/fs/ext3/extents.c
+@@ -801,7 +801,7 @@ cleanup:
for (i = 0; i < depth; i++) {
if (!ablocks[i])
continue;
for (i = 0; i < depth; i++) {
if (!ablocks[i])
continue;
-@@ -1613,7 +1613,7 @@ int ext3_ext_rm_idx(handle_t *handle, st
+@@ -1619,7 +1619,7 @@ int ext3_ext_rm_idx(handle_t *handle, st
ext_debug(inode, "index is empty, remove it, free block %lu\n", leaf);
bh = sb_find_get_block(inode->i_sb, leaf);
ext3_forget(handle, 1, inode, bh, leaf);
ext_debug(inode, "index is empty, remove it, free block %lu\n", leaf);
bh = sb_find_get_block(inode->i_sb, leaf);
ext3_forget(handle, 1, inode, bh, leaf);
-@@ -1672,7 +1672,7 @@ static int ext3_remove_blocks(handle_t *
+@@ -1678,7 +1678,7 @@ static int ext3_remove_blocks(handle_t *
unsigned long from, unsigned long to)
{
struct buffer_head *bh;
unsigned long from, unsigned long to)
{
struct buffer_head *bh;
-@@ -1690,6 +1690,8 @@ static int ext3_remove_blocks(handle_t *
+@@ -1696,6 +1696,8 @@ static int ext3_remove_blocks(handle_t *
spin_unlock(&sbi->s_ext_stats_lock);
}
#endif
spin_unlock(&sbi->s_ext_stats_lock);
}
#endif
if (from >= le32_to_cpu(ex->ee_block)
&& to == le32_to_cpu(ex->ee_block) + le16_to_cpu(ex->ee_len) - 1) {
/* tail removal */
if (from >= le32_to_cpu(ex->ee_block)
&& to == le32_to_cpu(ex->ee_block) + le16_to_cpu(ex->ee_len) - 1) {
/* tail removal */
-@@ -1701,7 +1703,7 @@ static int ext3_remove_blocks(handle_t *
+@@ -1707,7 +1709,7 @@ static int ext3_remove_blocks(handle_t *
bh = sb_find_get_block(inode->i_sb, start + i);
ext3_forget(handle, 0, inode, bh, start + i);
}
bh = sb_find_get_block(inode->i_sb, start + i);
ext3_forget(handle, 0, inode, bh, start + i);
}
} else if (from == le32_to_cpu(ex->ee_block)
&& to <= le32_to_cpu(ex->ee_block) + le16_to_cpu(ex->ee_len) - 1) {
printk("strange request: removal %lu-%lu from %u:%u\n",
} else if (from == le32_to_cpu(ex->ee_block)
&& to <= le32_to_cpu(ex->ee_block) + le16_to_cpu(ex->ee_len) - 1) {
printk("strange request: removal %lu-%lu from %u:%u\n",
-@@ -2034,7 +2036,7 @@ int ext3_ext_get_blocks(handle_t *handle
+@@ -2040,7 +2042,7 @@ int ext3_ext_get_blocks(handle_t *handle
struct ext3_extent newex, *ex;
int goal, newblock, err = 0, depth;
unsigned long allocated = 0;
struct ext3_extent newex, *ex;
int goal, newblock, err = 0, depth;
unsigned long allocated = 0;
__clear_bit(BH_New, &bh_result->b_state);
ext_debug(inode, "blocks %d/%lu requested for inode %u\n", (int) iblock,
__clear_bit(BH_New, &bh_result->b_state);
ext_debug(inode, "blocks %d/%lu requested for inode %u\n", (int) iblock,
-@@ -2116,18 +2118,33 @@ int ext3_ext_get_blocks(handle_t *handle
+@@ -2122,18 +2124,36 @@ int ext3_ext_get_blocks(handle_t *handle
if (S_ISREG(inode->i_mode) && (!EXT3_I(inode)->i_block_alloc_info))
ext3_init_block_alloc_info(inode);
if (S_ISREG(inode->i_mode) && (!EXT3_I(inode)->i_block_alloc_info))
ext3_init_block_alloc_info(inode);
+ ar.goal = ext3_ext_find_goal(inode, path, iblock);
+ ar.logical = iblock;
+ ar.len = allocated;
+ 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(inode, "allocate new block: goal %d, found %d/%lu\n",
+ newblock = ext3_mb_new_blocks(handle, &ar, &err);
if (!newblock)
goto out2;
ext_debug(inode, "allocate new block: goal %d, found %d/%lu\n",
-@@ -2137,12 +2154,16 @@ int ext3_ext_get_blocks(handle_t *handle
+@@ -2143,12 +2163,16 @@ int ext3_ext_get_blocks(handle_t *handle
newex.ee_block = cpu_to_le32(iblock);
newex.ee_start = cpu_to_le32(newblock);
newex.ee_start_hi = 0;
newex.ee_block = cpu_to_le32(iblock);
newex.ee_start = cpu_to_le32(newblock);
newex.ee_start_hi = 0;
-@@ -2151,6 +2172,7 @@ int ext3_ext_get_blocks(handle_t *handle
+@@ -2157,6 +2181,7 @@ int ext3_ext_get_blocks(handle_t *handle
/* previous routine could use block we allocated */
newblock = le32_to_cpu(newex.ee_start);
/* previous routine could use block we allocated */
newblock = le32_to_cpu(newex.ee_start);
__set_bit(BH_New, &bh_result->b_state);
ext3_ext_put_in_cache(inode, iblock, allocated, newblock,
__set_bit(BH_New, &bh_result->b_state);
ext3_ext_put_in_cache(inode, iblock, allocated, newblock,
-@@ -2202,6 +2224,9 @@ void ext3_ext_truncate(struct inode * in
+@@ -2208,6 +2233,9 @@ void ext3_ext_truncate(struct inode * in
mutex_lock(&EXT3_I(inode)->truncate_mutex);
ext3_ext_invalidate_cache(inode);
mutex_lock(&EXT3_I(inode)->truncate_mutex);
ext3_ext_invalidate_cache(inode);
/*
* TODO: optimization is possible here
* probably we need not scaning at all,
/*
* TODO: optimization is possible here
* probably we need not scaning at all,
-Index: linux-2.6.18.8/fs/ext3/Makefile
+Index: linux-2.6.22.19/fs/ext3/Makefile
===================================================================
===================================================================
---- linux-2.6.18.8.orig/fs/ext3/Makefile 2007-07-17 09:18:14.000000000 +0200
-+++ linux-2.6.18.8/fs/ext3/Makefile 2007-07-17 09:18:53.000000000 +0200
-@@ -5,7 +5,7 @@
+--- linux-2.6.22.19.orig/fs/ext3/Makefile
++++ linux-2.6.22.19/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 \
ioctl.o namei.o super.o symlink.o hash.o resize.o ext3_jbd.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 ext3_jbd.o \
ext3-$(CONFIG_EXT3_FS_XATTR) += xattr.o xattr_user.o xattr_trusted.o
ext3-$(CONFIG_EXT3_FS_POSIX_ACL) += acl.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.18.8/fs/ext3/xattr.c
+Index: linux-2.6.22.19/fs/ext3/xattr.c
===================================================================
===================================================================
---- linux-2.6.18.8.orig/fs/ext3/xattr.c 2007-02-24 00:52:30.000000000 +0100
-+++ linux-2.6.18.8/fs/ext3/xattr.c 2007-07-17 09:18:53.000000000 +0200
-@@ -484,7 +484,7 @@ ext3_xattr_release_block(handle_t *handl
+--- linux-2.6.22.19.orig/fs/ext3/xattr.c
++++ linux-2.6.22.19/fs/ext3/xattr.c
+@@ -488,7 +488,7 @@ ext3_xattr_release_block(handle_t *handl
ea_bdebug(bh, "refcount now=0; freeing");
if (ce)
mb_cache_entry_free(ce);
ea_bdebug(bh, "refcount now=0; freeing");
if (ce)
mb_cache_entry_free(ce);
get_bh(bh);
ext3_forget(handle, 1, inode, bh, bh->b_blocknr);
} else {
get_bh(bh);
ext3_forget(handle, 1, inode, bh, bh->b_blocknr);
} else {
-@@ -805,7 +805,7 @@ inserted:
+@@ -813,7 +813,7 @@ inserted:
new_bh = sb_getblk(sb, block);
if (!new_bh) {
getblk_failed:
new_bh = sb_getblk(sb, block);
if (!new_bh) {
getblk_failed:
error = -EIO;
goto cleanup;
}
error = -EIO;
goto cleanup;
}
-Index: linux-2.6.18.8/fs/ext3/balloc.c
+Index: linux-2.6.22.19/fs/ext3/balloc.c
===================================================================
===================================================================
---- linux-2.6.18.8.orig/fs/ext3/balloc.c 2007-02-24 00:52:30.000000000 +0100
-+++ linux-2.6.18.8/fs/ext3/balloc.c 2007-07-17 09:18:53.000000000 +0200
-@@ -79,7 +79,7 @@ struct ext3_group_desc * ext3_get_group_
+--- linux-2.6.22.19.orig/fs/ext3/balloc.c
++++ linux-2.6.22.19/fs/ext3/balloc.c
+@@ -90,7 +90,7 @@ struct ext3_group_desc * ext3_get_group_
*
* Return buffer_head on success or NULL in case of failure.
*/
*
* Return buffer_head on success or NULL in case of failure.
*/
read_block_bitmap(struct super_block *sb, unsigned int block_group)
{
struct ext3_group_desc * desc;
read_block_bitmap(struct super_block *sb, unsigned int block_group)
{
struct ext3_group_desc * desc;
-@@ -294,6 +294,8 @@ void ext3_discard_reservation(struct ino
+@@ -391,6 +391,8 @@ void ext3_discard_reservation(struct ino
struct ext3_reserve_window_node *rsv;
spinlock_t *rsv_lock = &EXT3_SB(inode->i_sb)->s_rsv_window_lock;
struct ext3_reserve_window_node *rsv;
spinlock_t *rsv_lock = &EXT3_SB(inode->i_sb)->s_rsv_window_lock;
+@@ -602,19 +604,24 @@ error_return:
* @count: number of blocks to count
*/
void ext3_free_blocks(handle_t *handle, struct inode *inode,
* @count: number of blocks to count
*/
void ext3_free_blocks(handle_t *handle, struct inode *inode,
-@@ -1199,7 +1205,7 @@ int ext3_should_retry_alloc(struct super
- * bitmap, and then for any free bit if that fails.
- * This function also updates quota and i_blocks field.
+@@ -1403,7 +1410,7 @@ int ext3_should_retry_alloc(struct super
+ * any specific goal block.
+ *
*/
-ext3_fsblk_t ext3_new_blocks(handle_t *handle, struct inode *inode,
+ext3_fsblk_t ext3_new_blocks_old(handle_t *handle, struct inode *inode,
ext3_fsblk_t goal, unsigned long *count, int *errp)
{
struct buffer_head *bitmap_bh = NULL;
*/
-ext3_fsblk_t ext3_new_blocks(handle_t *handle, struct inode *inode,
+ext3_fsblk_t ext3_new_blocks_old(handle_t *handle, struct inode *inode,
ext3_fsblk_t goal, unsigned long *count, int *errp)
{
struct buffer_head *bitmap_bh = NULL;
-@@ -1463,7 +1469,7 @@ out:
+@@ -1666,7 +1673,7 @@ out:
ext3_fsblk_t goal, int *errp)
{
unsigned long count = 1;
ext3_fsblk_t goal, int *errp)
{
unsigned long count = 1;
-Index: linux-2.6.18.8/fs/ext3/inode.c
+Index: linux-2.6.22.19/fs/ext3/inode.c
===================================================================
===================================================================
---- linux-2.6.18.8.orig/fs/ext3/inode.c 2007-07-17 09:18:14.000000000 +0200
-+++ linux-2.6.18.8/fs/ext3/inode.c 2007-07-17 09:18:53.000000000 +0200
+--- linux-2.6.22.19.orig/fs/ext3/inode.c
++++ linux-2.6.22.19/fs/ext3/inode.c
@@ -560,7 +560,7 @@ static int ext3_alloc_blocks(handle_t *h
return ret;
failed_out:
@@ -560,7 +560,7 @@ static int ext3_alloc_blocks(handle_t *h
return ret;
failed_out:
-@@ -1996,7 +1997,7 @@ static void ext3_clear_blocks(handle_t *
+@@ -1988,7 +1989,7 @@ static void ext3_clear_blocks(handle_t *
-@@ -2169,7 +2170,7 @@ static void ext3_free_branches(handle_t
+@@ -2161,7 +2162,7 @@ static void ext3_free_branches(handle_t
ext3_journal_test_restart(handle, inode);
}
ext3_journal_test_restart(handle, inode);
}
-Index: linux-2.6.18.8/fs/ext3/mballoc.c
+Index: linux-2.6.22.19/fs/ext3/mballoc.c
===================================================================
===================================================================
---- linux-2.6.18.8.orig/fs/ext3/mballoc.c 2007-07-17 09:18:14.000000000 +0200
-+++ linux-2.6.18.8/fs/ext3/mballoc.c 2007-07-17 09:23:56.000000000 +0200
-@@ -307,7 +307,7 @@
+--- linux-2.6.22.19.orig/fs/ext3/mballoc.c
++++ linux-2.6.22.19/fs/ext3/mballoc.c
+@@ -305,7 +305,7 @@
*/
#define MB_DEFAULT_STRIPE 256
*/
#define MB_DEFAULT_STRIPE 256
+ fex->fe_start
+ le32_to_cpu(EXT3_SB(sb)->s_es->s_first_data_block);
return block;
+ fex->fe_start
+ le32_to_cpu(EXT3_SB(sb)->s_es->s_first_data_block);
return block;
-@@ -3174,7 +3174,7 @@ void ext3_mb_collect_stats(struct ext3_a
+@@ -3202,7 +3202,7 @@ void ext3_mb_collect_stats(struct ext3_a
void ext3_mb_use_inode_pa(struct ext3_allocation_context *ac,
struct ext3_prealloc_space *pa)
{
void ext3_mb_use_inode_pa(struct ext3_allocation_context *ac,
struct ext3_prealloc_space *pa)
{
/* found preallocated blocks, use them */
start = pa->pa_pstart + (ac->ac_o_ex.fe_logical - pa->pa_lstart);
/* found preallocated blocks, use them */
start = pa->pa_pstart + (ac->ac_o_ex.fe_logical - pa->pa_lstart);
-@@ -4027,13 +4027,13 @@ int ext3_mb_discard_preallocations(struc
+@@ -4053,13 +4053,13 @@ int ext3_mb_discard_preallocations(struc
* it tries to use preallocation first, then falls back
* to usual allocation
*/
* it tries to use preallocation first, then falls back
* to usual allocation
*/
int freed, inquota;
sb = ar->inode->i_sb;
int freed, inquota;
sb = ar->inode->i_sb;
-@@ -4044,8 +4044,8 @@ unsigned long ext3_mb_new_blocks(handle_
+@@ -4070,8 +4070,8 @@ unsigned long ext3_mb_new_blocks(handle_
if (ext3_mballoc_warning++ == 0)
printk(KERN_ERR "EXT3-fs: multiblock request with "
"mballoc disabled!\n");
if (ext3_mballoc_warning++ == 0)
printk(KERN_ERR "EXT3-fs: multiblock request with "
"mballoc disabled!\n");
-@@ -4109,11 +4109,11 @@ out:
+@@ -4135,11 +4135,11 @@ out:
}
EXPORT_SYMBOL(ext3_mb_new_blocks);
}
EXPORT_SYMBOL(ext3_mb_new_blocks);
if (!test_opt(inode->i_sb, MBALLOC)) {
ret = ext3_new_block_old(handle, inode, goal, errp);
if (!test_opt(inode->i_sb, MBALLOC)) {
ret = ext3_new_block_old(handle, inode, goal, errp);
-@@ -4228,8 +4228,8 @@ int ext3_mb_free_metadata(handle_t *hand
+@@ -4254,8 +4254,8 @@ int ext3_mb_free_metadata(handle_t *hand
* Main entry point into mballoc to free blocks
*/
void ext3_mb_free_blocks(handle_t *handle, struct inode *inode,
* Main entry point into mballoc to free blocks
*/
void ext3_mb_free_blocks(handle_t *handle, struct inode *inode,
-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;
@@ -130,6 +130,10 @@ struct ext3_inode_info {
struct inode vfs_inode;
};
#endif /* _LINUX_EXT3_FS_I */
};
#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>
@@ -23,9 +23,16 @@
#define EXT_INCLUDE
#include <linux/blockgroup_lock.h>
/*
* third extended-fs super-block data in memory
/*
* 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 */
@@ -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
/* 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 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 *);
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,
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 = {
};
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_noextents, "noextents"},
{Opt_extdebug, "extdebug"},
{Opt_barrier, "barrier=%u"},
{Opt_err, NULL},
{Opt_resize, "resize"},
};
{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;
case Opt_extdebug:
set_opt (sbi->s_mount_opt, EXTDEBUG);
break;
default:
printk (KERN_ERR
"EXT3-fs: Unrecognized mount option \"%s\" "
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);
ext3_count_dirs(sb));
ext3_ext_init(sb);
-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;
for (i = 0; i < depth; i++) {
if (!ablocks[i])
continue;
-@@ -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);
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);
-@@ -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;
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;
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);
}
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);
} 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;
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);
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,
+ ar.goal = ext3_ext_find_goal(inode, path, iblock);
+ ar.logical = iblock;
+ ar.len = allocated;
+ 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",
+ 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;
newex.ee_block = iblock;
newex.ee_start = newblock;
newex.ee_start_hi = 0;
-@@ -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;
/* 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,
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);
down(&EXT3_I(inode)->truncate_sem);
ext3_ext_invalidate_cache(&tree);
/*
* TODO: optimization is possible here
* probably we need not scaning at all,
/*
* 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 \
@@ -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
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) {
@@ -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 {
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.
@@ -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;
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);
}
@@ -572,7 +572,7 @@ static int ext3_alloc_branch(handle_t *h
ext3_journal_forget(handle, branch[i].bh);
}
-Index: linux-2.6.16.27-0.9-full/include/linux/ext3_fs_i.h
+Index: linux-2.6.16.46-0.14/include/linux/ext3_fs_i.h
===================================================================
===================================================================
---- linux-2.6.16.27-0.9-full.orig/include/linux/ext3_fs_i.h 2007-03-28 05:12:50.000000000 +0400
-+++ linux-2.6.16.27-0.9-full/include/linux/ext3_fs_i.h 2007-03-28 16:03:20.000000000 +0400
+--- linux-2.6.16.46-0.14.orig/include/linux/ext3_fs_i.h
++++ linux-2.6.16.46-0.14/include/linux/ext3_fs_i.h
@@ -135,6 +135,10 @@ struct ext3_inode_info {
struct inode vfs_inode;
@@ -135,6 +135,10 @@ struct ext3_inode_info {
struct inode vfs_inode;
};
#endif /* _LINUX_EXT3_FS_I */
};
#endif /* _LINUX_EXT3_FS_I */
-Index: linux-2.6.16.27-0.9-full/include/linux/ext3_fs_sb.h
+Index: linux-2.6.16.46-0.14/include/linux/ext3_fs_sb.h
===================================================================
===================================================================
---- linux-2.6.16.27-0.9-full.orig/include/linux/ext3_fs_sb.h 2007-03-28 16:03:19.000000000 +0400
-+++ linux-2.6.16.27-0.9-full/include/linux/ext3_fs_sb.h 2007-03-28 16:03:20.000000000 +0400
+--- linux-2.6.16.46-0.14.orig/include/linux/ext3_fs_sb.h
++++ linux-2.6.16.46-0.14/include/linux/ext3_fs_sb.h
@@ -21,8 +21,15 @@
#include <linux/wait.h>
#include <linux/blockgroup_lock.h>
@@ -21,8 +21,15 @@
#include <linux/wait.h>
#include <linux/blockgroup_lock.h>
/*
* third extended-fs super-block data in memory
/*
* third extended-fs super-block data in memory
-Index: linux-2.6.16.27-0.9-full/include/linux/ext3_fs.h
+Index: linux-2.6.16.46-0.14/include/linux/ext3_fs.h
===================================================================
===================================================================
---- linux-2.6.16.27-0.9-full.orig/include/linux/ext3_fs.h 2007-03-28 16:03:19.000000000 +0400
-+++ linux-2.6.16.27-0.9-full/include/linux/ext3_fs.h 2007-03-28 16:03:20.000000000 +0400
+--- linux-2.6.16.46-0.14.orig/include/linux/ext3_fs.h
++++ linux-2.6.16.46-0.14/include/linux/ext3_fs.h
@@ -407,6 +407,7 @@ struct ext3_inode {
#define EXT3_MOUNT_IOPEN_NOPRIV 0x800000/* Make iopen world-readable */
#define EXT3_MOUNT_EXTENTS 0x1000000/* Extents support */
@@ -407,6 +407,7 @@ struct ext3_inode {
#define EXT3_MOUNT_IOPEN_NOPRIV 0x800000/* Make iopen world-readable */
#define EXT3_MOUNT_EXTENTS 0x1000000/* Extents support */
/* Compatibility, for having both ext2_fs.h and ext3_fs.h included at once */
#ifndef clear_opt
/* Compatibility, for having both ext2_fs.h and ext3_fs.h included at once */
#ifndef clear_opt
-@@ -767,8 +768,9 @@ struct dir_private_info {
+@@ -784,8 +785,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 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 *);
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.16.27-0.9-full/fs/ext3/super.c
+Index: linux-2.6.16.46-0.14/fs/ext3/super.c
===================================================================
===================================================================
---- linux-2.6.16.27-0.9-full.orig/fs/ext3/super.c 2007-03-28 16:03:19.000000000 +0400
-+++ linux-2.6.16.27-0.9-full/fs/ext3/super.c 2007-03-28 16:03:20.000000000 +0400
-@@ -688,6 +688,7 @@ enum {
+--- linux-2.6.16.46-0.14.orig/fs/ext3/super.c
++++ linux-2.6.16.46-0.14/fs/ext3/super.c
+@@ -685,6 +685,7 @@ enum {
Opt_ignore, Opt_barrier, Opt_err, Opt_resize, Opt_usrquota,
Opt_iopen, Opt_noiopen, Opt_iopen_nopriv,
Opt_extents, Opt_noextents, Opt_extdebug,
Opt_ignore, Opt_barrier, Opt_err, Opt_resize, Opt_usrquota,
Opt_iopen, Opt_noiopen, Opt_iopen_nopriv,
Opt_extents, Opt_noextents, Opt_extdebug,
-@@ -743,6 +744,9 @@ static match_table_t tokens = {
+@@ -740,6 +741,9 @@ static match_table_t tokens = {
{Opt_noextents, "noextents"},
{Opt_extdebug, "extdebug"},
{Opt_barrier, "barrier=%u"},
{Opt_noextents, "noextents"},
{Opt_extdebug, "extdebug"},
{Opt_barrier, "barrier=%u"},
{Opt_err, NULL},
{Opt_resize, "resize"},
};
{Opt_err, NULL},
{Opt_resize, "resize"},
};
-@@ -1092,6 +1096,19 @@ clear_qf_name:
+@@ -1089,6 +1093,19 @@ clear_qf_name:
case Opt_extdebug:
set_opt (sbi->s_mount_opt, EXTDEBUG);
break;
case Opt_extdebug:
set_opt (sbi->s_mount_opt, EXTDEBUG);
break;
default:
printk (KERN_ERR
"EXT3-fs: Unrecognized mount option \"%s\" "
default:
printk (KERN_ERR
"EXT3-fs: Unrecognized mount option \"%s\" "
-@@ -1819,6 +1836,7 @@ static int ext3_fill_super (struct super
+@@ -1820,6 +1837,7 @@ static int ext3_fill_super (struct super
ext3_count_dirs(sb));
ext3_ext_init(sb);
ext3_count_dirs(sb));
ext3_ext_init(sb);
-Index: linux-2.6.16.27-0.9-full/fs/ext3/extents.c
+Index: linux-2.6.16.46-0.14/fs/ext3/extents.c
===================================================================
===================================================================
---- linux-2.6.16.27-0.9-full.orig/fs/ext3/extents.c 2007-03-28 05:13:39.000000000 +0400
-+++ linux-2.6.16.27-0.9-full/fs/ext3/extents.c 2007-03-28 16:03:20.000000000 +0400
-@@ -779,7 +779,7 @@ cleanup:
+--- linux-2.6.16.46-0.14.orig/fs/ext3/extents.c
++++ linux-2.6.16.46-0.14/fs/ext3/extents.c
+@@ -819,7 +819,7 @@ cleanup:
for (i = 0; i < depth; i++) {
if (!ablocks[i])
continue;
for (i = 0; i < depth; i++) {
if (!ablocks[i])
continue;
-@@ -1586,7 +1586,7 @@ int ext3_ext_rm_idx(handle_t *handle, st
+@@ -1629,7 +1629,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);
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);
-@@ -2071,10 +2071,12 @@ ext3_remove_blocks(struct ext3_extents_t
+@@ -2128,10 +2128,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;
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;
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
+@@ -2143,7 +2145,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);
}
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);
} 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,
+@@ -2234,11 +2236,8 @@ int ext3_ext_get_block(handle_t *handle,
struct ext3_extent *ex;
int goal, newblock, err = 0, depth;
struct ext3_extents_tree tree;
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);
clear_buffer_new(bh_result);
ext3_init_tree_desc(&tree, inode);
-@@ -2253,18 +2252,33 @@ int ext3_ext_get_block(handle_t *handle,
+@@ -2310,18 +2309,36 @@ int ext3_ext_get_block(handle_t *handle,
+ ar.goal = ext3_ext_find_goal(inode, path, iblock);
+ ar.logical = iblock;
+ ar.len = allocated;
+ 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",
+ 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,
+@@ -2331,11 +2348,14 @@ int ext3_ext_get_block(handle_t *handle,
newex.ee_block = iblock;
newex.ee_start = newblock;
newex.ee_start_hi = 0;
newex.ee_block = iblock;
newex.ee_start = newblock;
newex.ee_start_hi = 0;
-@@ -2287,6 +2304,7 @@ int ext3_ext_get_block(handle_t *handle,
+@@ -2344,6 +2364,7 @@ int ext3_ext_get_block(handle_t *handle,
/* previous routine could use block we allocated */
newblock = newex.ee_start;
/* 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,
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
+@@ -2396,6 +2417,9 @@ void ext3_ext_truncate(struct inode * in
down(&EXT3_I(inode)->truncate_sem);
ext3_ext_invalidate_cache(&tree);
down(&EXT3_I(inode)->truncate_sem);
ext3_ext_invalidate_cache(&tree);
/*
* TODO: optimization is possible here
* probably we need not scaning at all,
/*
* TODO: optimization is possible here
* probably we need not scaning at all,
-Index: linux-2.6.16.27-0.9-full/fs/ext3/Makefile
+Index: linux-2.6.16.46-0.14/fs/ext3/Makefile
===================================================================
===================================================================
---- linux-2.6.16.27-0.9-full.orig/fs/ext3/Makefile 2007-03-28 05:12:50.000000000 +0400
-+++ linux-2.6.16.27-0.9-full/fs/ext3/Makefile 2007-03-28 16:03:20.000000000 +0400
+--- linux-2.6.16.46-0.14.orig/fs/ext3/Makefile
++++ linux-2.6.16.46-0.14/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 \
@@ -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
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.16.27-0.9-full/fs/ext3/xattr.c
+Index: linux-2.6.16.46-0.14/fs/ext3/xattr.c
===================================================================
===================================================================
---- linux-2.6.16.27-0.9-full.orig/fs/ext3/xattr.c 2007-03-13 02:56:52.000000000 +0300
-+++ linux-2.6.16.27-0.9-full/fs/ext3/xattr.c 2007-03-28 16:03:20.000000000 +0400
+--- linux-2.6.16.46-0.14.orig/fs/ext3/xattr.c
++++ linux-2.6.16.46-0.14/fs/ext3/xattr.c
@@ -484,7 +484,7 @@ ext3_xattr_release_block(handle_t *handl
ea_bdebug(bh, "refcount now=0; freeing");
if (ce)
@@ -484,7 +484,7 @@ ext3_xattr_release_block(handle_t *handl
ea_bdebug(bh, "refcount now=0; freeing");
if (ce)
error = -EIO;
goto cleanup;
}
error = -EIO;
goto cleanup;
}
-Index: linux-2.6.16.27-0.9-full/fs/ext3/balloc.c
+Index: linux-2.6.16.46-0.14/fs/ext3/balloc.c
===================================================================
===================================================================
---- linux-2.6.16.27-0.9-full.orig/fs/ext3/balloc.c 2007-03-13 02:56:52.000000000 +0300
-+++ linux-2.6.16.27-0.9-full/fs/ext3/balloc.c 2007-03-28 16:03:20.000000000 +0400
+--- linux-2.6.16.46-0.14.orig/fs/ext3/balloc.c
++++ linux-2.6.16.46-0.14/fs/ext3/balloc.c
@@ -80,7 +80,7 @@ struct ext3_group_desc * ext3_get_group_
*
* Return buffer_head on success or NULL in case of failure.
@@ -80,7 +80,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;
unsigned long goal, int *errp)
{
struct buffer_head *bitmap_bh = NULL;
-Index: linux-2.6.16.27-0.9-full/fs/ext3/inode.c
+Index: linux-2.6.16.46-0.14/fs/ext3/inode.c
===================================================================
===================================================================
---- linux-2.6.16.27-0.9-full.orig/fs/ext3/inode.c 2007-03-28 05:13:38.000000000 +0400
-+++ linux-2.6.16.27-0.9-full/fs/ext3/inode.c 2007-03-28 16:03:20.000000000 +0400
-@@ -568,7 +568,7 @@ static int ext3_alloc_branch(handle_t *h
+--- linux-2.6.16.46-0.14.orig/fs/ext3/inode.c
++++ linux-2.6.16.46-0.14/fs/ext3/inode.c
+@@ -569,7 +569,7 @@ static int ext3_alloc_branch(handle_t *h
ext3_journal_forget(handle, branch[i].bh);
}
for (i = 0; i < keys; i++)
ext3_journal_forget(handle, branch[i].bh);
}
for (i = 0; i < keys; i++)
-@@ -1865,7 +1865,7 @@ ext3_clear_blocks(handle_t *handle, stru
+@@ -1866,7 +1866,7 @@ ext3_clear_blocks(handle_t *handle, stru
-@@ -2038,7 +2038,7 @@ static void ext3_free_branches(handle_t
+@@ -2039,7 +2039,7 @@ static void ext3_free_branches(handle_t
ext3_journal_test_restart(handle, inode);
}
ext3_journal_test_restart(handle, inode);
}
-Index: linux-2.6.5-7.283-full/include/linux/ext3_fs_i.h
+Index: linux-2.6.5-7.286/include/linux/ext3_fs_i.h
===================================================================
===================================================================
---- linux-2.6.5-7.283-full.orig/include/linux/ext3_fs_i.h 2007-03-28 02:13:37.000000000 +0400
-+++ linux-2.6.5-7.283-full/include/linux/ext3_fs_i.h 2007-03-28 15:46:02.000000000 +0400
+--- linux-2.6.5-7.286.orig/include/linux/ext3_fs_i.h
++++ linux-2.6.5-7.286/include/linux/ext3_fs_i.h
@@ -131,6 +131,10 @@ struct ext3_inode_info {
struct inode vfs_inode;
@@ -131,6 +131,10 @@ struct ext3_inode_info {
struct inode vfs_inode;
};
#endif /* _LINUX_EXT3_FS_I */
};
#endif /* _LINUX_EXT3_FS_I */
-Index: linux-2.6.5-7.283-full/include/linux/ext3_fs_sb.h
+Index: linux-2.6.5-7.286/include/linux/ext3_fs_sb.h
===================================================================
===================================================================
---- linux-2.6.5-7.283-full.orig/include/linux/ext3_fs_sb.h 2007-03-28 15:46:00.000000000 +0400
-+++ linux-2.6.5-7.283-full/include/linux/ext3_fs_sb.h 2007-03-28 15:46:02.000000000 +0400
+--- linux-2.6.5-7.286.orig/include/linux/ext3_fs_sb.h
++++ linux-2.6.5-7.286/include/linux/ext3_fs_sb.h
@@ -23,9 +23,16 @@
#define EXT_INCLUDE
#include <linux/blockgroup_lock.h>
@@ -23,9 +23,16 @@
#define EXT_INCLUDE
#include <linux/blockgroup_lock.h>
/*
* third extended-fs super-block data in memory
/*
* third extended-fs super-block data in memory
-Index: linux-2.6.5-7.283-full/include/linux/ext3_fs.h
+Index: linux-2.6.5-7.286/include/linux/ext3_fs.h
===================================================================
===================================================================
---- linux-2.6.5-7.283-full.orig/include/linux/ext3_fs.h 2007-03-28 15:46:00.000000000 +0400
-+++ linux-2.6.5-7.283-full/include/linux/ext3_fs.h 2007-03-28 15:46:02.000000000 +0400
+--- linux-2.6.5-7.286.orig/include/linux/ext3_fs.h
++++ linux-2.6.5-7.286/include/linux/ext3_fs.h
@@ -363,6 +363,7 @@ struct ext3_inode {
#define EXT3_MOUNT_IOPEN_NOPRIV 0x100000/* Make iopen world-readable */
#define EXT3_MOUNT_EXTENTS 0x200000/* Extents support */
@@ -363,6 +363,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
/* Compatibility, for having both ext2_fs.h and ext3_fs.h included at once */
#ifndef clear_opt
-@@ -723,8 +724,9 @@ struct dir_private_info {
+@@ -731,8 +732,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 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 unsigned long ext3_count_free_blocks (struct super_block *);
extern void ext3_check_blocks_bitmap (struct super_block *);
extern struct ext3_group_desc * ext3_get_group_desc(struct super_block * sb,
extern unsigned long ext3_count_free_blocks (struct super_block *);
extern void ext3_check_blocks_bitmap (struct super_block *);
extern struct ext3_group_desc * ext3_get_group_desc(struct super_block * sb,
-Index: linux-2.6.5-7.283-full/fs/ext3/super.c
+Index: linux-2.6.5-7.286/fs/ext3/super.c
===================================================================
===================================================================
---- linux-2.6.5-7.283-full.orig/fs/ext3/super.c 2007-03-28 15:46:00.000000000 +0400
-+++ linux-2.6.5-7.283-full/fs/ext3/super.c 2007-03-28 15:46:02.000000000 +0400
-@@ -622,6 +622,7 @@ enum {
+--- linux-2.6.5-7.286.orig/fs/ext3/super.c
++++ linux-2.6.5-7.286/fs/ext3/super.c
+@@ -591,6 +591,7 @@ enum {
Opt_err,
Opt_iopen, Opt_noiopen, Opt_iopen_nopriv,
Opt_extents, Opt_noextents, Opt_extdebug,
Opt_err,
Opt_iopen, Opt_noiopen, Opt_iopen_nopriv,
Opt_extents, Opt_noextents, Opt_extdebug,
};
static match_table_t tokens = {
};
static match_table_t tokens = {
-@@ -669,6 +670,9 @@ static match_table_t tokens = {
+@@ -638,6 +639,9 @@ static match_table_t tokens = {
{Opt_noextents, "noextents"},
{Opt_extdebug, "extdebug"},
{Opt_barrier, "barrier=%u"},
{Opt_noextents, "noextents"},
{Opt_extdebug, "extdebug"},
{Opt_barrier, "barrier=%u"},
-@@ -893,6 +897,19 @@ static int parse_options (char * options
+@@ -862,6 +866,19 @@ static int parse_options (char * options
case Opt_extdebug:
set_opt (sbi->s_mount_opt, EXTDEBUG);
break;
case Opt_extdebug:
set_opt (sbi->s_mount_opt, EXTDEBUG);
break;
default:
printk (KERN_ERR
"EXT3-fs: Unrecognized mount option \"%s\" "
default:
printk (KERN_ERR
"EXT3-fs: Unrecognized mount option \"%s\" "
-@@ -1548,6 +1565,7 @@ static int ext3_fill_super (struct super
+@@ -1515,6 +1532,7 @@ static int ext3_fill_super (struct super
ext3_count_dirs(sb));
ext3_ext_init(sb);
ext3_count_dirs(sb));
ext3_ext_init(sb);
-Index: linux-2.6.5-7.283-full/fs/ext3/extents.c
+Index: linux-2.6.5-7.286/fs/ext3/extents.c
===================================================================
===================================================================
---- linux-2.6.5-7.283-full.orig/fs/ext3/extents.c 2007-03-28 03:18:19.000000000 +0400
-+++ linux-2.6.5-7.283-full/fs/ext3/extents.c 2007-03-28 15:46:02.000000000 +0400
-@@ -779,7 +779,7 @@ cleanup:
+--- linux-2.6.5-7.286.orig/fs/ext3/extents.c
++++ linux-2.6.5-7.286/fs/ext3/extents.c
+@@ -819,7 +819,7 @@ cleanup:
for (i = 0; i < depth; i++) {
if (!ablocks[i])
continue;
for (i = 0; i < depth; i++) {
if (!ablocks[i])
continue;
-@@ -1586,7 +1586,7 @@ int ext3_ext_rm_idx(handle_t *handle, st
+@@ -1629,7 +1629,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);
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);
-@@ -2071,10 +2071,12 @@ ext3_remove_blocks(struct ext3_extents_t
+@@ -2128,10 +2128,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;
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;
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
+@@ -2143,7 +2145,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);
}
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);
} 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,
+@@ -2234,11 +2236,8 @@ int ext3_ext_get_block(handle_t *handle,
struct ext3_extent *ex;
int goal, newblock, err = 0, depth;
struct ext3_extents_tree tree;
struct ext3_extent *ex;
int goal, newblock, err = 0, depth;
struct ext3_extents_tree tree;
__clear_bit(BH_New, &bh_result->b_state);
ext3_init_tree_desc(&tree, inode);
__clear_bit(BH_New, &bh_result->b_state);
ext3_init_tree_desc(&tree, inode);
-@@ -2253,18 +2252,33 @@ int ext3_ext_get_block(handle_t *handle,
+@@ -2310,18 +2309,36 @@ int ext3_ext_get_block(handle_t *handle,
+ ar.goal = ext3_ext_find_goal(inode, path, iblock);
+ ar.logical = iblock;
+ ar.len = allocated;
+ 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",
+ 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,
+@@ -2331,11 +2348,14 @@ int ext3_ext_get_block(handle_t *handle,
newex.ee_block = iblock;
newex.ee_start = newblock;
newex.ee_start_hi = 0;
newex.ee_block = iblock;
newex.ee_start = newblock;
newex.ee_start_hi = 0;
-@@ -2287,6 +2304,7 @@ int ext3_ext_get_block(handle_t *handle,
+@@ -2344,6 +2364,7 @@ int ext3_ext_get_block(handle_t *handle,
/* previous routine could use block we allocated */
newblock = newex.ee_start;
/* previous routine could use block we allocated */
newblock = newex.ee_start;
__set_bit(BH_New, &bh_result->b_state);
ext3_ext_put_in_cache(&tree, newex.ee_block, newex.ee_len,
__set_bit(BH_New, &bh_result->b_state);
ext3_ext_put_in_cache(&tree, newex.ee_block, newex.ee_len,
-@@ -2341,6 +2359,9 @@ void ext3_ext_truncate(struct inode * in
+@@ -2398,6 +2419,9 @@ void ext3_ext_truncate(struct inode * in
down(&EXT3_I(inode)->truncate_sem);
ext3_ext_invalidate_cache(&tree);
down(&EXT3_I(inode)->truncate_sem);
ext3_ext_invalidate_cache(&tree);
/*
* TODO: optimization is possible here
* probably we need not scaning at all,
/*
* TODO: optimization is possible here
* probably we need not scaning at all,
-Index: linux-2.6.5-7.283-full/fs/ext3/Makefile
+Index: linux-2.6.5-7.286/fs/ext3/Makefile
===================================================================
===================================================================
---- linux-2.6.5-7.283-full.orig/fs/ext3/Makefile 2007-03-28 15:27:39.000000000 +0400
-+++ linux-2.6.5-7.283-full/fs/ext3/Makefile 2007-03-28 15:46:02.000000000 +0400
+--- linux-2.6.5-7.286.orig/fs/ext3/Makefile
++++ linux-2.6.5-7.286/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 \
@@ -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
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.5-7.283-full/fs/ext3/xattr.c
+Index: linux-2.6.5-7.286/fs/ext3/xattr.c
===================================================================
===================================================================
---- linux-2.6.5-7.283-full.orig/fs/ext3/xattr.c 2007-03-28 02:13:37.000000000 +0400
-+++ linux-2.6.5-7.283-full/fs/ext3/xattr.c 2007-03-28 15:46:02.000000000 +0400
+--- linux-2.6.5-7.286.orig/fs/ext3/xattr.c
++++ linux-2.6.5-7.286/fs/ext3/xattr.c
@@ -1371,7 +1371,7 @@ ext3_xattr_set_handle2(handle_t *handle,
new_bh = sb_getblk(sb, block);
if (!new_bh) {
@@ -1371,7 +1371,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 {
get_bh(bh);
ext3_forget(handle, 1, inode, bh, EXT3_I(inode)->i_file_acl);
} else {
-Index: linux-2.6.5-7.283-full/fs/ext3/balloc.c
+Index: linux-2.6.5-7.286/fs/ext3/balloc.c
===================================================================
===================================================================
---- linux-2.6.5-7.283-full.orig/fs/ext3/balloc.c 2006-12-01 18:39:48.000000000 +0300
-+++ linux-2.6.5-7.283-full/fs/ext3/balloc.c 2007-03-28 15:46:02.000000000 +0400
+--- linux-2.6.5-7.286.orig/fs/ext3/balloc.c
++++ linux-2.6.5-7.286/fs/ext3/balloc.c
@@ -78,7 +78,7 @@ struct ext3_group_desc * ext3_get_group_
*
* Return buffer_head on success or NULL in case of failure.
@@ -78,7 +78,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;
unsigned long goal, int *errp)
{
struct buffer_head *bitmap_bh = NULL;
-Index: linux-2.6.5-7.283-full/fs/ext3/inode.c
+Index: linux-2.6.5-7.286/fs/ext3/inode.c
===================================================================
===================================================================
---- linux-2.6.5-7.283-full.orig/fs/ext3/inode.c 2007-03-28 02:50:19.000000000 +0400
-+++ linux-2.6.5-7.283-full/fs/ext3/inode.c 2007-03-28 15:46:02.000000000 +0400
+--- linux-2.6.5-7.286.orig/fs/ext3/inode.c
++++ linux-2.6.5-7.286/fs/ext3/inode.c
@@ -574,7 +574,7 @@ static int ext3_alloc_branch(handle_t *h
ext3_journal_forget(handle, branch[i].bh);
}
@@ -574,7 +574,7 @@ static int ext3_alloc_branch(handle_t *h
ext3_journal_forget(handle, branch[i].bh);
}
-@@ -1839,7 +1839,7 @@ ext3_clear_blocks(handle_t *handle, stru
+@@ -1848,7 +1848,7 @@ ext3_clear_blocks(handle_t *handle, stru
-@@ -2010,7 +2010,7 @@ static void ext3_free_branches(handle_t
+@@ -2019,7 +2019,7 @@ static void ext3_free_branches(handle_t
ext3_journal_test_restart(handle, inode);
}
ext3_journal_test_restart(handle, inode);
}