kernels/linux-2.4.0/drivers/scsi/scsi_merge.c
/*
 * Function:    recount_segments()
 *
 * Purpose:     Recount the number of scatter-gather segments for this request.
 *
 * Arguments:   req     - request that needs recounting.
 *
 * Returns:     Count of the number of SG segments for the request.
 *
 * Lock status: Irrelevant.
 *
 * Notes:	This is only used when we have partially completed requests
 *		and the bit that is leftover is of an indeterminate size.
 *		This can come up if you get a MEDIUM_ERROR, for example,
 *		as we will have "completed" all of the sectors up to and
 *		including the bad sector, and the leftover bit is what
 *		we have to do now.  This tends to be a rare occurrence, so
 *		we aren't busting our butts to instantiate separate versions
 *		of this function for the 4 different flag values.  We
 *		probably should, however.
 */
recount_segments()
Purpose:     Recount the number of scatter-gather segments for this request.

req     - request that needs recounting.

Count of the number of SG segments for the request.

Lock status: Irrelevant.

This is only used when we have partially completed requests
and the bit that is leftover is of an indeterminate size.
This can come up if you get a MEDIUM_ERROR, for example,
as we will have "completed" all of the sectors up to and
including the bad sector, and the leftover bit is what
we have to do now.  This tends to be a rare occurrence, so
we aren't busting our butts to instantiate separate versions
of this function for the 4 different flag values.  We
probably should, however.
recount_segments () Purpose : Recount the number of scatter - gather segments for this request . req - request that needs recounting . Count of the number of SG segments for the request . Lock status : Irrelevant . This is only used when we have partially completed requests and the bit that is leftover is of an indeterminate size . This can come up if you get a MEDIUM_ERROR for example as we will have " completed " all of the sectors up to and including the bad sector and the leftover bit is what we have to do now . This tends to be a rare occurrence so we aren ' t busting our butts to instantiate separate versions of this function for the 4 different flag values . We probably should however .
void
recount_segments(Scsi_Cmnd * SCpnt)
{
	struct request *req;
	struct Scsi_Host *SHpnt;
	Scsi_Device * SDpnt;
	req   = &SCpnt->request;
	SHpnt = SCpnt->host;
	SDpnt = SCpnt->device;
	req->nr_segments = __count_segments(req, 
					    CLUSTERABLE_DEVICE(SHpnt, SDpnt),
					    SHpnt->unchecked_isa_dma, NULL);
}
void recount_segments ( Scsi_Cmnd * SCpnt ) { struct request * req ; struct Scsi_Host * SHpnt ; Scsi_Device * SDpnt ; req = & SCpnt -> request ; SHpnt = SCpnt -> host ; SDpnt = SCpnt -> device ; req -> nr_segments = __count_segments ( req , CLUSTERABLE_DEVICE ( SHpnt , SDpnt ) , SHpnt -> unchecked_isa_dma , NULL ) ; }
Function:    recount_segments()
 Purpose:     Recount the number of scatter-gather segments for this request.
Function : recount_segments () Purpose : Recount the number of scatter - gather segments for this request .