Commit 69cc7151 authored by Liu Bo's avatar Liu Bo Committed by David Sterba

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: default avatarLiu Bo <bo.li.liu@oracle.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 219d33b2
...@@ -622,8 +622,8 @@ static void btrfs_wait_for_no_snapshotting_writes(struct btrfs_root *root) ...@@ -622,8 +622,8 @@ static void btrfs_wait_for_no_snapshotting_writes(struct btrfs_root *root)
if (writers) if (writers)
schedule(); schedule();
finish_wait(&root->subv_writers->wait, &wait);
} while (writers); } while (writers);
finish_wait(&root->subv_writers->wait, &wait);
} }
static int create_snapshot(struct btrfs_root *root, struct inode *dir, static int create_snapshot(struct btrfs_root *root, struct inode *dir,
......
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