Btrfs: protect conditions within root->log_mutex while waiting
authorLiu Bo <bo.li.liu@oracle.com>
Fri, 1 Sep 2017 22:14:30 +0000 (16:14 -0600)
committerDavid Sterba <dsterba@suse.com>
Mon, 30 Oct 2017 11:27:55 +0000 (12:27 +0100)
commit49e83f5735cf1aca03ca8b4eadca475c1f3b0b14
tree39541ef4b34a4fcbd9efb91ed90dac62f5567e4c
parent45bac0f3d24a76f127a118e7b95a54e616449d16
Btrfs: protect conditions within root->log_mutex while waiting

Both wait_for_commit() and wait_for_writer() are checking the
condition out of the mutex lock.

This refactors code a bit to be lock safe.

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/tree-log.c