rem: TRACE("PIO READ got %d sect\n", err);
add: TRACE("PIO READ got %ld sect\n", err);
context: flo_read(floppy_cookie *cookie, off_t position, void *data, size_t *numbytes){	status_t err;	size_t len = *numbytes;	size_t bytes_read = 0;	int sectsize = SECTOR_SIZE;	int cylsize = TRACK_SIZE; /* hmm, badly named, it's actually track_size (a cylinder has 2 tracks, one per head) */	const device_geometry *geom = NULL;	ssize_t disk_size = 0;		if (cookie->flp->geometry)		geom = &cookie->flp->geometry->g;	if (geom) {		sectsize = geom->bytes_per_sector;		cylsize = sectsize * geom->sectors_per_track/* * geom->head_count*/;		disk_size = (geom->bytes_per_sector)				* (geom->sectors_per_track)				* (geom->head_count)				* (geom->cylinder_count);	}	if (disk_size <= 0) {		*numbytes = 0;		return B_DEV_NO_MEDIA;	}	if (position > disk_size) {		dprintf(FLO "attempt to seek beyond device end!\n");		*numbytes = 0;		return B_OK;	}	if (position + *numbytes > disk_size) {		dprintf(FLO "attempt to read beyond device end!\n");		*numbytes = (size_t)((off_t)disk_size - position);		if (*numbytes == 0)			return B_OK;	}	// handle partial first block	if ((position % SECTOR_SIZE) != 0) {		size_t toread;		TRACE("read: begin %Ld, %ld\n", position, bytes_read);		err = read_sectors(cookie->flp, position / sectsize, 1);		TRACE("PIO READ got %d sect\n", err);		if (err <= 0) {			*numbytes = 0;			return err;		}		toread = MIN(len, sectsize);		toread = MIN(toread, sectsize - (position % sectsize));		memcpy(data, cookie->flp->master->buffer + position % cylsize/*(sectsize * ) + (position % sectsize)*/, toread);		len -= toread;		bytes_read += toread;		position += toread;	}	// read the middle blocks	while (len >= sectsize) {		TRACE("read: middle %Ld, %ld, %ld\n", position, bytes_read, len);		// try to read as many sectors as we can		err = read_sectors(cookie->flp, position / sectsize, len / sectsize);		TRACE("PIO READ got %d sect\n", err);		if (err <= 0) {			*numbytes = 0;			return err;		}		memcpy(((char *)data) + bytes_read, cookie->flp->master->buffer + position % cylsize, err*sectsize);		len -= err * sectsize;		bytes_read += err * sectsize;		position += err * sectsize;	}	// handle partial last block	if (len > 0 && (len % sectsize) != 0) {		TRACE("read: end %Ld, %ld %ld\n", position, bytes_read, len);		err = read_sectors(cookie->flp, position / sectsize, 1);		TRACE("PIO READ got %d sect\n", err);		if (err <= 0) {			*numbytes = 0;			return err;		}		memcpy(((char *)data) + bytes_read, cookie->flp->master->buffer + position % cylsize, len);		bytes_read += len;		position += len;	}		*numbytes = bytes_read;	return B_OK;}