@@ -1500,7 +1500,8 @@ static int __es_shrink(struct ext4_sb_info *sbi, int nr_to_scan,
continue;
}
- if (ei == locked_ei || !write_trylock(&ei->i_es_lock)) {
+ if (!list_empty(&ei->i_fc_list) || ei == locked_ei ||
+ !write_trylock(&ei->i_es_lock)) {
nr_skipped++;
continue;
}
@@ -951,7 +951,8 @@ static int ext4_fc_write_inode_data(struct inode *inode, u32 *crc)
while (cur_lblk_off <= new_blk_size) {
map.m_lblk = cur_lblk_off;
map.m_len = new_blk_size - cur_lblk_off + 1;
- ret = ext4_map_blocks(NULL, inode, &map, 0);
+ ret = ext4_map_blocks(NULL, inode, &map,
+ EXT4_GET_BLOCKS_CACHED_NOWAIT);
if (ret < 0)
return -ECANCELED;
This patch moves fc commit path to use extent status tree to lookup logical to physical mappings. In order to preserve the uncommitted entries in the es cache, this patch makes all the inodes on fast commit list as shrinker ineligible. Making the uncommitted entries in es cache to stick around is left as a future enhancement. Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com> --- fs/ext4/extents_status.c | 3 ++- fs/ext4/fast_commit.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)