aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/target/target_core_configfs.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_configfs.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_configfs.c')
-rw-r--r--drivers/target/target_core_configfs.c464
1 files changed, 232 insertions, 232 deletions
diff --git a/drivers/target/target_core_configfs.c b/drivers/target/target_core_configfs.c
index 6b00810b8dc..e56c39daeec 100644
--- a/drivers/target/target_core_configfs.c
+++ b/drivers/target/target_core_configfs.c
@@ -104,12 +104,12 @@ static struct target_fabric_configfs *target_core_get_fabric(
104{ 104{
105 struct target_fabric_configfs *tf; 105 struct target_fabric_configfs *tf;
106 106
107 if (!(name)) 107 if (!name)
108 return NULL; 108 return NULL;
109 109
110 mutex_lock(&g_tf_lock); 110 mutex_lock(&g_tf_lock);
111 list_for_each_entry(tf, &g_tf_list, tf_list) { 111 list_for_each_entry(tf, &g_tf_list, tf_list) {
112 if (!(strcmp(tf->tf_name, name))) { 112 if (!strcmp(tf->tf_name, name)) {
113 atomic_inc(&tf->tf_access_cnt); 113 atomic_inc(&tf->tf_access_cnt);
114 mutex_unlock(&g_tf_lock); 114 mutex_unlock(&g_tf_lock);
115 return tf; 115 return tf;
@@ -130,7 +130,7 @@ static struct config_group *target_core_register_fabric(
130 struct target_fabric_configfs *tf; 130 struct target_fabric_configfs *tf;
131 int ret; 131 int ret;
132 132
133 printk(KERN_INFO "Target_Core_ConfigFS: REGISTER -> group: %p name:" 133 pr_debug("Target_Core_ConfigFS: REGISTER -> group: %p name:"
134 " %s\n", group, name); 134 " %s\n", group, name);
135 /* 135 /*
136 * Ensure that TCM subsystem plugins are loaded at this point for 136 * Ensure that TCM subsystem plugins are loaded at this point for
@@ -150,7 +150,7 @@ static struct config_group *target_core_register_fabric(
150 * registered, but simply provids auto loading logic for modules with 150 * registered, but simply provids auto loading logic for modules with
151 * mkdir(2) system calls with known TCM fabric modules. 151 * mkdir(2) system calls with known TCM fabric modules.
152 */ 152 */
153 if (!(strncmp(name, "iscsi", 5))) { 153 if (!strncmp(name, "iscsi", 5)) {
154 /* 154 /*
155 * Automatically load the LIO Target fabric module when the 155 * Automatically load the LIO Target fabric module when the
156 * following is called: 156 * following is called:
@@ -159,11 +159,11 @@ static struct config_group *target_core_register_fabric(
159 */ 159 */
160 ret = request_module("iscsi_target_mod"); 160 ret = request_module("iscsi_target_mod");
161 if (ret < 0) { 161 if (ret < 0) {
162 printk(KERN_ERR "request_module() failed for" 162 pr_err("request_module() failed for"
163 " iscsi_target_mod.ko: %d\n", ret); 163 " iscsi_target_mod.ko: %d\n", ret);
164 return ERR_PTR(-EINVAL); 164 return ERR_PTR(-EINVAL);
165 } 165 }
166 } else if (!(strncmp(name, "loopback", 8))) { 166 } else if (!strncmp(name, "loopback", 8)) {
167 /* 167 /*
168 * Automatically load the tcm_loop fabric module when the 168 * Automatically load the tcm_loop fabric module when the
169 * following is called: 169 * following is called:
@@ -172,25 +172,25 @@ static struct config_group *target_core_register_fabric(
172 */ 172 */
173 ret = request_module("tcm_loop"); 173 ret = request_module("tcm_loop");
174 if (ret < 0) { 174 if (ret < 0) {
175 printk(KERN_ERR "request_module() failed for" 175 pr_err("request_module() failed for"
176 " tcm_loop.ko: %d\n", ret); 176 " tcm_loop.ko: %d\n", ret);
177 return ERR_PTR(-EINVAL); 177 return ERR_PTR(-EINVAL);
178 } 178 }
179 } 179 }
180 180
181 tf = target_core_get_fabric(name); 181 tf = target_core_get_fabric(name);
182 if (!(tf)) { 182 if (!tf) {
183 printk(KERN_ERR "target_core_get_fabric() failed for %s\n", 183 pr_err("target_core_get_fabric() failed for %s\n",
184 name); 184 name);
185 return ERR_PTR(-EINVAL); 185 return ERR_PTR(-EINVAL);
186 } 186 }
187 printk(KERN_INFO "Target_Core_ConfigFS: REGISTER -> Located fabric:" 187 pr_debug("Target_Core_ConfigFS: REGISTER -> Located fabric:"
188 " %s\n", tf->tf_name); 188 " %s\n", tf->tf_name);
189 /* 189 /*
190 * On a successful target_core_get_fabric() look, the returned 190 * On a successful target_core_get_fabric() look, the returned
191 * struct target_fabric_configfs *tf will contain a usage reference. 191 * struct target_fabric_configfs *tf will contain a usage reference.
192 */ 192 */
193 printk(KERN_INFO "Target_Core_ConfigFS: REGISTER tfc_wwn_cit -> %p\n", 193 pr_debug("Target_Core_ConfigFS: REGISTER tfc_wwn_cit -> %p\n",
194 &TF_CIT_TMPL(tf)->tfc_wwn_cit); 194 &TF_CIT_TMPL(tf)->tfc_wwn_cit);
195 195
196 tf->tf_group.default_groups = tf->tf_default_groups; 196 tf->tf_group.default_groups = tf->tf_default_groups;
@@ -202,14 +202,14 @@ static struct config_group *target_core_register_fabric(
202 config_group_init_type_name(&tf->tf_disc_group, "discovery_auth", 202 config_group_init_type_name(&tf->tf_disc_group, "discovery_auth",
203 &TF_CIT_TMPL(tf)->tfc_discovery_cit); 203 &TF_CIT_TMPL(tf)->tfc_discovery_cit);
204 204
205 printk(KERN_INFO "Target_Core_ConfigFS: REGISTER -> Allocated Fabric:" 205 pr_debug("Target_Core_ConfigFS: REGISTER -> Allocated Fabric:"
206 " %s\n", tf->tf_group.cg_item.ci_name); 206 " %s\n", tf->tf_group.cg_item.ci_name);
207 /* 207 /*
208 * Setup tf_ops.tf_subsys pointer for usage with configfs_depend_item() 208 * Setup tf_ops.tf_subsys pointer for usage with configfs_depend_item()
209 */ 209 */
210 tf->tf_ops.tf_subsys = tf->tf_subsys; 210 tf->tf_ops.tf_subsys = tf->tf_subsys;
211 tf->tf_fabric = &tf->tf_group.cg_item; 211 tf->tf_fabric = &tf->tf_group.cg_item;
212 printk(KERN_INFO "Target_Core_ConfigFS: REGISTER -> Set tf->tf_fabric" 212 pr_debug("Target_Core_ConfigFS: REGISTER -> Set tf->tf_fabric"
213 " for %s\n", name); 213 " for %s\n", name);
214 214
215 return &tf->tf_group; 215 return &tf->tf_group;
@@ -228,18 +228,18 @@ static void target_core_deregister_fabric(
228 struct config_item *df_item; 228 struct config_item *df_item;
229 int i; 229 int i;
230 230
231 printk(KERN_INFO "Target_Core_ConfigFS: DEREGISTER -> Looking up %s in" 231 pr_debug("Target_Core_ConfigFS: DEREGISTER -> Looking up %s in"
232 " tf list\n", config_item_name(item)); 232 " tf list\n", config_item_name(item));
233 233
234 printk(KERN_INFO "Target_Core_ConfigFS: DEREGISTER -> located fabric:" 234 pr_debug("Target_Core_ConfigFS: DEREGISTER -> located fabric:"
235 " %s\n", tf->tf_name); 235 " %s\n", tf->tf_name);
236 atomic_dec(&tf->tf_access_cnt); 236 atomic_dec(&tf->tf_access_cnt);
237 237
238 printk(KERN_INFO "Target_Core_ConfigFS: DEREGISTER -> Releasing" 238 pr_debug("Target_Core_ConfigFS: DEREGISTER -> Releasing"
239 " tf->tf_fabric for %s\n", tf->tf_name); 239 " tf->tf_fabric for %s\n", tf->tf_name);
240 tf->tf_fabric = NULL; 240 tf->tf_fabric = NULL;
241 241
242 printk(KERN_INFO "Target_Core_ConfigFS: DEREGISTER -> Releasing ci" 242 pr_debug("Target_Core_ConfigFS: DEREGISTER -> Releasing ci"
243 " %s\n", config_item_name(item)); 243 " %s\n", config_item_name(item));
244 244
245 tf_group = &tf->tf_group; 245 tf_group = &tf->tf_group;
@@ -307,17 +307,17 @@ struct target_fabric_configfs *target_fabric_configfs_init(
307 struct target_fabric_configfs *tf; 307 struct target_fabric_configfs *tf;
308 308
309 if (!(name)) { 309 if (!(name)) {
310 printk(KERN_ERR "Unable to locate passed fabric name\n"); 310 pr_err("Unable to locate passed fabric name\n");
311 return ERR_PTR(-EINVAL); 311 return ERR_PTR(-EINVAL);
312 } 312 }
313 if (strlen(name) >= TARGET_FABRIC_NAME_SIZE) { 313 if (strlen(name) >= TARGET_FABRIC_NAME_SIZE) {
314 printk(KERN_ERR "Passed name: %s exceeds TARGET_FABRIC" 314 pr_err("Passed name: %s exceeds TARGET_FABRIC"
315 "_NAME_SIZE\n", name); 315 "_NAME_SIZE\n", name);
316 return ERR_PTR(-EINVAL); 316 return ERR_PTR(-EINVAL);
317 } 317 }
318 318
319 tf = kzalloc(sizeof(struct target_fabric_configfs), GFP_KERNEL); 319 tf = kzalloc(sizeof(struct target_fabric_configfs), GFP_KERNEL);
320 if (!(tf)) 320 if (!tf)
321 return ERR_PTR(-ENOMEM); 321 return ERR_PTR(-ENOMEM);
322 322
323 INIT_LIST_HEAD(&tf->tf_list); 323 INIT_LIST_HEAD(&tf->tf_list);
@@ -336,9 +336,9 @@ struct target_fabric_configfs *target_fabric_configfs_init(
336 list_add_tail(&tf->tf_list, &g_tf_list); 336 list_add_tail(&tf->tf_list, &g_tf_list);
337 mutex_unlock(&g_tf_lock); 337 mutex_unlock(&g_tf_lock);
338 338
339 printk(KERN_INFO "<<<<<<<<<<<<<<<<<<<<<< BEGIN FABRIC API >>>>>>>>" 339 pr_debug("<<<<<<<<<<<<<<<<<<<<<< BEGIN FABRIC API >>>>>>>>"
340 ">>>>>>>>>>>>>>\n"); 340 ">>>>>>>>>>>>>>\n");
341 printk(KERN_INFO "Initialized struct target_fabric_configfs: %p for" 341 pr_debug("Initialized struct target_fabric_configfs: %p for"
342 " %s\n", tf, tf->tf_name); 342 " %s\n", tf, tf->tf_name);
343 return tf; 343 return tf;
344} 344}
@@ -367,132 +367,132 @@ static int target_fabric_tf_ops_check(
367{ 367{
368 struct target_core_fabric_ops *tfo = &tf->tf_ops; 368 struct target_core_fabric_ops *tfo = &tf->tf_ops;
369 369
370 if (!(tfo->get_fabric_name)) { 370 if (!tfo->get_fabric_name) {
371 printk(KERN_ERR "Missing tfo->get_fabric_name()\n"); 371 pr_err("Missing tfo->get_fabric_name()\n");
372 return -EINVAL; 372 return -EINVAL;
373 } 373 }
374 if (!(tfo->get_fabric_proto_ident)) { 374 if (!tfo->get_fabric_proto_ident) {
375 printk(KERN_ERR "Missing tfo->get_fabric_proto_ident()\n"); 375 pr_err("Missing tfo->get_fabric_proto_ident()\n");
376 return -EINVAL; 376 return -EINVAL;
377 } 377 }
378 if (!(tfo->tpg_get_wwn)) { 378 if (!tfo->tpg_get_wwn) {
379 printk(KERN_ERR "Missing tfo->tpg_get_wwn()\n"); 379 pr_err("Missing tfo->tpg_get_wwn()\n");
380 return -EINVAL; 380 return -EINVAL;
381 } 381 }
382 if (!(tfo->tpg_get_tag)) { 382 if (!tfo->tpg_get_tag) {
383 printk(KERN_ERR "Missing tfo->tpg_get_tag()\n"); 383 pr_err("Missing tfo->tpg_get_tag()\n");
384 return -EINVAL; 384 return -EINVAL;
385 } 385 }
386 if (!(tfo->tpg_get_default_depth)) { 386 if (!tfo->tpg_get_default_depth) {
387 printk(KERN_ERR "Missing tfo->tpg_get_default_depth()\n"); 387 pr_err("Missing tfo->tpg_get_default_depth()\n");
388 return -EINVAL; 388 return -EINVAL;
389 } 389 }
390 if (!(tfo->tpg_get_pr_transport_id)) { 390 if (!tfo->tpg_get_pr_transport_id) {
391 printk(KERN_ERR "Missing tfo->tpg_get_pr_transport_id()\n"); 391 pr_err("Missing tfo->tpg_get_pr_transport_id()\n");
392 return -EINVAL; 392 return -EINVAL;
393 } 393 }
394 if (!(tfo->tpg_get_pr_transport_id_len)) { 394 if (!tfo->tpg_get_pr_transport_id_len) {
395 printk(KERN_ERR "Missing tfo->tpg_get_pr_transport_id_len()\n"); 395 pr_err("Missing tfo->tpg_get_pr_transport_id_len()\n");
396 return -EINVAL; 396 return -EINVAL;
397 } 397 }
398 if (!(tfo->tpg_check_demo_mode)) { 398 if (!tfo->tpg_check_demo_mode) {
399 printk(KERN_ERR "Missing tfo->tpg_check_demo_mode()\n"); 399 pr_err("Missing tfo->tpg_check_demo_mode()\n");
400 return -EINVAL; 400 return -EINVAL;
401 } 401 }
402 if (!(tfo->tpg_check_demo_mode_cache)) { 402 if (!tfo->tpg_check_demo_mode_cache) {
403 printk(KERN_ERR "Missing tfo->tpg_check_demo_mode_cache()\n"); 403 pr_err("Missing tfo->tpg_check_demo_mode_cache()\n");
404 return -EINVAL; 404 return -EINVAL;
405 } 405 }
406 if (!(tfo->tpg_check_demo_mode_write_protect)) { 406 if (!tfo->tpg_check_demo_mode_write_protect) {
407 printk(KERN_ERR "Missing tfo->tpg_check_demo_mode_write_protect()\n"); 407 pr_err("Missing tfo->tpg_check_demo_mode_write_protect()\n");
408 return -EINVAL; 408 return -EINVAL;
409 } 409 }
410 if (!(tfo->tpg_check_prod_mode_write_protect)) { 410 if (!tfo->tpg_check_prod_mode_write_protect) {
411 printk(KERN_ERR "Missing tfo->tpg_check_prod_mode_write_protect()\n"); 411 pr_err("Missing tfo->tpg_check_prod_mode_write_protect()\n");
412 return -EINVAL; 412 return -EINVAL;
413 } 413 }
414 if (!(tfo->tpg_alloc_fabric_acl)) { 414 if (!tfo->tpg_alloc_fabric_acl) {
415 printk(KERN_ERR "Missing tfo->tpg_alloc_fabric_acl()\n"); 415 pr_err("Missing tfo->tpg_alloc_fabric_acl()\n");
416 return -EINVAL; 416 return -EINVAL;
417 } 417 }
418 if (!(tfo->tpg_release_fabric_acl)) { 418 if (!tfo->tpg_release_fabric_acl) {
419 printk(KERN_ERR "Missing tfo->tpg_release_fabric_acl()\n"); 419 pr_err("Missing tfo->tpg_release_fabric_acl()\n");
420 return -EINVAL; 420 return -EINVAL;
421 } 421 }
422 if (!(tfo->tpg_get_inst_index)) { 422 if (!tfo->tpg_get_inst_index) {
423 printk(KERN_ERR "Missing tfo->tpg_get_inst_index()\n"); 423 pr_err("Missing tfo->tpg_get_inst_index()\n");
424 return -EINVAL; 424 return -EINVAL;
425 } 425 }
426 if (!tfo->release_cmd) { 426 if (!tfo->release_cmd) {
427 printk(KERN_ERR "Missing tfo->release_cmd()\n"); 427 pr_err("Missing tfo->release_cmd()\n");
428 return -EINVAL; 428 return -EINVAL;
429 } 429 }
430 if (!(tfo->shutdown_session)) { 430 if (!tfo->shutdown_session) {
431 printk(KERN_ERR "Missing tfo->shutdown_session()\n"); 431 pr_err("Missing tfo->shutdown_session()\n");
432 return -EINVAL; 432 return -EINVAL;
433 } 433 }
434 if (!(tfo->close_session)) { 434 if (!tfo->close_session) {
435 printk(KERN_ERR "Missing tfo->close_session()\n"); 435 pr_err("Missing tfo->close_session()\n");
436 return -EINVAL; 436 return -EINVAL;
437 } 437 }
438 if (!(tfo->stop_session)) { 438 if (!tfo->stop_session) {
439 printk(KERN_ERR "Missing tfo->stop_session()\n"); 439 pr_err("Missing tfo->stop_session()\n");
440 return -EINVAL; 440 return -EINVAL;
441 } 441 }
442 if (!(tfo->fall_back_to_erl0)) { 442 if (!tfo->fall_back_to_erl0) {
443 printk(KERN_ERR "Missing tfo->fall_back_to_erl0()\n"); 443 pr_err("Missing tfo->fall_back_to_erl0()\n");
444 return -EINVAL; 444 return -EINVAL;
445 } 445 }
446 if (!(tfo->sess_logged_in)) { 446 if (!tfo->sess_logged_in) {
447 printk(KERN_ERR "Missing tfo->sess_logged_in()\n"); 447 pr_err("Missing tfo->sess_logged_in()\n");
448 return -EINVAL; 448 return -EINVAL;
449 } 449 }
450 if (!(tfo->sess_get_index)) { 450 if (!tfo->sess_get_index) {
451 printk(KERN_ERR "Missing tfo->sess_get_index()\n"); 451 pr_err("Missing tfo->sess_get_index()\n");
452 return -EINVAL; 452 return -EINVAL;
453 } 453 }
454 if (!(tfo->write_pending)) { 454 if (!tfo->write_pending) {
455 printk(KERN_ERR "Missing tfo->write_pending()\n"); 455 pr_err("Missing tfo->write_pending()\n");
456 return -EINVAL; 456 return -EINVAL;
457 } 457 }
458 if (!(tfo->write_pending_status)) { 458 if (!tfo->write_pending_status) {
459 printk(KERN_ERR "Missing tfo->write_pending_status()\n"); 459 pr_err("Missing tfo->write_pending_status()\n");
460 return -EINVAL; 460 return -EINVAL;
461 } 461 }
462 if (!(tfo->set_default_node_attributes)) { 462 if (!tfo->set_default_node_attributes) {
463 printk(KERN_ERR "Missing tfo->set_default_node_attributes()\n"); 463 pr_err("Missing tfo->set_default_node_attributes()\n");
464 return -EINVAL; 464 return -EINVAL;
465 } 465 }
466 if (!(tfo->get_task_tag)) { 466 if (!tfo->get_task_tag) {
467 printk(KERN_ERR "Missing tfo->get_task_tag()\n"); 467 pr_err("Missing tfo->get_task_tag()\n");
468 return -EINVAL; 468 return -EINVAL;
469 } 469 }
470 if (!(tfo->get_cmd_state)) { 470 if (!tfo->get_cmd_state) {
471 printk(KERN_ERR "Missing tfo->get_cmd_state()\n"); 471 pr_err("Missing tfo->get_cmd_state()\n");
472 return -EINVAL; 472 return -EINVAL;
473 } 473 }
474 if (!(tfo->queue_data_in)) { 474 if (!tfo->queue_data_in) {
475 printk(KERN_ERR "Missing tfo->queue_data_in()\n"); 475 pr_err("Missing tfo->queue_data_in()\n");
476 return -EINVAL; 476 return -EINVAL;
477 } 477 }
478 if (!(tfo->queue_status)) { 478 if (!tfo->queue_status) {
479 printk(KERN_ERR "Missing tfo->queue_status()\n"); 479 pr_err("Missing tfo->queue_status()\n");
480 return -EINVAL; 480 return -EINVAL;
481 } 481 }
482 if (!(tfo->queue_tm_rsp)) { 482 if (!tfo->queue_tm_rsp) {
483 printk(KERN_ERR "Missing tfo->queue_tm_rsp()\n"); 483 pr_err("Missing tfo->queue_tm_rsp()\n");
484 return -EINVAL; 484 return -EINVAL;
485 } 485 }
486 if (!(tfo->set_fabric_sense_len)) { 486 if (!tfo->set_fabric_sense_len) {
487 printk(KERN_ERR "Missing tfo->set_fabric_sense_len()\n"); 487 pr_err("Missing tfo->set_fabric_sense_len()\n");
488 return -EINVAL; 488 return -EINVAL;
489 } 489 }
490 if (!(tfo->get_fabric_sense_len)) { 490 if (!tfo->get_fabric_sense_len) {
491 printk(KERN_ERR "Missing tfo->get_fabric_sense_len()\n"); 491 pr_err("Missing tfo->get_fabric_sense_len()\n");
492 return -EINVAL; 492 return -EINVAL;
493 } 493 }
494 if (!(tfo->is_state_remove)) { 494 if (!tfo->is_state_remove) {
495 printk(KERN_ERR "Missing tfo->is_state_remove()\n"); 495 pr_err("Missing tfo->is_state_remove()\n");
496 return -EINVAL; 496 return -EINVAL;
497 } 497 }
498 /* 498 /*
@@ -500,20 +500,20 @@ static int target_fabric_tf_ops_check(
500 * tfo->fabric_make_tpg() and tfo->fabric_drop_tpg() in 500 * tfo->fabric_make_tpg() and tfo->fabric_drop_tpg() in
501 * target_core_fabric_configfs.c WWN+TPG group context code. 501 * target_core_fabric_configfs.c WWN+TPG group context code.
502 */ 502 */
503 if (!(tfo->fabric_make_wwn)) { 503 if (!tfo->fabric_make_wwn) {
504 printk(KERN_ERR "Missing tfo->fabric_make_wwn()\n"); 504 pr_err("Missing tfo->fabric_make_wwn()\n");
505 return -EINVAL; 505 return -EINVAL;
506 } 506 }
507 if (!(tfo->fabric_drop_wwn)) { 507 if (!tfo->fabric_drop_wwn) {
508 printk(KERN_ERR "Missing tfo->fabric_drop_wwn()\n"); 508 pr_err("Missing tfo->fabric_drop_wwn()\n");
509 return -EINVAL; 509 return -EINVAL;
510 } 510 }
511 if (!(tfo->fabric_make_tpg)) { 511 if (!tfo->fabric_make_tpg) {
512 printk(KERN_ERR "Missing tfo->fabric_make_tpg()\n"); 512 pr_err("Missing tfo->fabric_make_tpg()\n");
513 return -EINVAL; 513 return -EINVAL;
514 } 514 }
515 if (!(tfo->fabric_drop_tpg)) { 515 if (!tfo->fabric_drop_tpg) {
516 printk(KERN_ERR "Missing tfo->fabric_drop_tpg()\n"); 516 pr_err("Missing tfo->fabric_drop_tpg()\n");
517 return -EINVAL; 517 return -EINVAL;
518 } 518 }
519 519
@@ -533,13 +533,13 @@ int target_fabric_configfs_register(
533{ 533{
534 int ret; 534 int ret;
535 535
536 if (!(tf)) { 536 if (!tf) {
537 printk(KERN_ERR "Unable to locate target_fabric_configfs" 537 pr_err("Unable to locate target_fabric_configfs"
538 " pointer\n"); 538 " pointer\n");
539 return -EINVAL; 539 return -EINVAL;
540 } 540 }
541 if (!(tf->tf_subsys)) { 541 if (!tf->tf_subsys) {
542 printk(KERN_ERR "Unable to target struct config_subsystem" 542 pr_err("Unable to target struct config_subsystem"
543 " pointer\n"); 543 " pointer\n");
544 return -EINVAL; 544 return -EINVAL;
545 } 545 }
@@ -547,7 +547,7 @@ int target_fabric_configfs_register(
547 if (ret < 0) 547 if (ret < 0)
548 return ret; 548 return ret;
549 549
550 printk(KERN_INFO "<<<<<<<<<<<<<<<<<<<<<< END FABRIC API >>>>>>>>>>>>" 550 pr_debug("<<<<<<<<<<<<<<<<<<<<<< END FABRIC API >>>>>>>>>>>>"
551 ">>>>>>>>>>\n"); 551 ">>>>>>>>>>\n");
552 return 0; 552 return 0;
553} 553}
@@ -558,36 +558,36 @@ void target_fabric_configfs_deregister(
558{ 558{
559 struct configfs_subsystem *su; 559 struct configfs_subsystem *su;
560 560
561 if (!(tf)) { 561 if (!tf) {
562 printk(KERN_ERR "Unable to locate passed target_fabric_" 562 pr_err("Unable to locate passed target_fabric_"
563 "configfs\n"); 563 "configfs\n");
564 return; 564 return;
565 } 565 }
566 su = tf->tf_subsys; 566 su = tf->tf_subsys;
567 if (!(su)) { 567 if (!su) {
568 printk(KERN_ERR "Unable to locate passed tf->tf_subsys" 568 pr_err("Unable to locate passed tf->tf_subsys"
569 " pointer\n"); 569 " pointer\n");
570 return; 570 return;
571 } 571 }
572 printk(KERN_INFO "<<<<<<<<<<<<<<<<<<<<<< BEGIN FABRIC API >>>>>>>>>>" 572 pr_debug("<<<<<<<<<<<<<<<<<<<<<< BEGIN FABRIC API >>>>>>>>>>"
573 ">>>>>>>>>>>>\n"); 573 ">>>>>>>>>>>>\n");
574 mutex_lock(&g_tf_lock); 574 mutex_lock(&g_tf_lock);
575 if (atomic_read(&tf->tf_access_cnt)) { 575 if (atomic_read(&tf->tf_access_cnt)) {
576 mutex_unlock(&g_tf_lock); 576 mutex_unlock(&g_tf_lock);
577 printk(KERN_ERR "Non zero tf->tf_access_cnt for fabric %s\n", 577 pr_err("Non zero tf->tf_access_cnt for fabric %s\n",
578 tf->tf_name); 578 tf->tf_name);
579 BUG(); 579 BUG();
580 } 580 }
581 list_del(&tf->tf_list); 581 list_del(&tf->tf_list);
582 mutex_unlock(&g_tf_lock); 582 mutex_unlock(&g_tf_lock);
583 583
584 printk(KERN_INFO "Target_Core_ConfigFS: DEREGISTER -> Releasing tf:" 584 pr_debug("Target_Core_ConfigFS: DEREGISTER -> Releasing tf:"
585 " %s\n", tf->tf_name); 585 " %s\n", tf->tf_name);
586 tf->tf_module = NULL; 586 tf->tf_module = NULL;
587 tf->tf_subsys = NULL; 587 tf->tf_subsys = NULL;
588 kfree(tf); 588 kfree(tf);
589 589
590 printk("<<<<<<<<<<<<<<<<<<<<<< END FABRIC API >>>>>>>>>>>>>>>>>" 590 pr_debug("<<<<<<<<<<<<<<<<<<<<<< END FABRIC API >>>>>>>>>>>>>>>>>"
591 ">>>>>\n"); 591 ">>>>>\n");
592} 592}
593EXPORT_SYMBOL(target_fabric_configfs_deregister); 593EXPORT_SYMBOL(target_fabric_configfs_deregister);
@@ -609,7 +609,7 @@ static ssize_t target_core_dev_show_attr_##_name( \
609 \ 609 \
610 spin_lock(&se_dev->se_dev_lock); \ 610 spin_lock(&se_dev->se_dev_lock); \
611 dev = se_dev->se_dev_ptr; \ 611 dev = se_dev->se_dev_ptr; \
612 if (!(dev)) { \ 612 if (!dev) { \
613 spin_unlock(&se_dev->se_dev_lock); \ 613 spin_unlock(&se_dev->se_dev_lock); \
614 return -ENODEV; \ 614 return -ENODEV; \
615 } \ 615 } \
@@ -633,14 +633,14 @@ static ssize_t target_core_dev_store_attr_##_name( \
633 \ 633 \
634 spin_lock(&se_dev->se_dev_lock); \ 634 spin_lock(&se_dev->se_dev_lock); \
635 dev = se_dev->se_dev_ptr; \ 635 dev = se_dev->se_dev_ptr; \
636 if (!(dev)) { \ 636 if (!dev) { \
637 spin_unlock(&se_dev->se_dev_lock); \ 637 spin_unlock(&se_dev->se_dev_lock); \
638 return -ENODEV; \ 638 return -ENODEV; \
639 } \ 639 } \
640 ret = strict_strtoul(page, 0, &val); \ 640 ret = strict_strtoul(page, 0, &val); \
641 if (ret < 0) { \ 641 if (ret < 0) { \
642 spin_unlock(&se_dev->se_dev_lock); \ 642 spin_unlock(&se_dev->se_dev_lock); \
643 printk(KERN_ERR "strict_strtoul() failed with" \ 643 pr_err("strict_strtoul() failed with" \
644 " ret: %d\n", ret); \ 644 " ret: %d\n", ret); \
645 return -EINVAL; \ 645 return -EINVAL; \
646 } \ 646 } \
@@ -806,7 +806,7 @@ static ssize_t target_core_dev_wwn_show_attr_vpd_unit_serial(
806 struct se_device *dev; 806 struct se_device *dev;
807 807
808 dev = se_dev->se_dev_ptr; 808 dev = se_dev->se_dev_ptr;
809 if (!(dev)) 809 if (!dev)
810 return -ENODEV; 810 return -ENODEV;
811 811
812 return sprintf(page, "T10 VPD Unit Serial Number: %s\n", 812 return sprintf(page, "T10 VPD Unit Serial Number: %s\n",
@@ -833,13 +833,13 @@ static ssize_t target_core_dev_wwn_store_attr_vpd_unit_serial(
833 * VPD Unit Serial Number that OS dependent multipath can depend on. 833 * VPD Unit Serial Number that OS dependent multipath can depend on.
834 */ 834 */
835 if (su_dev->su_dev_flags & SDF_FIRMWARE_VPD_UNIT_SERIAL) { 835 if (su_dev->su_dev_flags & SDF_FIRMWARE_VPD_UNIT_SERIAL) {
836 printk(KERN_ERR "Underlying SCSI device firmware provided VPD" 836 pr_err("Underlying SCSI device firmware provided VPD"
837 " Unit Serial, ignoring request\n"); 837 " Unit Serial, ignoring request\n");
838 return -EOPNOTSUPP; 838 return -EOPNOTSUPP;
839 } 839 }
840 840
841 if (strlen(page) >= INQUIRY_VPD_SERIAL_LEN) { 841 if (strlen(page) >= INQUIRY_VPD_SERIAL_LEN) {
842 printk(KERN_ERR "Emulated VPD Unit Serial exceeds" 842 pr_err("Emulated VPD Unit Serial exceeds"
843 " INQUIRY_VPD_SERIAL_LEN: %d\n", INQUIRY_VPD_SERIAL_LEN); 843 " INQUIRY_VPD_SERIAL_LEN: %d\n", INQUIRY_VPD_SERIAL_LEN);
844 return -EOVERFLOW; 844 return -EOVERFLOW;
845 } 845 }
@@ -850,9 +850,9 @@ static ssize_t target_core_dev_wwn_store_attr_vpd_unit_serial(
850 * could cause negative effects. 850 * could cause negative effects.
851 */ 851 */
852 dev = su_dev->se_dev_ptr; 852 dev = su_dev->se_dev_ptr;
853 if ((dev)) { 853 if (dev) {
854 if (atomic_read(&dev->dev_export_obj.obj_access_count)) { 854 if (atomic_read(&dev->dev_export_obj.obj_access_count)) {
855 printk(KERN_ERR "Unable to set VPD Unit Serial while" 855 pr_err("Unable to set VPD Unit Serial while"
856 " active %d $FABRIC_MOD exports exist\n", 856 " active %d $FABRIC_MOD exports exist\n",
857 atomic_read(&dev->dev_export_obj.obj_access_count)); 857 atomic_read(&dev->dev_export_obj.obj_access_count));
858 return -EINVAL; 858 return -EINVAL;
@@ -870,7 +870,7 @@ static ssize_t target_core_dev_wwn_store_attr_vpd_unit_serial(
870 "%s", strstrip(buf)); 870 "%s", strstrip(buf));
871 su_dev->su_dev_flags |= SDF_EMULATED_VPD_UNIT_SERIAL; 871 su_dev->su_dev_flags |= SDF_EMULATED_VPD_UNIT_SERIAL;
872 872
873 printk(KERN_INFO "Target_Core_ConfigFS: Set emulated VPD Unit Serial:" 873 pr_debug("Target_Core_ConfigFS: Set emulated VPD Unit Serial:"
874 " %s\n", su_dev->t10_wwn.unit_serial); 874 " %s\n", su_dev->t10_wwn.unit_serial);
875 875
876 return count; 876 return count;
@@ -892,19 +892,19 @@ static ssize_t target_core_dev_wwn_show_attr_vpd_protocol_identifier(
892 ssize_t len = 0; 892 ssize_t len = 0;
893 893
894 dev = se_dev->se_dev_ptr; 894 dev = se_dev->se_dev_ptr;
895 if (!(dev)) 895 if (!dev)
896 return -ENODEV; 896 return -ENODEV;
897 897
898 memset(buf, 0, VPD_TMP_BUF_SIZE); 898 memset(buf, 0, VPD_TMP_BUF_SIZE);
899 899
900 spin_lock(&t10_wwn->t10_vpd_lock); 900 spin_lock(&t10_wwn->t10_vpd_lock);
901 list_for_each_entry(vpd, &t10_wwn->t10_vpd_list, vpd_list) { 901 list_for_each_entry(vpd, &t10_wwn->t10_vpd_list, vpd_list) {
902 if (!(vpd->protocol_identifier_set)) 902 if (!vpd->protocol_identifier_set)
903 continue; 903 continue;
904 904
905 transport_dump_vpd_proto_id(vpd, buf, VPD_TMP_BUF_SIZE); 905 transport_dump_vpd_proto_id(vpd, buf, VPD_TMP_BUF_SIZE);
906 906
907 if ((len + strlen(buf) >= PAGE_SIZE)) 907 if (len + strlen(buf) >= PAGE_SIZE)
908 break; 908 break;
909 909
910 len += sprintf(page+len, "%s", buf); 910 len += sprintf(page+len, "%s", buf);
@@ -939,7 +939,7 @@ static ssize_t target_core_dev_wwn_show_attr_##_name( \
939 ssize_t len = 0; \ 939 ssize_t len = 0; \
940 \ 940 \
941 dev = se_dev->se_dev_ptr; \ 941 dev = se_dev->se_dev_ptr; \
942 if (!(dev)) \ 942 if (!dev) \
943 return -ENODEV; \ 943 return -ENODEV; \
944 \ 944 \
945 spin_lock(&t10_wwn->t10_vpd_lock); \ 945 spin_lock(&t10_wwn->t10_vpd_lock); \
@@ -949,19 +949,19 @@ static ssize_t target_core_dev_wwn_show_attr_##_name( \
949 \ 949 \
950 memset(buf, 0, VPD_TMP_BUF_SIZE); \ 950 memset(buf, 0, VPD_TMP_BUF_SIZE); \
951 transport_dump_vpd_assoc(vpd, buf, VPD_TMP_BUF_SIZE); \ 951 transport_dump_vpd_assoc(vpd, buf, VPD_TMP_BUF_SIZE); \
952 if ((len + strlen(buf) >= PAGE_SIZE)) \ 952 if (len + strlen(buf) >= PAGE_SIZE) \
953 break; \ 953 break; \
954 len += sprintf(page+len, "%s", buf); \ 954 len += sprintf(page+len, "%s", buf); \
955 \ 955 \
956 memset(buf, 0, VPD_TMP_BUF_SIZE); \ 956 memset(buf, 0, VPD_TMP_BUF_SIZE); \
957 transport_dump_vpd_ident_type(vpd, buf, VPD_TMP_BUF_SIZE); \ 957 transport_dump_vpd_ident_type(vpd, buf, VPD_TMP_BUF_SIZE); \
958 if ((len + strlen(buf) >= PAGE_SIZE)) \ 958 if (len + strlen(buf) >= PAGE_SIZE) \
959 break; \ 959 break; \
960 len += sprintf(page+len, "%s", buf); \ 960 len += sprintf(page+len, "%s", buf); \
961 \ 961 \
962 memset(buf, 0, VPD_TMP_BUF_SIZE); \ 962 memset(buf, 0, VPD_TMP_BUF_SIZE); \
963 transport_dump_vpd_ident(vpd, buf, VPD_TMP_BUF_SIZE); \ 963 transport_dump_vpd_ident(vpd, buf, VPD_TMP_BUF_SIZE); \
964 if ((len + strlen(buf) >= PAGE_SIZE)) \ 964 if (len + strlen(buf) >= PAGE_SIZE) \
965 break; \ 965 break; \
966 len += sprintf(page+len, "%s", buf); \ 966 len += sprintf(page+len, "%s", buf); \
967 } \ 967 } \
@@ -1070,7 +1070,7 @@ static ssize_t target_core_dev_pr_show_spc3_res(
1070 1070
1071 spin_lock(&dev->dev_reservation_lock); 1071 spin_lock(&dev->dev_reservation_lock);
1072 pr_reg = dev->dev_pr_res_holder; 1072 pr_reg = dev->dev_pr_res_holder;
1073 if (!(pr_reg)) { 1073 if (!pr_reg) {
1074 *len += sprintf(page + *len, "No SPC-3 Reservation holder\n"); 1074 *len += sprintf(page + *len, "No SPC-3 Reservation holder\n");
1075 spin_unlock(&dev->dev_reservation_lock); 1075 spin_unlock(&dev->dev_reservation_lock);
1076 return *len; 1076 return *len;
@@ -1096,7 +1096,7 @@ static ssize_t target_core_dev_pr_show_spc2_res(
1096 1096
1097 spin_lock(&dev->dev_reservation_lock); 1097 spin_lock(&dev->dev_reservation_lock);
1098 se_nacl = dev->dev_reserved_node_acl; 1098 se_nacl = dev->dev_reserved_node_acl;
1099 if (!(se_nacl)) { 1099 if (!se_nacl) {
1100 *len += sprintf(page + *len, "No SPC-2 Reservation holder\n"); 1100 *len += sprintf(page + *len, "No SPC-2 Reservation holder\n");
1101 spin_unlock(&dev->dev_reservation_lock); 1101 spin_unlock(&dev->dev_reservation_lock);
1102 return *len; 1102 return *len;
@@ -1115,7 +1115,7 @@ static ssize_t target_core_dev_pr_show_attr_res_holder(
1115{ 1115{
1116 ssize_t len = 0; 1116 ssize_t len = 0;
1117 1117
1118 if (!(su_dev->se_dev_ptr)) 1118 if (!su_dev->se_dev_ptr)
1119 return -ENODEV; 1119 return -ENODEV;
1120 1120
1121 switch (su_dev->t10_pr.res_type) { 1121 switch (su_dev->t10_pr.res_type) {
@@ -1152,7 +1152,7 @@ static ssize_t target_core_dev_pr_show_attr_res_pr_all_tgt_pts(
1152 ssize_t len = 0; 1152 ssize_t len = 0;
1153 1153
1154 dev = su_dev->se_dev_ptr; 1154 dev = su_dev->se_dev_ptr;
1155 if (!(dev)) 1155 if (!dev)
1156 return -ENODEV; 1156 return -ENODEV;
1157 1157
1158 if (su_dev->t10_pr.res_type != SPC3_PERSISTENT_RESERVATIONS) 1158 if (su_dev->t10_pr.res_type != SPC3_PERSISTENT_RESERVATIONS)
@@ -1160,7 +1160,7 @@ static ssize_t target_core_dev_pr_show_attr_res_pr_all_tgt_pts(
1160 1160
1161 spin_lock(&dev->dev_reservation_lock); 1161 spin_lock(&dev->dev_reservation_lock);
1162 pr_reg = dev->dev_pr_res_holder; 1162 pr_reg = dev->dev_pr_res_holder;
1163 if (!(pr_reg)) { 1163 if (!pr_reg) {
1164 len = sprintf(page, "No SPC-3 Reservation holder\n"); 1164 len = sprintf(page, "No SPC-3 Reservation holder\n");
1165 spin_unlock(&dev->dev_reservation_lock); 1165 spin_unlock(&dev->dev_reservation_lock);
1166 return len; 1166 return len;
@@ -1189,7 +1189,7 @@ static ssize_t target_core_dev_pr_show_attr_res_pr_generation(
1189 struct se_subsystem_dev *su_dev, 1189 struct se_subsystem_dev *su_dev,
1190 char *page) 1190 char *page)
1191{ 1191{
1192 if (!(su_dev->se_dev_ptr)) 1192 if (!su_dev->se_dev_ptr)
1193 return -ENODEV; 1193 return -ENODEV;
1194 1194
1195 if (su_dev->t10_pr.res_type != SPC3_PERSISTENT_RESERVATIONS) 1195 if (su_dev->t10_pr.res_type != SPC3_PERSISTENT_RESERVATIONS)
@@ -1216,7 +1216,7 @@ static ssize_t target_core_dev_pr_show_attr_res_pr_holder_tg_port(
1216 ssize_t len = 0; 1216 ssize_t len = 0;
1217 1217
1218 dev = su_dev->se_dev_ptr; 1218 dev = su_dev->se_dev_ptr;
1219 if (!(dev)) 1219 if (!dev)
1220 return -ENODEV; 1220 return -ENODEV;
1221 1221
1222 if (su_dev->t10_pr.res_type != SPC3_PERSISTENT_RESERVATIONS) 1222 if (su_dev->t10_pr.res_type != SPC3_PERSISTENT_RESERVATIONS)
@@ -1224,7 +1224,7 @@ static ssize_t target_core_dev_pr_show_attr_res_pr_holder_tg_port(
1224 1224
1225 spin_lock(&dev->dev_reservation_lock); 1225 spin_lock(&dev->dev_reservation_lock);
1226 pr_reg = dev->dev_pr_res_holder; 1226 pr_reg = dev->dev_pr_res_holder;
1227 if (!(pr_reg)) { 1227 if (!pr_reg) {
1228 len = sprintf(page, "No SPC-3 Reservation holder\n"); 1228 len = sprintf(page, "No SPC-3 Reservation holder\n");
1229 spin_unlock(&dev->dev_reservation_lock); 1229 spin_unlock(&dev->dev_reservation_lock);
1230 return len; 1230 return len;
@@ -1263,7 +1263,7 @@ static ssize_t target_core_dev_pr_show_attr_res_pr_registered_i_pts(
1263 ssize_t len = 0; 1263 ssize_t len = 0;
1264 int reg_count = 0, prf_isid; 1264 int reg_count = 0, prf_isid;
1265 1265
1266 if (!(su_dev->se_dev_ptr)) 1266 if (!su_dev->se_dev_ptr)
1267 return -ENODEV; 1267 return -ENODEV;
1268 1268
1269 if (su_dev->t10_pr.res_type != SPC3_PERSISTENT_RESERVATIONS) 1269 if (su_dev->t10_pr.res_type != SPC3_PERSISTENT_RESERVATIONS)
@@ -1286,7 +1286,7 @@ static ssize_t target_core_dev_pr_show_attr_res_pr_registered_i_pts(
1286 &i_buf[0] : "", pr_reg->pr_res_key, 1286 &i_buf[0] : "", pr_reg->pr_res_key,
1287 pr_reg->pr_res_generation); 1287 pr_reg->pr_res_generation);
1288 1288
1289 if ((len + strlen(buf) >= PAGE_SIZE)) 1289 if (len + strlen(buf) >= PAGE_SIZE)
1290 break; 1290 break;
1291 1291
1292 len += sprintf(page+len, "%s", buf); 1292 len += sprintf(page+len, "%s", buf);
@@ -1294,7 +1294,7 @@ static ssize_t target_core_dev_pr_show_attr_res_pr_registered_i_pts(
1294 } 1294 }
1295 spin_unlock(&su_dev->t10_pr.registration_lock); 1295 spin_unlock(&su_dev->t10_pr.registration_lock);
1296 1296
1297 if (!(reg_count)) 1297 if (!reg_count)
1298 len += sprintf(page+len, "None\n"); 1298 len += sprintf(page+len, "None\n");
1299 1299
1300 return len; 1300 return len;
@@ -1314,7 +1314,7 @@ static ssize_t target_core_dev_pr_show_attr_res_pr_type(
1314 ssize_t len = 0; 1314 ssize_t len = 0;
1315 1315
1316 dev = su_dev->se_dev_ptr; 1316 dev = su_dev->se_dev_ptr;
1317 if (!(dev)) 1317 if (!dev)
1318 return -ENODEV; 1318 return -ENODEV;
1319 1319
1320 if (su_dev->t10_pr.res_type != SPC3_PERSISTENT_RESERVATIONS) 1320 if (su_dev->t10_pr.res_type != SPC3_PERSISTENT_RESERVATIONS)
@@ -1322,7 +1322,7 @@ static ssize_t target_core_dev_pr_show_attr_res_pr_type(
1322 1322
1323 spin_lock(&dev->dev_reservation_lock); 1323 spin_lock(&dev->dev_reservation_lock);
1324 pr_reg = dev->dev_pr_res_holder; 1324 pr_reg = dev->dev_pr_res_holder;
1325 if (!(pr_reg)) { 1325 if (!pr_reg) {
1326 len = sprintf(page, "No SPC-3 Reservation holder\n"); 1326 len = sprintf(page, "No SPC-3 Reservation holder\n");
1327 spin_unlock(&dev->dev_reservation_lock); 1327 spin_unlock(&dev->dev_reservation_lock);
1328 return len; 1328 return len;
@@ -1345,7 +1345,7 @@ static ssize_t target_core_dev_pr_show_attr_res_type(
1345{ 1345{
1346 ssize_t len = 0; 1346 ssize_t len = 0;
1347 1347
1348 if (!(su_dev->se_dev_ptr)) 1348 if (!su_dev->se_dev_ptr)
1349 return -ENODEV; 1349 return -ENODEV;
1350 1350
1351 switch (su_dev->t10_pr.res_type) { 1351 switch (su_dev->t10_pr.res_type) {
@@ -1376,7 +1376,7 @@ static ssize_t target_core_dev_pr_show_attr_res_aptpl_active(
1376 struct se_subsystem_dev *su_dev, 1376 struct se_subsystem_dev *su_dev,
1377 char *page) 1377 char *page)
1378{ 1378{
1379 if (!(su_dev->se_dev_ptr)) 1379 if (!su_dev->se_dev_ptr)
1380 return -ENODEV; 1380 return -ENODEV;
1381 1381
1382 if (su_dev->t10_pr.res_type != SPC3_PERSISTENT_RESERVATIONS) 1382 if (su_dev->t10_pr.res_type != SPC3_PERSISTENT_RESERVATIONS)
@@ -1395,7 +1395,7 @@ static ssize_t target_core_dev_pr_show_attr_res_aptpl_metadata(
1395 struct se_subsystem_dev *su_dev, 1395 struct se_subsystem_dev *su_dev,
1396 char *page) 1396 char *page)
1397{ 1397{
1398 if (!(su_dev->se_dev_ptr)) 1398 if (!su_dev->se_dev_ptr)
1399 return -ENODEV; 1399 return -ENODEV;
1400 1400
1401 if (su_dev->t10_pr.res_type != SPC3_PERSISTENT_RESERVATIONS) 1401 if (su_dev->t10_pr.res_type != SPC3_PERSISTENT_RESERVATIONS)
@@ -1447,14 +1447,14 @@ static ssize_t target_core_dev_pr_store_attr_res_aptpl_metadata(
1447 u8 type = 0, scope; 1447 u8 type = 0, scope;
1448 1448
1449 dev = su_dev->se_dev_ptr; 1449 dev = su_dev->se_dev_ptr;
1450 if (!(dev)) 1450 if (!dev)
1451 return -ENODEV; 1451 return -ENODEV;
1452 1452
1453 if (su_dev->t10_pr.res_type != SPC3_PERSISTENT_RESERVATIONS) 1453 if (su_dev->t10_pr.res_type != SPC3_PERSISTENT_RESERVATIONS)
1454 return 0; 1454 return 0;
1455 1455
1456 if (atomic_read(&dev->dev_export_obj.obj_access_count)) { 1456 if (atomic_read(&dev->dev_export_obj.obj_access_count)) {
1457 printk(KERN_INFO "Unable to process APTPL metadata while" 1457 pr_debug("Unable to process APTPL metadata while"
1458 " active fabric exports exist\n"); 1458 " active fabric exports exist\n");
1459 return -EINVAL; 1459 return -EINVAL;
1460 } 1460 }
@@ -1484,7 +1484,7 @@ static ssize_t target_core_dev_pr_store_attr_res_aptpl_metadata(
1484 goto out; 1484 goto out;
1485 } 1485 }
1486 if (strlen(i_port) >= PR_APTPL_MAX_IPORT_LEN) { 1486 if (strlen(i_port) >= PR_APTPL_MAX_IPORT_LEN) {
1487 printk(KERN_ERR "APTPL metadata initiator_node=" 1487 pr_err("APTPL metadata initiator_node="
1488 " exceeds PR_APTPL_MAX_IPORT_LEN: %d\n", 1488 " exceeds PR_APTPL_MAX_IPORT_LEN: %d\n",
1489 PR_APTPL_MAX_IPORT_LEN); 1489 PR_APTPL_MAX_IPORT_LEN);
1490 ret = -EINVAL; 1490 ret = -EINVAL;
@@ -1498,7 +1498,7 @@ static ssize_t target_core_dev_pr_store_attr_res_aptpl_metadata(
1498 goto out; 1498 goto out;
1499 } 1499 }
1500 if (strlen(isid) >= PR_REG_ISID_LEN) { 1500 if (strlen(isid) >= PR_REG_ISID_LEN) {
1501 printk(KERN_ERR "APTPL metadata initiator_isid" 1501 pr_err("APTPL metadata initiator_isid"
1502 "= exceeds PR_REG_ISID_LEN: %d\n", 1502 "= exceeds PR_REG_ISID_LEN: %d\n",
1503 PR_REG_ISID_LEN); 1503 PR_REG_ISID_LEN);
1504 ret = -EINVAL; 1504 ret = -EINVAL;
@@ -1513,7 +1513,7 @@ static ssize_t target_core_dev_pr_store_attr_res_aptpl_metadata(
1513 } 1513 }
1514 ret = strict_strtoull(arg_p, 0, &tmp_ll); 1514 ret = strict_strtoull(arg_p, 0, &tmp_ll);
1515 if (ret < 0) { 1515 if (ret < 0) {
1516 printk(KERN_ERR "strict_strtoull() failed for" 1516 pr_err("strict_strtoull() failed for"
1517 " sa_res_key=\n"); 1517 " sa_res_key=\n");
1518 goto out; 1518 goto out;
1519 } 1519 }
@@ -1559,7 +1559,7 @@ static ssize_t target_core_dev_pr_store_attr_res_aptpl_metadata(
1559 goto out; 1559 goto out;
1560 } 1560 }
1561 if (strlen(t_port) >= PR_APTPL_MAX_TPORT_LEN) { 1561 if (strlen(t_port) >= PR_APTPL_MAX_TPORT_LEN) {
1562 printk(KERN_ERR "APTPL metadata target_node=" 1562 pr_err("APTPL metadata target_node="
1563 " exceeds PR_APTPL_MAX_TPORT_LEN: %d\n", 1563 " exceeds PR_APTPL_MAX_TPORT_LEN: %d\n",
1564 PR_APTPL_MAX_TPORT_LEN); 1564 PR_APTPL_MAX_TPORT_LEN);
1565 ret = -EINVAL; 1565 ret = -EINVAL;
@@ -1583,14 +1583,14 @@ static ssize_t target_core_dev_pr_store_attr_res_aptpl_metadata(
1583 } 1583 }
1584 } 1584 }
1585 1585
1586 if (!(i_port) || !(t_port) || !(sa_res_key)) { 1586 if (!i_port || !t_port || !sa_res_key) {
1587 printk(KERN_ERR "Illegal parameters for APTPL registration\n"); 1587 pr_err("Illegal parameters for APTPL registration\n");
1588 ret = -EINVAL; 1588 ret = -EINVAL;
1589 goto out; 1589 goto out;
1590 } 1590 }
1591 1591
1592 if (res_holder && !(type)) { 1592 if (res_holder && !(type)) {
1593 printk(KERN_ERR "Illegal PR type: 0x%02x for reservation" 1593 pr_err("Illegal PR type: 0x%02x for reservation"
1594 " holder\n", type); 1594 " holder\n", type);
1595 ret = -EINVAL; 1595 ret = -EINVAL;
1596 goto out; 1596 goto out;
@@ -1649,7 +1649,7 @@ static ssize_t target_core_show_dev_info(void *p, char *page)
1649 int bl = 0; 1649 int bl = 0;
1650 ssize_t read_bytes = 0; 1650 ssize_t read_bytes = 0;
1651 1651
1652 if (!(se_dev->se_dev_ptr)) 1652 if (!se_dev->se_dev_ptr)
1653 return -ENODEV; 1653 return -ENODEV;
1654 1654
1655 transport_dump_dev_state(se_dev->se_dev_ptr, page, &bl); 1655 transport_dump_dev_state(se_dev->se_dev_ptr, page, &bl);
@@ -1675,8 +1675,8 @@ static ssize_t target_core_store_dev_control(
1675 struct se_hba *hba = se_dev->se_dev_hba; 1675 struct se_hba *hba = se_dev->se_dev_hba;
1676 struct se_subsystem_api *t = hba->transport; 1676 struct se_subsystem_api *t = hba->transport;
1677 1677
1678 if (!(se_dev->se_dev_su_ptr)) { 1678 if (!se_dev->se_dev_su_ptr) {
1679 printk(KERN_ERR "Unable to locate struct se_subsystem_dev>se" 1679 pr_err("Unable to locate struct se_subsystem_dev>se"
1680 "_dev_su_ptr\n"); 1680 "_dev_su_ptr\n");
1681 return -EINVAL; 1681 return -EINVAL;
1682 } 1682 }
@@ -1712,7 +1712,7 @@ static ssize_t target_core_store_dev_alias(
1712 ssize_t read_bytes; 1712 ssize_t read_bytes;
1713 1713
1714 if (count > (SE_DEV_ALIAS_LEN-1)) { 1714 if (count > (SE_DEV_ALIAS_LEN-1)) {
1715 printk(KERN_ERR "alias count: %d exceeds" 1715 pr_err("alias count: %d exceeds"
1716 " SE_DEV_ALIAS_LEN-1: %u\n", (int)count, 1716 " SE_DEV_ALIAS_LEN-1: %u\n", (int)count,
1717 SE_DEV_ALIAS_LEN-1); 1717 SE_DEV_ALIAS_LEN-1);
1718 return -EINVAL; 1718 return -EINVAL;
@@ -1722,7 +1722,7 @@ static ssize_t target_core_store_dev_alias(
1722 read_bytes = snprintf(&se_dev->se_dev_alias[0], SE_DEV_ALIAS_LEN, 1722 read_bytes = snprintf(&se_dev->se_dev_alias[0], SE_DEV_ALIAS_LEN,
1723 "%s", page); 1723 "%s", page);
1724 1724
1725 printk(KERN_INFO "Target_Core_ConfigFS: %s/%s set alias: %s\n", 1725 pr_debug("Target_Core_ConfigFS: %s/%s set alias: %s\n",
1726 config_item_name(&hba->hba_group.cg_item), 1726 config_item_name(&hba->hba_group.cg_item),
1727 config_item_name(&se_dev->se_dev_group.cg_item), 1727 config_item_name(&se_dev->se_dev_group.cg_item),
1728 se_dev->se_dev_alias); 1728 se_dev->se_dev_alias);
@@ -1758,7 +1758,7 @@ static ssize_t target_core_store_dev_udev_path(
1758 ssize_t read_bytes; 1758 ssize_t read_bytes;
1759 1759
1760 if (count > (SE_UDEV_PATH_LEN-1)) { 1760 if (count > (SE_UDEV_PATH_LEN-1)) {
1761 printk(KERN_ERR "udev_path count: %d exceeds" 1761 pr_err("udev_path count: %d exceeds"
1762 " SE_UDEV_PATH_LEN-1: %u\n", (int)count, 1762 " SE_UDEV_PATH_LEN-1: %u\n", (int)count,
1763 SE_UDEV_PATH_LEN-1); 1763 SE_UDEV_PATH_LEN-1);
1764 return -EINVAL; 1764 return -EINVAL;
@@ -1768,7 +1768,7 @@ static ssize_t target_core_store_dev_udev_path(
1768 read_bytes = snprintf(&se_dev->se_dev_udev_path[0], SE_UDEV_PATH_LEN, 1768 read_bytes = snprintf(&se_dev->se_dev_udev_path[0], SE_UDEV_PATH_LEN,
1769 "%s", page); 1769 "%s", page);
1770 1770
1771 printk(KERN_INFO "Target_Core_ConfigFS: %s/%s set udev_path: %s\n", 1771 pr_debug("Target_Core_ConfigFS: %s/%s set udev_path: %s\n",
1772 config_item_name(&hba->hba_group.cg_item), 1772 config_item_name(&hba->hba_group.cg_item),
1773 config_item_name(&se_dev->se_dev_group.cg_item), 1773 config_item_name(&se_dev->se_dev_group.cg_item),
1774 se_dev->se_dev_udev_path); 1774 se_dev->se_dev_udev_path);
@@ -1796,13 +1796,13 @@ static ssize_t target_core_store_dev_enable(
1796 char *ptr; 1796 char *ptr;
1797 1797
1798 ptr = strstr(page, "1"); 1798 ptr = strstr(page, "1");
1799 if (!(ptr)) { 1799 if (!ptr) {
1800 printk(KERN_ERR "For dev_enable ops, only valid value" 1800 pr_err("For dev_enable ops, only valid value"
1801 " is \"1\"\n"); 1801 " is \"1\"\n");
1802 return -EINVAL; 1802 return -EINVAL;
1803 } 1803 }
1804 if ((se_dev->se_dev_ptr)) { 1804 if (se_dev->se_dev_ptr) {
1805 printk(KERN_ERR "se_dev->se_dev_ptr already set for storage" 1805 pr_err("se_dev->se_dev_ptr already set for storage"
1806 " object\n"); 1806 " object\n");
1807 return -EEXIST; 1807 return -EEXIST;
1808 } 1808 }
@@ -1817,7 +1817,7 @@ static ssize_t target_core_store_dev_enable(
1817 return -EINVAL; 1817 return -EINVAL;
1818 1818
1819 se_dev->se_dev_ptr = dev; 1819 se_dev->se_dev_ptr = dev;
1820 printk(KERN_INFO "Target_Core_ConfigFS: Registered se_dev->se_dev_ptr:" 1820 pr_debug("Target_Core_ConfigFS: Registered se_dev->se_dev_ptr:"
1821 " %p\n", se_dev->se_dev_ptr); 1821 " %p\n", se_dev->se_dev_ptr);
1822 1822
1823 return count; 1823 return count;
@@ -1841,22 +1841,22 @@ static ssize_t target_core_show_alua_lu_gp(void *p, char *page)
1841 ssize_t len = 0; 1841 ssize_t len = 0;
1842 1842
1843 dev = su_dev->se_dev_ptr; 1843 dev = su_dev->se_dev_ptr;
1844 if (!(dev)) 1844 if (!dev)
1845 return -ENODEV; 1845 return -ENODEV;
1846 1846
1847 if (su_dev->t10_alua.alua_type != SPC3_ALUA_EMULATED) 1847 if (su_dev->t10_alua.alua_type != SPC3_ALUA_EMULATED)
1848 return len; 1848 return len;
1849 1849
1850 lu_gp_mem = dev->dev_alua_lu_gp_mem; 1850 lu_gp_mem = dev->dev_alua_lu_gp_mem;
1851 if (!(lu_gp_mem)) { 1851 if (!lu_gp_mem) {
1852 printk(KERN_ERR "NULL struct se_device->dev_alua_lu_gp_mem" 1852 pr_err("NULL struct se_device->dev_alua_lu_gp_mem"
1853 " pointer\n"); 1853 " pointer\n");
1854 return -EINVAL; 1854 return -EINVAL;
1855 } 1855 }
1856 1856
1857 spin_lock(&lu_gp_mem->lu_gp_mem_lock); 1857 spin_lock(&lu_gp_mem->lu_gp_mem_lock);
1858 lu_gp = lu_gp_mem->lu_gp; 1858 lu_gp = lu_gp_mem->lu_gp;
1859 if ((lu_gp)) { 1859 if (lu_gp) {
1860 lu_ci = &lu_gp->lu_gp_group.cg_item; 1860 lu_ci = &lu_gp->lu_gp_group.cg_item;
1861 len += sprintf(page, "LU Group Alias: %s\nLU Group ID: %hu\n", 1861 len += sprintf(page, "LU Group Alias: %s\nLU Group ID: %hu\n",
1862 config_item_name(lu_ci), lu_gp->lu_gp_id); 1862 config_item_name(lu_ci), lu_gp->lu_gp_id);
@@ -1880,17 +1880,17 @@ static ssize_t target_core_store_alua_lu_gp(
1880 int move = 0; 1880 int move = 0;
1881 1881
1882 dev = su_dev->se_dev_ptr; 1882 dev = su_dev->se_dev_ptr;
1883 if (!(dev)) 1883 if (!dev)
1884 return -ENODEV; 1884 return -ENODEV;
1885 1885
1886 if (su_dev->t10_alua.alua_type != SPC3_ALUA_EMULATED) { 1886 if (su_dev->t10_alua.alua_type != SPC3_ALUA_EMULATED) {
1887 printk(KERN_WARNING "SPC3_ALUA_EMULATED not enabled for %s/%s\n", 1887 pr_warn("SPC3_ALUA_EMULATED not enabled for %s/%s\n",
1888 config_item_name(&hba->hba_group.cg_item), 1888 config_item_name(&hba->hba_group.cg_item),
1889 config_item_name(&su_dev->se_dev_group.cg_item)); 1889 config_item_name(&su_dev->se_dev_group.cg_item));
1890 return -EINVAL; 1890 return -EINVAL;
1891 } 1891 }
1892 if (count > LU_GROUP_NAME_BUF) { 1892 if (count > LU_GROUP_NAME_BUF) {
1893 printk(KERN_ERR "ALUA LU Group Alias too large!\n"); 1893 pr_err("ALUA LU Group Alias too large!\n");
1894 return -EINVAL; 1894 return -EINVAL;
1895 } 1895 }
1896 memset(buf, 0, LU_GROUP_NAME_BUF); 1896 memset(buf, 0, LU_GROUP_NAME_BUF);
@@ -1906,27 +1906,27 @@ static ssize_t target_core_store_alua_lu_gp(
1906 * core_alua_get_lu_gp_by_name below(). 1906 * core_alua_get_lu_gp_by_name below().
1907 */ 1907 */
1908 lu_gp_new = core_alua_get_lu_gp_by_name(strstrip(buf)); 1908 lu_gp_new = core_alua_get_lu_gp_by_name(strstrip(buf));
1909 if (!(lu_gp_new)) 1909 if (!lu_gp_new)
1910 return -ENODEV; 1910 return -ENODEV;
1911 } 1911 }
1912 lu_gp_mem = dev->dev_alua_lu_gp_mem; 1912 lu_gp_mem = dev->dev_alua_lu_gp_mem;
1913 if (!(lu_gp_mem)) { 1913 if (!lu_gp_mem) {
1914 if (lu_gp_new) 1914 if (lu_gp_new)
1915 core_alua_put_lu_gp_from_name(lu_gp_new); 1915 core_alua_put_lu_gp_from_name(lu_gp_new);
1916 printk(KERN_ERR "NULL struct se_device->dev_alua_lu_gp_mem" 1916 pr_err("NULL struct se_device->dev_alua_lu_gp_mem"
1917 " pointer\n"); 1917 " pointer\n");
1918 return -EINVAL; 1918 return -EINVAL;
1919 } 1919 }
1920 1920
1921 spin_lock(&lu_gp_mem->lu_gp_mem_lock); 1921 spin_lock(&lu_gp_mem->lu_gp_mem_lock);
1922 lu_gp = lu_gp_mem->lu_gp; 1922 lu_gp = lu_gp_mem->lu_gp;
1923 if ((lu_gp)) { 1923 if (lu_gp) {
1924 /* 1924 /*
1925 * Clearing an existing lu_gp association, and replacing 1925 * Clearing an existing lu_gp association, and replacing
1926 * with NULL 1926 * with NULL
1927 */ 1927 */
1928 if (!(lu_gp_new)) { 1928 if (!lu_gp_new) {
1929 printk(KERN_INFO "Target_Core_ConfigFS: Releasing %s/%s" 1929 pr_debug("Target_Core_ConfigFS: Releasing %s/%s"
1930 " from ALUA LU Group: core/alua/lu_gps/%s, ID:" 1930 " from ALUA LU Group: core/alua/lu_gps/%s, ID:"
1931 " %hu\n", 1931 " %hu\n",
1932 config_item_name(&hba->hba_group.cg_item), 1932 config_item_name(&hba->hba_group.cg_item),
@@ -1951,7 +1951,7 @@ static ssize_t target_core_store_alua_lu_gp(
1951 __core_alua_attach_lu_gp_mem(lu_gp_mem, lu_gp_new); 1951 __core_alua_attach_lu_gp_mem(lu_gp_mem, lu_gp_new);
1952 spin_unlock(&lu_gp_mem->lu_gp_mem_lock); 1952 spin_unlock(&lu_gp_mem->lu_gp_mem_lock);
1953 1953
1954 printk(KERN_INFO "Target_Core_ConfigFS: %s %s/%s to ALUA LU Group:" 1954 pr_debug("Target_Core_ConfigFS: %s %s/%s to ALUA LU Group:"
1955 " core/alua/lu_gps/%s, ID: %hu\n", 1955 " core/alua/lu_gps/%s, ID: %hu\n",
1956 (move) ? "Moving" : "Adding", 1956 (move) ? "Moving" : "Adding",
1957 config_item_name(&hba->hba_group.cg_item), 1957 config_item_name(&hba->hba_group.cg_item),
@@ -1995,7 +1995,7 @@ static void target_core_dev_release(struct config_item *item)
1995 *`echo 1 > $CONFIGFS/core/$HBA/$DEV/dev_enable` 1995 *`echo 1 > $CONFIGFS/core/$HBA/$DEV/dev_enable`
1996 */ 1996 */
1997 if (se_dev->se_dev_ptr) { 1997 if (se_dev->se_dev_ptr) {
1998 printk(KERN_INFO "Target_Core_ConfigFS: Calling se_free_" 1998 pr_debug("Target_Core_ConfigFS: Calling se_free_"
1999 "virtual_device() for se_dev_ptr: %p\n", 1999 "virtual_device() for se_dev_ptr: %p\n",
2000 se_dev->se_dev_ptr); 2000 se_dev->se_dev_ptr);
2001 2001
@@ -2004,14 +2004,14 @@ static void target_core_dev_release(struct config_item *item)
2004 /* 2004 /*
2005 * Release struct se_subsystem_dev->se_dev_su_ptr.. 2005 * Release struct se_subsystem_dev->se_dev_su_ptr..
2006 */ 2006 */
2007 printk(KERN_INFO "Target_Core_ConfigFS: Calling t->free_" 2007 pr_debug("Target_Core_ConfigFS: Calling t->free_"
2008 "device() for se_dev_su_ptr: %p\n", 2008 "device() for se_dev_su_ptr: %p\n",
2009 se_dev->se_dev_su_ptr); 2009 se_dev->se_dev_su_ptr);
2010 2010
2011 t->free_device(se_dev->se_dev_su_ptr); 2011 t->free_device(se_dev->se_dev_su_ptr);
2012 } 2012 }
2013 2013
2014 printk(KERN_INFO "Target_Core_ConfigFS: Deallocating se_subsystem" 2014 pr_debug("Target_Core_ConfigFS: Deallocating se_subsystem"
2015 "_dev_t: %p\n", se_dev); 2015 "_dev_t: %p\n", se_dev);
2016 kfree(se_dev); 2016 kfree(se_dev);
2017} 2017}
@@ -2026,7 +2026,7 @@ static ssize_t target_core_dev_show(struct config_item *item,
2026 struct target_core_configfs_attribute *tc_attr = container_of( 2026 struct target_core_configfs_attribute *tc_attr = container_of(
2027 attr, struct target_core_configfs_attribute, attr); 2027 attr, struct target_core_configfs_attribute, attr);
2028 2028
2029 if (!(tc_attr->show)) 2029 if (!tc_attr->show)
2030 return -EINVAL; 2030 return -EINVAL;
2031 2031
2032 return tc_attr->show(se_dev, page); 2032 return tc_attr->show(se_dev, page);
@@ -2042,7 +2042,7 @@ static ssize_t target_core_dev_store(struct config_item *item,
2042 struct target_core_configfs_attribute *tc_attr = container_of( 2042 struct target_core_configfs_attribute *tc_attr = container_of(
2043 attr, struct target_core_configfs_attribute, attr); 2043 attr, struct target_core_configfs_attribute, attr);
2044 2044
2045 if (!(tc_attr->store)) 2045 if (!tc_attr->store)
2046 return -EINVAL; 2046 return -EINVAL;
2047 2047
2048 return tc_attr->store(se_dev, page, count); 2048 return tc_attr->store(se_dev, page, count);
@@ -2085,7 +2085,7 @@ static ssize_t target_core_alua_lu_gp_show_attr_lu_gp_id(
2085 struct t10_alua_lu_gp *lu_gp, 2085 struct t10_alua_lu_gp *lu_gp,
2086 char *page) 2086 char *page)
2087{ 2087{
2088 if (!(lu_gp->lu_gp_valid_id)) 2088 if (!lu_gp->lu_gp_valid_id)
2089 return 0; 2089 return 0;
2090 2090
2091 return sprintf(page, "%hu\n", lu_gp->lu_gp_id); 2091 return sprintf(page, "%hu\n", lu_gp->lu_gp_id);
@@ -2102,12 +2102,12 @@ static ssize_t target_core_alua_lu_gp_store_attr_lu_gp_id(
2102 2102
2103 ret = strict_strtoul(page, 0, &lu_gp_id); 2103 ret = strict_strtoul(page, 0, &lu_gp_id);
2104 if (ret < 0) { 2104 if (ret < 0) {
2105 printk(KERN_ERR "strict_strtoul() returned %d for" 2105 pr_err("strict_strtoul() returned %d for"
2106 " lu_gp_id\n", ret); 2106 " lu_gp_id\n", ret);
2107 return -EINVAL; 2107 return -EINVAL;
2108 } 2108 }
2109 if (lu_gp_id > 0x0000ffff) { 2109 if (lu_gp_id > 0x0000ffff) {
2110 printk(KERN_ERR "ALUA lu_gp_id: %lu exceeds maximum:" 2110 pr_err("ALUA lu_gp_id: %lu exceeds maximum:"
2111 " 0x0000ffff\n", lu_gp_id); 2111 " 0x0000ffff\n", lu_gp_id);
2112 return -EINVAL; 2112 return -EINVAL;
2113 } 2113 }
@@ -2116,7 +2116,7 @@ static ssize_t target_core_alua_lu_gp_store_attr_lu_gp_id(
2116 if (ret < 0) 2116 if (ret < 0)
2117 return -EINVAL; 2117 return -EINVAL;
2118 2118
2119 printk(KERN_INFO "Target_Core_ConfigFS: Set ALUA Logical Unit" 2119 pr_debug("Target_Core_ConfigFS: Set ALUA Logical Unit"
2120 " Group: core/alua/lu_gps/%s to ID: %hu\n", 2120 " Group: core/alua/lu_gps/%s to ID: %hu\n",
2121 config_item_name(&alua_lu_gp_cg->cg_item), 2121 config_item_name(&alua_lu_gp_cg->cg_item),
2122 lu_gp->lu_gp_id); 2122 lu_gp->lu_gp_id);
@@ -2154,7 +2154,7 @@ static ssize_t target_core_alua_lu_gp_show_attr_members(
2154 cur_len++; /* Extra byte for NULL terminator */ 2154 cur_len++; /* Extra byte for NULL terminator */
2155 2155
2156 if ((cur_len + len) > PAGE_SIZE) { 2156 if ((cur_len + len) > PAGE_SIZE) {
2157 printk(KERN_WARNING "Ran out of lu_gp_show_attr" 2157 pr_warn("Ran out of lu_gp_show_attr"
2158 "_members buffer\n"); 2158 "_members buffer\n");
2159 break; 2159 break;
2160 } 2160 }
@@ -2218,7 +2218,7 @@ static struct config_group *target_core_alua_create_lu_gp(
2218 config_group_init_type_name(alua_lu_gp_cg, name, 2218 config_group_init_type_name(alua_lu_gp_cg, name,
2219 &target_core_alua_lu_gp_cit); 2219 &target_core_alua_lu_gp_cit);
2220 2220
2221 printk(KERN_INFO "Target_Core_ConfigFS: Allocated ALUA Logical Unit" 2221 pr_debug("Target_Core_ConfigFS: Allocated ALUA Logical Unit"
2222 " Group: core/alua/lu_gps/%s\n", 2222 " Group: core/alua/lu_gps/%s\n",
2223 config_item_name(alua_lu_gp_ci)); 2223 config_item_name(alua_lu_gp_ci));
2224 2224
@@ -2233,7 +2233,7 @@ static void target_core_alua_drop_lu_gp(
2233 struct t10_alua_lu_gp *lu_gp = container_of(to_config_group(item), 2233 struct t10_alua_lu_gp *lu_gp = container_of(to_config_group(item),
2234 struct t10_alua_lu_gp, lu_gp_group); 2234 struct t10_alua_lu_gp, lu_gp_group);
2235 2235
2236 printk(KERN_INFO "Target_Core_ConfigFS: Releasing ALUA Logical Unit" 2236 pr_debug("Target_Core_ConfigFS: Releasing ALUA Logical Unit"
2237 " Group: core/alua/lu_gps/%s, ID: %hu\n", 2237 " Group: core/alua/lu_gps/%s, ID: %hu\n",
2238 config_item_name(item), lu_gp->lu_gp_id); 2238 config_item_name(item), lu_gp->lu_gp_id);
2239 /* 2239 /*
@@ -2292,22 +2292,22 @@ static ssize_t target_core_alua_tg_pt_gp_store_attr_alua_access_state(
2292 unsigned long tmp; 2292 unsigned long tmp;
2293 int new_state, ret; 2293 int new_state, ret;
2294 2294
2295 if (!(tg_pt_gp->tg_pt_gp_valid_id)) { 2295 if (!tg_pt_gp->tg_pt_gp_valid_id) {
2296 printk(KERN_ERR "Unable to do implict ALUA on non valid" 2296 pr_err("Unable to do implict ALUA on non valid"
2297 " tg_pt_gp ID: %hu\n", tg_pt_gp->tg_pt_gp_valid_id); 2297 " tg_pt_gp ID: %hu\n", tg_pt_gp->tg_pt_gp_valid_id);
2298 return -EINVAL; 2298 return -EINVAL;
2299 } 2299 }
2300 2300
2301 ret = strict_strtoul(page, 0, &tmp); 2301 ret = strict_strtoul(page, 0, &tmp);
2302 if (ret < 0) { 2302 if (ret < 0) {
2303 printk("Unable to extract new ALUA access state from" 2303 pr_err("Unable to extract new ALUA access state from"
2304 " %s\n", page); 2304 " %s\n", page);
2305 return -EINVAL; 2305 return -EINVAL;
2306 } 2306 }
2307 new_state = (int)tmp; 2307 new_state = (int)tmp;
2308 2308
2309 if (!(tg_pt_gp->tg_pt_gp_alua_access_type & TPGS_IMPLICT_ALUA)) { 2309 if (!(tg_pt_gp->tg_pt_gp_alua_access_type & TPGS_IMPLICT_ALUA)) {
2310 printk(KERN_ERR "Unable to process implict configfs ALUA" 2310 pr_err("Unable to process implict configfs ALUA"
2311 " transition while TPGS_IMPLICT_ALUA is diabled\n"); 2311 " transition while TPGS_IMPLICT_ALUA is diabled\n");
2312 return -EINVAL; 2312 return -EINVAL;
2313 } 2313 }
@@ -2338,8 +2338,8 @@ static ssize_t target_core_alua_tg_pt_gp_store_attr_alua_access_status(
2338 unsigned long tmp; 2338 unsigned long tmp;
2339 int new_status, ret; 2339 int new_status, ret;
2340 2340
2341 if (!(tg_pt_gp->tg_pt_gp_valid_id)) { 2341 if (!tg_pt_gp->tg_pt_gp_valid_id) {
2342 printk(KERN_ERR "Unable to do set ALUA access status on non" 2342 pr_err("Unable to do set ALUA access status on non"
2343 " valid tg_pt_gp ID: %hu\n", 2343 " valid tg_pt_gp ID: %hu\n",
2344 tg_pt_gp->tg_pt_gp_valid_id); 2344 tg_pt_gp->tg_pt_gp_valid_id);
2345 return -EINVAL; 2345 return -EINVAL;
@@ -2347,7 +2347,7 @@ static ssize_t target_core_alua_tg_pt_gp_store_attr_alua_access_status(
2347 2347
2348 ret = strict_strtoul(page, 0, &tmp); 2348 ret = strict_strtoul(page, 0, &tmp);
2349 if (ret < 0) { 2349 if (ret < 0) {
2350 printk(KERN_ERR "Unable to extract new ALUA access status" 2350 pr_err("Unable to extract new ALUA access status"
2351 " from %s\n", page); 2351 " from %s\n", page);
2352 return -EINVAL; 2352 return -EINVAL;
2353 } 2353 }
@@ -2356,7 +2356,7 @@ static ssize_t target_core_alua_tg_pt_gp_store_attr_alua_access_status(
2356 if ((new_status != ALUA_STATUS_NONE) && 2356 if ((new_status != ALUA_STATUS_NONE) &&
2357 (new_status != ALUA_STATUS_ALTERED_BY_EXPLICT_STPG) && 2357 (new_status != ALUA_STATUS_ALTERED_BY_EXPLICT_STPG) &&
2358 (new_status != ALUA_STATUS_ALTERED_BY_IMPLICT_ALUA)) { 2358 (new_status != ALUA_STATUS_ALTERED_BY_IMPLICT_ALUA)) {
2359 printk(KERN_ERR "Illegal ALUA access status: 0x%02x\n", 2359 pr_err("Illegal ALUA access status: 0x%02x\n",
2360 new_status); 2360 new_status);
2361 return -EINVAL; 2361 return -EINVAL;
2362 } 2362 }
@@ -2407,12 +2407,12 @@ static ssize_t target_core_alua_tg_pt_gp_store_attr_alua_write_metadata(
2407 2407
2408 ret = strict_strtoul(page, 0, &tmp); 2408 ret = strict_strtoul(page, 0, &tmp);
2409 if (ret < 0) { 2409 if (ret < 0) {
2410 printk(KERN_ERR "Unable to extract alua_write_metadata\n"); 2410 pr_err("Unable to extract alua_write_metadata\n");
2411 return -EINVAL; 2411 return -EINVAL;
2412 } 2412 }
2413 2413
2414 if ((tmp != 0) && (tmp != 1)) { 2414 if ((tmp != 0) && (tmp != 1)) {
2415 printk(KERN_ERR "Illegal value for alua_write_metadata:" 2415 pr_err("Illegal value for alua_write_metadata:"
2416 " %lu\n", tmp); 2416 " %lu\n", tmp);
2417 return -EINVAL; 2417 return -EINVAL;
2418 } 2418 }
@@ -2494,7 +2494,7 @@ static ssize_t target_core_alua_tg_pt_gp_show_attr_tg_pt_gp_id(
2494 struct t10_alua_tg_pt_gp *tg_pt_gp, 2494 struct t10_alua_tg_pt_gp *tg_pt_gp,
2495 char *page) 2495 char *page)
2496{ 2496{
2497 if (!(tg_pt_gp->tg_pt_gp_valid_id)) 2497 if (!tg_pt_gp->tg_pt_gp_valid_id)
2498 return 0; 2498 return 0;
2499 2499
2500 return sprintf(page, "%hu\n", tg_pt_gp->tg_pt_gp_id); 2500 return sprintf(page, "%hu\n", tg_pt_gp->tg_pt_gp_id);
@@ -2511,12 +2511,12 @@ static ssize_t target_core_alua_tg_pt_gp_store_attr_tg_pt_gp_id(
2511 2511
2512 ret = strict_strtoul(page, 0, &tg_pt_gp_id); 2512 ret = strict_strtoul(page, 0, &tg_pt_gp_id);
2513 if (ret < 0) { 2513 if (ret < 0) {
2514 printk(KERN_ERR "strict_strtoul() returned %d for" 2514 pr_err("strict_strtoul() returned %d for"
2515 " tg_pt_gp_id\n", ret); 2515 " tg_pt_gp_id\n", ret);
2516 return -EINVAL; 2516 return -EINVAL;
2517 } 2517 }
2518 if (tg_pt_gp_id > 0x0000ffff) { 2518 if (tg_pt_gp_id > 0x0000ffff) {
2519 printk(KERN_ERR "ALUA tg_pt_gp_id: %lu exceeds maximum:" 2519 pr_err("ALUA tg_pt_gp_id: %lu exceeds maximum:"
2520 " 0x0000ffff\n", tg_pt_gp_id); 2520 " 0x0000ffff\n", tg_pt_gp_id);
2521 return -EINVAL; 2521 return -EINVAL;
2522 } 2522 }
@@ -2525,7 +2525,7 @@ static ssize_t target_core_alua_tg_pt_gp_store_attr_tg_pt_gp_id(
2525 if (ret < 0) 2525 if (ret < 0)
2526 return -EINVAL; 2526 return -EINVAL;
2527 2527
2528 printk(KERN_INFO "Target_Core_ConfigFS: Set ALUA Target Port Group: " 2528 pr_debug("Target_Core_ConfigFS: Set ALUA Target Port Group: "
2529 "core/alua/tg_pt_gps/%s to ID: %hu\n", 2529 "core/alua/tg_pt_gps/%s to ID: %hu\n",
2530 config_item_name(&alua_tg_pt_gp_cg->cg_item), 2530 config_item_name(&alua_tg_pt_gp_cg->cg_item),
2531 tg_pt_gp->tg_pt_gp_id); 2531 tg_pt_gp->tg_pt_gp_id);
@@ -2566,7 +2566,7 @@ static ssize_t target_core_alua_tg_pt_gp_show_attr_members(
2566 cur_len++; /* Extra byte for NULL terminator */ 2566 cur_len++; /* Extra byte for NULL terminator */
2567 2567
2568 if ((cur_len + len) > PAGE_SIZE) { 2568 if ((cur_len + len) > PAGE_SIZE) {
2569 printk(KERN_WARNING "Ran out of lu_gp_show_attr" 2569 pr_warn("Ran out of lu_gp_show_attr"
2570 "_members buffer\n"); 2570 "_members buffer\n");
2571 break; 2571 break;
2572 } 2572 }
@@ -2632,7 +2632,7 @@ static struct config_group *target_core_alua_create_tg_pt_gp(
2632 struct config_item *alua_tg_pt_gp_ci = NULL; 2632 struct config_item *alua_tg_pt_gp_ci = NULL;
2633 2633
2634 tg_pt_gp = core_alua_allocate_tg_pt_gp(su_dev, name, 0); 2634 tg_pt_gp = core_alua_allocate_tg_pt_gp(su_dev, name, 0);
2635 if (!(tg_pt_gp)) 2635 if (!tg_pt_gp)
2636 return NULL; 2636 return NULL;
2637 2637
2638 alua_tg_pt_gp_cg = &tg_pt_gp->tg_pt_gp_group; 2638 alua_tg_pt_gp_cg = &tg_pt_gp->tg_pt_gp_group;
@@ -2641,7 +2641,7 @@ static struct config_group *target_core_alua_create_tg_pt_gp(
2641 config_group_init_type_name(alua_tg_pt_gp_cg, name, 2641 config_group_init_type_name(alua_tg_pt_gp_cg, name,
2642 &target_core_alua_tg_pt_gp_cit); 2642 &target_core_alua_tg_pt_gp_cit);
2643 2643
2644 printk(KERN_INFO "Target_Core_ConfigFS: Allocated ALUA Target Port" 2644 pr_debug("Target_Core_ConfigFS: Allocated ALUA Target Port"
2645 " Group: alua/tg_pt_gps/%s\n", 2645 " Group: alua/tg_pt_gps/%s\n",
2646 config_item_name(alua_tg_pt_gp_ci)); 2646 config_item_name(alua_tg_pt_gp_ci));
2647 2647
@@ -2655,7 +2655,7 @@ static void target_core_alua_drop_tg_pt_gp(
2655 struct t10_alua_tg_pt_gp *tg_pt_gp = container_of(to_config_group(item), 2655 struct t10_alua_tg_pt_gp *tg_pt_gp = container_of(to_config_group(item),
2656 struct t10_alua_tg_pt_gp, tg_pt_gp_group); 2656 struct t10_alua_tg_pt_gp, tg_pt_gp_group);
2657 2657
2658 printk(KERN_INFO "Target_Core_ConfigFS: Releasing ALUA Target Port" 2658 pr_debug("Target_Core_ConfigFS: Releasing ALUA Target Port"
2659 " Group: alua/tg_pt_gps/%s, ID: %hu\n", 2659 " Group: alua/tg_pt_gps/%s, ID: %hu\n",
2660 config_item_name(item), tg_pt_gp->tg_pt_gp_id); 2660 config_item_name(item), tg_pt_gp->tg_pt_gp_id);
2661 /* 2661 /*
@@ -2746,7 +2746,7 @@ static struct config_group *target_core_make_subdev(
2746 2746
2747 se_dev = kzalloc(sizeof(struct se_subsystem_dev), GFP_KERNEL); 2747 se_dev = kzalloc(sizeof(struct se_subsystem_dev), GFP_KERNEL);
2748 if (!se_dev) { 2748 if (!se_dev) {
2749 printk(KERN_ERR "Unable to allocate memory for" 2749 pr_err("Unable to allocate memory for"
2750 " struct se_subsystem_dev\n"); 2750 " struct se_subsystem_dev\n");
2751 goto unlock; 2751 goto unlock;
2752 } 2752 }
@@ -2770,7 +2770,7 @@ static struct config_group *target_core_make_subdev(
2770 2770
2771 dev_cg->default_groups = kzalloc(sizeof(struct config_group) * 7, 2771 dev_cg->default_groups = kzalloc(sizeof(struct config_group) * 7,
2772 GFP_KERNEL); 2772 GFP_KERNEL);
2773 if (!(dev_cg->default_groups)) 2773 if (!dev_cg->default_groups)
2774 goto out; 2774 goto out;
2775 /* 2775 /*
2776 * Set se_dev_su_ptr from struct se_subsystem_api returned void ptr 2776 * Set se_dev_su_ptr from struct se_subsystem_api returned void ptr
@@ -2781,8 +2781,8 @@ static struct config_group *target_core_make_subdev(
2781 * configfs tree for device object's struct config_group. 2781 * configfs tree for device object's struct config_group.
2782 */ 2782 */
2783 se_dev->se_dev_su_ptr = t->allocate_virtdevice(hba, name); 2783 se_dev->se_dev_su_ptr = t->allocate_virtdevice(hba, name);
2784 if (!(se_dev->se_dev_su_ptr)) { 2784 if (!se_dev->se_dev_su_ptr) {
2785 printk(KERN_ERR "Unable to locate subsystem dependent pointer" 2785 pr_err("Unable to locate subsystem dependent pointer"
2786 " from allocate_virtdevice()\n"); 2786 " from allocate_virtdevice()\n");
2787 goto out; 2787 goto out;
2788 } 2788 }
@@ -2813,14 +2813,14 @@ static struct config_group *target_core_make_subdev(
2813 * Add core/$HBA/$DEV/alua/default_tg_pt_gp 2813 * Add core/$HBA/$DEV/alua/default_tg_pt_gp
2814 */ 2814 */
2815 tg_pt_gp = core_alua_allocate_tg_pt_gp(se_dev, "default_tg_pt_gp", 1); 2815 tg_pt_gp = core_alua_allocate_tg_pt_gp(se_dev, "default_tg_pt_gp", 1);
2816 if (!(tg_pt_gp)) 2816 if (!tg_pt_gp)
2817 goto out; 2817 goto out;
2818 2818
2819 tg_pt_gp_cg = &se_dev->t10_alua.alua_tg_pt_gps_group; 2819 tg_pt_gp_cg = &se_dev->t10_alua.alua_tg_pt_gps_group;
2820 tg_pt_gp_cg->default_groups = kzalloc(sizeof(struct config_group) * 2, 2820 tg_pt_gp_cg->default_groups = kzalloc(sizeof(struct config_group) * 2,
2821 GFP_KERNEL); 2821 GFP_KERNEL);
2822 if (!(tg_pt_gp_cg->default_groups)) { 2822 if (!tg_pt_gp_cg->default_groups) {
2823 printk(KERN_ERR "Unable to allocate tg_pt_gp_cg->" 2823 pr_err("Unable to allocate tg_pt_gp_cg->"
2824 "default_groups\n"); 2824 "default_groups\n");
2825 goto out; 2825 goto out;
2826 } 2826 }
@@ -2837,12 +2837,12 @@ static struct config_group *target_core_make_subdev(
2837 dev_stat_grp->default_groups = kzalloc(sizeof(struct config_group) * 4, 2837 dev_stat_grp->default_groups = kzalloc(sizeof(struct config_group) * 4,
2838 GFP_KERNEL); 2838 GFP_KERNEL);
2839 if (!dev_stat_grp->default_groups) { 2839 if (!dev_stat_grp->default_groups) {
2840 printk(KERN_ERR "Unable to allocate dev_stat_grp->default_groups\n"); 2840 pr_err("Unable to allocate dev_stat_grp->default_groups\n");
2841 goto out; 2841 goto out;
2842 } 2842 }
2843 target_stat_setup_dev_default_groups(se_dev); 2843 target_stat_setup_dev_default_groups(se_dev);
2844 2844
2845 printk(KERN_INFO "Target_Core_ConfigFS: Allocated struct se_subsystem_dev:" 2845 pr_debug("Target_Core_ConfigFS: Allocated struct se_subsystem_dev:"
2846 " %p se_dev_su_ptr: %p\n", se_dev, se_dev->se_dev_su_ptr); 2846 " %p se_dev_su_ptr: %p\n", se_dev, se_dev->se_dev_su_ptr);
2847 2847
2848 mutex_unlock(&hba->hba_access_mutex); 2848 mutex_unlock(&hba->hba_access_mutex);
@@ -2975,13 +2975,13 @@ static ssize_t target_core_hba_store_attr_hba_mode(struct se_hba *hba,
2975 2975
2976 ret = strict_strtoul(page, 0, &mode_flag); 2976 ret = strict_strtoul(page, 0, &mode_flag);
2977 if (ret < 0) { 2977 if (ret < 0) {
2978 printk(KERN_ERR "Unable to extract hba mode flag: %d\n", ret); 2978 pr_err("Unable to extract hba mode flag: %d\n", ret);
2979 return -EINVAL; 2979 return -EINVAL;
2980 } 2980 }
2981 2981
2982 spin_lock(&hba->device_lock); 2982 spin_lock(&hba->device_lock);
2983 if (!(list_empty(&hba->hba_dev_list))) { 2983 if (!list_empty(&hba->hba_dev_list)) {
2984 printk(KERN_ERR "Unable to set hba_mode with active devices\n"); 2984 pr_err("Unable to set hba_mode with active devices\n");
2985 spin_unlock(&hba->device_lock); 2985 spin_unlock(&hba->device_lock);
2986 return -EINVAL; 2986 return -EINVAL;
2987 } 2987 }
@@ -3040,7 +3040,7 @@ static struct config_group *target_core_call_addhbatotarget(
3040 3040
3041 memset(buf, 0, TARGET_CORE_NAME_MAX_LEN); 3041 memset(buf, 0, TARGET_CORE_NAME_MAX_LEN);
3042 if (strlen(name) >= TARGET_CORE_NAME_MAX_LEN) { 3042 if (strlen(name) >= TARGET_CORE_NAME_MAX_LEN) {
3043 printk(KERN_ERR "Passed *name strlen(): %d exceeds" 3043 pr_err("Passed *name strlen(): %d exceeds"
3044 " TARGET_CORE_NAME_MAX_LEN: %d\n", (int)strlen(name), 3044 " TARGET_CORE_NAME_MAX_LEN: %d\n", (int)strlen(name),
3045 TARGET_CORE_NAME_MAX_LEN); 3045 TARGET_CORE_NAME_MAX_LEN);
3046 return ERR_PTR(-ENAMETOOLONG); 3046 return ERR_PTR(-ENAMETOOLONG);
@@ -3048,8 +3048,8 @@ static struct config_group *target_core_call_addhbatotarget(
3048 snprintf(buf, TARGET_CORE_NAME_MAX_LEN, "%s", name); 3048 snprintf(buf, TARGET_CORE_NAME_MAX_LEN, "%s", name);
3049 3049
3050 str = strstr(buf, "_"); 3050 str = strstr(buf, "_");
3051 if (!(str)) { 3051 if (!str) {
3052 printk(KERN_ERR "Unable to locate \"_\" for $SUBSYSTEM_PLUGIN_$HOST_ID\n"); 3052 pr_err("Unable to locate \"_\" for $SUBSYSTEM_PLUGIN_$HOST_ID\n");
3053 return ERR_PTR(-EINVAL); 3053 return ERR_PTR(-EINVAL);
3054 } 3054 }
3055 se_plugin_str = buf; 3055 se_plugin_str = buf;
@@ -3058,7 +3058,7 @@ static struct config_group *target_core_call_addhbatotarget(
3058 * Namely rd_direct and rd_mcp.. 3058 * Namely rd_direct and rd_mcp..
3059 */ 3059 */
3060 str2 = strstr(str+1, "_"); 3060 str2 = strstr(str+1, "_");
3061 if ((str2)) { 3061 if (str2) {
3062 *str2 = '\0'; /* Terminate for *se_plugin_str */ 3062 *str2 = '\0'; /* Terminate for *se_plugin_str */
3063 str2++; /* Skip to start of plugin dependent ID */ 3063 str2++; /* Skip to start of plugin dependent ID */
3064 str = str2; 3064 str = str2;
@@ -3069,7 +3069,7 @@ static struct config_group *target_core_call_addhbatotarget(
3069 3069
3070 ret = strict_strtoul(str, 0, &plugin_dep_id); 3070 ret = strict_strtoul(str, 0, &plugin_dep_id);
3071 if (ret < 0) { 3071 if (ret < 0) {
3072 printk(KERN_ERR "strict_strtoul() returned %d for" 3072 pr_err("strict_strtoul() returned %d for"
3073 " plugin_dep_id\n", ret); 3073 " plugin_dep_id\n", ret);
3074 return ERR_PTR(-EINVAL); 3074 return ERR_PTR(-EINVAL);
3075 } 3075 }
@@ -3122,7 +3122,7 @@ static int __init target_core_init_configfs(void)
3122 struct t10_alua_lu_gp *lu_gp; 3122 struct t10_alua_lu_gp *lu_gp;
3123 int ret; 3123 int ret;
3124 3124
3125 printk(KERN_INFO "TARGET_CORE[0]: Loading Generic Kernel Storage" 3125 pr_debug("TARGET_CORE[0]: Loading Generic Kernel Storage"
3126 " Engine: %s on %s/%s on "UTS_RELEASE"\n", 3126 " Engine: %s on %s/%s on "UTS_RELEASE"\n",
3127 TARGET_CORE_VERSION, utsname()->sysname, utsname()->machine); 3127 TARGET_CORE_VERSION, utsname()->sysname, utsname()->machine);
3128 3128
@@ -3142,8 +3142,8 @@ static int __init target_core_init_configfs(void)
3142 target_cg = &subsys->su_group; 3142 target_cg = &subsys->su_group;
3143 target_cg->default_groups = kzalloc(sizeof(struct config_group) * 2, 3143 target_cg->default_groups = kzalloc(sizeof(struct config_group) * 2,
3144 GFP_KERNEL); 3144 GFP_KERNEL);
3145 if (!(target_cg->default_groups)) { 3145 if (!target_cg->default_groups) {
3146 printk(KERN_ERR "Unable to allocate target_cg->default_groups\n"); 3146 pr_err("Unable to allocate target_cg->default_groups\n");
3147 goto out_global; 3147 goto out_global;
3148 } 3148 }
3149 3149
@@ -3157,8 +3157,8 @@ static int __init target_core_init_configfs(void)
3157 hba_cg = &target_core_hbagroup; 3157 hba_cg = &target_core_hbagroup;
3158 hba_cg->default_groups = kzalloc(sizeof(struct config_group) * 2, 3158 hba_cg->default_groups = kzalloc(sizeof(struct config_group) * 2,
3159 GFP_KERNEL); 3159 GFP_KERNEL);
3160 if (!(hba_cg->default_groups)) { 3160 if (!hba_cg->default_groups) {
3161 printk(KERN_ERR "Unable to allocate hba_cg->default_groups\n"); 3161 pr_err("Unable to allocate hba_cg->default_groups\n");
3162 goto out_global; 3162 goto out_global;
3163 } 3163 }
3164 config_group_init_type_name(&alua_group, 3164 config_group_init_type_name(&alua_group,
@@ -3172,8 +3172,8 @@ static int __init target_core_init_configfs(void)
3172 alua_cg = &alua_group; 3172 alua_cg = &alua_group;
3173 alua_cg->default_groups = kzalloc(sizeof(struct config_group) * 2, 3173 alua_cg->default_groups = kzalloc(sizeof(struct config_group) * 2,
3174 GFP_KERNEL); 3174 GFP_KERNEL);
3175 if (!(alua_cg->default_groups)) { 3175 if (!alua_cg->default_groups) {
3176 printk(KERN_ERR "Unable to allocate alua_cg->default_groups\n"); 3176 pr_err("Unable to allocate alua_cg->default_groups\n");
3177 goto out_global; 3177 goto out_global;
3178 } 3178 }
3179 3179
@@ -3191,8 +3191,8 @@ static int __init target_core_init_configfs(void)
3191 lu_gp_cg = &alua_lu_gps_group; 3191 lu_gp_cg = &alua_lu_gps_group;
3192 lu_gp_cg->default_groups = kzalloc(sizeof(struct config_group) * 2, 3192 lu_gp_cg->default_groups = kzalloc(sizeof(struct config_group) * 2,
3193 GFP_KERNEL); 3193 GFP_KERNEL);
3194 if (!(lu_gp_cg->default_groups)) { 3194 if (!lu_gp_cg->default_groups) {
3195 printk(KERN_ERR "Unable to allocate lu_gp_cg->default_groups\n"); 3195 pr_err("Unable to allocate lu_gp_cg->default_groups\n");
3196 goto out_global; 3196 goto out_global;
3197 } 3197 }
3198 3198
@@ -3206,11 +3206,11 @@ static int __init target_core_init_configfs(void)
3206 */ 3206 */
3207 ret = configfs_register_subsystem(subsys); 3207 ret = configfs_register_subsystem(subsys);
3208 if (ret < 0) { 3208 if (ret < 0) {
3209 printk(KERN_ERR "Error %d while registering subsystem %s\n", 3209 pr_err("Error %d while registering subsystem %s\n",
3210 ret, subsys->su_group.cg_item.ci_namebuf); 3210 ret, subsys->su_group.cg_item.ci_namebuf);
3211 goto out_global; 3211 goto out_global;
3212 } 3212 }
3213 printk(KERN_INFO "TARGET_CORE[0]: Initialized ConfigFS Fabric" 3213 pr_debug("TARGET_CORE[0]: Initialized ConfigFS Fabric"
3214 " Infrastructure: "TARGET_CORE_CONFIGFS_VERSION" on %s/%s" 3214 " Infrastructure: "TARGET_CORE_CONFIGFS_VERSION" on %s/%s"
3215 " on "UTS_RELEASE"\n", utsname()->sysname, utsname()->machine); 3215 " on "UTS_RELEASE"\n", utsname()->sysname, utsname()->machine);
3216 /* 3216 /*
@@ -3290,7 +3290,7 @@ static void __exit target_core_exit_configfs(void)
3290 core_alua_free_lu_gp(default_lu_gp); 3290 core_alua_free_lu_gp(default_lu_gp);
3291 default_lu_gp = NULL; 3291 default_lu_gp = NULL;
3292 3292
3293 printk(KERN_INFO "TARGET_CORE[0]: Released ConfigFS Fabric" 3293 pr_debug("TARGET_CORE[0]: Released ConfigFS Fabric"
3294 " Infrastructure\n"); 3294 " Infrastructure\n");
3295 3295
3296 core_dev_release_virtual_lun0(); 3296 core_dev_release_virtual_lun0();