diff options
author | Mingming Cao <cmm@us.ibm.com> | 2008-08-20 04:16:05 +0200 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2008-08-20 04:16:05 +0200 |
commit | ee12b630687d510f6f4b6d4acdc4e267fd4adeda (patch) | |
tree | 8dd253073c5e811751bf1bb479fb03f772e42406 /fs/ext4/migrate.c | |
parent | ext4: journal credits calulation cleanup and fix for non-extent writepage (diff) | |
download | linux-ee12b630687d510f6f4b6d4acdc4e267fd4adeda.tar.xz linux-ee12b630687d510f6f4b6d4acdc4e267fd4adeda.zip |
ext4: journal credits reservation fixes for extent file writepage
This patch modified the writepage/write_begin credit calculation for
extent files, to use the credits caculation helper function.
The current calculation of how many index/leaf blocks should be
accounted is too conservetive, it always considered the worse case,
where the tree level is 5, and in the case of multiple chunk
allocations, it always assumed no blocks were dirtied in common across
the allocations. This path uses the accurate depth of the inode with
some extras to calculate the index blocks, and also less conservative in
the case of multiple allocation accounting.
Signed-off-by: Mingming Cao <cmm@us.ibm.com>
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to '')
-rw-r--r-- | fs/ext4/migrate.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/ext4/migrate.c b/fs/ext4/migrate.c index b9e077ba07e9..46fc0b5b12ba 100644 --- a/fs/ext4/migrate.c +++ b/fs/ext4/migrate.c @@ -53,7 +53,8 @@ static int finish_range(handle_t *handle, struct inode *inode, * credit. But below we try to not accumalate too much * of them by restarting the journal. */ - needed = ext4_ext_calc_credits_for_insert(inode, path); + needed = ext4_ext_calc_credits_for_single_extent(inode, + lb->last_block - lb->first_block + 1, path); /* * Make sure the credit we accumalated is not really high |