aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/target/target_core_ua.c
diff options
context:
space:
mode:
authorAndy Grover <agrover@redhat.com>2011-06-08 13:36:43 -0400
committerNicholas Bellinger <nab@linux-iscsi.org>2011-07-22 05:37:48 -0400
commit6708bb27bb2703da238f21f516034263348af5be (patch)
treea23e1f9eab22933d773d6b6ad6263d6751379a00 /drivers/target/target_core_ua.c
parentec98f7825c6eaa4a9afb0eb518826efc8a2ed4a2 (diff)
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_ua.c')
-rw-r--r--drivers/target/target_core_ua.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/drivers/target/target_core_ua.c b/drivers/target/target_core_ua.c
index d28e9c4a1c9..31e3c652527 100644
--- a/drivers/target/target_core_ua.c
+++ b/drivers/target/target_core_ua.c
@@ -49,15 +49,15 @@ int core_scsi3_ua_check(
49 struct se_session *sess = cmd->se_sess; 49 struct se_session *sess = cmd->se_sess;
50 struct se_node_acl *nacl; 50 struct se_node_acl *nacl;
51 51
52 if (!(sess)) 52 if (!sess)
53 return 0; 53 return 0;
54 54
55 nacl = sess->se_node_acl; 55 nacl = sess->se_node_acl;
56 if (!(nacl)) 56 if (!nacl)
57 return 0; 57 return 0;
58 58
59 deve = &nacl->device_list[cmd->orig_fe_lun]; 59 deve = &nacl->device_list[cmd->orig_fe_lun];
60 if (!(atomic_read(&deve->ua_count))) 60 if (!atomic_read(&deve->ua_count))
61 return 0; 61 return 0;
62 /* 62 /*
63 * From sam4r14, section 5.14 Unit attention condition: 63 * From sam4r14, section 5.14 Unit attention condition:
@@ -97,12 +97,12 @@ int core_scsi3_ua_allocate(
97 /* 97 /*
98 * PASSTHROUGH OPS 98 * PASSTHROUGH OPS
99 */ 99 */
100 if (!(nacl)) 100 if (!nacl)
101 return -EINVAL; 101 return -EINVAL;
102 102
103 ua = kmem_cache_zalloc(se_ua_cache, GFP_ATOMIC); 103 ua = kmem_cache_zalloc(se_ua_cache, GFP_ATOMIC);
104 if (!(ua)) { 104 if (!ua) {
105 printk(KERN_ERR "Unable to allocate struct se_ua\n"); 105 pr_err("Unable to allocate struct se_ua\n");
106 return -ENOMEM; 106 return -ENOMEM;
107 } 107 }
108 INIT_LIST_HEAD(&ua->ua_dev_list); 108 INIT_LIST_HEAD(&ua->ua_dev_list);
@@ -177,7 +177,7 @@ int core_scsi3_ua_allocate(
177 spin_unlock(&deve->ua_lock); 177 spin_unlock(&deve->ua_lock);
178 spin_unlock_irq(&nacl->device_list_lock); 178 spin_unlock_irq(&nacl->device_list_lock);
179 179
180 printk(KERN_INFO "[%s]: Allocated UNIT ATTENTION, mapped LUN: %u, ASC:" 180 pr_debug("[%s]: Allocated UNIT ATTENTION, mapped LUN: %u, ASC:"
181 " 0x%02x, ASCQ: 0x%02x\n", 181 " 0x%02x, ASCQ: 0x%02x\n",
182 nacl->se_tpg->se_tpg_tfo->get_fabric_name(), unpacked_lun, 182 nacl->se_tpg->se_tpg_tfo->get_fabric_name(), unpacked_lun,
183 asc, ascq); 183 asc, ascq);
@@ -215,16 +215,16 @@ void core_scsi3_ua_for_check_condition(
215 struct se_ua *ua = NULL, *ua_p; 215 struct se_ua *ua = NULL, *ua_p;
216 int head = 1; 216 int head = 1;
217 217
218 if (!(sess)) 218 if (!sess)
219 return; 219 return;
220 220
221 nacl = sess->se_node_acl; 221 nacl = sess->se_node_acl;
222 if (!(nacl)) 222 if (!nacl)
223 return; 223 return;
224 224
225 spin_lock_irq(&nacl->device_list_lock); 225 spin_lock_irq(&nacl->device_list_lock);
226 deve = &nacl->device_list[cmd->orig_fe_lun]; 226 deve = &nacl->device_list[cmd->orig_fe_lun];
227 if (!(atomic_read(&deve->ua_count))) { 227 if (!atomic_read(&deve->ua_count)) {
228 spin_unlock_irq(&nacl->device_list_lock); 228 spin_unlock_irq(&nacl->device_list_lock);
229 return; 229 return;
230 } 230 }
@@ -264,7 +264,7 @@ void core_scsi3_ua_for_check_condition(
264 spin_unlock(&deve->ua_lock); 264 spin_unlock(&deve->ua_lock);
265 spin_unlock_irq(&nacl->device_list_lock); 265 spin_unlock_irq(&nacl->device_list_lock);
266 266
267 printk(KERN_INFO "[%s]: %s UNIT ATTENTION condition with" 267 pr_debug("[%s]: %s UNIT ATTENTION condition with"
268 " INTLCK_CTRL: %d, mapped LUN: %u, got CDB: 0x%02x" 268 " INTLCK_CTRL: %d, mapped LUN: %u, got CDB: 0x%02x"
269 " reported ASC: 0x%02x, ASCQ: 0x%02x\n", 269 " reported ASC: 0x%02x, ASCQ: 0x%02x\n",
270 nacl->se_tpg->se_tpg_tfo->get_fabric_name(), 270 nacl->se_tpg->se_tpg_tfo->get_fabric_name(),
@@ -284,16 +284,16 @@ int core_scsi3_ua_clear_for_request_sense(
284 struct se_ua *ua = NULL, *ua_p; 284 struct se_ua *ua = NULL, *ua_p;
285 int head = 1; 285 int head = 1;
286 286
287 if (!(sess)) 287 if (!sess)
288 return -EINVAL; 288 return -EINVAL;
289 289
290 nacl = sess->se_node_acl; 290 nacl = sess->se_node_acl;
291 if (!(nacl)) 291 if (!nacl)
292 return -EINVAL; 292 return -EINVAL;
293 293
294 spin_lock_irq(&nacl->device_list_lock); 294 spin_lock_irq(&nacl->device_list_lock);
295 deve = &nacl->device_list[cmd->orig_fe_lun]; 295 deve = &nacl->device_list[cmd->orig_fe_lun];
296 if (!(atomic_read(&deve->ua_count))) { 296 if (!atomic_read(&deve->ua_count)) {
297 spin_unlock_irq(&nacl->device_list_lock); 297 spin_unlock_irq(&nacl->device_list_lock);
298 return -EPERM; 298 return -EPERM;
299 } 299 }
@@ -323,7 +323,7 @@ int core_scsi3_ua_clear_for_request_sense(
323 spin_unlock(&deve->ua_lock); 323 spin_unlock(&deve->ua_lock);
324 spin_unlock_irq(&nacl->device_list_lock); 324 spin_unlock_irq(&nacl->device_list_lock);
325 325
326 printk(KERN_INFO "[%s]: Released UNIT ATTENTION condition, mapped" 326 pr_debug("[%s]: Released UNIT ATTENTION condition, mapped"
327 " LUN: %u, got REQUEST_SENSE reported ASC: 0x%02x," 327 " LUN: %u, got REQUEST_SENSE reported ASC: 0x%02x,"
328 " ASCQ: 0x%02x\n", nacl->se_tpg->se_tpg_tfo->get_fabric_name(), 328 " ASCQ: 0x%02x\n", nacl->se_tpg->se_tpg_tfo->get_fabric_name(),
329 cmd->orig_fe_lun, *asc, *ascq); 329 cmd->orig_fe_lun, *asc, *ascq);