fix unit of rs_same_csums accounting
[safe/jmp/linux-2.6] / drivers / block / ub.c
index e67bbae..2e88983 100644 (file)
@@ -393,7 +393,7 @@ static int ub_probe_lun(struct ub_dev *sc, int lnum);
 #define ub_usb_ids  usb_storage_usb_ids
 #else
 
-static struct usb_device_id ub_usb_ids[] = {
+static const struct usb_device_id ub_usb_ids[] = {
        { USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, US_SC_SCSI, US_PR_BULK) },
        { }
 };
@@ -722,7 +722,7 @@ static void ub_cmd_build_block(struct ub_dev *sc, struct ub_lun *lun,
        /*
         * build the command
         *
-        * The call to blk_queue_hardsect_size() guarantees that request
+        * The call to blk_queue_logical_block_size() guarantees that request
         * is aligned, but it is given in terms of 512 byte units, always.
         */
        block = blk_rq_pos(rq) >> lun->capacity.bshift;
@@ -1749,7 +1749,7 @@ static int ub_bd_revalidate(struct gendisk *disk)
        ub_revalidate(lun->udev, lun);
 
        /* XXX Support sector size switching like in sr.c */
-       blk_queue_hardsect_size(disk->queue, lun->capacity.bsize);
+       blk_queue_logical_block_size(disk->queue, lun->capacity.bsize);
        set_capacity(disk, lun->capacity.nsec);
        // set_disk_ro(sdkp->disk, lun->readonly);
 
@@ -1789,7 +1789,7 @@ static int ub_bd_media_changed(struct gendisk *disk)
        return lun->changed;
 }
 
-static struct block_device_operations ub_bd_fops = {
+static const struct block_device_operations ub_bd_fops = {
        .owner          = THIS_MODULE,
        .open           = ub_bd_open,
        .release        = ub_bd_release,
@@ -2320,11 +2320,10 @@ static int ub_probe_lun(struct ub_dev *sc, int lnum)
        disk->queue = q;
 
        blk_queue_bounce_limit(q, BLK_BOUNCE_HIGH);
-       blk_queue_max_hw_segments(q, UB_MAX_REQ_SG);
-       blk_queue_max_phys_segments(q, UB_MAX_REQ_SG);
+       blk_queue_max_segments(q, UB_MAX_REQ_SG);
        blk_queue_segment_boundary(q, 0xffffffff);      /* Dubious. */
-       blk_queue_max_sectors(q, UB_MAX_SECTORS);
-       blk_queue_hardsect_size(q, lun->capacity.bsize);
+       blk_queue_max_hw_sectors(q, UB_MAX_SECTORS);
+       blk_queue_logical_block_size(q, lun->capacity.bsize);
 
        lun->disk = disk;
        q->queuedata = lun;