Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
[safe/jmp/linux-2.6] / drivers / block / pktcdvd.c
index 7cd2973..ddf1942 100644 (file)
@@ -57,6 +57,7 @@
 #include <linux/miscdevice.h>
 #include <linux/freezer.h>
 #include <linux/mutex.h>
+#include <linux/slab.h>
 #include <scsi/scsi_cmnd.h>
 #include <scsi/scsi_ioctl.h>
 #include <scsi/scsi.h>
@@ -284,7 +285,7 @@ static ssize_t kobj_pkt_store(struct kobject *kobj,
        return len;
 }
 
-static struct sysfs_ops kobj_pkt_ops = {
+static const struct sysfs_ops kobj_pkt_ops = {
        .show = kobj_pkt_show,
        .store = kobj_pkt_store
 };
@@ -337,7 +338,9 @@ static void class_pktcdvd_release(struct class *cls)
 {
        kfree(cls);
 }
-static ssize_t class_pktcdvd_show_map(struct class *c, char *data)
+static ssize_t class_pktcdvd_show_map(struct class *c,
+                                       struct class_attribute *attr,
+                                       char *data)
 {
        int n = 0;
        int idx;
@@ -356,7 +359,9 @@ static ssize_t class_pktcdvd_show_map(struct class *c, char *data)
        return n;
 }
 
-static ssize_t class_pktcdvd_store_add(struct class *c, const char *buf,
+static ssize_t class_pktcdvd_store_add(struct class *c,
+                                       struct class_attribute *attr,
+                                       const char *buf,
                                        size_t count)
 {
        unsigned int major, minor;
@@ -376,7 +381,9 @@ static ssize_t class_pktcdvd_store_add(struct class *c, const char *buf,
        return -EINVAL;
 }
 
-static ssize_t class_pktcdvd_store_remove(struct class *c, const char *buf,
+static ssize_t class_pktcdvd_store_remove(struct class *c,
+                                         struct class_attribute *attr,
+                                         const char *buf,
                                        size_t count)
 {
        unsigned int major, minor;
@@ -950,14 +957,14 @@ static void pkt_iosched_process_queue(struct pktcdvd_device *pd)
 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)) {
+           <= queue_max_segments(q)) {
                /*
                 * The cdrom device can handle one segment/frame
                 */
                clear_bit(PACKET_MERGE_SEGS, &pd->flags);
                return 0;
        } else if ((pd->settings.size << 9) / PAGE_SIZE
-                  <= queue_max_phys_segments(q)) {
+                  <= queue_max_segments(q)) {
                /*
                 * We can handle this case at the expense of some extra memory
                 * copies during write operations
@@ -2312,7 +2319,7 @@ static int pkt_open_dev(struct pktcdvd_device *pd, fmode_t write)
                 * even if the size is a multiple of the packet size.
                 */
                spin_lock_irq(q->queue_lock);
-               blk_queue_max_sectors(q, pd->settings.size);
+               blk_queue_max_hw_sectors(q, pd->settings.size);
                spin_unlock_irq(q->queue_lock);
                set_bit(PACKET_WRITABLE, &pd->flags);
        } else {
@@ -2613,7 +2620,7 @@ static void pkt_init_queue(struct pktcdvd_device *pd)
 
        blk_queue_make_request(q, pkt_make_request);
        blk_queue_logical_block_size(q, CD_FRAMESIZE);
-       blk_queue_max_sectors(q, PACKET_MAX_SECTORS);
+       blk_queue_max_hw_sectors(q, PACKET_MAX_SECTORS);
        blk_queue_merge_bvec(q, pkt_merge_bvec);
        q->queuedata = pd;
 }