Commit d002ebf1 authored by Eric Sandeen's avatar Eric Sandeen Committed by Theodore Ts'o

ext4: don't pass entire map to check_eofblocks_fl

Since check_eofblocks_fl() only uses the m_lblk portion of the map
structure, we may as well pass that directly, rather than passing the
entire map, which IMHO obfuscates what parameters check_eofblocks_fl()
cares about.  Not a big deal, but seems tidier and less confusing, to
me.
Signed-off-by: default avatarEric Sandeen <sandeen@redhat.com>
Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
parent 1c5b9e90
...@@ -3102,7 +3102,7 @@ static void unmap_underlying_metadata_blocks(struct block_device *bdev, ...@@ -3102,7 +3102,7 @@ static void unmap_underlying_metadata_blocks(struct block_device *bdev,
* Handle EOFBLOCKS_FL flag, clearing it if necessary * Handle EOFBLOCKS_FL flag, clearing it if necessary
*/ */
static int check_eofblocks_fl(handle_t *handle, struct inode *inode, static int check_eofblocks_fl(handle_t *handle, struct inode *inode,
struct ext4_map_blocks *map, ext4_lblk_t lblk,
struct ext4_ext_path *path, struct ext4_ext_path *path,
unsigned int len) unsigned int len)
{ {
...@@ -3132,7 +3132,7 @@ static int check_eofblocks_fl(handle_t *handle, struct inode *inode, ...@@ -3132,7 +3132,7 @@ static int check_eofblocks_fl(handle_t *handle, struct inode *inode,
* this turns out to be false, we can bail out from this * this turns out to be false, we can bail out from this
* function immediately. * function immediately.
*/ */
if (map->m_lblk + len < le32_to_cpu(last_ex->ee_block) + if (lblk + len < le32_to_cpu(last_ex->ee_block) +
ext4_ext_get_actual_len(last_ex)) ext4_ext_get_actual_len(last_ex))
return 0; return 0;
/* /*
...@@ -3188,8 +3188,8 @@ ext4_ext_handle_uninitialized_extents(handle_t *handle, struct inode *inode, ...@@ -3188,8 +3188,8 @@ ext4_ext_handle_uninitialized_extents(handle_t *handle, struct inode *inode,
path); path);
if (ret >= 0) { if (ret >= 0) {
ext4_update_inode_fsync_trans(handle, inode, 1); ext4_update_inode_fsync_trans(handle, inode, 1);
err = check_eofblocks_fl(handle, inode, map, path, err = check_eofblocks_fl(handle, inode, map->m_lblk,
map->m_len); path, map->m_len);
} else } else
err = ret; err = ret;
goto out2; goto out2;
...@@ -3219,7 +3219,8 @@ ext4_ext_handle_uninitialized_extents(handle_t *handle, struct inode *inode, ...@@ -3219,7 +3219,8 @@ ext4_ext_handle_uninitialized_extents(handle_t *handle, struct inode *inode,
ret = ext4_ext_convert_to_initialized(handle, inode, map, path); ret = ext4_ext_convert_to_initialized(handle, inode, map, path);
if (ret >= 0) { if (ret >= 0) {
ext4_update_inode_fsync_trans(handle, inode, 1); ext4_update_inode_fsync_trans(handle, inode, 1);
err = check_eofblocks_fl(handle, inode, map, path, map->m_len); err = check_eofblocks_fl(handle, inode, map->m_lblk, path,
map->m_len);
if (err < 0) if (err < 0)
goto out2; goto out2;
} }
...@@ -3472,7 +3473,7 @@ int ext4_ext_map_blocks(handle_t *handle, struct inode *inode, ...@@ -3472,7 +3473,7 @@ int ext4_ext_map_blocks(handle_t *handle, struct inode *inode,
map->m_flags |= EXT4_MAP_UNINIT; map->m_flags |= EXT4_MAP_UNINIT;
} }
err = check_eofblocks_fl(handle, inode, map, path, ar.len); err = check_eofblocks_fl(handle, inode, map->m_lblk, path, ar.len);
if (err) if (err)
goto out2; goto out2;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment