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>
This commit is contained in:
@@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user