diff options
author | Theodore Ts'o <tytso@mit.edu> | 2009-08-09 22:01:13 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2009-08-09 22:01:13 -0400 |
commit | 4ba74d00a20256e22f159cb288ff34b587608917 (patch) | |
tree | 6859cf49f8043ec11846e2c8ebc836499e1048c4 /fs/ext4/ext4.h | |
parent | 0ef90db93a4ddfc300af288c2a1bfc1e6c79da64 (diff) | |
download | op-kernel-dev-4ba74d00a20256e22f159cb288ff34b587608917.zip op-kernel-dev-4ba74d00a20256e22f159cb288ff34b587608917.tar.gz |
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>
Diffstat (limited to 'fs/ext4/ext4.h')
-rw-r--r-- | fs/ext4/ext4.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index e267727..70aa951 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h @@ -88,6 +88,8 @@ typedef unsigned int ext4_group_t; #define EXT4_MB_HINT_TRY_GOAL 0x0200 /* blocks already pre-reserved by delayed allocation */ #define EXT4_MB_DELALLOC_RESERVED 0x0400 +/* We are doing stream allocation */ +#define EXT4_MB_STREAM_ALLOC 0x0800 struct ext4_allocation_request { |