mirror of
https://github.com/torvalds/linux.git
synced 2026-05-23 22:52:19 +02:00
btrfs: reduce critical section at btrfs_wait_ordered_extents()
At btrfs_wait_ordered_extents(), there's no point in updating the counters after locking the root's ordered extent lock, as the counters are local. So change this to update the counters before taking the lock. Reviewed-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
03103ecf5e
commit
ac1f580c10
|
|
@ -783,10 +783,10 @@ u64 btrfs_wait_ordered_extents(struct btrfs_root *root, u64 nr,
|
|||
btrfs_queue_work(fs_info->flush_workers, &ordered->flush_work);
|
||||
|
||||
cond_resched();
|
||||
spin_lock(&root->ordered_extent_lock);
|
||||
if (nr != U64_MAX)
|
||||
nr--;
|
||||
count++;
|
||||
spin_lock(&root->ordered_extent_lock);
|
||||
}
|
||||
list_splice_tail(&skipped, &root->ordered_extents);
|
||||
list_splice_tail(&splice, &root->ordered_extents);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user