Commit 99ba0c81 authored by Filipe Manana's avatar Filipe Manana Committed by David Sterba

btrfs: use cond_resched_rwlock_write() during inode eviction

At evict_inode_truncate_pages(), instead of manually checking if
rescheduling is needed, then unlock the extent map tree, reschedule and
then write lock again the tree, use the helper cond_resched_rwlock_write()
which does all that.
Signed-off-by: default avatarFilipe Manana <fdmanana@suse.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent f3109e33
...@@ -5305,11 +5305,7 @@ static void evict_inode_truncate_pages(struct inode *inode) ...@@ -5305,11 +5305,7 @@ static void evict_inode_truncate_pages(struct inode *inode)
clear_bit(EXTENT_FLAG_LOGGING, &em->flags); clear_bit(EXTENT_FLAG_LOGGING, &em->flags);
remove_extent_mapping(map_tree, em); remove_extent_mapping(map_tree, em);
free_extent_map(em); free_extent_map(em);
if (need_resched()) { cond_resched_rwlock_write(&map_tree->lock);
write_unlock(&map_tree->lock);
cond_resched();
write_lock(&map_tree->lock);
}
} }
write_unlock(&map_tree->lock); write_unlock(&map_tree->lock);
......
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