diff options
author | Theodore Ts'o <tytso@mit.edu> | 2014-09-04 18:07:25 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2014-09-04 18:07:25 -0400 |
commit | e3cf5d5d9a86df1c5e413bdd3725c25a16ff854c (patch) | |
tree | 77a44d159efb7807419e6443584cc67f28929c10 /fs/ext4/indirect.c | |
parent | a521100231f816f8cdd9c8e77da14ff1e42c2b17 (diff) | |
download | linux-e3cf5d5d9a86df1c5e413bdd3725c25a16ff854c.tar.bz2 |
ext4: prepare to drop EXT4_STATE_DELALLOC_RESERVED
The EXT4_STATE_DELALLOC_RESERVED flag was originally implemented
because it was too hard to make sure the mballoc and get_block flags
could be reliably passed down through all of the codepaths that end up
calling ext4_mb_new_blocks().
Since then, we have mb_flags passed down through most of the code
paths, so getting rid of EXT4_STATE_DELALLOC_RESERVED isn't as tricky
as it used to.
This commit plumbs in the last of what is required, and then adds a
WARN_ON check to make sure we haven't missed anything. If this passes
a full regression test run, we can then drop
EXT4_STATE_DELALLOC_RESERVED.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/ext4/indirect.c')
-rw-r--r-- | fs/ext4/indirect.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/ext4/indirect.c b/fs/ext4/indirect.c index 69af0cd64724..36b369697a13 100644 --- a/fs/ext4/indirect.c +++ b/fs/ext4/indirect.c @@ -333,7 +333,9 @@ static int ext4_alloc_branch(handle_t *handle, new_blocks[i] = ext4_mb_new_blocks(handle, ar, &err); } else ar->goal = new_blocks[i] = ext4_new_meta_blocks(handle, - ar->inode, ar->goal, 0, NULL, &err); + ar->inode, ar->goal, + ar->flags & EXT4_MB_DELALLOC_RESERVED, + NULL, &err); if (err) { i--; goto failed; @@ -572,6 +574,8 @@ int ext4_ind_map_blocks(handle_t *handle, struct inode *inode, ar.logical = map->m_lblk; if (S_ISREG(inode->i_mode)) ar.flags = EXT4_MB_HINT_DATA; + if (flags & EXT4_GET_BLOCKS_DELALLOC_RESERVE) + ar.flags |= EXT4_MB_DELALLOC_RESERVED; ar.goal = ext4_find_goal(inode, map->m_lblk, partial); |