aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-01-18 18:59:18 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-01-18 18:59:18 -0500
commit4ba3069fea9f0771dad3f4906b305ab50d5a1b30 (patch)
tree3f75f2c0a320a6f38538c5e63f46ef79b0b3f1d1 /Documentation
parent507a03c1cba0e32309223d23d19a1bfc0916c140 (diff)
parent895f3022523361e9b383cf48f51feb1f7d5e7e53 (diff)
Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending
* 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending: (26 commits) target: Set additional sense length field in sense data target: Remove legacy device status check from transport_execute_tasks target: Remove __transport_execute_tasks() for each processing context target: Remove extra se_device->execute_task_lock access in fast path target: Drop se_device TCQ queue_depth usage from I/O path target: Fix possible NULL pointer with __transport_execute_tasks target: Remove TFO->check_release_cmd() fabric API caller tcm_fc: Convert ft_send_work to use target_submit_cmd target: Add target_submit_cmd() for process context fabric submission target: Make target_put_sess_cmd use target_release_cmd_kref target: Set response format in INQUIRY response target: tcm_mod_builder: small fixups Documentation/target: Fix tcm_mod_builder.py build breakage target: remove overagressive ____cacheline_aligned annoations tcm_loop: bump max_sectors target/configs: remove trailing newline from udev_path and alias iscsi-target: fix chap identifier simple_strtoul usage target: remove useless casts target: simplify target_check_cdb_and_preempt target: Move core_scsi3_check_cdb_abort_and_preempt ...
Diffstat (limited to 'Documentation')
-rwxr-xr-xDocumentation/target/tcm_mod_builder.py60
1 files changed, 15 insertions, 45 deletions
diff --git a/Documentation/target/tcm_mod_builder.py b/Documentation/target/tcm_mod_builder.py
index 7ef9b843d529..6e21b8b52638 100755
--- a/Documentation/target/tcm_mod_builder.py
+++ b/Documentation/target/tcm_mod_builder.py
@@ -230,14 +230,9 @@ def tcm_mod_build_configfs(proto_ident, fabric_mod_dir_var, fabric_mod_name):
230 buf += "#include <linux/ctype.h>\n" 230 buf += "#include <linux/ctype.h>\n"
231 buf += "#include <asm/unaligned.h>\n\n" 231 buf += "#include <asm/unaligned.h>\n\n"
232 buf += "#include <target/target_core_base.h>\n" 232 buf += "#include <target/target_core_base.h>\n"
233 buf += "#include <target/target_core_transport.h>\n" 233 buf += "#include <target/target_core_fabric.h>\n"
234 buf += "#include <target/target_core_fabric_ops.h>\n"
235 buf += "#include <target/target_core_fabric_configfs.h>\n" 234 buf += "#include <target/target_core_fabric_configfs.h>\n"
236 buf += "#include <target/target_core_fabric_lib.h>\n"
237 buf += "#include <target/target_core_device.h>\n"
238 buf += "#include <target/target_core_tpg.h>\n"
239 buf += "#include <target/target_core_configfs.h>\n" 235 buf += "#include <target/target_core_configfs.h>\n"
240 buf += "#include <target/target_core_base.h>\n"
241 buf += "#include <target/configfs_macros.h>\n\n" 236 buf += "#include <target/configfs_macros.h>\n\n"
242 buf += "#include \"" + fabric_mod_name + "_base.h\"\n" 237 buf += "#include \"" + fabric_mod_name + "_base.h\"\n"
243 buf += "#include \"" + fabric_mod_name + "_fabric.h\"\n\n" 238 buf += "#include \"" + fabric_mod_name + "_fabric.h\"\n\n"
@@ -260,7 +255,7 @@ def tcm_mod_build_configfs(proto_ident, fabric_mod_dir_var, fabric_mod_name):
260 buf += " /* " + fabric_mod_name + "_parse_wwn(name, &wwpn, 1) < 0)\n" 255 buf += " /* " + fabric_mod_name + "_parse_wwn(name, &wwpn, 1) < 0)\n"
261 buf += " return ERR_PTR(-EINVAL); */\n" 256 buf += " return ERR_PTR(-EINVAL); */\n"
262 buf += " se_nacl_new = " + fabric_mod_name + "_alloc_fabric_acl(se_tpg);\n" 257 buf += " se_nacl_new = " + fabric_mod_name + "_alloc_fabric_acl(se_tpg);\n"
263 buf += " if (!(se_nacl_new))\n" 258 buf += " if (!se_nacl_new)\n"
264 buf += " return ERR_PTR(-ENOMEM);\n" 259 buf += " return ERR_PTR(-ENOMEM);\n"
265 buf += "//#warning FIXME: Hardcoded nexus depth in " + fabric_mod_name + "_make_nodeacl()\n" 260 buf += "//#warning FIXME: Hardcoded nexus depth in " + fabric_mod_name + "_make_nodeacl()\n"
266 buf += " nexus_depth = 1;\n" 261 buf += " nexus_depth = 1;\n"
@@ -308,7 +303,7 @@ def tcm_mod_build_configfs(proto_ident, fabric_mod_dir_var, fabric_mod_name):
308 buf += " if (strict_strtoul(name + 5, 10, &tpgt) || tpgt > UINT_MAX)\n" 303 buf += " if (strict_strtoul(name + 5, 10, &tpgt) || tpgt > UINT_MAX)\n"
309 buf += " return ERR_PTR(-EINVAL);\n\n" 304 buf += " return ERR_PTR(-EINVAL);\n\n"
310 buf += " tpg = kzalloc(sizeof(struct " + fabric_mod_name + "_tpg), GFP_KERNEL);\n" 305 buf += " tpg = kzalloc(sizeof(struct " + fabric_mod_name + "_tpg), GFP_KERNEL);\n"
311 buf += " if (!(tpg)) {\n" 306 buf += " if (!tpg) {\n"
312 buf += " printk(KERN_ERR \"Unable to allocate struct " + fabric_mod_name + "_tpg\");\n" 307 buf += " printk(KERN_ERR \"Unable to allocate struct " + fabric_mod_name + "_tpg\");\n"
313 buf += " return ERR_PTR(-ENOMEM);\n" 308 buf += " return ERR_PTR(-ENOMEM);\n"
314 buf += " }\n" 309 buf += " }\n"
@@ -344,7 +339,7 @@ def tcm_mod_build_configfs(proto_ident, fabric_mod_dir_var, fabric_mod_name):
344 buf += " /* if (" + fabric_mod_name + "_parse_wwn(name, &wwpn, 1) < 0)\n" 339 buf += " /* if (" + fabric_mod_name + "_parse_wwn(name, &wwpn, 1) < 0)\n"
345 buf += " return ERR_PTR(-EINVAL); */\n\n" 340 buf += " return ERR_PTR(-EINVAL); */\n\n"
346 buf += " " + fabric_mod_port + " = kzalloc(sizeof(struct " + fabric_mod_name + "_" + fabric_mod_port + "), GFP_KERNEL);\n" 341 buf += " " + fabric_mod_port + " = kzalloc(sizeof(struct " + fabric_mod_name + "_" + fabric_mod_port + "), GFP_KERNEL);\n"
347 buf += " if (!(" + fabric_mod_port + ")) {\n" 342 buf += " if (!" + fabric_mod_port + ") {\n"
348 buf += " printk(KERN_ERR \"Unable to allocate struct " + fabric_mod_name + "_" + fabric_mod_port + "\");\n" 343 buf += " printk(KERN_ERR \"Unable to allocate struct " + fabric_mod_name + "_" + fabric_mod_port + "\");\n"
349 buf += " return ERR_PTR(-ENOMEM);\n" 344 buf += " return ERR_PTR(-ENOMEM);\n"
350 buf += " }\n" 345 buf += " }\n"
@@ -352,7 +347,7 @@ def tcm_mod_build_configfs(proto_ident, fabric_mod_dir_var, fabric_mod_name):
352 if proto_ident == "FC" or proto_ident == "SAS": 347 if proto_ident == "FC" or proto_ident == "SAS":
353 buf += " " + fabric_mod_port + "->" + fabric_mod_port + "_wwpn = wwpn;\n" 348 buf += " " + fabric_mod_port + "->" + fabric_mod_port + "_wwpn = wwpn;\n"
354 349
355 buf += " /* " + fabric_mod_name + "_format_wwn(&" + fabric_mod_port + "->" + fabric_mod_port + "_name[0], " + fabric_mod_name.upper() + "__NAMELEN, wwpn); */\n\n" 350 buf += " /* " + fabric_mod_name + "_format_wwn(&" + fabric_mod_port + "->" + fabric_mod_port + "_name[0], " + fabric_mod_name.upper() + "_NAMELEN, wwpn); */\n\n"
356 buf += " return &" + fabric_mod_port + "->" + fabric_mod_port + "_wwn;\n" 351 buf += " return &" + fabric_mod_port + "->" + fabric_mod_port + "_wwn;\n"
357 buf += "}\n\n" 352 buf += "}\n\n"
358 buf += "static void " + fabric_mod_name + "_drop_" + fabric_mod_port + "(struct se_wwn *wwn)\n" 353 buf += "static void " + fabric_mod_name + "_drop_" + fabric_mod_port + "(struct se_wwn *wwn)\n"
@@ -391,8 +386,7 @@ def tcm_mod_build_configfs(proto_ident, fabric_mod_dir_var, fabric_mod_name):
391 buf += " .tpg_alloc_fabric_acl = " + fabric_mod_name + "_alloc_fabric_acl,\n" 386 buf += " .tpg_alloc_fabric_acl = " + fabric_mod_name + "_alloc_fabric_acl,\n"
392 buf += " .tpg_release_fabric_acl = " + fabric_mod_name + "_release_fabric_acl,\n" 387 buf += " .tpg_release_fabric_acl = " + fabric_mod_name + "_release_fabric_acl,\n"
393 buf += " .tpg_get_inst_index = " + fabric_mod_name + "_tpg_get_inst_index,\n" 388 buf += " .tpg_get_inst_index = " + fabric_mod_name + "_tpg_get_inst_index,\n"
394 buf += " .release_cmd_to_pool = " + fabric_mod_name + "_release_cmd,\n" 389 buf += " .release_cmd = " + fabric_mod_name + "_release_cmd,\n"
395 buf += " .release_cmd_direct = " + fabric_mod_name + "_release_cmd,\n"
396 buf += " .shutdown_session = " + fabric_mod_name + "_shutdown_session,\n" 390 buf += " .shutdown_session = " + fabric_mod_name + "_shutdown_session,\n"
397 buf += " .close_session = " + fabric_mod_name + "_close_session,\n" 391 buf += " .close_session = " + fabric_mod_name + "_close_session,\n"
398 buf += " .stop_session = " + fabric_mod_name + "_stop_session,\n" 392 buf += " .stop_session = " + fabric_mod_name + "_stop_session,\n"
@@ -405,14 +399,12 @@ def tcm_mod_build_configfs(proto_ident, fabric_mod_dir_var, fabric_mod_name):
405 buf += " .set_default_node_attributes = " + fabric_mod_name + "_set_default_node_attrs,\n" 399 buf += " .set_default_node_attributes = " + fabric_mod_name + "_set_default_node_attrs,\n"
406 buf += " .get_task_tag = " + fabric_mod_name + "_get_task_tag,\n" 400 buf += " .get_task_tag = " + fabric_mod_name + "_get_task_tag,\n"
407 buf += " .get_cmd_state = " + fabric_mod_name + "_get_cmd_state,\n" 401 buf += " .get_cmd_state = " + fabric_mod_name + "_get_cmd_state,\n"
408 buf += " .new_cmd_failure = " + fabric_mod_name + "_new_cmd_failure,\n"
409 buf += " .queue_data_in = " + fabric_mod_name + "_queue_data_in,\n" 402 buf += " .queue_data_in = " + fabric_mod_name + "_queue_data_in,\n"
410 buf += " .queue_status = " + fabric_mod_name + "_queue_status,\n" 403 buf += " .queue_status = " + fabric_mod_name + "_queue_status,\n"
411 buf += " .queue_tm_rsp = " + fabric_mod_name + "_queue_tm_rsp,\n" 404 buf += " .queue_tm_rsp = " + fabric_mod_name + "_queue_tm_rsp,\n"
412 buf += " .get_fabric_sense_len = " + fabric_mod_name + "_get_fabric_sense_len,\n" 405 buf += " .get_fabric_sense_len = " + fabric_mod_name + "_get_fabric_sense_len,\n"
413 buf += " .set_fabric_sense_len = " + fabric_mod_name + "_set_fabric_sense_len,\n" 406 buf += " .set_fabric_sense_len = " + fabric_mod_name + "_set_fabric_sense_len,\n"
414 buf += " .is_state_remove = " + fabric_mod_name + "_is_state_remove,\n" 407 buf += " .is_state_remove = " + fabric_mod_name + "_is_state_remove,\n"
415 buf += " .pack_lun = " + fabric_mod_name + "_pack_lun,\n"
416 buf += " /*\n" 408 buf += " /*\n"
417 buf += " * Setup function pointers for generic logic in target_core_fabric_configfs.c\n" 409 buf += " * Setup function pointers for generic logic in target_core_fabric_configfs.c\n"
418 buf += " */\n" 410 buf += " */\n"
@@ -439,9 +431,9 @@ def tcm_mod_build_configfs(proto_ident, fabric_mod_dir_var, fabric_mod_name):
439 buf += " * Register the top level struct config_item_type with TCM core\n" 431 buf += " * Register the top level struct config_item_type with TCM core\n"
440 buf += " */\n" 432 buf += " */\n"
441 buf += " fabric = target_fabric_configfs_init(THIS_MODULE, \"" + fabric_mod_name[4:] + "\");\n" 433 buf += " fabric = target_fabric_configfs_init(THIS_MODULE, \"" + fabric_mod_name[4:] + "\");\n"
442 buf += " if (!(fabric)) {\n" 434 buf += " if (IS_ERR(fabric)) {\n"
443 buf += " printk(KERN_ERR \"target_fabric_configfs_init() failed\\n\");\n" 435 buf += " printk(KERN_ERR \"target_fabric_configfs_init() failed\\n\");\n"
444 buf += " return -ENOMEM;\n" 436 buf += " return PTR_ERR(fabric);\n"
445 buf += " }\n" 437 buf += " }\n"
446 buf += " /*\n" 438 buf += " /*\n"
447 buf += " * Setup fabric->tf_ops from our local " + fabric_mod_name + "_ops\n" 439 buf += " * Setup fabric->tf_ops from our local " + fabric_mod_name + "_ops\n"
@@ -475,9 +467,9 @@ def tcm_mod_build_configfs(proto_ident, fabric_mod_dir_var, fabric_mod_name):
475 buf += " printk(KERN_INFO \"" + fabric_mod_name.upper() + "[0] - Set fabric -> " + fabric_mod_name + "_fabric_configfs\\n\");\n" 467 buf += " printk(KERN_INFO \"" + fabric_mod_name.upper() + "[0] - Set fabric -> " + fabric_mod_name + "_fabric_configfs\\n\");\n"
476 buf += " return 0;\n" 468 buf += " return 0;\n"
477 buf += "};\n\n" 469 buf += "};\n\n"
478 buf += "static void " + fabric_mod_name + "_deregister_configfs(void)\n" 470 buf += "static void __exit " + fabric_mod_name + "_deregister_configfs(void)\n"
479 buf += "{\n" 471 buf += "{\n"
480 buf += " if (!(" + fabric_mod_name + "_fabric_configfs))\n" 472 buf += " if (!" + fabric_mod_name + "_fabric_configfs)\n"
481 buf += " return;\n\n" 473 buf += " return;\n\n"
482 buf += " target_fabric_configfs_deregister(" + fabric_mod_name + "_fabric_configfs);\n" 474 buf += " target_fabric_configfs_deregister(" + fabric_mod_name + "_fabric_configfs);\n"
483 buf += " " + fabric_mod_name + "_fabric_configfs = NULL;\n" 475 buf += " " + fabric_mod_name + "_fabric_configfs = NULL;\n"
@@ -492,17 +484,15 @@ def tcm_mod_build_configfs(proto_ident, fabric_mod_dir_var, fabric_mod_name):
492 buf += " return ret;\n\n" 484 buf += " return ret;\n\n"
493 buf += " return 0;\n" 485 buf += " return 0;\n"
494 buf += "};\n\n" 486 buf += "};\n\n"
495 buf += "static void " + fabric_mod_name + "_exit(void)\n" 487 buf += "static void __exit " + fabric_mod_name + "_exit(void)\n"
496 buf += "{\n" 488 buf += "{\n"
497 buf += " " + fabric_mod_name + "_deregister_configfs();\n" 489 buf += " " + fabric_mod_name + "_deregister_configfs();\n"
498 buf += "};\n\n" 490 buf += "};\n\n"
499 491
500 buf += "#ifdef MODULE\n"
501 buf += "MODULE_DESCRIPTION(\"" + fabric_mod_name.upper() + " series fabric driver\");\n" 492 buf += "MODULE_DESCRIPTION(\"" + fabric_mod_name.upper() + " series fabric driver\");\n"
502 buf += "MODULE_LICENSE(\"GPL\");\n" 493 buf += "MODULE_LICENSE(\"GPL\");\n"
503 buf += "module_init(" + fabric_mod_name + "_init);\n" 494 buf += "module_init(" + fabric_mod_name + "_init);\n"
504 buf += "module_exit(" + fabric_mod_name + "_exit);\n" 495 buf += "module_exit(" + fabric_mod_name + "_exit);\n"
505 buf += "#endif\n"
506 496
507 ret = p.write(buf) 497 ret = p.write(buf)
508 if ret: 498 if ret:
@@ -514,7 +504,7 @@ def tcm_mod_build_configfs(proto_ident, fabric_mod_dir_var, fabric_mod_name):
514 504
515def tcm_mod_scan_fabric_ops(tcm_dir): 505def tcm_mod_scan_fabric_ops(tcm_dir):
516 506
517 fabric_ops_api = tcm_dir + "include/target/target_core_fabric_ops.h" 507 fabric_ops_api = tcm_dir + "include/target/target_core_fabric.h"
518 508
519 print "Using tcm_mod_scan_fabric_ops: " + fabric_ops_api 509 print "Using tcm_mod_scan_fabric_ops: " + fabric_ops_api
520 process_fo = 0; 510 process_fo = 0;
@@ -579,11 +569,7 @@ def tcm_mod_dump_fabric_ops(proto_ident, fabric_mod_dir_var, fabric_mod_name):
579 buf += "#include <scsi/scsi_cmnd.h>\n" 569 buf += "#include <scsi/scsi_cmnd.h>\n"
580 buf += "#include <scsi/libfc.h>\n\n" 570 buf += "#include <scsi/libfc.h>\n\n"
581 buf += "#include <target/target_core_base.h>\n" 571 buf += "#include <target/target_core_base.h>\n"
582 buf += "#include <target/target_core_transport.h>\n" 572 buf += "#include <target/target_core_fabric.h>\n"
583 buf += "#include <target/target_core_fabric_ops.h>\n"
584 buf += "#include <target/target_core_fabric_lib.h>\n"
585 buf += "#include <target/target_core_device.h>\n"
586 buf += "#include <target/target_core_tpg.h>\n"
587 buf += "#include <target/target_core_configfs.h>\n\n" 573 buf += "#include <target/target_core_configfs.h>\n\n"
588 buf += "#include \"" + fabric_mod_name + "_base.h\"\n" 574 buf += "#include \"" + fabric_mod_name + "_base.h\"\n"
589 buf += "#include \"" + fabric_mod_name + "_fabric.h\"\n\n" 575 buf += "#include \"" + fabric_mod_name + "_fabric.h\"\n\n"
@@ -788,7 +774,7 @@ def tcm_mod_dump_fabric_ops(proto_ident, fabric_mod_dir_var, fabric_mod_name):
788 buf += "{\n" 774 buf += "{\n"
789 buf += " struct " + fabric_mod_name + "_nacl *nacl;\n\n" 775 buf += " struct " + fabric_mod_name + "_nacl *nacl;\n\n"
790 buf += " nacl = kzalloc(sizeof(struct " + fabric_mod_name + "_nacl), GFP_KERNEL);\n" 776 buf += " nacl = kzalloc(sizeof(struct " + fabric_mod_name + "_nacl), GFP_KERNEL);\n"
791 buf += " if (!(nacl)) {\n" 777 buf += " if (!nacl) {\n"
792 buf += " printk(KERN_ERR \"Unable to alocate struct " + fabric_mod_name + "_nacl\\n\");\n" 778 buf += " printk(KERN_ERR \"Unable to alocate struct " + fabric_mod_name + "_nacl\\n\");\n"
793 buf += " return NULL;\n" 779 buf += " return NULL;\n"
794 buf += " }\n\n" 780 buf += " }\n\n"
@@ -815,7 +801,7 @@ def tcm_mod_dump_fabric_ops(proto_ident, fabric_mod_dir_var, fabric_mod_name):
815 buf += "}\n\n" 801 buf += "}\n\n"
816 bufi += "u32 " + fabric_mod_name + "_tpg_get_inst_index(struct se_portal_group *);\n" 802 bufi += "u32 " + fabric_mod_name + "_tpg_get_inst_index(struct se_portal_group *);\n"
817 803
818 if re.search('release_cmd_to_pool', fo): 804 if re.search('\*release_cmd\)\(', fo):
819 buf += "void " + fabric_mod_name + "_release_cmd(struct se_cmd *se_cmd)\n" 805 buf += "void " + fabric_mod_name + "_release_cmd(struct se_cmd *se_cmd)\n"
820 buf += "{\n" 806 buf += "{\n"
821 buf += " return;\n" 807 buf += " return;\n"
@@ -899,13 +885,6 @@ def tcm_mod_dump_fabric_ops(proto_ident, fabric_mod_dir_var, fabric_mod_name):
899 buf += "}\n\n" 885 buf += "}\n\n"
900 bufi += "int " + fabric_mod_name + "_get_cmd_state(struct se_cmd *);\n" 886 bufi += "int " + fabric_mod_name + "_get_cmd_state(struct se_cmd *);\n"
901 887
902 if re.search('new_cmd_failure\)\(', fo):
903 buf += "void " + fabric_mod_name + "_new_cmd_failure(struct se_cmd *se_cmd)\n"
904 buf += "{\n"
905 buf += " return;\n"
906 buf += "}\n\n"
907 bufi += "void " + fabric_mod_name + "_new_cmd_failure(struct se_cmd *);\n"
908
909 if re.search('queue_data_in\)\(', fo): 888 if re.search('queue_data_in\)\(', fo):
910 buf += "int " + fabric_mod_name + "_queue_data_in(struct se_cmd *se_cmd)\n" 889 buf += "int " + fabric_mod_name + "_queue_data_in(struct se_cmd *se_cmd)\n"
911 buf += "{\n" 890 buf += "{\n"
@@ -948,15 +927,6 @@ def tcm_mod_dump_fabric_ops(proto_ident, fabric_mod_dir_var, fabric_mod_name):
948 buf += "}\n\n" 927 buf += "}\n\n"
949 bufi += "int " + fabric_mod_name + "_is_state_remove(struct se_cmd *);\n" 928 bufi += "int " + fabric_mod_name + "_is_state_remove(struct se_cmd *);\n"
950 929
951 if re.search('pack_lun\)\(', fo):
952 buf += "u64 " + fabric_mod_name + "_pack_lun(unsigned int lun)\n"
953 buf += "{\n"
954 buf += " WARN_ON(lun >= 256);\n"
955 buf += " /* Caller wants this byte-swapped */\n"
956 buf += " return cpu_to_le64((lun & 0xff) << 8);\n"
957 buf += "}\n\n"
958 bufi += "u64 " + fabric_mod_name + "_pack_lun(unsigned int);\n"
959
960 930
961 ret = p.write(buf) 931 ret = p.write(buf)
962 if ret: 932 if ret: