Add ext4-printk-throttling patch
[ext4-patch-queue.git] / JC6-defrag-alloc-contiguous-blks-credit
blob10c07442a77ba4d63b0213a25ae8c317250d73b1
1 This patch should be merged with ext4-online-defrag-alloc-contiguous-blks.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
5 the patch queue.
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>
11 ---
12 Index: linux-2.6.27-rc1/fs/ext4/defrag.c
13 ===================================================================
14 --- linux-2.6.27-rc1.orig/fs/ext4/defrag.c      2008-08-11 17:15:49.000000000 -0700
15 +++ linux-2.6.27-rc1/fs/ext4/defrag.c   2008-08-11 19:46:59.000000000 -0700
16 @@ -186,9 +186,9 @@ ext4_defrag_alloc_blocks(handle_t *handl
17         struct buffer_head *bh = NULL;
18         int err, i, credits = 0;
20 -       credits = ext4_ext_calc_credits_for_insert(dest_inode, dest_path);
21 -       err = ext4_ext_journal_restart(handle,
22 -                               credits + EXT4_TRANS_META_BLOCKS);
23 +       credits = ext4_ext_calc_credits_for_single_extent(dest_inode,
24 +                                                         ar->len, dest_path);
25 +       err = ext4_ext_journal_restart(handle, credits);
26         if (err)
27                 return err;
32 To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
33 the body of a message to majordomo@vger.kernel.org
34 More majordomo info at  http://vger.kernel.org/majordomo-info.html