]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: Fix bugs in mballoc's stream allocation mode
authorTheodore Ts'o <tytso@mit.edu>
Mon, 10 Aug 2009 02:01:13 +0000 (22:01 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 10 Aug 2009 02:01:13 +0000 (22:01 -0400)
commit2b66203617324c6a1e676aa08429eb5d80e7f591
tree6859cf49f8043ec11846e2c8ebc836499e1048c4
parent6587f36b360646516a51a6402a8349b7eba67474
ext4: Fix bugs in mballoc's stream allocation mode

The logic around sbi->s_mb_last_group and sbi->s_mb_last_start was all
screwed up.  These fields were getting unconditionally all the time,
set even when stream allocation had not taken place, and if they were
being used when the file was smaller than s_mb_stream_request, which
is when the allocation should _not_ be doing stream allocation.

Fix this by determining whether or not we stream allocation should
take place once, in ext4_mb_group_or_file(), and setting a flag which
gets used in ext4_mb_regular_allocator() and ext4_mb_use_best_found().
This simplifies the code and assures that we are consistently using
(or not using) the stream allocation logic.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs/ext4/ext4.h
fs/ext4/mballoc.c