if (!conf->mirrors[ndisk].rdev || !conf->mirrors[ndisk].rdev->in_sync) 
if ((rdev=rcu_dereference(conf->mirrors[ndisk].rdev)) == NULL || !rdev->in_sync) 
static int read_balance(conf_t *conf, r10bio_t *r10_bio){	const unsigned long this_sector = r10_bio->sector;	int disk, slot, nslot;	const int sectors = r10_bio->sectors;	sector_t new_distance, current_distance;	raid10_find_phys(conf, r10_bio);	rcu_read_lock();	/*	 * Check if we can balance. We can balance on the whole	 * device if no resync is going on, or below the resync window.	 * We take the first readable disk when above the resync window.	 */	if (conf->mddev->recovery_cp < MaxSector	    && (this_sector + sectors >= conf->next_resync)) {		/* make sure that disk is operational */		slot = 0;		disk = r10_bio->devs[slot].devnum;		while (!conf->mirrors[disk].rdev ||		       !conf->mirrors[disk].rdev->in_sync) {			slot++;			if (slot == conf->copies) {				slot = 0;				disk = -1;				break;			}			disk = r10_bio->devs[slot].devnum;		}		goto rb_out;	}	/* make sure the disk is operational */	slot = 0;	disk = r10_bio->devs[slot].devnum;	while (!conf->mirrors[disk].rdev ||	       !conf->mirrors[disk].rdev->in_sync) {		slot ++;		if (slot == conf->copies) {			disk = -1;			goto rb_out;		}		disk = r10_bio->devs[slot].devnum;	}	current_distance = abs(r10_bio->devs[slot].addr -			       conf->mirrors[disk].head_position);	/* Find the disk whose head is closest */	for (nslot = slot; nslot < conf->copies; nslot++) {		int ndisk = r10_bio->devs[nslot].devnum;		if (!conf->mirrors[ndisk].rdev ||		    !conf->mirrors[ndisk].rdev->in_sync)			continue;		if (!atomic_read(&conf->mirrors[ndisk].rdev->nr_pending)) {			disk = ndisk;			slot = nslot;			break;		}		new_distance = abs(r10_bio->devs[nslot].addr -				   conf->mirrors[ndisk].head_position);		if (new_distance < current_distance) {			current_distance = new_distance;			disk = ndisk;			slot = nslot;		}	}rb_out:	r10_bio->read_slot = slot;/*	conf->next_seq_sect = this_sector + sectors;*/	if (disk >= 0 && conf->mirrors[disk].rdev)		atomic_inc(&conf->mirrors[disk].rdev->nr_pending);	rcu_read_unlock();	return disk;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/d6065f7bf8bec170c9c56524a250093ce73ca5d9/raid10.c/buggy/drivers/md/raid10.c