ext4: drop EXT4_EX_NOFREE_ON_ERR in convert_initialized_extent()

Transfer responsibility of freeing struct ext4_ext_path on error to
ext4_ext_find_extent().

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
This commit is contained in:
Theodore Ts'o 2014-09-01 14:36:09 -04:00
parent e8b83d9303
commit 4f224b8b7b
1 changed files with 5 additions and 5 deletions

View File

@ -3915,9 +3915,10 @@ get_reserved_cluster_alloc(struct inode *inode, ext4_lblk_t lblk_start,
static int static int
convert_initialized_extent(handle_t *handle, struct inode *inode, convert_initialized_extent(handle_t *handle, struct inode *inode,
struct ext4_map_blocks *map, struct ext4_map_blocks *map,
struct ext4_ext_path *path, int flags, struct ext4_ext_path **ppath, int flags,
unsigned int allocated, ext4_fsblk_t newblock) unsigned int allocated, ext4_fsblk_t newblock)
{ {
struct ext4_ext_path *path = *ppath;
struct ext4_extent *ex; struct ext4_extent *ex;
ext4_lblk_t ee_block; ext4_lblk_t ee_block;
unsigned int ee_len; unsigned int ee_len;
@ -3946,8 +3947,7 @@ convert_initialized_extent(handle_t *handle, struct inode *inode,
if (err < 0) if (err < 0)
return err; return err;
ext4_ext_drop_refs(path); ext4_ext_drop_refs(path);
path = ext4_ext_find_extent(inode, map->m_lblk, &path, path = ext4_ext_find_extent(inode, map->m_lblk, ppath, 0);
EXT4_EX_NOFREE_ON_ERR);
if (IS_ERR(path)) if (IS_ERR(path))
return PTR_ERR(path); return PTR_ERR(path);
depth = ext_depth(inode); depth = ext_depth(inode);
@ -4325,8 +4325,8 @@ int ext4_ext_map_blocks(handle_t *handle, struct inode *inode,
if ((!ext4_ext_is_unwritten(ex)) && if ((!ext4_ext_is_unwritten(ex)) &&
(flags & EXT4_GET_BLOCKS_CONVERT_UNWRITTEN)) { (flags & EXT4_GET_BLOCKS_CONVERT_UNWRITTEN)) {
allocated = convert_initialized_extent( allocated = convert_initialized_extent(
handle, inode, map, path, flags, handle, inode, map, &path,
allocated, newblock); flags, allocated, newblock);
goto out2; goto out2;
} else if (!ext4_ext_is_unwritten(ex)) } else if (!ext4_ext_is_unwritten(ex))
goto out; goto out;