1 This patch should be merged with ext4-online-defrag-relocate-file-data.patch
3 It originally came from ext4_journal_credits_fix_for_writepages.patch,
4 but was split off when this patch was moved into the stable part of
7 Cc: Akira Fujita <a-fujita@rs.jp.nec.com>
8 Cc: Takashi Sato <t-sato@yk.jp.nec.com>
9 Signed-off-by: Mingming Cao <cmm@us.ibm.com>
10 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
13 Index: linux-2.6.26-git6/fs/ext4/defrag.c
14 ===================================================================
15 --- linux-2.6.26-git6.orig/fs/ext4/defrag.c 2008-07-25 17:39:23.000000000 -0700
16 +++ linux-2.6.26-git6/fs/ext4/defrag.c 2008-07-25 17:39:52.000000000 -0700
17 @@ -1494,7 +1495,7 @@ ext4_defrag_partial(struct inode *tmp_in
18 * It needs twice the amount of ordinary journal buffers because
19 * inode and tmp_inode may change each different metadata blocks.
21 - jblocks = ext4_writepage_trans_blocks(org_inode) * 2;
22 + jblocks = ext4_writepages_trans_blocks(org_inode, 1) * 2;
23 handle = ext4_journal_start(org_inode, jblocks);
25 ret = PTR_ERR(handle);