diff options
Diffstat (limited to 'drivers/target/tcm_fc/tfc_conf.c')
-rw-r--r-- | drivers/target/tcm_fc/tfc_conf.c | 47 |
1 files changed, 21 insertions, 26 deletions
diff --git a/drivers/target/tcm_fc/tfc_conf.c b/drivers/target/tcm_fc/tfc_conf.c index 84e868c255d..d63e3dd3b18 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; |
108 | fail: | 108 | fail: |
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,14 +216,14 @@ 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) |
223 | return ERR_PTR(-EINVAL); | 223 | return ERR_PTR(-EINVAL); |
224 | 224 | ||
225 | acl = kzalloc(sizeof(struct ft_node_acl), GFP_KERNEL); | 225 | acl = kzalloc(sizeof(struct ft_node_acl), GFP_KERNEL); |
226 | if (!(acl)) | 226 | if (!acl) |
227 | return ERR_PTR(-ENOMEM); | 227 | return ERR_PTR(-ENOMEM); |
228 | acl->node_auth.port_name = wwpn; | 228 | acl->node_auth.port_name = wwpn; |
229 | 229 | ||
@@ -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 */ |
@@ -280,11 +280,11 @@ struct se_node_acl *ft_tpg_alloc_fabric_acl(struct se_portal_group *se_tpg) | |||
280 | struct ft_node_acl *acl; | 280 | struct ft_node_acl *acl; |
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. |
@@ -331,7 +331,7 @@ static struct se_portal_group *ft_add_tpg( | |||
331 | transport_init_queue_obj(&tpg->qobj); | 331 | transport_init_queue_obj(&tpg->qobj); |
332 | 332 | ||
333 | ret = core_tpg_register(&ft_configfs->tf_ops, wwn, &tpg->se_tpg, | 333 | ret = core_tpg_register(&ft_configfs->tf_ops, wwn, &tpg->se_tpg, |
334 | (void *)tpg, TRANSPORT_TPG_TYPE_NORMAL); | 334 | tpg, TRANSPORT_TPG_TYPE_NORMAL); |
335 | if (ret < 0) { | 335 | if (ret < 0) { |
336 | kfree(tpg); | 336 | kfree(tpg); |
337 | return NULL; | 337 | return NULL; |
@@ -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); |
@@ -536,8 +536,7 @@ static struct target_core_fabric_ops ft_fabric_ops = { | |||
536 | .tpg_release_fabric_acl = ft_tpg_release_fabric_acl, | 536 | .tpg_release_fabric_acl = ft_tpg_release_fabric_acl, |
537 | .tpg_get_inst_index = ft_tpg_get_inst_index, | 537 | .tpg_get_inst_index = ft_tpg_get_inst_index, |
538 | .check_stop_free = ft_check_stop_free, | 538 | .check_stop_free = ft_check_stop_free, |
539 | .release_cmd_to_pool = ft_release_cmd, | 539 | .release_cmd = ft_release_cmd, |
540 | .release_cmd_direct = ft_release_cmd, | ||
541 | .shutdown_session = ft_sess_shutdown, | 540 | .shutdown_session = ft_sess_shutdown, |
542 | .close_session = ft_sess_close, | 541 | .close_session = ft_sess_close, |
543 | .stop_session = ft_sess_stop, | 542 | .stop_session = ft_sess_stop, |
@@ -550,7 +549,6 @@ static struct target_core_fabric_ops ft_fabric_ops = { | |||
550 | .set_default_node_attributes = ft_set_default_node_attr, | 549 | .set_default_node_attributes = ft_set_default_node_attr, |
551 | .get_task_tag = ft_get_task_tag, | 550 | .get_task_tag = ft_get_task_tag, |
552 | .get_cmd_state = ft_get_cmd_state, | 551 | .get_cmd_state = ft_get_cmd_state, |
553 | .new_cmd_failure = ft_new_cmd_failure, | ||
554 | .queue_data_in = ft_queue_data_in, | 552 | .queue_data_in = ft_queue_data_in, |
555 | .queue_status = ft_queue_status, | 553 | .queue_status = ft_queue_status, |
556 | .queue_tm_rsp = ft_queue_tm_resp, | 554 | .queue_tm_rsp = ft_queue_tm_resp, |
@@ -582,10 +580,10 @@ int ft_register_configfs(void) | |||
582 | * Register the top level struct config_item_type with TCM core | 580 | * Register the top level struct config_item_type with TCM core |
583 | */ | 581 | */ |
584 | fabric = target_fabric_configfs_init(THIS_MODULE, "fc"); | 582 | fabric = target_fabric_configfs_init(THIS_MODULE, "fc"); |
585 | if (!fabric) { | 583 | if (IS_ERR(fabric)) { |
586 | printk(KERN_INFO "%s: target_fabric_configfs_init() failed!\n", | 584 | pr_err("%s: target_fabric_configfs_init() failed!\n", |
587 | __func__); | 585 | __func__); |
588 | return -1; | 586 | return PTR_ERR(fabric); |
589 | } | 587 | } |
590 | fabric->tf_ops = ft_fabric_ops; | 588 | fabric->tf_ops = ft_fabric_ops; |
591 | 589 | ||
@@ -610,11 +608,8 @@ int ft_register_configfs(void) | |||
610 | */ | 608 | */ |
611 | ret = target_fabric_configfs_register(fabric); | 609 | ret = target_fabric_configfs_register(fabric); |
612 | if (ret < 0) { | 610 | if (ret < 0) { |
613 | FT_CONF_DBG("target_fabric_configfs_register() for" | 611 | pr_debug("target_fabric_configfs_register() for" |
614 | " FC Target failed!\n"); | 612 | " FC Target failed!\n"); |
615 | printk(KERN_INFO | ||
616 | "%s: target_fabric_configfs_register() failed!\n", | ||
617 | __func__); | ||
618 | target_fabric_configfs_free(fabric); | 613 | target_fabric_configfs_free(fabric); |
619 | return -1; | 614 | return -1; |
620 | } | 615 | } |