SCpnt->device->channel, SCpnt->device->id, SCpnt->device->lun, SCpnt->pid, k, flushcount, 
SCpnt->pid, k, flushcount, 
static int reorder(struct hostdata *ha, unsigned long cursec,		   unsigned int ihdlr, unsigned int il[], unsigned int n_ready){	struct scsi_cmnd *SCpnt;	struct mscp *cpp;	unsigned int k, n;	unsigned int rev = 0, s = 1, r = 1;	unsigned int input_only = 1, overlap = 0;	unsigned long sl[n_ready], pl[n_ready], ll[n_ready];	unsigned long maxsec = 0, minsec = ULONG_MAX, seek = 0, iseek = 0;	unsigned long ioseek = 0;	static unsigned int flushcount = 0, batchcount = 0, sortcount = 0;	static unsigned int readycount = 0, ovlcount = 0, inputcount = 0;	static unsigned int readysorted = 0, revcount = 0;	static unsigned long seeksorted = 0, seeknosort = 0;	if (link_statistics && !(++flushcount % link_statistics))		printk("fc %d bc %d ic %d oc %d rc %d rs %d sc %d re %d"		       " av %ldK as %ldK.\n", flushcount, batchcount,		       inputcount, ovlcount, readycount, readysorted, sortcount,		       revcount, seeknosort / (readycount + 1),		       seeksorted / (readycount + 1));	if (n_ready <= 1)		return 0;	for (n = 0; n < n_ready; n++) {		k = il[n];		cpp = &ha->cp[k];		SCpnt = cpp->SCpnt;		if (!cpp->din)			input_only = 0;		if (SCpnt->request->sector < minsec)			minsec = SCpnt->request->sector;		if (SCpnt->request->sector > maxsec)			maxsec = SCpnt->request->sector;		sl[n] = SCpnt->request->sector;		ioseek += SCpnt->request->nr_sectors;		if (!n)			continue;		if (sl[n] < sl[n - 1])			s = 0;		if (sl[n] > sl[n - 1])			r = 0;		if (link_statistics) {			if (sl[n] > sl[n - 1])				seek += sl[n] - sl[n - 1];			else				seek += sl[n - 1] - sl[n];		}	}	if (link_statistics) {		if (cursec > sl[0])			seek += cursec - sl[0];		else			seek += sl[0] - cursec;	}	if (cursec > ((maxsec + minsec) / 2))		rev = 1;	if (ioseek > ((maxsec - minsec) / 2))		rev = 0;	if (!((rev && r) || (!rev && s)))		sort(sl, il, n_ready, rev);	if (!input_only)		for (n = 0; n < n_ready; n++) {			k = il[n];			cpp = &ha->cp[k];			SCpnt = cpp->SCpnt;			ll[n] = SCpnt->request->nr_sectors;			pl[n] = SCpnt->pid;			if (!n)				continue;			if ((sl[n] == sl[n - 1])			    || (!rev && ((sl[n - 1] + ll[n - 1]) > sl[n]))			    || (rev && ((sl[n] + ll[n]) > sl[n - 1])))				overlap = 1;		}	if (overlap)		sort(pl, il, n_ready, 0);	if (link_statistics) {		if (cursec > sl[0])			iseek = cursec - sl[0];		else			iseek = sl[0] - cursec;		batchcount++;		readycount += n_ready;		seeknosort += seek / 1024;		if (input_only)			inputcount++;		if (overlap) {			ovlcount++;			seeksorted += iseek / 1024;		} else			seeksorted += (iseek + maxsec - minsec) / 1024;		if (rev && !r) {			revcount++;			readysorted += n_ready;		}		if (!rev && !s) {			sortcount++;			readysorted += n_ready;		}	}#if defined(DEBUG_LINKED_COMMANDS)	if (link_statistics && (overlap || !(flushcount % link_statistics)))		for (n = 0; n < n_ready; n++) {			k = il[n];			cpp = &ha->cp[k];			SCpnt = cpp->SCpnt;			printk			    ("%s %d.%d:%d pid %ld mb %d fc %d nr %d sec %ld ns %ld"			     " cur %ld s:%c r:%c rev:%c in:%c ov:%c xd %d.\n",			     (ihdlr ? "ihdlr" : "qcomm"),			     SCpnt->device->channel, SCpnt->device->id,			     SCpnt->device->lun, SCpnt->pid, k, flushcount,			     n_ready, SCpnt->request->sector,			     SCpnt->request->nr_sectors, cursec, YESNO(s),			     YESNO(r), YESNO(rev), YESNO(input_only),			     YESNO(overlap), cpp->din);		}#endif	return overlap;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/017560fca496f72ed9dd734ffde63ce39dfe0411/eata.c/clean/drivers/scsi/eata.c