set_current_state(TASK_UNINTERRUPTIBLE); schedule_timeout(1);
schedule_timeout_uninterruptible(1);
static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, int go_faster){	raid6_conf_t *conf = (raid6_conf_t *) mddev->private;	struct stripe_head *sh;	int sectors_per_chunk = conf->chunk_size >> 9;	sector_t x;	unsigned long stripe;	int chunk_offset;	int dd_idx, pd_idx;	sector_t first_sector;	int raid_disks = conf->raid_disks;	int data_disks = raid_disks - 2;	sector_t max_sector = mddev->size << 1;	int sync_blocks;	if (sector_nr >= max_sector) {		/* just being told to finish up .. nothing much to do */		unplug_slaves(mddev);		if (mddev->curr_resync < max_sector) /* aborted */			bitmap_end_sync(mddev->bitmap, mddev->curr_resync,					&sync_blocks, 1);		else /* compelted sync */			conf->fullsync = 0;		bitmap_close_sync(mddev->bitmap);		return 0;	}	/* if there are 2 or more failed drives and we are trying	 * to resync, then assert that we are finished, because there is	 * nothing we can do.	 */	if (mddev->degraded >= 2 && test_bit(MD_RECOVERY_SYNC, &mddev->recovery)) {		sector_t rv = (mddev->size << 1) - sector_nr;		*skipped = 1;		return rv;	}	if (!bitmap_start_sync(mddev->bitmap, sector_nr, &sync_blocks, 1) &&	    !conf->fullsync && sync_blocks >= STRIPE_SECTORS) {		/* we can skip this block, and probably more */		sync_blocks /= STRIPE_SECTORS;		*skipped = 1;		return sync_blocks * STRIPE_SECTORS; /* keep things rounded to whole stripes */	}	x = sector_nr;	chunk_offset = sector_div(x, sectors_per_chunk);	stripe = x;	BUG_ON(x != stripe);	first_sector = raid6_compute_sector((sector_t)stripe*data_disks*sectors_per_chunk		+ chunk_offset, raid_disks, data_disks, &dd_idx, &pd_idx, conf);	sh = get_active_stripe(conf, sector_nr, pd_idx, 1);	if (sh == NULL) {		sh = get_active_stripe(conf, sector_nr, pd_idx, 0);		/* make sure we don't swamp the stripe cache if someone else		 * is trying to get access		 */		set_current_state(TASK_UNINTERRUPTIBLE);		schedule_timeout(1);	}	bitmap_start_sync(mddev->bitmap, sector_nr, &sync_blocks, 0);	spin_lock(&sh->lock);	set_bit(STRIPE_SYNCING, &sh->state);	clear_bit(STRIPE_INSYNC, &sh->state);	spin_unlock(&sh->lock);	handle_stripe(sh);	release_stripe(sh);	return STRIPE_SECTORS;}