if (conf->mddev->bitmap && firstwrite) { sh->bm_seq = conf->seq_write; bitmap_startwrite(conf->mddev->bitmap, sh->sector, STRIPE_SECTORS, 0); set_bit(STRIPE_BIT_DELAY, &sh->state); }  
static int add_stripe_bio(struct stripe_head *sh, struct bio *bi, int dd_idx, int forwrite){	struct bio **bip;	raid5_conf_t *conf = sh->raid_conf;	PRINTK("adding bh b#%llu to stripe s#%llu\n",		(unsigned long long)bi->bi_sector,		(unsigned long long)sh->sector);	spin_lock(&sh->lock);	spin_lock_irq(&conf->device_lock);	if (forwrite)		bip = &sh->dev[dd_idx].towrite;	else		bip = &sh->dev[dd_idx].toread;	while (*bip && (*bip)->bi_sector < bi->bi_sector) {		if ((*bip)->bi_sector + ((*bip)->bi_size >> 9) > bi->bi_sector)			goto overlap;		bip = & (*bip)->bi_next;	}	if (*bip && (*bip)->bi_sector < bi->bi_sector + ((bi->bi_size)>>9))		goto overlap;	if (*bip && bi->bi_next && (*bip) != bi->bi_next)		BUG();	if (*bip)		bi->bi_next = *bip;	*bip = bi;	bi->bi_phys_segments ++;	spin_unlock_irq(&conf->device_lock);	spin_unlock(&sh->lock);	PRINTK("added bi b#%llu to stripe s#%llu, disk %d.\n",		(unsigned long long)bi->bi_sector,		(unsigned long long)sh->sector, dd_idx);	if (forwrite) {		/* check if page is covered */		sector_t sector = sh->dev[dd_idx].sector;		for (bi=sh->dev[dd_idx].towrite;		     sector < sh->dev[dd_idx].sector + STRIPE_SECTORS &&			     bi && bi->bi_sector <= sector;		     bi = r5_next_bio(bi, sh->dev[dd_idx].sector)) {			if (bi->bi_sector + (bi->bi_size>>9) >= sector)				sector = bi->bi_sector + (bi->bi_size>>9);		}		if (sector >= sh->dev[dd_idx].sector + STRIPE_SECTORS)			set_bit(R5_OVERWRITE, &sh->dev[dd_idx].flags);	}	return 1; overlap:	set_bit(R5_Overlap, &sh->dev[dd_idx].flags);	spin_unlock_irq(&conf->device_lock);	spin_unlock(&sh->lock);	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/72626685dc66d455742a7f215a0535c551628b9e/raid5.c/clean/drivers/md/raid5.c