static int cdrom_read_cdda_bpc()

in cdrom.c [2165:2191]


static int cdrom_read_cdda_bpc(struct cdrom_device_info *cdi, __u8 __user *ubuf,
			       int lba, int nframes)
{
	int max_frames = (queue_max_sectors(cdi->disk->queue) << 9) /
			  CD_FRAMESIZE_RAW;
	int nr, ret = 0;

	cdi->last_sense = 0;

	while (nframes) {
		if (cdi->cdda_method == CDDA_BPC_SINGLE)
			nr = 1;
		else
			nr = min(nframes, max_frames);

		ret = cdi->ops->read_cdda_bpc(cdi, ubuf, lba, nr,
					      &cdi->last_sense);
		if (ret)
			break;

		nframes -= nr;
		lba += nr;
		ubuf += (nr * CD_FRAMESIZE_RAW);
	}

	return ret;
}