/* Special care is needed if the underlying block device has a small max_phys_segments value.  */
static int pkt_set_segment_merging(struct pktcdvd_device *pd, struct request_queue *q)
/* Special care is needed if the underlying block device has a small max_phys_segments value.  */
static int pkt_set_segment_merging(struct pktcdvd_device *pd, struct request_queue *q)
{
	if ((pd->settings.size << 9) / CD_FRAMESIZE
	    <= queue_max_phys_segments(q)) {
		clear_bit(PACKET_MERGE_SEGS, &pd->flags);
		return 0;
	} else if ((pd->settings.size << 9) / PAGE_SIZE
		   <= queue_max_phys_segments(q)) {
		set_bit(PACKET_MERGE_SEGS, &pd->flags);
		return 0;
	} else {
		printk(DRIVER_NAME": cdrom max_phys_segments too small\n");
		return -EIO;
	}
}