if (rdev2->raid_disk >= 0 && rdev->in_sync && !rdev2->faulty) 
if (rdev2->raid_disk >= 0 && rdev2->in_sync && !rdev2->faulty) 
static void super_90_sync(mddev_t *mddev, mdk_rdev_t *rdev){	mdp_super_t *sb;	struct list_head *tmp;	mdk_rdev_t *rdev2;	int next_spare = mddev->raid_disks;	/* make rdev->sb match mddev data..	 *	 * 1/ zero out disks	 * 2/ Add info for each disk, keeping track of highest desc_nr (next_spare);	 * 3/ any empty disks < next_spare become removed	 *	 * disks[0] gets initialised to REMOVED because	 * we cannot be sure from other fields if it has	 * been initialised or not.	 */	int i;	int active=0, working=0,failed=0,spare=0,nr_disks=0;	rdev->sb_size = MD_SB_BYTES;	sb = (mdp_super_t*)page_address(rdev->sb_page);	memset(sb, 0, sizeof(*sb));	sb->md_magic = MD_SB_MAGIC;	sb->major_version = mddev->major_version;	sb->minor_version = mddev->minor_version;	sb->patch_version = mddev->patch_version;	sb->gvalid_words  = 0; /* ignored */	memcpy(&sb->set_uuid0, mddev->uuid+0, 4);	memcpy(&sb->set_uuid1, mddev->uuid+4, 4);	memcpy(&sb->set_uuid2, mddev->uuid+8, 4);	memcpy(&sb->set_uuid3, mddev->uuid+12,4);	sb->ctime = mddev->ctime;	sb->level = mddev->level;	sb->size  = mddev->size;	sb->raid_disks = mddev->raid_disks;	sb->md_minor = mddev->md_minor;	sb->not_persistent = !mddev->persistent;	sb->utime = mddev->utime;	sb->state = 0;	sb->events_hi = (mddev->events>>32);	sb->events_lo = (u32)mddev->events;	if (mddev->in_sync)	{		sb->recovery_cp = mddev->recovery_cp;		sb->cp_events_hi = (mddev->events>>32);		sb->cp_events_lo = (u32)mddev->events;		if (mddev->recovery_cp == MaxSector)			sb->state = (1<< MD_SB_CLEAN);	} else		sb->recovery_cp = 0;	sb->layout = mddev->layout;	sb->chunk_size = mddev->chunk_size;	if (mddev->bitmap && mddev->bitmap_file == NULL)		sb->state |= (1<<MD_SB_BITMAP_PRESENT);	sb->disks[0].state = (1<<MD_DISK_REMOVED);	ITERATE_RDEV(mddev,rdev2,tmp) {		mdp_disk_t *d;		if (rdev2->raid_disk >= 0 && rdev2->in_sync && !rdev2->faulty)			rdev2->desc_nr = rdev2->raid_disk;		else			rdev2->desc_nr = next_spare++;		d = &sb->disks[rdev2->desc_nr];		nr_disks++;		d->number = rdev2->desc_nr;		d->major = MAJOR(rdev2->bdev->bd_dev);		d->minor = MINOR(rdev2->bdev->bd_dev);		if (rdev2->raid_disk >= 0 && rdev->in_sync && !rdev2->faulty)			d->raid_disk = rdev2->raid_disk;		else			d->raid_disk = rdev2->desc_nr; /* compatibility */		if (rdev2->faulty) {			d->state = (1<<MD_DISK_FAULTY);			failed++;		} else if (rdev2->in_sync) {			d->state = (1<<MD_DISK_ACTIVE);			d->state |= (1<<MD_DISK_SYNC);			active++;			working++;		} else {			d->state = 0;			spare++;			working++;		}		if (test_bit(WriteMostly, &rdev2->flags))			d->state |= (1<<MD_DISK_WRITEMOSTLY);	}		/* now set the "removed" and "faulty" bits on any missing devices */	for (i=0 ; i < mddev->raid_disks ; i++) {		mdp_disk_t *d = &sb->disks[i];		if (d->state == 0 && d->number == 0) {			d->number = i;			d->raid_disk = i;			d->state = (1<<MD_DISK_REMOVED);			d->state |= (1<<MD_DISK_FAULTY);			failed++;		}	}	sb->nr_disks = nr_disks;	sb->active_disks = active;	sb->working_disks = working;	sb->failed_disks = failed;	sb->spare_disks = spare;	sb->this_disk = sb->disks[rdev->desc_nr];	sb->sb_csum = calc_sb_csum(sb);}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/86e6ffdd243a06663713e637ee683fb27dce8e0c/md.c/clean/drivers/md/md.c