aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/extents.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2014-09-04 18:07:25 -0400
committerTheodore Ts'o <tytso@mit.edu>2014-09-04 18:07:25 -0400
commite3cf5d5d9a86df1c5e413bdd3725c25a16ff854c (patch)
tree77a44d159efb7807419e6443584cc67f28929c10 /fs/ext4/extents.c
parenta521100231f816f8cdd9c8e77da14ff1e42c2b17 (diff)
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/extents.c')
-rw-r--r--fs/ext4/extents.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 3ac1686efff8..8170b3254767 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -1933,6 +1933,8 @@ int ext4_ext_insert_extent(handle_t *handle, struct inode *inode,
1933 ext4_lblk_t next; 1933 ext4_lblk_t next;
1934 int mb_flags = 0, unwritten; 1934 int mb_flags = 0, unwritten;
1935 1935
1936 if (gb_flags & EXT4_GET_BLOCKS_DELALLOC_RESERVE)
1937 mb_flags |= EXT4_MB_DELALLOC_RESERVED;
1936 if (unlikely(ext4_ext_get_actual_len(newext) == 0)) { 1938 if (unlikely(ext4_ext_get_actual_len(newext) == 0)) {
1937 EXT4_ERROR_INODE(inode, "ext4_ext_get_actual_len(newext) == 0"); 1939 EXT4_ERROR_INODE(inode, "ext4_ext_get_actual_len(newext) == 0");
1938 return -EIO; 1940 return -EIO;
@@ -2054,7 +2056,7 @@ prepend:
2054 * We're gonna add a new leaf in the tree. 2056 * We're gonna add a new leaf in the tree.
2055 */ 2057 */
2056 if (gb_flags & EXT4_GET_BLOCKS_METADATA_NOFAIL) 2058 if (gb_flags & EXT4_GET_BLOCKS_METADATA_NOFAIL)
2057 mb_flags = EXT4_MB_USE_RESERVED; 2059 mb_flags |= EXT4_MB_USE_RESERVED;
2058 err = ext4_ext_create_new_leaf(handle, inode, mb_flags, gb_flags, 2060 err = ext4_ext_create_new_leaf(handle, inode, mb_flags, gb_flags,
2059 ppath, newext); 2061 ppath, newext);
2060 if (err) 2062 if (err)
@@ -4438,6 +4440,8 @@ int ext4_ext_map_blocks(handle_t *handle, struct inode *inode,
4438 ar.flags = 0; 4440 ar.flags = 0;
4439 if (flags & EXT4_GET_BLOCKS_NO_NORMALIZE) 4441 if (flags & EXT4_GET_BLOCKS_NO_NORMALIZE)
4440 ar.flags |= EXT4_MB_HINT_NOPREALLOC; 4442 ar.flags |= EXT4_MB_HINT_NOPREALLOC;
4443 if (flags & EXT4_GET_BLOCKS_DELALLOC_RESERVE)
4444 ar.flags |= EXT4_MB_DELALLOC_RESERVED;
4441 newblock = ext4_mb_new_blocks(handle, &ar, &err); 4445 newblock = ext4_mb_new_blocks(handle, &ar, &err);
4442 if (!newblock) 4446 if (!newblock)
4443 goto out2; 4447 goto out2;