]> Pileus Git - ~andy/linux/blobdiff - drivers/scsi/st.c
Merge branch 'upstream'
[~andy/linux] / drivers / scsi / st.c
index a93308ae97362b3fa2d0b2a76979ffca3c5da630..770c4324f3d5750e51eae824fd59a985209b9732 100644 (file)
@@ -3577,7 +3577,8 @@ static long st_compat_ioctl(struct file *file, unsigned int cmd, unsigned long a
 static struct st_buffer *
  new_tape_buffer(int from_initialization, int need_dma, int max_sg)
 {
-       int i, priority, got = 0, segs = 0;
+       int i, got = 0, segs = 0;
+       gfp_t priority;
        struct st_buffer *tb;
 
        if (from_initialization)
@@ -3610,7 +3611,8 @@ static struct st_buffer *
 /* Try to allocate enough space in the tape buffer */
 static int enlarge_buffer(struct st_buffer * STbuffer, int new_size, int need_dma)
 {
-       int segs, nbr, max_segs, b_size, priority, order, got;
+       int segs, nbr, max_segs, b_size, order, got;
+       gfp_t priority;
 
        if (new_size <= STbuffer->buffer_size)
                return 1;
@@ -3885,9 +3887,7 @@ static int st_probe(struct device *dev)
        if (SDp->type != TYPE_TAPE)
                return -ENODEV;
        if ((stp = st_incompatible(SDp))) {
-               printk(KERN_INFO
-                      "st: Found incompatible tape at scsi%d, channel %d, id %d, lun %d\n",
-                      SDp->host->host_no, SDp->channel, SDp->id, SDp->lun);
+               sdev_printk(KERN_INFO, SDp, "Found incompatible tape\n");
                printk(KERN_INFO "st: The suggested driver is %s.\n", stp);
                return -ENODEV;
        }
@@ -4075,9 +4075,8 @@ static int st_probe(struct device *dev)
        }
        disk->number = devfs_register_tape(SDp->devfs_name);
 
-       printk(KERN_WARNING
-       "Attached scsi tape %s at scsi%d, channel %d, id %d, lun %d\n",
-              tape_name(tpnt), SDp->host->host_no, SDp->channel, SDp->id, SDp->lun);
+       sdev_printk(KERN_WARNING, SDp,
+                   "Attached scsi tape %s", tape_name(tpnt));
        printk(KERN_WARNING "%s: try direct i/o: %s (alignment %d B), max page reachable by HBA %lu\n",
               tape_name(tpnt), tpnt->try_dio ? "yes" : "no",
               queue_dma_alignment(SDp->request_queue) + 1, tpnt->max_pfn);
@@ -4108,8 +4107,7 @@ out_free_tape:
        write_unlock(&st_dev_arr_lock);
 out_put_disk:
        put_disk(disk);
-       if (tpnt)
-               kfree(tpnt);
+       kfree(tpnt);
 out_buffer_free:
        kfree(buffer);
 out:
@@ -4206,6 +4204,7 @@ static int st_init_command(struct scsi_cmnd *SCpnt)
                return 0;
 
        memcpy(SCpnt->cmnd, rq->cmd, sizeof(SCpnt->cmnd));
+       SCpnt->cmd_len = rq->cmd_len;
 
        if (rq_data_dir(rq) == WRITE)
                SCpnt->sc_data_direction = DMA_TO_DEVICE;
@@ -4374,7 +4373,7 @@ static void do_create_class_files(struct scsi_tape *STp, int dev_num, int mode)
                snprintf(name, 10, "%s%s%s", rew ? "n" : "",
                         STp->disk->disk_name, st_formats[i]);
                st_class_member =
-                       class_device_create(st_sysfs_class,
+                       class_device_create(st_sysfs_class, NULL,
                                            MKDEV(SCSI_TAPE_MAJOR,
                                                  TAPE_MINOR(dev_num, mode, rew)),
                                            &STp->device->sdev_gendev, "%s", name);
@@ -4523,12 +4522,16 @@ static int sgl_unmap_user_pages(struct scatterlist *sgl, const unsigned int nr_p
        int i;
 
        for (i=0; i < nr_pages; i++) {
-               if (dirtied && !PageReserved(sgl[i].page))
-                       SetPageDirty(sgl[i].page);
+               struct page *page = sgl[i].page;
+
+               /* XXX: just for debug. Remove when PageReserved is removed */
+               BUG_ON(PageReserved(page));
+               if (dirtied)
+                       SetPageDirty(page);
                /* FIXME: cache flush missing for rw==READ
                 * FIXME: call the correct reference counting function
                 */
-               page_cache_release(sgl[i].page);
+               page_cache_release(page);
        }
 
        return 0;