aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/target/tcm_fc
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/tcm_fc
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/tcm_fc')
-rw-r--r--drivers/target/tcm_fc/tcm_fc.h24
-rw-r--r--drivers/target/tcm_fc/tfc_cmd.c37
-rw-r--r--drivers/target/tcm_fc/tfc_conf.c33
-rw-r--r--drivers/target/tcm_fc/tfc_io.c8
-rw-r--r--drivers/target/tcm_fc/tfc_sess.c18
5 files changed, 45 insertions, 75 deletions
diff --git a/drivers/target/tcm_fc/tcm_fc.h b/drivers/target/tcm_fc/tcm_fc.h
index 8d26779e440c..f7fff7ed63c3 100644
--- a/drivers/target/tcm_fc/tcm_fc.h
+++ b/drivers/target/tcm_fc/tcm_fc.h
@@ -23,30 +23,6 @@
23#define FT_TPG_NAMELEN 32 /* max length of TPG name */ 23#define FT_TPG_NAMELEN 32 /* max length of TPG name */
24#define FT_LUN_NAMELEN 32 /* max length of LUN name */ 24#define FT_LUN_NAMELEN 32 /* max length of LUN name */
25 25
26/*
27 * Debug options.
28 */
29#define FT_DEBUG_CONF 0x01 /* configuration messages */
30#define FT_DEBUG_SESS 0x02 /* session messages */
31#define FT_DEBUG_TM 0x04 /* TM operations */
32#define FT_DEBUG_IO 0x08 /* I/O commands */
33#define FT_DEBUG_DATA 0x10 /* Data transfer */
34
35extern unsigned int ft_debug_logging; /* debug options */
36
37#define FT_DEBUG(mask, fmt, args...) \
38 do { \
39 if (ft_debug_logging & (mask)) \
40 printk(KERN_INFO "tcm_fc: %s: " fmt, \
41 __func__, ##args); \
42 } while (0)
43
44#define FT_CONF_DBG(fmt, args...) FT_DEBUG(FT_DEBUG_CONF, fmt, ##args)
45#define FT_SESS_DBG(fmt, args...) FT_DEBUG(FT_DEBUG_SESS, fmt, ##args)
46#define FT_TM_DBG(fmt, args...) FT_DEBUG(FT_DEBUG_TM, fmt, ##args)
47#define FT_IO_DBG(fmt, args...) FT_DEBUG(FT_DEBUG_IO, fmt, ##args)
48#define FT_DATA_DBG(fmt, args...) FT_DEBUG(FT_DEBUG_DATA, fmt, ##args)
49
50struct ft_transport_id { 26struct ft_transport_id {
51 __u8 format; 27 __u8 format;
52 __u8 __resvd1[7]; 28 __u8 __resvd1[7];
diff --git a/drivers/target/tcm_fc/tfc_cmd.c b/drivers/target/tcm_fc/tfc_cmd.c
index 9365e53947ad..a9e9a31da11d 100644
--- a/drivers/target/tcm_fc/tfc_cmd.c
+++ b/drivers/target/tcm_fc/tfc_cmd.c
@@ -62,22 +62,19 @@ void ft_dump_cmd(struct ft_cmd *cmd, const char *caller)
62 struct scatterlist *sg; 62 struct scatterlist *sg;
63 int count; 63 int count;
64 64
65 if (!(ft_debug_logging & FT_DEBUG_IO))
66 return;
67
68 se_cmd = &cmd->se_cmd; 65 se_cmd = &cmd->se_cmd;
69 printk(KERN_INFO "%s: cmd %p state %d sess %p seq %p se_cmd %p\n", 66 pr_debug("%s: cmd %p state %d sess %p seq %p se_cmd %p\n",
70 caller, cmd, cmd->state, cmd->sess, cmd->seq, se_cmd); 67 caller, cmd, cmd->state, cmd->sess, cmd->seq, se_cmd);
71 printk(KERN_INFO "%s: cmd %p cdb %p\n", 68 pr_debug("%s: cmd %p cdb %p\n",
72 caller, cmd, cmd->cdb); 69 caller, cmd, cmd->cdb);
73 printk(KERN_INFO "%s: cmd %p lun %d\n", caller, cmd, cmd->lun); 70 pr_debug("%s: cmd %p lun %d\n", caller, cmd, cmd->lun);
74 71
75 printk(KERN_INFO "%s: cmd %p data_nents %u len %u se_cmd_flags <0x%x>\n", 72 pr_debug("%s: cmd %p data_nents %u len %u se_cmd_flags <0x%x>\n",
76 caller, cmd, se_cmd->t_data_nents, 73 caller, cmd, se_cmd->t_data_nents,
77 se_cmd->data_length, se_cmd->se_cmd_flags); 74 se_cmd->data_length, se_cmd->se_cmd_flags);
78 75
79 for_each_sg(se_cmd->t_data_sg, sg, se_cmd->t_data_nents, count) 76 for_each_sg(se_cmd->t_data_sg, sg, se_cmd->t_data_nents, count)
80 printk(KERN_INFO "%s: cmd %p sg %p page %p " 77 pr_debug("%s: cmd %p sg %p page %p "
81 "len 0x%x off 0x%x\n", 78 "len 0x%x off 0x%x\n",
82 caller, cmd, sg, 79 caller, cmd, sg,
83 sg_page(sg), sg->length, sg->offset); 80 sg_page(sg), sg->length, sg->offset);
@@ -85,7 +82,7 @@ void ft_dump_cmd(struct ft_cmd *cmd, const char *caller)
85 sp = cmd->seq; 82 sp = cmd->seq;
86 if (sp) { 83 if (sp) {
87 ep = fc_seq_exch(sp); 84 ep = fc_seq_exch(sp);
88 printk(KERN_INFO "%s: cmd %p sid %x did %x " 85 pr_debug("%s: cmd %p sid %x did %x "
89 "ox_id %x rx_id %x seq_id %x e_stat %x\n", 86 "ox_id %x rx_id %x seq_id %x e_stat %x\n",
90 caller, cmd, ep->sid, ep->did, ep->oxid, ep->rxid, 87 caller, cmd, ep->sid, ep->did, ep->oxid, ep->rxid,
91 sp->id, ep->esb_stat); 88 sp->id, ep->esb_stat);
@@ -321,7 +318,7 @@ static void ft_recv_seq(struct fc_seq *sp, struct fc_frame *fp, void *arg)
321 case FC_RCTL_DD_SOL_CTL: /* transfer ready */ 318 case FC_RCTL_DD_SOL_CTL: /* transfer ready */
322 case FC_RCTL_DD_DATA_DESC: /* transfer ready */ 319 case FC_RCTL_DD_DATA_DESC: /* transfer ready */
323 default: 320 default:
324 printk(KERN_INFO "%s: unhandled frame r_ctl %x\n", 321 pr_debug("%s: unhandled frame r_ctl %x\n",
325 __func__, fh->fh_r_ctl); 322 __func__, fh->fh_r_ctl);
326 fc_frame_free(fp); 323 fc_frame_free(fp);
327 transport_generic_free_cmd(&cmd->se_cmd, 0, 0); 324 transport_generic_free_cmd(&cmd->se_cmd, 0, 0);
@@ -346,7 +343,7 @@ static void ft_send_resp_status(struct fc_lport *lport,
346 struct fcp_resp_rsp_info *info; 343 struct fcp_resp_rsp_info *info;
347 344
348 fh = fc_frame_header_get(rx_fp); 345 fh = fc_frame_header_get(rx_fp);
349 FT_IO_DBG("FCP error response: did %x oxid %x status %x code %x\n", 346 pr_debug("FCP error response: did %x oxid %x status %x code %x\n",
350 ntoh24(fh->fh_s_id), ntohs(fh->fh_ox_id), status, code); 347 ntoh24(fh->fh_s_id), ntohs(fh->fh_ox_id), status, code);
351 len = sizeof(*fcp); 348 len = sizeof(*fcp);
352 if (status == SAM_STAT_GOOD) 349 if (status == SAM_STAT_GOOD)
@@ -416,15 +413,15 @@ static void ft_send_tm(struct ft_cmd *cmd)
416 * FCP4r01 indicates having a combination of 413 * FCP4r01 indicates having a combination of
417 * tm_flags set is invalid. 414 * tm_flags set is invalid.
418 */ 415 */
419 FT_TM_DBG("invalid FCP tm_flags %x\n", fcp->fc_tm_flags); 416 pr_debug("invalid FCP tm_flags %x\n", fcp->fc_tm_flags);
420 ft_send_resp_code(cmd, FCP_CMND_FIELDS_INVALID); 417 ft_send_resp_code(cmd, FCP_CMND_FIELDS_INVALID);
421 return; 418 return;
422 } 419 }
423 420
424 FT_TM_DBG("alloc tm cmd fn %d\n", tm_func); 421 pr_debug("alloc tm cmd fn %d\n", tm_func);
425 tmr = core_tmr_alloc_req(&cmd->se_cmd, cmd, tm_func); 422 tmr = core_tmr_alloc_req(&cmd->se_cmd, cmd, tm_func);
426 if (!tmr) { 423 if (!tmr) {
427 FT_TM_DBG("alloc failed\n"); 424 pr_debug("alloc failed\n");
428 ft_send_resp_code(cmd, FCP_TMF_FAILED); 425 ft_send_resp_code(cmd, FCP_TMF_FAILED);
429 return; 426 return;
430 } 427 }
@@ -439,7 +436,7 @@ static void ft_send_tm(struct ft_cmd *cmd)
439 * since "unable to handle TMR request because failed 436 * since "unable to handle TMR request because failed
440 * to get to LUN" 437 * to get to LUN"
441 */ 438 */
442 FT_TM_DBG("Failed to get LUN for TMR func %d, " 439 pr_debug("Failed to get LUN for TMR func %d, "
443 "se_cmd %p, unpacked_lun %d\n", 440 "se_cmd %p, unpacked_lun %d\n",
444 tm_func, &cmd->se_cmd, cmd->lun); 441 tm_func, &cmd->se_cmd, cmd->lun);
445 ft_dump_cmd(cmd, __func__); 442 ft_dump_cmd(cmd, __func__);
@@ -490,7 +487,7 @@ int ft_queue_tm_resp(struct se_cmd *se_cmd)
490 code = FCP_TMF_FAILED; 487 code = FCP_TMF_FAILED;
491 break; 488 break;
492 } 489 }
493 FT_TM_DBG("tmr fn %d resp %d fcp code %d\n", 490 pr_debug("tmr fn %d resp %d fcp code %d\n",
494 tmr->function, tmr->response, code); 491 tmr->function, tmr->response, code);
495 ft_send_resp_code(cmd, code); 492 ft_send_resp_code(cmd, code);
496 return 0; 493 return 0;
@@ -518,7 +515,7 @@ static void ft_recv_cmd(struct ft_sess *sess, struct fc_frame *fp)
518 return; 515 return;
519 516
520busy: 517busy:
521 FT_IO_DBG("cmd or seq allocation failure - sending BUSY\n"); 518 pr_debug("cmd or seq allocation failure - sending BUSY\n");
522 ft_send_resp_status(lport, fp, SAM_STAT_BUSY, 0); 519 ft_send_resp_status(lport, fp, SAM_STAT_BUSY, 0);
523 fc_frame_free(fp); 520 fc_frame_free(fp);
524 ft_sess_put(sess); /* undo get from lookup */ 521 ft_sess_put(sess); /* undo get from lookup */
@@ -543,7 +540,7 @@ void ft_recv_req(struct ft_sess *sess, struct fc_frame *fp)
543 case FC_RCTL_DD_DATA_DESC: /* transfer ready */ 540 case FC_RCTL_DD_DATA_DESC: /* transfer ready */
544 case FC_RCTL_ELS4_REQ: /* SRR, perhaps */ 541 case FC_RCTL_ELS4_REQ: /* SRR, perhaps */
545 default: 542 default:
546 printk(KERN_INFO "%s: unhandled frame r_ctl %x\n", 543 pr_debug("%s: unhandled frame r_ctl %x\n",
547 __func__, fh->fh_r_ctl); 544 __func__, fh->fh_r_ctl);
548 fc_frame_free(fp); 545 fc_frame_free(fp);
549 ft_sess_put(sess); /* undo get from lookup */ 546 ft_sess_put(sess); /* undo get from lookup */
@@ -642,7 +639,7 @@ static void ft_send_cmd(struct ft_cmd *cmd)
642 639
643 ret = transport_generic_allocate_tasks(se_cmd, cmd->cdb); 640 ret = transport_generic_allocate_tasks(se_cmd, cmd->cdb);
644 641
645 FT_IO_DBG("r_ctl %x alloc task ret %d\n", fh->fh_r_ctl, ret); 642 pr_debug("r_ctl %x alloc task ret %d\n", fh->fh_r_ctl, ret);
646 ft_dump_cmd(cmd, __func__); 643 ft_dump_cmd(cmd, __func__);
647 644
648 if (ret == -ENOMEM) { 645 if (ret == -ENOMEM) {
@@ -672,7 +669,7 @@ err:
672 */ 669 */
673static void ft_exec_req(struct ft_cmd *cmd) 670static void ft_exec_req(struct ft_cmd *cmd)
674{ 671{
675 FT_IO_DBG("cmd state %x\n", cmd->state); 672 pr_debug("cmd state %x\n", cmd->state);
676 switch (cmd->state) { 673 switch (cmd->state) {
677 case FC_CMD_ST_NEW: 674 case FC_CMD_ST_NEW:
678 ft_send_cmd(cmd); 675 ft_send_cmd(cmd);
diff --git a/drivers/target/tcm_fc/tfc_conf.c b/drivers/target/tcm_fc/tfc_conf.c
index ec9e40dc4514..d63e3dd3b180 100644
--- a/drivers/target/tcm_fc/tfc_conf.c
+++ b/drivers/target/tcm_fc/tfc_conf.c
@@ -106,7 +106,7 @@ static ssize_t ft_parse_wwn(const char *name, u64 *wwn, int strict)
106 } 106 }
107 err = 4; 107 err = 4;
108fail: 108fail:
109 FT_CONF_DBG("err %u len %zu pos %u byte %u\n", 109 pr_debug("err %u len %zu pos %u byte %u\n",
110 err, cp - name, pos, byte); 110 err, cp - name, pos, byte);
111 return -1; 111 return -1;
112} 112}
@@ -216,7 +216,7 @@ static struct se_node_acl *ft_add_acl(
216 u64 wwpn; 216 u64 wwpn;
217 u32 q_depth; 217 u32 q_depth;
218 218
219 FT_CONF_DBG("add acl %s\n", name); 219 pr_debug("add acl %s\n", name);
220 tpg = container_of(se_tpg, struct ft_tpg, se_tpg); 220 tpg = container_of(se_tpg, struct ft_tpg, se_tpg);
221 221
222 if (ft_parse_wwn(name, &wwpn, 1) < 0) 222 if (ft_parse_wwn(name, &wwpn, 1) < 0)
@@ -239,11 +239,11 @@ static void ft_del_acl(struct se_node_acl *se_acl)
239 struct ft_node_acl *acl = container_of(se_acl, 239 struct ft_node_acl *acl = container_of(se_acl,
240 struct ft_node_acl, se_node_acl); 240 struct ft_node_acl, se_node_acl);
241 241
242 FT_CONF_DBG("del acl %s\n", 242 pr_debug("del acl %s\n",
243 config_item_name(&se_acl->acl_group.cg_item)); 243 config_item_name(&se_acl->acl_group.cg_item));
244 244
245 tpg = container_of(se_tpg, struct ft_tpg, se_tpg); 245 tpg = container_of(se_tpg, struct ft_tpg, se_tpg);
246 FT_CONF_DBG("del acl %p se_acl %p tpg %p se_tpg %p\n", 246 pr_debug("del acl %p se_acl %p tpg %p se_tpg %p\n",
247 acl, se_acl, tpg, &tpg->se_tpg); 247 acl, se_acl, tpg, &tpg->se_tpg);
248 248
249 core_tpg_del_initiator_node_acl(&tpg->se_tpg, se_acl, 1); 249 core_tpg_del_initiator_node_acl(&tpg->se_tpg, se_acl, 1);
@@ -260,11 +260,11 @@ struct ft_node_acl *ft_acl_get(struct ft_tpg *tpg, struct fc_rport_priv *rdata)
260 spin_lock_bh(&se_tpg->acl_node_lock); 260 spin_lock_bh(&se_tpg->acl_node_lock);
261 list_for_each_entry(se_acl, &se_tpg->acl_node_list, acl_list) { 261 list_for_each_entry(se_acl, &se_tpg->acl_node_list, acl_list) {
262 acl = container_of(se_acl, struct ft_node_acl, se_node_acl); 262 acl = container_of(se_acl, struct ft_node_acl, se_node_acl);
263 FT_CONF_DBG("acl %p port_name %llx\n", 263 pr_debug("acl %p port_name %llx\n",
264 acl, (unsigned long long)acl->node_auth.port_name); 264 acl, (unsigned long long)acl->node_auth.port_name);
265 if (acl->node_auth.port_name == rdata->ids.port_name || 265 if (acl->node_auth.port_name == rdata->ids.port_name ||
266 acl->node_auth.node_name == rdata->ids.node_name) { 266 acl->node_auth.node_name == rdata->ids.node_name) {
267 FT_CONF_DBG("acl %p port_name %llx matched\n", acl, 267 pr_debug("acl %p port_name %llx matched\n", acl,
268 (unsigned long long)rdata->ids.port_name); 268 (unsigned long long)rdata->ids.port_name);
269 found = acl; 269 found = acl;
270 /* XXX need to hold onto ACL */ 270 /* XXX need to hold onto ACL */
@@ -281,10 +281,10 @@ struct se_node_acl *ft_tpg_alloc_fabric_acl(struct se_portal_group *se_tpg)
281 281
282 acl = kzalloc(sizeof(*acl), GFP_KERNEL); 282 acl = kzalloc(sizeof(*acl), GFP_KERNEL);
283 if (!acl) { 283 if (!acl) {
284 printk(KERN_ERR "Unable to allocate struct ft_node_acl\n"); 284 pr_err("Unable to allocate struct ft_node_acl\n");
285 return NULL; 285 return NULL;
286 } 286 }
287 FT_CONF_DBG("acl %p\n", acl); 287 pr_debug("acl %p\n", acl);
288 return &acl->se_node_acl; 288 return &acl->se_node_acl;
289} 289}
290 290
@@ -294,7 +294,7 @@ static void ft_tpg_release_fabric_acl(struct se_portal_group *se_tpg,
294 struct ft_node_acl *acl = container_of(se_acl, 294 struct ft_node_acl *acl = container_of(se_acl,
295 struct ft_node_acl, se_node_acl); 295 struct ft_node_acl, se_node_acl);
296 296
297 FT_CONF_DBG(KERN_INFO "acl %p\n", acl); 297 pr_debug("acl %p\n", acl);
298 kfree(acl); 298 kfree(acl);
299} 299}
300 300
@@ -311,7 +311,7 @@ static struct se_portal_group *ft_add_tpg(
311 unsigned long index; 311 unsigned long index;
312 int ret; 312 int ret;
313 313
314 FT_CONF_DBG("tcm_fc: add tpg %s\n", name); 314 pr_debug("tcm_fc: add tpg %s\n", name);
315 315
316 /* 316 /*
317 * Name must be "tpgt_" followed by the index. 317 * Name must be "tpgt_" followed by the index.
@@ -354,7 +354,7 @@ static void ft_del_tpg(struct se_portal_group *se_tpg)
354{ 354{
355 struct ft_tpg *tpg = container_of(se_tpg, struct ft_tpg, se_tpg); 355 struct ft_tpg *tpg = container_of(se_tpg, struct ft_tpg, se_tpg);
356 356
357 FT_CONF_DBG("del tpg %s\n", 357 pr_debug("del tpg %s\n",
358 config_item_name(&tpg->se_tpg.tpg_group.cg_item)); 358 config_item_name(&tpg->se_tpg.tpg_group.cg_item));
359 359
360 kthread_stop(tpg->thread); 360 kthread_stop(tpg->thread);
@@ -412,7 +412,7 @@ static struct se_wwn *ft_add_lport(
412 struct ft_lport_acl *old_lacl; 412 struct ft_lport_acl *old_lacl;
413 u64 wwpn; 413 u64 wwpn;
414 414
415 FT_CONF_DBG("add lport %s\n", name); 415 pr_debug("add lport %s\n", name);
416 if (ft_parse_wwn(name, &wwpn, 1) < 0) 416 if (ft_parse_wwn(name, &wwpn, 1) < 0)
417 return NULL; 417 return NULL;
418 lacl = kzalloc(sizeof(*lacl), GFP_KERNEL); 418 lacl = kzalloc(sizeof(*lacl), GFP_KERNEL);
@@ -441,7 +441,7 @@ static void ft_del_lport(struct se_wwn *wwn)
441 struct ft_lport_acl *lacl = container_of(wwn, 441 struct ft_lport_acl *lacl = container_of(wwn,
442 struct ft_lport_acl, fc_lport_wwn); 442 struct ft_lport_acl, fc_lport_wwn);
443 443
444 FT_CONF_DBG("del lport %s\n", 444 pr_debug("del lport %s\n",
445 config_item_name(&wwn->wwn_group.cg_item)); 445 config_item_name(&wwn->wwn_group.cg_item));
446 mutex_lock(&ft_lport_lock); 446 mutex_lock(&ft_lport_lock);
447 list_del(&lacl->list); 447 list_del(&lacl->list);
@@ -581,7 +581,7 @@ int ft_register_configfs(void)
581 */ 581 */
582 fabric = target_fabric_configfs_init(THIS_MODULE, "fc"); 582 fabric = target_fabric_configfs_init(THIS_MODULE, "fc");
583 if (IS_ERR(fabric)) { 583 if (IS_ERR(fabric)) {
584 printk(KERN_INFO "%s: target_fabric_configfs_init() failed!\n", 584 pr_err("%s: target_fabric_configfs_init() failed!\n",
585 __func__); 585 __func__);
586 return PTR_ERR(fabric); 586 return PTR_ERR(fabric);
587 } 587 }
@@ -608,11 +608,8 @@ int ft_register_configfs(void)
608 */ 608 */
609 ret = target_fabric_configfs_register(fabric); 609 ret = target_fabric_configfs_register(fabric);
610 if (ret < 0) { 610 if (ret < 0) {
611 FT_CONF_DBG("target_fabric_configfs_register() for" 611 pr_debug("target_fabric_configfs_register() for"
612 " FC Target failed!\n"); 612 " FC Target failed!\n");
613 printk(KERN_INFO
614 "%s: target_fabric_configfs_register() failed!\n",
615 __func__);
616 target_fabric_configfs_free(fabric); 613 target_fabric_configfs_free(fabric);
617 return -1; 614 return -1;
618 } 615 }
diff --git a/drivers/target/tcm_fc/tfc_io.c b/drivers/target/tcm_fc/tfc_io.c
index 3563a9029c4a..11e6483fc127 100644
--- a/drivers/target/tcm_fc/tfc_io.c
+++ b/drivers/target/tcm_fc/tfc_io.c
@@ -39,6 +39,7 @@
39#include <linux/configfs.h> 39#include <linux/configfs.h>
40#include <linux/ctype.h> 40#include <linux/ctype.h>
41#include <linux/hash.h> 41#include <linux/hash.h>
42#include <linux/ratelimit.h>
42#include <asm/unaligned.h> 43#include <asm/unaligned.h>
43#include <scsi/scsi.h> 44#include <scsi/scsi.h>
44#include <scsi/scsi_host.h> 45#include <scsi/scsi_host.h>
@@ -176,8 +177,7 @@ int ft_queue_data_in(struct se_cmd *se_cmd)
176 error = lport->tt.seq_send(lport, cmd->seq, fp); 177 error = lport->tt.seq_send(lport, cmd->seq, fp);
177 if (error) { 178 if (error) {
178 /* XXX For now, initiator will retry */ 179 /* XXX For now, initiator will retry */
179 if (printk_ratelimit()) 180 pr_err_ratelimited("%s: Failed to send frame %p, "
180 printk(KERN_ERR "%s: Failed to send frame %p, "
181 "xid <0x%x>, remaining %zu, " 181 "xid <0x%x>, remaining %zu, "
182 "lso_max <0x%x>\n", 182 "lso_max <0x%x>\n",
183 __func__, fp, ep->xid, 183 __func__, fp, ep->xid,
@@ -222,7 +222,7 @@ void ft_recv_write_data(struct ft_cmd *cmd, struct fc_frame *fp)
222 */ 222 */
223 buf = fc_frame_payload_get(fp, 1); 223 buf = fc_frame_payload_get(fp, 1);
224 if (cmd->was_ddp_setup && buf) { 224 if (cmd->was_ddp_setup && buf) {
225 printk(KERN_INFO "%s: When DDP was setup, not expected to" 225 pr_debug("%s: When DDP was setup, not expected to"
226 "receive frame with payload, Payload shall be" 226 "receive frame with payload, Payload shall be"
227 "copied directly to buffer instead of coming " 227 "copied directly to buffer instead of coming "
228 "via. legacy receive queues\n", __func__); 228 "via. legacy receive queues\n", __func__);
@@ -260,7 +260,7 @@ void ft_recv_write_data(struct ft_cmd *cmd, struct fc_frame *fp)
260 * this point, but just in case if required in future 260 * this point, but just in case if required in future
261 * for debugging or any other purpose 261 * for debugging or any other purpose
262 */ 262 */
263 printk(KERN_ERR "%s: Received frame with TSI bit not" 263 pr_err("%s: Received frame with TSI bit not"
264 " being SET, dropping the frame, " 264 " being SET, dropping the frame, "
265 "cmd->sg <%p>, cmd->sg_cnt <0x%x>\n", 265 "cmd->sg <%p>, cmd->sg_cnt <0x%x>\n",
266 __func__, cmd->sg, cmd->sg_cnt); 266 __func__, cmd->sg, cmd->sg_cnt);
diff --git a/drivers/target/tcm_fc/tfc_sess.c b/drivers/target/tcm_fc/tfc_sess.c
index 7491e21cc6ae..fbcbb3d1d06b 100644
--- a/drivers/target/tcm_fc/tfc_sess.c
+++ b/drivers/target/tcm_fc/tfc_sess.c
@@ -198,13 +198,13 @@ static struct ft_sess *ft_sess_get(struct fc_lport *lport, u32 port_id)
198 if (sess->port_id == port_id) { 198 if (sess->port_id == port_id) {
199 kref_get(&sess->kref); 199 kref_get(&sess->kref);
200 rcu_read_unlock(); 200 rcu_read_unlock();
201 FT_SESS_DBG("port_id %x found %p\n", port_id, sess); 201 pr_debug("port_id %x found %p\n", port_id, sess);
202 return sess; 202 return sess;
203 } 203 }
204 } 204 }
205out: 205out:
206 rcu_read_unlock(); 206 rcu_read_unlock();
207 FT_SESS_DBG("port_id %x not found\n", port_id); 207 pr_debug("port_id %x not found\n", port_id);
208 return NULL; 208 return NULL;
209} 209}
210 210
@@ -240,7 +240,7 @@ static struct ft_sess *ft_sess_create(struct ft_tport *tport, u32 port_id,
240 hlist_add_head_rcu(&sess->hash, head); 240 hlist_add_head_rcu(&sess->hash, head);
241 tport->sess_count++; 241 tport->sess_count++;
242 242
243 FT_SESS_DBG("port_id %x sess %p\n", port_id, sess); 243 pr_debug("port_id %x sess %p\n", port_id, sess);
244 244
245 transport_register_session(&tport->tpg->se_tpg, &acl->se_node_acl, 245 transport_register_session(&tport->tpg->se_tpg, &acl->se_node_acl,
246 sess->se_sess, sess); 246 sess->se_sess, sess);
@@ -314,7 +314,7 @@ int ft_sess_shutdown(struct se_session *se_sess)
314{ 314{
315 struct ft_sess *sess = se_sess->fabric_sess_ptr; 315 struct ft_sess *sess = se_sess->fabric_sess_ptr;
316 316
317 FT_SESS_DBG("port_id %x\n", sess->port_id); 317 pr_debug("port_id %x\n", sess->port_id);
318 return 1; 318 return 1;
319} 319}
320 320
@@ -335,7 +335,7 @@ void ft_sess_close(struct se_session *se_sess)
335 mutex_unlock(&ft_lport_lock); 335 mutex_unlock(&ft_lport_lock);
336 return; 336 return;
337 } 337 }
338 FT_SESS_DBG("port_id %x\n", port_id); 338 pr_debug("port_id %x\n", port_id);
339 ft_sess_unhash(sess); 339 ft_sess_unhash(sess);
340 mutex_unlock(&ft_lport_lock); 340 mutex_unlock(&ft_lport_lock);
341 transport_deregister_session_configfs(se_sess); 341 transport_deregister_session_configfs(se_sess);
@@ -348,7 +348,7 @@ void ft_sess_stop(struct se_session *se_sess, int sess_sleep, int conn_sleep)
348{ 348{
349 struct ft_sess *sess = se_sess->fabric_sess_ptr; 349 struct ft_sess *sess = se_sess->fabric_sess_ptr;
350 350
351 FT_SESS_DBG("port_id %x\n", sess->port_id); 351 pr_debug("port_id %x\n", sess->port_id);
352} 352}
353 353
354int ft_sess_logged_in(struct se_session *se_sess) 354int ft_sess_logged_in(struct se_session *se_sess)
@@ -458,7 +458,7 @@ static int ft_prli(struct fc_rport_priv *rdata, u32 spp_len,
458 mutex_lock(&ft_lport_lock); 458 mutex_lock(&ft_lport_lock);
459 ret = ft_prli_locked(rdata, spp_len, rspp, spp); 459 ret = ft_prli_locked(rdata, spp_len, rspp, spp);
460 mutex_unlock(&ft_lport_lock); 460 mutex_unlock(&ft_lport_lock);
461 FT_SESS_DBG("port_id %x flags %x ret %x\n", 461 pr_debug("port_id %x flags %x ret %x\n",
462 rdata->ids.port_id, rspp ? rspp->spp_flags : 0, ret); 462 rdata->ids.port_id, rspp ? rspp->spp_flags : 0, ret);
463 return ret; 463 return ret;
464} 464}
@@ -518,11 +518,11 @@ static void ft_recv(struct fc_lport *lport, struct fc_frame *fp)
518 struct ft_sess *sess; 518 struct ft_sess *sess;
519 u32 sid = fc_frame_sid(fp); 519 u32 sid = fc_frame_sid(fp);
520 520
521 FT_SESS_DBG("sid %x\n", sid); 521 pr_debug("sid %x\n", sid);
522 522
523 sess = ft_sess_get(lport, sid); 523 sess = ft_sess_get(lport, sid);
524 if (!sess) { 524 if (!sess) {
525 FT_SESS_DBG("sid %x sess lookup failed\n", sid); 525 pr_debug("sid %x sess lookup failed\n", sid);
526 /* TBD XXX - if FCP_CMND, send PRLO */ 526 /* TBD XXX - if FCP_CMND, send PRLO */
527 fc_frame_free(fp); 527 fc_frame_free(fp);
528 return; 528 return;