diff options
author | Andy Grover <agrover@redhat.com> | 2011-06-08 17:36:43 (GMT) |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2011-07-22 09:37:48 (GMT) |
commit | 6708bb27bb2703da238f21f516034263348af5be (patch) | |
tree | a23e1f9eab22933d773d6b6ad6263d6751379a00 /drivers/target/target_core_pscsi.c | |
parent | ec98f7825c6eaa4a9afb0eb518826efc8a2ed4a2 (diff) | |
download | linux-6708bb27bb2703da238f21f516034263348af5be.tar.xz |
target: Follow up core updates from AGrover and HCH (round 4)
This patch contains the squashed version of forth round series cleanups
from Andy and Christoph following the post heavy lifting in the preceeding:
'Eliminate usage of struct se_mem' and 'Make all control CDBs scatter-gather'
changes. This also includes a conversion of target core and the v3.0
mainline fabric modules (loopback and tcm_fc) to use pr_debug and the
CONFIG_DYNAMIC_DEBUG infrastructure!
These have been squashed into this third and final round for v3.1.
target: Remove ifdeffed code in t_g_process_write
target: Remove direct ramdisk code
target: Rename task_sg_num to task_sg_nents
target: Remove custom debug macros for pr_debug. Use pr_err().
target: Remove custom debug macros in mainline fabrics
target: Set WSNZ=1 in block limits VPD. Abort if WRITE_SAME sectors = 0
target: Remove transport do_se_mem_map callback
target: Further simplify transport_free_pages
target: Redo task allocation return value handling
target: Remove extra parentheses
target: change alloc_task call to take *cdb, not *cmd
(nab: Fix bogus struct file assignments in fd_do_readv and fd_do_writev)
Signed-off-by: Andy Grover <agrover@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/target_core_pscsi.c')
-rw-r--r-- | drivers/target/target_core_pscsi.c | 183 |
1 files changed, 78 insertions, 105 deletions
diff --git a/drivers/target/target_core_pscsi.c b/drivers/target/target_core_pscsi.c index 318ef14..a2ce599 100644 --- a/drivers/target/target_core_pscsi.c +++ b/drivers/target/target_core_pscsi.c @@ -65,8 +65,8 @@ static int pscsi_attach_hba(struct se_hba *hba, u32 host_id) struct pscsi_hba_virt *phv; phv = kzalloc(sizeof(struct pscsi_hba_virt), GFP_KERNEL); - if (!(phv)) { - printk(KERN_ERR "Unable to allocate struct pscsi_hba_virt\n"); + if (!phv) { + pr_err("Unable to allocate struct pscsi_hba_virt\n"); return -ENOMEM; } phv->phv_host_id = host_id; @@ -74,10 +74,10 @@ static int pscsi_attach_hba(struct se_hba *hba, u32 host_id) hba->hba_ptr = phv; - printk(KERN_INFO "CORE_HBA[%d] - TCM SCSI HBA Driver %s on" + pr_debug("CORE_HBA[%d] - TCM SCSI HBA Driver %s on" " Generic Target Core Stack %s\n", hba->hba_id, PSCSI_VERSION, TARGET_CORE_MOD_VERSION); - printk(KERN_INFO "CORE_HBA[%d] - Attached SCSI HBA to Generic\n", + pr_debug("CORE_HBA[%d] - Attached SCSI HBA to Generic\n", hba->hba_id); return 0; @@ -91,12 +91,12 @@ static void pscsi_detach_hba(struct se_hba *hba) if (scsi_host) { scsi_host_put(scsi_host); - printk(KERN_INFO "CORE_HBA[%d] - Detached SCSI HBA: %s from" + pr_debug("CORE_HBA[%d] - Detached SCSI HBA: %s from" " Generic Target Core\n", hba->hba_id, (scsi_host->hostt->name) ? (scsi_host->hostt->name) : "Unknown"); } else - printk(KERN_INFO "CORE_HBA[%d] - Detached Virtual SCSI HBA" + pr_debug("CORE_HBA[%d] - Detached Virtual SCSI HBA" " from Generic Target Core\n", hba->hba_id); kfree(phv); @@ -110,14 +110,14 @@ static int pscsi_pmode_enable_hba(struct se_hba *hba, unsigned long mode_flag) /* * Release the struct Scsi_Host */ - if (!(mode_flag)) { - if (!(sh)) + if (!mode_flag) { + if (!sh) return 0; phv->phv_lld_host = NULL; phv->phv_mode = PHV_VIRUTAL_HOST_ID; - printk(KERN_INFO "CORE_HBA[%d] - Disabled pSCSI HBA Passthrough" + pr_debug("CORE_HBA[%d] - Disabled pSCSI HBA Passthrough" " %s\n", hba->hba_id, (sh->hostt->name) ? (sh->hostt->name) : "Unknown"); @@ -130,7 +130,7 @@ static int pscsi_pmode_enable_hba(struct se_hba *hba, unsigned long mode_flag) */ sh = scsi_host_lookup(phv->phv_host_id); if (IS_ERR(sh)) { - printk(KERN_ERR "pSCSI: Unable to locate SCSI Host for" + pr_err("pSCSI: Unable to locate SCSI Host for" " phv_host_id: %d\n", phv->phv_host_id); return PTR_ERR(sh); } @@ -138,7 +138,7 @@ static int pscsi_pmode_enable_hba(struct se_hba *hba, unsigned long mode_flag) phv->phv_lld_host = sh; phv->phv_mode = PHV_LLD_SCSI_HOST_NO; - printk(KERN_INFO "CORE_HBA[%d] - Enabled pSCSI HBA Passthrough %s\n", + pr_debug("CORE_HBA[%d] - Enabled pSCSI HBA Passthrough %s\n", hba->hba_id, (sh->hostt->name) ? (sh->hostt->name) : "Unknown"); return 1; @@ -257,15 +257,15 @@ pscsi_get_inquiry_vpd_device_ident(struct scsi_device *sdev, page_83 = &buf[off]; ident_len = page_83[3]; if (!ident_len) { - printk(KERN_ERR "page_83[3]: identifier" + pr_err("page_83[3]: identifier" " length zero!\n"); break; } - printk(KERN_INFO "T10 VPD Identifer Length: %d\n", ident_len); + pr_debug("T10 VPD Identifer Length: %d\n", ident_len); vpd = kzalloc(sizeof(struct t10_vpd), GFP_KERNEL); if (!vpd) { - printk(KERN_ERR "Unable to allocate memory for" + pr_err("Unable to allocate memory for" " struct t10_vpd\n"); goto out; } @@ -317,7 +317,7 @@ static struct se_device *pscsi_add_device_to_list( if (!sd->queue_depth) { sd->queue_depth = PSCSI_DEFAULT_QUEUEDEPTH; - printk(KERN_ERR "Set broken SCSI Device %d:%d:%d" + pr_err("Set broken SCSI Device %d:%d:%d" " queue_depth to %d\n", sd->channel, sd->id, sd->lun, sd->queue_depth); } @@ -355,7 +355,7 @@ static struct se_device *pscsi_add_device_to_list( dev = transport_add_device_to_core_hba(hba, &pscsi_template, se_dev, dev_flags, pdv, &dev_limits, NULL, NULL); - if (!(dev)) { + if (!dev) { pdv->pdv_sd = NULL; return NULL; } @@ -385,13 +385,13 @@ static void *pscsi_allocate_virtdevice(struct se_hba *hba, const char *name) struct pscsi_dev_virt *pdv; pdv = kzalloc(sizeof(struct pscsi_dev_virt), GFP_KERNEL); - if (!(pdv)) { - printk(KERN_ERR "Unable to allocate memory for struct pscsi_dev_virt\n"); + if (!pdv) { + pr_err("Unable to allocate memory for struct pscsi_dev_virt\n"); return NULL; } pdv->pdv_se_hba = hba; - printk(KERN_INFO "PSCSI: Allocated pdv: %p for %s\n", pdv, name); + pr_debug("PSCSI: Allocated pdv: %p for %s\n", pdv, name); return pdv; } @@ -412,7 +412,7 @@ static struct se_device *pscsi_create_type_disk( u32 dev_flags = 0; if (scsi_device_get(sd)) { - printk(KERN_ERR "scsi_device_get() failed for %d:%d:%d:%d\n", + pr_err("scsi_device_get() failed for %d:%d:%d:%d\n", sh->host_no, sd->channel, sd->id, sd->lun); spin_unlock_irq(sh->host_lock); return NULL; @@ -425,19 +425,19 @@ static struct se_device *pscsi_create_type_disk( bd = blkdev_get_by_path(se_dev->se_dev_udev_path, FMODE_WRITE|FMODE_READ|FMODE_EXCL, pdv); if (IS_ERR(bd)) { - printk(KERN_ERR "pSCSI: blkdev_get_by_path() failed\n"); + pr_err("pSCSI: blkdev_get_by_path() failed\n"); scsi_device_put(sd); return NULL; } pdv->pdv_bd = bd; dev = pscsi_add_device_to_list(hba, se_dev, pdv, sd, dev_flags); - if (!(dev)) { + if (!dev) { blkdev_put(pdv->pdv_bd, FMODE_WRITE|FMODE_READ|FMODE_EXCL); scsi_device_put(sd); return NULL; } - printk(KERN_INFO "CORE_PSCSI[%d] - Added TYPE_DISK for %d:%d:%d:%d\n", + pr_debug("CORE_PSCSI[%d] - Added TYPE_DISK for %d:%d:%d:%d\n", phv->phv_host_id, sh->host_no, sd->channel, sd->id, sd->lun); return dev; @@ -459,7 +459,7 @@ static struct se_device *pscsi_create_type_rom( u32 dev_flags = 0; if (scsi_device_get(sd)) { - printk(KERN_ERR "scsi_device_get() failed for %d:%d:%d:%d\n", + pr_err("scsi_device_get() failed for %d:%d:%d:%d\n", sh->host_no, sd->channel, sd->id, sd->lun); spin_unlock_irq(sh->host_lock); return NULL; @@ -467,11 +467,11 @@ static struct se_device *pscsi_create_type_rom( spin_unlock_irq(sh->host_lock); dev = pscsi_add_device_to_list(hba, se_dev, pdv, sd, dev_flags); - if (!(dev)) { + if (!dev) { scsi_device_put(sd); return NULL; } - printk(KERN_INFO "CORE_PSCSI[%d] - Added Type: %s for %d:%d:%d:%d\n", + pr_debug("CORE_PSCSI[%d] - Added Type: %s for %d:%d:%d:%d\n", phv->phv_host_id, scsi_device_type(sd->type), sh->host_no, sd->channel, sd->id, sd->lun); @@ -495,10 +495,10 @@ static struct se_device *pscsi_create_type_other( spin_unlock_irq(sh->host_lock); dev = pscsi_add_device_to_list(hba, se_dev, pdv, sd, dev_flags); - if (!(dev)) + if (!dev) return NULL; - printk(KERN_INFO "CORE_PSCSI[%d] - Added Type: %s for %d:%d:%d:%d\n", + pr_debug("CORE_PSCSI[%d] - Added Type: %s for %d:%d:%d:%d\n", phv->phv_host_id, scsi_device_type(sd->type), sh->host_no, sd->channel, sd->id, sd->lun); @@ -517,8 +517,8 @@ static struct se_device *pscsi_create_virtdevice( struct Scsi_Host *sh = phv->phv_lld_host; int legacy_mode_enable = 0; - if (!(pdv)) { - printk(KERN_ERR "Unable to locate struct pscsi_dev_virt" + if (!pdv) { + pr_err("Unable to locate struct pscsi_dev_virt" " parameter\n"); return ERR_PTR(-EINVAL); } @@ -526,9 +526,9 @@ static struct se_device *pscsi_create_virtdevice( * If not running in PHV_LLD_SCSI_HOST_NO mode, locate the * struct Scsi_Host we will need to bring the TCM/pSCSI object online */ - if (!(sh)) { + if (!sh) { if (phv->phv_mode == PHV_LLD_SCSI_HOST_NO) { - printk(KERN_ERR "pSCSI: Unable to locate struct" + pr_err("pSCSI: Unable to locate struct" " Scsi_Host for PHV_LLD_SCSI_HOST_NO\n"); return ERR_PTR(-ENODEV); } @@ -537,7 +537,7 @@ static struct se_device *pscsi_create_virtdevice( * reference, we enforce that udev_path has been set */ if (!(se_dev->su_dev_flags & SDF_USING_UDEV_PATH)) { - printk(KERN_ERR "pSCSI: udev_path attribute has not" + pr_err("pSCSI: udev_path attribute has not" " been set before ENABLE=1\n"); return ERR_PTR(-EINVAL); } @@ -548,8 +548,8 @@ static struct se_device *pscsi_create_virtdevice( */ if (!(pdv->pdv_flags & PDF_HAS_VIRT_HOST_ID)) { spin_lock(&hba->device_lock); - if (!(list_empty(&hba->hba_dev_list))) { - printk(KERN_ERR "pSCSI: Unable to set hba_mode" + if (!list_empty(&hba->hba_dev_list)) { + pr_err("pSCSI: Unable to set hba_mode" " with active devices\n"); spin_unlock(&hba->device_lock); return ERR_PTR(-EEXIST); @@ -565,14 +565,14 @@ static struct se_device *pscsi_create_virtdevice( } else { sh = scsi_host_lookup(pdv->pdv_host_id); if (IS_ERR(sh)) { - printk(KERN_ERR "pSCSI: Unable to locate" + pr_err("pSCSI: Unable to locate" " pdv_host_id: %d\n", pdv->pdv_host_id); return (struct se_device *) sh; } } } else { if (phv->phv_mode == PHV_VIRUTAL_HOST_ID) { - printk(KERN_ERR "pSCSI: PHV_VIRUTAL_HOST_ID set while" + pr_err("pSCSI: PHV_VIRUTAL_HOST_ID set while" " struct Scsi_Host exists\n"); return ERR_PTR(-EEXIST); } @@ -601,7 +601,7 @@ static struct se_device *pscsi_create_virtdevice( break; } - if (!(dev)) { + if (!dev) { if (phv->phv_mode == PHV_VIRUTAL_HOST_ID) scsi_host_put(sh); else if (legacy_mode_enable) { @@ -615,7 +615,7 @@ static struct se_device *pscsi_create_virtdevice( } spin_unlock_irq(sh->host_lock); - printk(KERN_ERR "pSCSI: Unable to locate %d:%d:%d:%d\n", sh->host_no, + pr_err("pSCSI: Unable to locate %d:%d:%d:%d\n", sh->host_no, pdv->pdv_channel_id, pdv->pdv_target_id, pdv->pdv_lun_id); if (phv->phv_mode == PHV_VIRUTAL_HOST_ID) @@ -729,8 +729,8 @@ after_mode_sense: u32 blocksize; buf = sg_virt(&sg[0]); - if (!(buf)) { - printk(KERN_ERR "Unable to get buf for scatterlist\n"); + if (!buf) { + pr_err("Unable to get buf for scatterlist\n"); goto after_mode_select; } @@ -760,34 +760,20 @@ after_mode_select: } static struct se_task * -pscsi_alloc_task(struct se_cmd *cmd) +pscsi_alloc_task(unsigned char *cdb) { struct pscsi_plugin_task *pt; - unsigned char *cdb = cmd->t_task_cdb; - pt = kzalloc(sizeof(struct pscsi_plugin_task), GFP_KERNEL); + /* + * Dynamically alloc cdb space, since it may be larger than + * TCM_MAX_COMMAND_SIZE + */ + pt = kzalloc(sizeof(*pt) + scsi_command_size(cdb), GFP_KERNEL); if (!pt) { - printk(KERN_ERR "Unable to allocate struct pscsi_plugin_task\n"); + pr_err("Unable to allocate struct pscsi_plugin_task\n"); return NULL; } - /* - * If TCM Core is signaling a > TCM_MAX_COMMAND_SIZE allocation, - * allocate the extended CDB buffer for per struct se_task context - * pt->pscsi_cdb now. - */ - if (cmd->t_task_cdb != cmd->__t_task_cdb) { - - pt->pscsi_cdb = kzalloc(scsi_command_size(cdb), GFP_KERNEL); - if (!(pt->pscsi_cdb)) { - printk(KERN_ERR "pSCSI: Unable to allocate extended" - " pt->pscsi_cdb\n"); - kfree(pt); - return NULL; - } - } else - pt->pscsi_cdb = &pt->__pscsi_cdb[0]; - return &pt->pscsi_task; } @@ -837,8 +823,8 @@ static int pscsi_blk_get_request(struct se_task *task) pt->pscsi_req = blk_get_request(pdv->pdv_sd->request_queue, (task->task_data_direction == DMA_TO_DEVICE), GFP_KERNEL); - if (!(pt->pscsi_req) || IS_ERR(pt->pscsi_req)) { - printk(KERN_ERR "PSCSI: blk_get_request() failed: %ld\n", + if (!pt->pscsi_req || IS_ERR(pt->pscsi_req)) { + pr_err("PSCSI: blk_get_request() failed: %ld\n", IS_ERR(pt->pscsi_req)); return PYX_TRANSPORT_LU_COMM_FAILURE; } @@ -883,15 +869,8 @@ static int pscsi_do_task(struct se_task *task) static void pscsi_free_task(struct se_task *task) { struct pscsi_plugin_task *pt = PSCSI_TASK(task); - struct se_cmd *cmd = task->task_se_cmd; /* - * Release the extended CDB allocation from pscsi_alloc_task() - * if one exists. - */ - if (cmd->t_task_cdb != cmd->__t_task_cdb) - kfree(pt->pscsi_cdb); - /* * We do not release the bio(s) here associated with this task, as * this is handled by bio_put() and pscsi_bi_endio(). */ @@ -936,7 +915,7 @@ static ssize_t pscsi_set_configfs_dev_params(struct se_hba *hba, switch (token) { case Opt_scsi_host_id: if (phv->phv_mode == PHV_LLD_SCSI_HOST_NO) { - printk(KERN_ERR "PSCSI[%d]: Unable to accept" + pr_err("PSCSI[%d]: Unable to accept" " scsi_host_id while phv_mode ==" " PHV_LLD_SCSI_HOST_NO\n", phv->phv_host_id); @@ -945,14 +924,14 @@ static ssize_t pscsi_set_configfs_dev_params(struct se_hba *hba, } match_int(args, &arg); pdv->pdv_host_id = arg; - printk(KERN_INFO "PSCSI[%d]: Referencing SCSI Host ID:" + pr_debug("PSCSI[%d]: Referencing SCSI Host ID:" " %d\n", phv->phv_host_id, pdv->pdv_host_id); pdv->pdv_flags |= PDF_HAS_VIRT_HOST_ID; break; case Opt_scsi_channel_id: match_int(args, &arg); pdv->pdv_channel_id = arg; - printk(KERN_INFO "PSCSI[%d]: Referencing SCSI Channel" + pr_debug("PSCSI[%d]: Referencing SCSI Channel" " ID: %d\n", phv->phv_host_id, pdv->pdv_channel_id); pdv->pdv_flags |= PDF_HAS_CHANNEL_ID; @@ -960,7 +939,7 @@ static ssize_t pscsi_set_configfs_dev_params(struct se_hba *hba, case Opt_scsi_target_id: match_int(args, &arg); pdv->pdv_target_id = arg; - printk(KERN_INFO "PSCSI[%d]: Referencing SCSI Target" + pr_debug("PSCSI[%d]: Referencing SCSI Target" " ID: %d\n", phv->phv_host_id, pdv->pdv_target_id); pdv->pdv_flags |= PDF_HAS_TARGET_ID; @@ -968,7 +947,7 @@ static ssize_t pscsi_set_configfs_dev_params(struct se_hba *hba, case Opt_scsi_lun_id: match_int(args, &arg); pdv->pdv_lun_id = arg; - printk(KERN_INFO "PSCSI[%d]: Referencing SCSI LUN ID:" + pr_debug("PSCSI[%d]: Referencing SCSI LUN ID:" " %d\n", phv->phv_host_id, pdv->pdv_lun_id); pdv->pdv_flags |= PDF_HAS_LUN_ID; break; @@ -991,7 +970,7 @@ static ssize_t pscsi_check_configfs_dev_params( if (!(pdv->pdv_flags & PDF_HAS_CHANNEL_ID) || !(pdv->pdv_flags & PDF_HAS_TARGET_ID) || !(pdv->pdv_flags & PDF_HAS_LUN_ID)) { - printk(KERN_ERR "Missing scsi_channel_id=, scsi_target_id= and" + pr_err("Missing scsi_channel_id=, scsi_target_id= and" " scsi_lun_id= parameters\n"); return -EINVAL; } @@ -1061,8 +1040,8 @@ static inline struct bio *pscsi_get_bio(int sg_num) * in block/blk-core.c:blk_make_request() */ bio = bio_kmalloc(GFP_KERNEL, sg_num); - if (!(bio)) { - printk(KERN_ERR "PSCSI: bio_kmalloc() failed\n"); + if (!bio) { + pr_err("PSCSI: bio_kmalloc() failed\n"); return NULL; } bio->bi_end_io = pscsi_bi_endio; @@ -1070,12 +1049,6 @@ static inline struct bio *pscsi_get_bio(int sg_num) return bio; } -#if 0 -#define DEBUG_PSCSI(x...) printk(x) -#else -#define DEBUG_PSCSI(x...) -#endif - static int __pscsi_map_task_SG( struct se_task *task, struct scatterlist *task_sg, @@ -1106,34 +1079,34 @@ static int __pscsi_map_task_SG( * is ported to upstream SCSI passthrough functionality that accepts * struct scatterlist->page_link or struct page as a paraemeter. */ - DEBUG_PSCSI("PSCSI: nr_pages: %d\n", nr_pages); + pr_debug("PSCSI: nr_pages: %d\n", nr_pages); for_each_sg(task_sg, sg, task_sg_num, i) { page = sg_page(sg); off = sg->offset; len = sg->length; - DEBUG_PSCSI("PSCSI: i: %d page: %p len: %d off: %d\n", i, + pr_debug("PSCSI: i: %d page: %p len: %d off: %d\n", i, page, len, off); while (len > 0 && data_len > 0) { bytes = min_t(unsigned int, len, PAGE_SIZE - off); bytes = min(bytes, data_len); - if (!(bio)) { + if (!bio) { nr_vecs = min_t(int, BIO_MAX_PAGES, nr_pages); nr_pages -= nr_vecs; /* * Calls bio_kmalloc() and sets bio->bi_end_io() */ bio = pscsi_get_bio(nr_vecs); - if (!(bio)) + if (!bio) goto fail; if (rw) bio->bi_rw |= REQ_WRITE; - DEBUG_PSCSI("PSCSI: Allocated bio: %p," + pr_debug("PSCSI: Allocated bio: %p," " dir: %s nr_vecs: %d\n", bio, (rw) ? "rw" : "r", nr_vecs); /* @@ -1148,7 +1121,7 @@ static int __pscsi_map_task_SG( tbio = tbio->bi_next = bio; } - DEBUG_PSCSI("PSCSI: Calling bio_add_pc_page() i: %d" + pr_debug("PSCSI: Calling bio_add_pc_page() i: %d" " bio: %p page: %p len: %d off: %d\n", i, bio, page, len, off); @@ -1157,11 +1130,11 @@ static int __pscsi_map_task_SG( if (rc != bytes) goto fail; - DEBUG_PSCSI("PSCSI: bio->bi_vcnt: %d nr_vecs: %d\n", + pr_debug("PSCSI: bio->bi_vcnt: %d nr_vecs: %d\n", bio->bi_vcnt, nr_vecs); if (bio->bi_vcnt > nr_vecs) { - DEBUG_PSCSI("PSCSI: Reached bio->bi_vcnt max:" + pr_debug("PSCSI: Reached bio->bi_vcnt max:" " %d i: %d bio: %p, allocating another" " bio\n", bio->bi_vcnt, i, bio); /* @@ -1183,15 +1156,15 @@ static int __pscsi_map_task_SG( * Setup the primary pt->pscsi_req used for non BIDI and BIDI-COMMAND * primary SCSI WRITE poayload mapped for struct se_task->task_sg[] */ - if (!(bidi_read)) { + if (!bidi_read) { /* * Starting with v2.6.31, call blk_make_request() passing in *hbio to * allocate the pSCSI task a struct request. */ pt->pscsi_req = blk_make_request(pdv->pdv_sd->request_queue, hbio, GFP_KERNEL); - if (!(pt->pscsi_req)) { - printk(KERN_ERR "pSCSI: blk_make_request() failed\n"); + if (!pt->pscsi_req) { + pr_err("pSCSI: blk_make_request() failed\n"); goto fail; } /* @@ -1200,7 +1173,7 @@ static int __pscsi_map_task_SG( */ pscsi_blk_init_request(task, pt, pt->pscsi_req, 0); - return task->task_sg_num; + return task->task_sg_nents; } /* * Setup the secondary pt->pscsi_req->next_rq used for the extra BIDI-COMMAND @@ -1208,13 +1181,13 @@ static int __pscsi_map_task_SG( */ pt->pscsi_req->next_rq = blk_make_request(pdv->pdv_sd->request_queue, hbio, GFP_KERNEL); - if (!(pt->pscsi_req->next_rq)) { - printk(KERN_ERR "pSCSI: blk_make_request() failed for BIDI\n"); + if (!pt->pscsi_req->next_rq) { + pr_err("pSCSI: blk_make_request() failed for BIDI\n"); goto fail; } pscsi_blk_init_request(task, pt, pt->pscsi_req->next_rq, 1); - return task->task_sg_num; + return task->task_sg_nents; fail: while (hbio) { bio = hbio; @@ -1233,14 +1206,14 @@ static int pscsi_map_task_SG(struct se_task *task) * Setup the main struct request for the task->task_sg[] payload */ - ret = __pscsi_map_task_SG(task, task->task_sg, task->task_sg_num, 0); + ret = __pscsi_map_task_SG(task, task->task_sg, task->task_sg_nents, 0); if (ret >= 0 && task->task_sg_bidi) { /* * If present, set up the extra BIDI-COMMAND SCSI READ * struct request and payload. */ ret = __pscsi_map_task_SG(task, task->task_sg_bidi, - task->task_sg_num, 1); + task->task_sg_nents, 1); } if (ret < 0) @@ -1319,9 +1292,9 @@ static inline void pscsi_process_SAM_status( struct pscsi_plugin_task *pt) { task->task_scsi_status = status_byte(pt->pscsi_result); - if ((task->task_scsi_status)) { + if (task->task_scsi_status) { task->task_scsi_status <<= 1; - printk(KERN_INFO "PSCSI Status Byte exception at task: %p CDB:" + pr_debug("PSCSI Status Byte exception at task: %p CDB:" " 0x%02x Result: 0x%08x\n", task, pt->pscsi_cdb[0], pt->pscsi_result); } @@ -1331,7 +1304,7 @@ static inline void pscsi_process_SAM_status( transport_complete_task(task, (!task->task_scsi_status)); break; default: - printk(KERN_INFO "PSCSI Host Byte exception at task: %p CDB:" + pr_debug("PSCSI Host Byte exception at task: %p CDB:" " 0x%02x Result: 0x%08x\n", task, pt->pscsi_cdb[0], pt->pscsi_result); task->task_scsi_status = SAM_STAT_CHECK_CONDITION; |