diff options
Diffstat (limited to 'drivers/block/pktcdvd.c')
-rw-r--r-- | drivers/block/pktcdvd.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index dc7a8c352da2..83650e00632d 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c | |||
@@ -430,7 +430,7 @@ static void pkt_sysfs_cleanup(void) | |||
430 | /******************************************************************** | 430 | /******************************************************************** |
431 | entries in debugfs | 431 | entries in debugfs |
432 | 432 | ||
433 | /debugfs/pktcdvd[0-7]/ | 433 | /sys/kernel/debug/pktcdvd[0-7]/ |
434 | info | 434 | info |
435 | 435 | ||
436 | *******************************************************************/ | 436 | *******************************************************************/ |
@@ -991,13 +991,15 @@ static void pkt_iosched_process_queue(struct pktcdvd_device *pd) | |||
991 | */ | 991 | */ |
992 | static int pkt_set_segment_merging(struct pktcdvd_device *pd, struct request_queue *q) | 992 | static int pkt_set_segment_merging(struct pktcdvd_device *pd, struct request_queue *q) |
993 | { | 993 | { |
994 | if ((pd->settings.size << 9) / CD_FRAMESIZE <= q->max_phys_segments) { | 994 | if ((pd->settings.size << 9) / CD_FRAMESIZE |
995 | <= queue_max_phys_segments(q)) { | ||
995 | /* | 996 | /* |
996 | * The cdrom device can handle one segment/frame | 997 | * The cdrom device can handle one segment/frame |
997 | */ | 998 | */ |
998 | clear_bit(PACKET_MERGE_SEGS, &pd->flags); | 999 | clear_bit(PACKET_MERGE_SEGS, &pd->flags); |
999 | return 0; | 1000 | return 0; |
1000 | } else if ((pd->settings.size << 9) / PAGE_SIZE <= q->max_phys_segments) { | 1001 | } else if ((pd->settings.size << 9) / PAGE_SIZE |
1002 | <= queue_max_phys_segments(q)) { | ||
1001 | /* | 1003 | /* |
1002 | * We can handle this case at the expense of some extra memory | 1004 | * We can handle this case at the expense of some extra memory |
1003 | * copies during write operations | 1005 | * copies during write operations |
@@ -2657,7 +2659,7 @@ static void pkt_init_queue(struct pktcdvd_device *pd) | |||
2657 | struct request_queue *q = pd->disk->queue; | 2659 | struct request_queue *q = pd->disk->queue; |
2658 | 2660 | ||
2659 | blk_queue_make_request(q, pkt_make_request); | 2661 | blk_queue_make_request(q, pkt_make_request); |
2660 | blk_queue_hardsect_size(q, CD_FRAMESIZE); | 2662 | blk_queue_logical_block_size(q, CD_FRAMESIZE); |
2661 | blk_queue_max_sectors(q, PACKET_MAX_SECTORS); | 2663 | blk_queue_max_sectors(q, PACKET_MAX_SECTORS); |
2662 | blk_queue_merge_bvec(q, pkt_merge_bvec); | 2664 | blk_queue_merge_bvec(q, pkt_merge_bvec); |
2663 | q->queuedata = pd; | 2665 | q->queuedata = pd; |
@@ -2853,6 +2855,11 @@ static struct block_device_operations pktcdvd_ops = { | |||
2853 | .media_changed = pkt_media_changed, | 2855 | .media_changed = pkt_media_changed, |
2854 | }; | 2856 | }; |
2855 | 2857 | ||
2858 | static char *pktcdvd_nodename(struct gendisk *gd) | ||
2859 | { | ||
2860 | return kasprintf(GFP_KERNEL, "pktcdvd/%s", gd->disk_name); | ||
2861 | } | ||
2862 | |||
2856 | /* | 2863 | /* |
2857 | * Set up mapping from pktcdvd device to CD-ROM device. | 2864 | * Set up mapping from pktcdvd device to CD-ROM device. |
2858 | */ | 2865 | */ |
@@ -2905,6 +2912,7 @@ static int pkt_setup_dev(dev_t dev, dev_t* pkt_dev) | |||
2905 | disk->fops = &pktcdvd_ops; | 2912 | disk->fops = &pktcdvd_ops; |
2906 | disk->flags = GENHD_FL_REMOVABLE; | 2913 | disk->flags = GENHD_FL_REMOVABLE; |
2907 | strcpy(disk->disk_name, pd->name); | 2914 | strcpy(disk->disk_name, pd->name); |
2915 | disk->nodename = pktcdvd_nodename; | ||
2908 | disk->private_data = pd; | 2916 | disk->private_data = pd; |
2909 | disk->queue = blk_alloc_queue(GFP_KERNEL); | 2917 | disk->queue = blk_alloc_queue(GFP_KERNEL); |
2910 | if (!disk->queue) | 2918 | if (!disk->queue) |
@@ -3060,6 +3068,7 @@ static const struct file_operations pkt_ctl_fops = { | |||
3060 | static struct miscdevice pkt_misc = { | 3068 | static struct miscdevice pkt_misc = { |
3061 | .minor = MISC_DYNAMIC_MINOR, | 3069 | .minor = MISC_DYNAMIC_MINOR, |
3062 | .name = DRIVER_NAME, | 3070 | .name = DRIVER_NAME, |
3071 | .name = "pktcdvd/control", | ||
3063 | .fops = &pkt_ctl_fops | 3072 | .fops = &pkt_ctl_fops |
3064 | }; | 3073 | }; |
3065 | 3074 | ||