From: Liu Bo Date: Fri, 1 Sep 2017 22:14:28 +0000 (-0600) Subject: Btrfs: move finish_wait out of the loop X-Git-Tag: v5.15~9611^2~121 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=69cc7151ee8055e6bf7241a21211231a1a208abd;p=platform%2Fkernel%2Flinux-starfive.git Btrfs: move finish_wait out of the loop If we're still going to wait after schedule(), we don't have to do finish_wait() to remove our %wait_queue_entry since prepare_to_wait() won't add the same %wait_queue_entry twice. Signed-off-by: Liu Bo Reviewed-by: David Sterba Signed-off-by: David Sterba --- diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 6c7a49f..1d4f8a7 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -622,8 +622,8 @@ static void btrfs_wait_for_no_snapshotting_writes(struct btrfs_root *root) if (writers) schedule(); - finish_wait(&root->subv_writers->wait, &wait); } while (writers); + finish_wait(&root->subv_writers->wait, &wait); } static int create_snapshot(struct btrfs_root *root, struct inode *dir,