wake_up(&fs_info->replace_wait);
}
+#define btrfs_wait_event_io(wq, condition) \
+do { \
+ if (condition) \
+ break; \
+ (void)___wait_event(wq, condition, TASK_UNINTERRUPTIBLE, 0, 0, \
+ io_schedule()); \
+} while (0)
+
void btrfs_bio_counter_inc_blocked(struct btrfs_fs_info *fs_info)
{
- DEFINE_WAIT(wait);
again:
percpu_counter_inc(&fs_info->bio_counter);
if (test_bit(BTRFS_FS_STATE_DEV_REPLACING, &fs_info->fs_state)) {
btrfs_bio_counter_dec(fs_info);
- wait_event(fs_info->replace_wait,
- !test_bit(BTRFS_FS_STATE_DEV_REPLACING,
- &fs_info->fs_state));
+ btrfs_wait_event_io(fs_info->replace_wait,
+ !test_bit(BTRFS_FS_STATE_DEV_REPLACING,
+ &fs_info->fs_state));
goto again;
}