From d434a96eb3996195fa179a59724a29b8df8a46e5 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Wed, 4 Jun 2008 23:30:01 -0400 Subject: [PATCH] Fix fragile patch so the change to one of multiple functions that look almost identical is modified correctly. --- ext4-use-inode-preallocation-with-noextents.patch | 68 ++++++++++------------- 1 file changed, 30 insertions(+), 38 deletions(-) diff --git a/ext4-use-inode-preallocation-with-noextents.patch b/ext4-use-inode-preallocation-with-noextents.patch index 94b4c019..132f7920 100644 --- a/ext4-use-inode-preallocation-with-noextents.patch +++ b/ext4-use-inode-preallocation-with-noextents.patch @@ -7,19 +7,11 @@ file data blocks from inode prealloc space. Signed-off-by: Aneesh Kumar K.V Signed-off-by: Mingming Cao ---- - fs/ext4/balloc.c | 36 +++++++++++++++++++++++++-- - fs/ext4/ext4.h | 7 +++-- - fs/ext4/extents.c | 2 - - fs/ext4/inode.c | 72 ++++++++++++++++++++++++++++++++++++++++-------------- - fs/ext4/xattr.c | 2 - - 5 files changed, 95 insertions(+), 24 deletions(-) - -Index: linux-2.6.26-rc4/fs/ext4/balloc.c -=================================================================== ---- linux-2.6.26-rc4.orig/fs/ext4/balloc.c 2008-05-29 10:52:30.000000000 -0700 -+++ linux-2.6.26-rc4/fs/ext4/balloc.c 2008-05-29 10:52:31.000000000 -0700 -@@ -1862,7 +1862,7 @@ out: +diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c +index b5a5f1c..b961ad1 100644 +--- a/fs/ext4/balloc.c ++++ b/fs/ext4/balloc.c +@@ -1928,7 +1928,7 @@ out: return 0; } @@ -28,7 +20,7 @@ Index: linux-2.6.26-rc4/fs/ext4/balloc.c ext4_fsblk_t goal, int *errp) { struct ext4_allocation_request ar; -@@ -1881,9 +1881,29 @@ ext4_fsblk_t ext4_new_block(handle_t *ha +@@ -1947,9 +1947,29 @@ ext4_fsblk_t ext4_new_block(handle_t *handle, struct inode *inode, ret = ext4_mb_new_blocks(handle, &ar, errp); return ret; } @@ -59,7 +51,7 @@ Index: linux-2.6.26-rc4/fs/ext4/balloc.c { struct ext4_allocation_request ar; ext4_fsblk_t ret; -@@ -1894,9 +1914,21 @@ ext4_fsblk_t ext4_new_blocks(handle_t *h +@@ -1960,9 +1980,21 @@ ext4_fsblk_t ext4_new_blocks(handle_t *handle, struct inode *inode, } memset(&ar, 0, sizeof(ar)); @@ -81,11 +73,11 @@ Index: linux-2.6.26-rc4/fs/ext4/balloc.c ret = ext4_mb_new_blocks(handle, &ar, errp); *count = ar.len; return ret; -Index: linux-2.6.26-rc4/fs/ext4/ext4.h -=================================================================== ---- linux-2.6.26-rc4.orig/fs/ext4/ext4.h 2008-05-29 10:52:30.000000000 -0700 -+++ linux-2.6.26-rc4/fs/ext4/ext4.h 2008-05-29 10:52:31.000000000 -0700 -@@ -958,10 +958,13 @@ extern ext4_grpblk_t ext4_block_group_of +diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h +index c4aa1ce..b3e62b7 100644 +--- a/fs/ext4/ext4.h ++++ b/fs/ext4/ext4.h +@@ -970,10 +970,13 @@ extern ext4_grpblk_t ext4_block_group_offset(struct super_block *sb, extern int ext4_bg_has_super(struct super_block *sb, ext4_group_t group); extern unsigned long ext4_bg_num_gdb(struct super_block *sb, ext4_group_t group); @@ -101,11 +93,11 @@ Index: linux-2.6.26-rc4/fs/ext4/ext4.h extern ext4_fsblk_t ext4_new_blocks_old(handle_t *handle, struct inode *inode, ext4_fsblk_t goal, unsigned long *count, int *errp); extern void ext4_free_blocks (handle_t *handle, struct inode *inode, -Index: linux-2.6.26-rc4/fs/ext4/extents.c -=================================================================== ---- linux-2.6.26-rc4.orig/fs/ext4/extents.c 2008-05-29 10:52:30.000000000 -0700 -+++ linux-2.6.26-rc4/fs/ext4/extents.c 2008-05-29 10:52:31.000000000 -0700 -@@ -188,7 +188,7 @@ ext4_ext_new_block(handle_t *handle, str +diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c +index 47929c4..5ba81b3 100644 +--- a/fs/ext4/extents.c ++++ b/fs/ext4/extents.c +@@ -188,7 +188,7 @@ ext4_ext_new_block(handle_t *handle, struct inode *inode, ext4_fsblk_t goal, newblock; goal = ext4_ext_find_goal(inode, path, le32_to_cpu(ex->ee_block)); @@ -114,11 +106,11 @@ Index: linux-2.6.26-rc4/fs/ext4/extents.c return newblock; } -Index: linux-2.6.26-rc4/fs/ext4/inode.c -=================================================================== ---- linux-2.6.26-rc4.orig/fs/ext4/inode.c 2008-05-29 10:52:30.000000000 -0700 -+++ linux-2.6.26-rc4/fs/ext4/inode.c 2008-05-29 10:52:31.000000000 -0700 -@@ -508,11 +508,12 @@ static int ext4_blks_to_allocate(Indirec +diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c +index 8d97077..3f4182f 100644 +--- a/fs/ext4/inode.c ++++ b/fs/ext4/inode.c +@@ -508,11 +508,12 @@ static int ext4_blks_to_allocate(Indirect *branch, int k, unsigned long blks, * direct blocks */ static int ext4_alloc_blocks(handle_t *handle, struct inode *inode, @@ -134,7 +126,7 @@ Index: linux-2.6.26-rc4/fs/ext4/inode.c int index = 0; ext4_fsblk_t current_block = 0; int ret = 0; -@@ -525,12 +526,13 @@ static int ext4_alloc_blocks(handle_t *h +@@ -525,12 +526,13 @@ static int ext4_alloc_blocks(handle_t *handle, struct inode *inode, * the first direct block of this branch. That's the * minimum number of blocks need to allocate(required) */ @@ -152,7 +144,7 @@ Index: linux-2.6.26-rc4/fs/ext4/inode.c if (*err) goto failed_out; -@@ -540,16 +542,48 @@ static int ext4_alloc_blocks(handle_t *h +@@ -540,16 +542,48 @@ static int ext4_alloc_blocks(handle_t *handle, struct inode *inode, new_blocks[index++] = current_block++; count--; } @@ -219,7 +211,7 @@ Index: linux-2.6.26-rc4/fs/ext4/inode.c { int blocksize = inode->i_sb->s_blocksize; int i, n = 0; -@@ -595,7 +630,7 @@ static int ext4_alloc_branch(handle_t *h +@@ -595,7 +630,7 @@ static int ext4_alloc_branch(handle_t *handle, struct inode *inode, ext4_fsblk_t new_blocks[4]; ext4_fsblk_t current_block; @@ -228,7 +220,7 @@ Index: linux-2.6.26-rc4/fs/ext4/inode.c *blks, new_blocks, &err); if (err) return err; -@@ -855,8 +890,9 @@ int ext4_get_blocks_handle(handle_t *han +@@ -855,8 +890,9 @@ int ext4_get_blocks_handle(handle_t *handle, struct inode *inode, /* * Block out ext4_truncate while we alter the tree */ @@ -240,10 +232,10 @@ Index: linux-2.6.26-rc4/fs/ext4/inode.c /* * The ext4_splice_branch call will free and forget any buffers -Index: linux-2.6.26-rc4/fs/ext4/xattr.c -=================================================================== ---- linux-2.6.26-rc4.orig/fs/ext4/xattr.c 2008-05-29 10:52:30.000000000 -0700 -+++ linux-2.6.26-rc4/fs/ext4/xattr.c 2008-05-29 10:52:31.000000000 -0700 +diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c +index ff08633..93c5fdc 100644 +--- a/fs/ext4/xattr.c ++++ b/fs/ext4/xattr.c @@ -810,7 +810,7 @@ inserted: /* We need to allocate a new block */ ext4_fsblk_t goal = ext4_group_first_block_no(sb, -- 2.11.4.GIT