Commit 5b552ad7 authored by Harshad Shirwadkar's avatar Harshad Shirwadkar Committed by Theodore Ts'o
Browse files

ext4: drop redundant calls ext4_fc_track_range



ext4_fc_track_range() should only be called when blocks are added or
removed from an inode. So, the only places from where we need to call
this function are ext4_map_blocks(), punch hole, collapse / zero
range, truncate. Remove all the other redundant calls to ths function.

Signed-off-by: default avatarHarshad Shirwadkar <harshadshirwadkar@gmail.com>
Link: https://lore.kernel.org/r/20201106035911.1942128-4-harshadshirwadkar@gmail.com


Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
parent b21ebf14
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -3724,7 +3724,6 @@ static int ext4_convert_unwritten_extents_endio(handle_t *handle,
	err = ext4_ext_dirty(handle, inode, path + path->p_depth);
out:
	ext4_ext_show_leaf(inode, path);
	ext4_fc_track_range(inode, ee_block, ee_block + ee_len - 1);
	return err;
}

@@ -3796,7 +3795,6 @@ convert_initialized_extent(handle_t *handle, struct inode *inode,
	if (*allocated > map->m_len)
		*allocated = map->m_len;
	map->m_len = *allocated;
	ext4_fc_track_range(inode, ee_block, ee_block + ee_len - 1);
	return 0;
}

@@ -4329,7 +4327,6 @@ int ext4_ext_map_blocks(handle_t *handle, struct inode *inode,
	map->m_len = ar.len;
	allocated = map->m_len;
	ext4_ext_show_leaf(inode, path);
	ext4_fc_track_range(inode, map->m_lblk, map->m_lblk + map->m_len - 1);
out:
	ext4_ext_drop_refs(path);
	kfree(path);
@@ -4651,8 +4648,6 @@ long ext4_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
		     FALLOC_FL_COLLAPSE_RANGE | FALLOC_FL_ZERO_RANGE |
		     FALLOC_FL_INSERT_RANGE))
		return -EOPNOTSUPP;
	ext4_fc_track_range(inode, offset >> blkbits,
			(offset + len - 1) >> blkbits);

	ext4_fc_start_update(inode);

+0 −4
Original line number Diff line number Diff line
@@ -6560,10 +6560,6 @@ static ssize_t ext4_quota_write(struct super_block *sb, int type,
	brelse(bh);
out:
	if (inode->i_size < off + len) {
		ext4_fc_track_range(inode,
			(inode->i_size > 0 ? inode->i_size - 1 : 0)
				>> inode->i_sb->s_blocksize_bits,
			(off + len) >> inode->i_sb->s_blocksize_bits);
		i_size_write(inode, off + len);
		EXT4_I(inode)->i_disksize = inode->i_size;
		err2 = ext4_mark_inode_dirty(handle, inode);