diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-12-21 13:16:05 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-12-21 13:16:05 -0500 |
commit | d5db84a871f815968e4d2933b9dd6f8ab83f80d1 (patch) | |
tree | 5b85af064a1fba8d28e86d6431a089b8319f456f /drivers/target | |
parent | f8114f8583bb18a467c04ddc1e8978330e445801 (diff) | |
parent | 83337e544323a8bd7492994d64af339175ac7107 (diff) |
Merge branch 'scsi-target-for-v4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/bvanassche/linux
Pull scsi target cleanups from Bart Van Assche:
"The changes here are:
- a few small bug fixes for the iSCSI and user space target drivers.
- minimize the target build time by about 30% by rearranging #include
directives
- fix the second argument passed to percpu_ida_alloc()
- reduce the number of false positive warnings reported by sparse
These patches pass Wu Fengguang's build bot tests and also the
linux-next tests"
* 'scsi-target-for-v4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/bvanassche/linux:
iscsi-target: Return error if unable to add network portal
target: Fix spelling mistake and unwrap multi-line text
target/iscsi: Fix double free in lio_target_tiqn_addtpg()
target/user: Fix use-after-free of tcmu_cmds if they are expired
target: Minimize #include directives
target/user: Add an #include directive
cxgbit: Add an #include directive
ibmvscsi_tgt: Add two #include directives
sbp-target: Add an #include directive
qla2xxx: Add an #include directive
configfs: Minimize #include directives
usb: gadget: Fix second argument of percpu_ida_alloc()
sbp-target: Fix second argument of percpu_ida_alloc()
target/user: Fix a data type in tcmu_queue_cmd()
target: Use NULL instead of 0 to represent a pointer
Diffstat (limited to 'drivers/target')
49 files changed, 169 insertions, 18 deletions
diff --git a/drivers/target/iscsi/cxgbit/cxgbit_target.c b/drivers/target/iscsi/cxgbit/cxgbit_target.c index d02bf58aea6d..8bcb9b71f764 100644 --- a/drivers/target/iscsi/cxgbit/cxgbit_target.c +++ b/drivers/target/iscsi/cxgbit/cxgbit_target.c | |||
@@ -9,6 +9,7 @@ | |||
9 | #include <linux/workqueue.h> | 9 | #include <linux/workqueue.h> |
10 | #include <linux/kthread.h> | 10 | #include <linux/kthread.h> |
11 | #include <asm/unaligned.h> | 11 | #include <asm/unaligned.h> |
12 | #include <net/tcp.h> | ||
12 | #include <target/target_core_base.h> | 13 | #include <target/target_core_base.h> |
13 | #include <target/target_core_fabric.h> | 14 | #include <target/target_core_fabric.h> |
14 | #include "cxgbit.h" | 15 | #include "cxgbit.h" |
diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c index b7d747e92c7a..da2c73a255de 100644 --- a/drivers/target/iscsi/iscsi_target.c +++ b/drivers/target/iscsi/iscsi_target.c | |||
@@ -23,7 +23,9 @@ | |||
23 | #include <linux/module.h> | 23 | #include <linux/module.h> |
24 | #include <linux/vmalloc.h> | 24 | #include <linux/vmalloc.h> |
25 | #include <linux/idr.h> | 25 | #include <linux/idr.h> |
26 | #include <linux/delay.h> | ||
26 | #include <asm/unaligned.h> | 27 | #include <asm/unaligned.h> |
28 | #include <net/ipv6.h> | ||
27 | #include <scsi/scsi_proto.h> | 29 | #include <scsi/scsi_proto.h> |
28 | #include <scsi/iscsi_proto.h> | 30 | #include <scsi/iscsi_proto.h> |
29 | #include <scsi/scsi_tcq.h> | 31 | #include <scsi/scsi_tcq.h> |
diff --git a/drivers/target/iscsi/iscsi_target.h b/drivers/target/iscsi/iscsi_target.h index 4cf2c0f2ba2f..e0db2ceb0f87 100644 --- a/drivers/target/iscsi/iscsi_target.h +++ b/drivers/target/iscsi/iscsi_target.h | |||
@@ -1,6 +1,18 @@ | |||
1 | #ifndef ISCSI_TARGET_H | 1 | #ifndef ISCSI_TARGET_H |
2 | #define ISCSI_TARGET_H | 2 | #define ISCSI_TARGET_H |
3 | 3 | ||
4 | #include <linux/types.h> | ||
5 | #include <linux/spinlock.h> | ||
6 | |||
7 | struct iscsi_cmd; | ||
8 | struct iscsi_conn; | ||
9 | struct iscsi_np; | ||
10 | struct iscsi_portal_group; | ||
11 | struct iscsi_session; | ||
12 | struct iscsi_tpg_np; | ||
13 | struct kref; | ||
14 | struct sockaddr_storage; | ||
15 | |||
4 | extern struct iscsi_tiqn *iscsit_get_tiqn_for_login(unsigned char *); | 16 | extern struct iscsi_tiqn *iscsit_get_tiqn_for_login(unsigned char *); |
5 | extern struct iscsi_tiqn *iscsit_get_tiqn(unsigned char *, int); | 17 | extern struct iscsi_tiqn *iscsit_get_tiqn(unsigned char *, int); |
6 | extern void iscsit_put_tiqn_for_login(struct iscsi_tiqn *); | 18 | extern void iscsit_put_tiqn_for_login(struct iscsi_tiqn *); |
diff --git a/drivers/target/iscsi/iscsi_target_auth.c b/drivers/target/iscsi/iscsi_target_auth.c index e116f0e845c0..903b667f8e01 100644 --- a/drivers/target/iscsi/iscsi_target_auth.c +++ b/drivers/target/iscsi/iscsi_target_auth.c | |||
@@ -20,8 +20,8 @@ | |||
20 | #include <linux/kernel.h> | 20 | #include <linux/kernel.h> |
21 | #include <linux/string.h> | 21 | #include <linux/string.h> |
22 | #include <linux/err.h> | 22 | #include <linux/err.h> |
23 | #include <linux/random.h> | ||
23 | #include <linux/scatterlist.h> | 24 | #include <linux/scatterlist.h> |
24 | |||
25 | #include <target/iscsi/iscsi_target_core.h> | 25 | #include <target/iscsi/iscsi_target_core.h> |
26 | #include "iscsi_target_nego.h" | 26 | #include "iscsi_target_nego.h" |
27 | #include "iscsi_target_auth.h" | 27 | #include "iscsi_target_auth.h" |
diff --git a/drivers/target/iscsi/iscsi_target_auth.h b/drivers/target/iscsi/iscsi_target_auth.h index d22f7b96a06c..1b91c13cc965 100644 --- a/drivers/target/iscsi/iscsi_target_auth.h +++ b/drivers/target/iscsi/iscsi_target_auth.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef _ISCSI_CHAP_H_ | 1 | #ifndef _ISCSI_CHAP_H_ |
2 | #define _ISCSI_CHAP_H_ | 2 | #define _ISCSI_CHAP_H_ |
3 | 3 | ||
4 | #include <linux/types.h> | ||
5 | |||
4 | #define CHAP_DIGEST_UNKNOWN 0 | 6 | #define CHAP_DIGEST_UNKNOWN 0 |
5 | #define CHAP_DIGEST_MD5 5 | 7 | #define CHAP_DIGEST_MD5 5 |
6 | #define CHAP_DIGEST_SHA 6 | 8 | #define CHAP_DIGEST_SHA 6 |
@@ -18,6 +20,9 @@ | |||
18 | #define CHAP_STAGE_CLIENT_NRIC 4 | 20 | #define CHAP_STAGE_CLIENT_NRIC 4 |
19 | #define CHAP_STAGE_SERVER_NR 5 | 21 | #define CHAP_STAGE_SERVER_NR 5 |
20 | 22 | ||
23 | struct iscsi_node_auth; | ||
24 | struct iscsi_conn; | ||
25 | |||
21 | extern u32 chap_main_loop(struct iscsi_conn *, struct iscsi_node_auth *, char *, char *, | 26 | extern u32 chap_main_loop(struct iscsi_conn *, struct iscsi_node_auth *, char *, char *, |
22 | int *, int *); | 27 | int *, int *); |
23 | 28 | ||
diff --git a/drivers/target/iscsi/iscsi_target_configfs.c b/drivers/target/iscsi/iscsi_target_configfs.c index 923c032f0b95..bf40f03755dd 100644 --- a/drivers/target/iscsi/iscsi_target_configfs.c +++ b/drivers/target/iscsi/iscsi_target_configfs.c | |||
@@ -21,10 +21,11 @@ | |||
21 | #include <linux/ctype.h> | 21 | #include <linux/ctype.h> |
22 | #include <linux/export.h> | 22 | #include <linux/export.h> |
23 | #include <linux/inet.h> | 23 | #include <linux/inet.h> |
24 | #include <linux/module.h> | ||
25 | #include <net/ipv6.h> | ||
24 | #include <target/target_core_base.h> | 26 | #include <target/target_core_base.h> |
25 | #include <target/target_core_fabric.h> | 27 | #include <target/target_core_fabric.h> |
26 | #include <target/iscsi/iscsi_transport.h> | 28 | #include <target/iscsi/iscsi_transport.h> |
27 | |||
28 | #include <target/iscsi/iscsi_target_core.h> | 29 | #include <target/iscsi/iscsi_target_core.h> |
29 | #include "iscsi_target_parameters.h" | 30 | #include "iscsi_target_parameters.h" |
30 | #include "iscsi_target_device.h" | 31 | #include "iscsi_target_device.h" |
@@ -100,8 +101,10 @@ static ssize_t lio_target_np_driver_store(struct config_item *item, | |||
100 | 101 | ||
101 | tpg_np_new = iscsit_tpg_add_network_portal(tpg, | 102 | tpg_np_new = iscsit_tpg_add_network_portal(tpg, |
102 | &np->np_sockaddr, tpg_np, type); | 103 | &np->np_sockaddr, tpg_np, type); |
103 | if (IS_ERR(tpg_np_new)) | 104 | if (IS_ERR(tpg_np_new)) { |
105 | rc = PTR_ERR(tpg_np_new); | ||
104 | goto out; | 106 | goto out; |
107 | } | ||
105 | } else { | 108 | } else { |
106 | tpg_np_new = iscsit_tpg_locate_child_np(tpg_np, type); | 109 | tpg_np_new = iscsit_tpg_locate_child_np(tpg_np, type); |
107 | if (tpg_np_new) { | 110 | if (tpg_np_new) { |
diff --git a/drivers/target/iscsi/iscsi_target_datain_values.c b/drivers/target/iscsi/iscsi_target_datain_values.c index 647d4a5dca52..173ddd93c757 100644 --- a/drivers/target/iscsi/iscsi_target_datain_values.c +++ b/drivers/target/iscsi/iscsi_target_datain_values.c | |||
@@ -16,8 +16,8 @@ | |||
16 | * GNU General Public License for more details. | 16 | * GNU General Public License for more details. |
17 | ******************************************************************************/ | 17 | ******************************************************************************/ |
18 | 18 | ||
19 | #include <linux/slab.h> | ||
19 | #include <scsi/iscsi_proto.h> | 20 | #include <scsi/iscsi_proto.h> |
20 | |||
21 | #include <target/iscsi/iscsi_target_core.h> | 21 | #include <target/iscsi/iscsi_target_core.h> |
22 | #include "iscsi_target_seq_pdu_list.h" | 22 | #include "iscsi_target_seq_pdu_list.h" |
23 | #include "iscsi_target_erl1.h" | 23 | #include "iscsi_target_erl1.h" |
diff --git a/drivers/target/iscsi/iscsi_target_datain_values.h b/drivers/target/iscsi/iscsi_target_datain_values.h index 646429ac5a02..16edeeeb7777 100644 --- a/drivers/target/iscsi/iscsi_target_datain_values.h +++ b/drivers/target/iscsi/iscsi_target_datain_values.h | |||
@@ -1,6 +1,9 @@ | |||
1 | #ifndef ISCSI_TARGET_DATAIN_VALUES_H | 1 | #ifndef ISCSI_TARGET_DATAIN_VALUES_H |
2 | #define ISCSI_TARGET_DATAIN_VALUES_H | 2 | #define ISCSI_TARGET_DATAIN_VALUES_H |
3 | 3 | ||
4 | struct iscsi_cmd; | ||
5 | struct iscsi_datain; | ||
6 | |||
4 | extern struct iscsi_datain_req *iscsit_allocate_datain_req(void); | 7 | extern struct iscsi_datain_req *iscsit_allocate_datain_req(void); |
5 | extern void iscsit_attach_datain_req(struct iscsi_cmd *, struct iscsi_datain_req *); | 8 | extern void iscsit_attach_datain_req(struct iscsi_cmd *, struct iscsi_datain_req *); |
6 | extern void iscsit_free_datain_req(struct iscsi_cmd *, struct iscsi_datain_req *); | 9 | extern void iscsit_free_datain_req(struct iscsi_cmd *, struct iscsi_datain_req *); |
diff --git a/drivers/target/iscsi/iscsi_target_device.h b/drivers/target/iscsi/iscsi_target_device.h index a0e2df9e8090..06dbff5cd520 100644 --- a/drivers/target/iscsi/iscsi_target_device.h +++ b/drivers/target/iscsi/iscsi_target_device.h | |||
@@ -1,6 +1,9 @@ | |||
1 | #ifndef ISCSI_TARGET_DEVICE_H | 1 | #ifndef ISCSI_TARGET_DEVICE_H |
2 | #define ISCSI_TARGET_DEVICE_H | 2 | #define ISCSI_TARGET_DEVICE_H |
3 | 3 | ||
4 | struct iscsi_cmd; | ||
5 | struct iscsi_session; | ||
6 | |||
4 | extern void iscsit_determine_maxcmdsn(struct iscsi_session *); | 7 | extern void iscsit_determine_maxcmdsn(struct iscsi_session *); |
5 | extern void iscsit_increment_maxcmdsn(struct iscsi_cmd *, struct iscsi_session *); | 8 | extern void iscsit_increment_maxcmdsn(struct iscsi_cmd *, struct iscsi_session *); |
6 | 9 | ||
diff --git a/drivers/target/iscsi/iscsi_target_erl0.h b/drivers/target/iscsi/iscsi_target_erl0.h index a9e2f9497fb2..60e69e2af6ed 100644 --- a/drivers/target/iscsi/iscsi_target_erl0.h +++ b/drivers/target/iscsi/iscsi_target_erl0.h | |||
@@ -1,6 +1,12 @@ | |||
1 | #ifndef ISCSI_TARGET_ERL0_H | 1 | #ifndef ISCSI_TARGET_ERL0_H |
2 | #define ISCSI_TARGET_ERL0_H | 2 | #define ISCSI_TARGET_ERL0_H |
3 | 3 | ||
4 | #include <linux/types.h> | ||
5 | |||
6 | struct iscsi_cmd; | ||
7 | struct iscsi_conn; | ||
8 | struct iscsi_session; | ||
9 | |||
4 | extern void iscsit_set_dataout_sequence_values(struct iscsi_cmd *); | 10 | extern void iscsit_set_dataout_sequence_values(struct iscsi_cmd *); |
5 | extern int iscsit_check_pre_dataout(struct iscsi_cmd *, unsigned char *); | 11 | extern int iscsit_check_pre_dataout(struct iscsi_cmd *, unsigned char *); |
6 | extern int iscsit_check_post_dataout(struct iscsi_cmd *, unsigned char *, u8); | 12 | extern int iscsit_check_post_dataout(struct iscsi_cmd *, unsigned char *, u8); |
diff --git a/drivers/target/iscsi/iscsi_target_erl1.c b/drivers/target/iscsi/iscsi_target_erl1.c index 9214c9dafa2b..fe9b7f1e44ac 100644 --- a/drivers/target/iscsi/iscsi_target_erl1.c +++ b/drivers/target/iscsi/iscsi_target_erl1.c | |||
@@ -17,6 +17,7 @@ | |||
17 | ******************************************************************************/ | 17 | ******************************************************************************/ |
18 | 18 | ||
19 | #include <linux/list.h> | 19 | #include <linux/list.h> |
20 | #include <linux/slab.h> | ||
20 | #include <scsi/iscsi_proto.h> | 21 | #include <scsi/iscsi_proto.h> |
21 | #include <target/target_core_base.h> | 22 | #include <target/target_core_base.h> |
22 | #include <target/target_core_fabric.h> | 23 | #include <target/target_core_fabric.h> |
diff --git a/drivers/target/iscsi/iscsi_target_erl1.h b/drivers/target/iscsi/iscsi_target_erl1.h index 2a3ebf118a34..54d36bd25bea 100644 --- a/drivers/target/iscsi/iscsi_target_erl1.h +++ b/drivers/target/iscsi/iscsi_target_erl1.h | |||
@@ -1,6 +1,16 @@ | |||
1 | #ifndef ISCSI_TARGET_ERL1_H | 1 | #ifndef ISCSI_TARGET_ERL1_H |
2 | #define ISCSI_TARGET_ERL1_H | 2 | #define ISCSI_TARGET_ERL1_H |
3 | 3 | ||
4 | #include <linux/types.h> | ||
5 | #include <scsi/iscsi_proto.h> /* itt_t */ | ||
6 | |||
7 | struct iscsi_cmd; | ||
8 | struct iscsi_conn; | ||
9 | struct iscsi_datain_req; | ||
10 | struct iscsi_ooo_cmdsn; | ||
11 | struct iscsi_pdu; | ||
12 | struct iscsi_session; | ||
13 | |||
4 | extern int iscsit_dump_data_payload(struct iscsi_conn *, u32, int); | 14 | extern int iscsit_dump_data_payload(struct iscsi_conn *, u32, int); |
5 | extern int iscsit_create_recovery_datain_values_datasequenceinorder_yes( | 15 | extern int iscsit_create_recovery_datain_values_datasequenceinorder_yes( |
6 | struct iscsi_cmd *, struct iscsi_datain_req *); | 16 | struct iscsi_cmd *, struct iscsi_datain_req *); |
diff --git a/drivers/target/iscsi/iscsi_target_erl2.c b/drivers/target/iscsi/iscsi_target_erl2.c index e24f1c7c5862..faf9ae014b30 100644 --- a/drivers/target/iscsi/iscsi_target_erl2.c +++ b/drivers/target/iscsi/iscsi_target_erl2.c | |||
@@ -17,6 +17,7 @@ | |||
17 | * GNU General Public License for more details. | 17 | * GNU General Public License for more details. |
18 | ******************************************************************************/ | 18 | ******************************************************************************/ |
19 | 19 | ||
20 | #include <linux/slab.h> | ||
20 | #include <scsi/iscsi_proto.h> | 21 | #include <scsi/iscsi_proto.h> |
21 | #include <target/target_core_base.h> | 22 | #include <target/target_core_base.h> |
22 | #include <target/target_core_fabric.h> | 23 | #include <target/target_core_fabric.h> |
diff --git a/drivers/target/iscsi/iscsi_target_erl2.h b/drivers/target/iscsi/iscsi_target_erl2.h index 63f2501f3fe0..7965f1e86506 100644 --- a/drivers/target/iscsi/iscsi_target_erl2.h +++ b/drivers/target/iscsi/iscsi_target_erl2.h | |||
@@ -1,6 +1,13 @@ | |||
1 | #ifndef ISCSI_TARGET_ERL2_H | 1 | #ifndef ISCSI_TARGET_ERL2_H |
2 | #define ISCSI_TARGET_ERL2_H | 2 | #define ISCSI_TARGET_ERL2_H |
3 | 3 | ||
4 | #include <linux/types.h> | ||
5 | |||
6 | struct iscsi_cmd; | ||
7 | struct iscsi_conn; | ||
8 | struct iscsi_conn_recovery; | ||
9 | struct iscsi_session; | ||
10 | |||
4 | extern void iscsit_create_conn_recovery_datain_values(struct iscsi_cmd *, __be32); | 11 | extern void iscsit_create_conn_recovery_datain_values(struct iscsi_cmd *, __be32); |
5 | extern void iscsit_create_conn_recovery_dataout_values(struct iscsi_cmd *); | 12 | extern void iscsit_create_conn_recovery_dataout_values(struct iscsi_cmd *); |
6 | extern struct iscsi_conn_recovery *iscsit_get_inactive_connection_recovery_entry( | 13 | extern struct iscsi_conn_recovery *iscsit_get_inactive_connection_recovery_entry( |
diff --git a/drivers/target/iscsi/iscsi_target_login.c b/drivers/target/iscsi/iscsi_target_login.c index 15f79a2ca34a..450f51deb2a2 100644 --- a/drivers/target/iscsi/iscsi_target_login.c +++ b/drivers/target/iscsi/iscsi_target_login.c | |||
@@ -20,6 +20,8 @@ | |||
20 | #include <linux/string.h> | 20 | #include <linux/string.h> |
21 | #include <linux/kthread.h> | 21 | #include <linux/kthread.h> |
22 | #include <linux/idr.h> | 22 | #include <linux/idr.h> |
23 | #include <linux/tcp.h> /* TCP_NODELAY */ | ||
24 | #include <net/ipv6.h> /* ipv6_addr_v4mapped() */ | ||
23 | #include <scsi/iscsi_proto.h> | 25 | #include <scsi/iscsi_proto.h> |
24 | #include <target/target_core_base.h> | 26 | #include <target/target_core_base.h> |
25 | #include <target/target_core_fabric.h> | 27 | #include <target/target_core_fabric.h> |
diff --git a/drivers/target/iscsi/iscsi_target_login.h b/drivers/target/iscsi/iscsi_target_login.h index b597aa2c61a1..0e1fd6cedd54 100644 --- a/drivers/target/iscsi/iscsi_target_login.h +++ b/drivers/target/iscsi/iscsi_target_login.h | |||
@@ -1,6 +1,13 @@ | |||
1 | #ifndef ISCSI_TARGET_LOGIN_H | 1 | #ifndef ISCSI_TARGET_LOGIN_H |
2 | #define ISCSI_TARGET_LOGIN_H | 2 | #define ISCSI_TARGET_LOGIN_H |
3 | 3 | ||
4 | #include <linux/types.h> | ||
5 | |||
6 | struct iscsi_conn; | ||
7 | struct iscsi_login; | ||
8 | struct iscsi_np; | ||
9 | struct sockaddr_storage; | ||
10 | |||
4 | extern int iscsi_login_setup_crypto(struct iscsi_conn *); | 11 | extern int iscsi_login_setup_crypto(struct iscsi_conn *); |
5 | extern int iscsi_check_for_session_reinstatement(struct iscsi_conn *); | 12 | extern int iscsi_check_for_session_reinstatement(struct iscsi_conn *); |
6 | extern int iscsi_login_post_auth_non_zero_tsih(struct iscsi_conn *, u16, u32); | 13 | extern int iscsi_login_post_auth_non_zero_tsih(struct iscsi_conn *, u16, u32); |
diff --git a/drivers/target/iscsi/iscsi_target_nego.c b/drivers/target/iscsi/iscsi_target_nego.c index 89d34bd6d87f..46388c9e08da 100644 --- a/drivers/target/iscsi/iscsi_target_nego.c +++ b/drivers/target/iscsi/iscsi_target_nego.c | |||
@@ -18,6 +18,8 @@ | |||
18 | 18 | ||
19 | #include <linux/ctype.h> | 19 | #include <linux/ctype.h> |
20 | #include <linux/kthread.h> | 20 | #include <linux/kthread.h> |
21 | #include <linux/slab.h> | ||
22 | #include <net/sock.h> | ||
21 | #include <scsi/iscsi_proto.h> | 23 | #include <scsi/iscsi_proto.h> |
22 | #include <target/target_core_base.h> | 24 | #include <target/target_core_base.h> |
23 | #include <target/target_core_fabric.h> | 25 | #include <target/target_core_fabric.h> |
diff --git a/drivers/target/iscsi/iscsi_target_nego.h b/drivers/target/iscsi/iscsi_target_nego.h index f021cbd330e5..53438bfca4c6 100644 --- a/drivers/target/iscsi/iscsi_target_nego.h +++ b/drivers/target/iscsi/iscsi_target_nego.h | |||
@@ -4,6 +4,10 @@ | |||
4 | #define DECIMAL 0 | 4 | #define DECIMAL 0 |
5 | #define HEX 1 | 5 | #define HEX 1 |
6 | 6 | ||
7 | struct iscsi_conn; | ||
8 | struct iscsi_login; | ||
9 | struct iscsi_np; | ||
10 | |||
7 | extern void convert_null_to_semi(char *, int); | 11 | extern void convert_null_to_semi(char *, int); |
8 | extern int extract_param(const char *, const char *, unsigned int, char *, | 12 | extern int extract_param(const char *, const char *, unsigned int, char *, |
9 | unsigned char *); | 13 | unsigned char *); |
diff --git a/drivers/target/iscsi/iscsi_target_nodeattrib.h b/drivers/target/iscsi/iscsi_target_nodeattrib.h index 0c69a46a62ec..79cdf06ade48 100644 --- a/drivers/target/iscsi/iscsi_target_nodeattrib.h +++ b/drivers/target/iscsi/iscsi_target_nodeattrib.h | |||
@@ -1,6 +1,11 @@ | |||
1 | #ifndef ISCSI_TARGET_NODEATTRIB_H | 1 | #ifndef ISCSI_TARGET_NODEATTRIB_H |
2 | #define ISCSI_TARGET_NODEATTRIB_H | 2 | #define ISCSI_TARGET_NODEATTRIB_H |
3 | 3 | ||
4 | #include <linux/types.h> | ||
5 | |||
6 | struct iscsi_node_acl; | ||
7 | struct iscsi_portal_group; | ||
8 | |||
4 | extern void iscsit_set_default_node_attribues(struct iscsi_node_acl *, | 9 | extern void iscsit_set_default_node_attribues(struct iscsi_node_acl *, |
5 | struct iscsi_portal_group *); | 10 | struct iscsi_portal_group *); |
6 | extern int iscsit_na_dataout_timeout(struct iscsi_node_acl *, u32); | 11 | extern int iscsit_na_dataout_timeout(struct iscsi_node_acl *, u32); |
diff --git a/drivers/target/iscsi/iscsi_target_parameters.c b/drivers/target/iscsi/iscsi_target_parameters.c index 0efa80bb8962..e65bf78ceef3 100644 --- a/drivers/target/iscsi/iscsi_target_parameters.c +++ b/drivers/target/iscsi/iscsi_target_parameters.c | |||
@@ -17,7 +17,7 @@ | |||
17 | ******************************************************************************/ | 17 | ******************************************************************************/ |
18 | 18 | ||
19 | #include <linux/slab.h> | 19 | #include <linux/slab.h> |
20 | 20 | #include <linux/uio.h> /* struct kvec */ | |
21 | #include <target/iscsi/iscsi_target_core.h> | 21 | #include <target/iscsi/iscsi_target_core.h> |
22 | #include "iscsi_target_util.h" | 22 | #include "iscsi_target_util.h" |
23 | #include "iscsi_target_parameters.h" | 23 | #include "iscsi_target_parameters.h" |
diff --git a/drivers/target/iscsi/iscsi_target_parameters.h b/drivers/target/iscsi/iscsi_target_parameters.h index a0751e3f0813..9962ccf0ccd7 100644 --- a/drivers/target/iscsi/iscsi_target_parameters.h +++ b/drivers/target/iscsi/iscsi_target_parameters.h | |||
@@ -1,6 +1,7 @@ | |||
1 | #ifndef ISCSI_PARAMETERS_H | 1 | #ifndef ISCSI_PARAMETERS_H |
2 | #define ISCSI_PARAMETERS_H | 2 | #define ISCSI_PARAMETERS_H |
3 | 3 | ||
4 | #include <linux/types.h> | ||
4 | #include <scsi/iscsi_proto.h> | 5 | #include <scsi/iscsi_proto.h> |
5 | 6 | ||
6 | struct iscsi_extra_response { | 7 | struct iscsi_extra_response { |
@@ -23,6 +24,11 @@ struct iscsi_param { | |||
23 | struct list_head p_list; | 24 | struct list_head p_list; |
24 | } ____cacheline_aligned; | 25 | } ____cacheline_aligned; |
25 | 26 | ||
27 | struct iscsi_conn; | ||
28 | struct iscsi_conn_ops; | ||
29 | struct iscsi_param_list; | ||
30 | struct iscsi_sess_ops; | ||
31 | |||
26 | extern int iscsi_login_rx_data(struct iscsi_conn *, char *, int); | 32 | extern int iscsi_login_rx_data(struct iscsi_conn *, char *, int); |
27 | extern int iscsi_login_tx_data(struct iscsi_conn *, char *, char *, int); | 33 | extern int iscsi_login_tx_data(struct iscsi_conn *, char *, char *, int); |
28 | extern void iscsi_dump_conn_ops(struct iscsi_conn_ops *); | 34 | extern void iscsi_dump_conn_ops(struct iscsi_conn_ops *); |
diff --git a/drivers/target/iscsi/iscsi_target_seq_pdu_list.h b/drivers/target/iscsi/iscsi_target_seq_pdu_list.h index d5b153751a8d..be1234362271 100644 --- a/drivers/target/iscsi/iscsi_target_seq_pdu_list.h +++ b/drivers/target/iscsi/iscsi_target_seq_pdu_list.h | |||
@@ -1,6 +1,9 @@ | |||
1 | #ifndef ISCSI_SEQ_AND_PDU_LIST_H | 1 | #ifndef ISCSI_SEQ_AND_PDU_LIST_H |
2 | #define ISCSI_SEQ_AND_PDU_LIST_H | 2 | #define ISCSI_SEQ_AND_PDU_LIST_H |
3 | 3 | ||
4 | #include <linux/types.h> | ||
5 | #include <linux/cache.h> | ||
6 | |||
4 | /* struct iscsi_pdu->status */ | 7 | /* struct iscsi_pdu->status */ |
5 | #define DATAOUT_PDU_SENT 1 | 8 | #define DATAOUT_PDU_SENT 1 |
6 | 9 | ||
@@ -78,6 +81,8 @@ struct iscsi_seq { | |||
78 | u32 xfer_len; | 81 | u32 xfer_len; |
79 | } ____cacheline_aligned; | 82 | } ____cacheline_aligned; |
80 | 83 | ||
84 | struct iscsi_cmd; | ||
85 | |||
81 | extern int iscsit_build_pdu_and_seq_lists(struct iscsi_cmd *, u32); | 86 | extern int iscsit_build_pdu_and_seq_lists(struct iscsi_cmd *, u32); |
82 | extern struct iscsi_pdu *iscsit_get_pdu_holder(struct iscsi_cmd *, u32, u32); | 87 | extern struct iscsi_pdu *iscsit_get_pdu_holder(struct iscsi_cmd *, u32, u32); |
83 | extern struct iscsi_pdu *iscsit_get_pdu_holder_for_seq(struct iscsi_cmd *, struct iscsi_seq *); | 88 | extern struct iscsi_pdu *iscsit_get_pdu_holder_for_seq(struct iscsi_cmd *, struct iscsi_seq *); |
diff --git a/drivers/target/iscsi/iscsi_target_tmr.h b/drivers/target/iscsi/iscsi_target_tmr.h index 142e992cb097..64cc5c07e47c 100644 --- a/drivers/target/iscsi/iscsi_target_tmr.h +++ b/drivers/target/iscsi/iscsi_target_tmr.h | |||
@@ -1,6 +1,12 @@ | |||
1 | #ifndef ISCSI_TARGET_TMR_H | 1 | #ifndef ISCSI_TARGET_TMR_H |
2 | #define ISCSI_TARGET_TMR_H | 2 | #define ISCSI_TARGET_TMR_H |
3 | 3 | ||
4 | #include <linux/types.h> | ||
5 | |||
6 | struct iscsi_cmd; | ||
7 | struct iscsi_conn; | ||
8 | struct iscsi_tmr_req; | ||
9 | |||
4 | extern u8 iscsit_tmr_abort_task(struct iscsi_cmd *, unsigned char *); | 10 | extern u8 iscsit_tmr_abort_task(struct iscsi_cmd *, unsigned char *); |
5 | extern int iscsit_tmr_task_warm_reset(struct iscsi_conn *, struct iscsi_tmr_req *, | 11 | extern int iscsit_tmr_task_warm_reset(struct iscsi_conn *, struct iscsi_tmr_req *, |
6 | unsigned char *); | 12 | unsigned char *); |
diff --git a/drivers/target/iscsi/iscsi_target_tpg.c b/drivers/target/iscsi/iscsi_target_tpg.c index 0814e5894a96..2e7e08dbda48 100644 --- a/drivers/target/iscsi/iscsi_target_tpg.c +++ b/drivers/target/iscsi/iscsi_target_tpg.c | |||
@@ -16,9 +16,9 @@ | |||
16 | * GNU General Public License for more details. | 16 | * GNU General Public License for more details. |
17 | ******************************************************************************/ | 17 | ******************************************************************************/ |
18 | 18 | ||
19 | #include <linux/slab.h> | ||
19 | #include <target/target_core_base.h> | 20 | #include <target/target_core_base.h> |
20 | #include <target/target_core_fabric.h> | 21 | #include <target/target_core_fabric.h> |
21 | |||
22 | #include <target/iscsi/iscsi_target_core.h> | 22 | #include <target/iscsi/iscsi_target_core.h> |
23 | #include "iscsi_target_erl0.h" | 23 | #include "iscsi_target_erl0.h" |
24 | #include "iscsi_target_login.h" | 24 | #include "iscsi_target_login.h" |
@@ -260,7 +260,6 @@ err_out: | |||
260 | iscsi_release_param_list(tpg->param_list); | 260 | iscsi_release_param_list(tpg->param_list); |
261 | tpg->param_list = NULL; | 261 | tpg->param_list = NULL; |
262 | } | 262 | } |
263 | kfree(tpg); | ||
264 | return -ENOMEM; | 263 | return -ENOMEM; |
265 | } | 264 | } |
266 | 265 | ||
diff --git a/drivers/target/iscsi/iscsi_target_tpg.h b/drivers/target/iscsi/iscsi_target_tpg.h index 2da211920c18..ceba29851167 100644 --- a/drivers/target/iscsi/iscsi_target_tpg.h +++ b/drivers/target/iscsi/iscsi_target_tpg.h | |||
@@ -1,6 +1,15 @@ | |||
1 | #ifndef ISCSI_TARGET_TPG_H | 1 | #ifndef ISCSI_TARGET_TPG_H |
2 | #define ISCSI_TARGET_TPG_H | 2 | #define ISCSI_TARGET_TPG_H |
3 | 3 | ||
4 | #include <linux/types.h> | ||
5 | |||
6 | struct iscsi_np; | ||
7 | struct iscsi_session; | ||
8 | struct iscsi_tiqn; | ||
9 | struct iscsi_tpg_np; | ||
10 | struct se_node_acl; | ||
11 | struct sockaddr_storage; | ||
12 | |||
4 | extern struct iscsi_portal_group *iscsit_alloc_portal_group(struct iscsi_tiqn *, u16); | 13 | extern struct iscsi_portal_group *iscsit_alloc_portal_group(struct iscsi_tiqn *, u16); |
5 | extern int iscsit_load_discovery_tpg(void); | 14 | extern int iscsit_load_discovery_tpg(void); |
6 | extern void iscsit_release_discovery_tpg(void); | 15 | extern void iscsit_release_discovery_tpg(void); |
diff --git a/drivers/target/iscsi/iscsi_target_transport.c b/drivers/target/iscsi/iscsi_target_transport.c index 08217d62fb0d..c4eb141c6435 100644 --- a/drivers/target/iscsi/iscsi_target_transport.c +++ b/drivers/target/iscsi/iscsi_target_transport.c | |||
@@ -1,5 +1,6 @@ | |||
1 | #include <linux/spinlock.h> | 1 | #include <linux/spinlock.h> |
2 | #include <linux/list.h> | 2 | #include <linux/list.h> |
3 | #include <linux/module.h> | ||
3 | #include <target/iscsi/iscsi_transport.h> | 4 | #include <target/iscsi/iscsi_transport.h> |
4 | 5 | ||
5 | static LIST_HEAD(g_transport_list); | 6 | static LIST_HEAD(g_transport_list); |
diff --git a/drivers/target/iscsi/iscsi_target_util.c b/drivers/target/iscsi/iscsi_target_util.c index 1f38177207e0..b5a1b4ccba12 100644 --- a/drivers/target/iscsi/iscsi_target_util.c +++ b/drivers/target/iscsi/iscsi_target_util.c | |||
@@ -18,6 +18,7 @@ | |||
18 | 18 | ||
19 | #include <linux/list.h> | 19 | #include <linux/list.h> |
20 | #include <linux/percpu_ida.h> | 20 | #include <linux/percpu_ida.h> |
21 | #include <net/ipv6.h> /* ipv6_addr_equal() */ | ||
21 | #include <scsi/scsi_tcq.h> | 22 | #include <scsi/scsi_tcq.h> |
22 | #include <scsi/iscsi_proto.h> | 23 | #include <scsi/iscsi_proto.h> |
23 | #include <target/target_core_base.h> | 24 | #include <target/target_core_base.h> |
diff --git a/drivers/target/iscsi/iscsi_target_util.h b/drivers/target/iscsi/iscsi_target_util.h index 995f1cb29d0e..8ff08856516a 100644 --- a/drivers/target/iscsi/iscsi_target_util.h +++ b/drivers/target/iscsi/iscsi_target_util.h | |||
@@ -1,8 +1,16 @@ | |||
1 | #ifndef ISCSI_TARGET_UTIL_H | 1 | #ifndef ISCSI_TARGET_UTIL_H |
2 | #define ISCSI_TARGET_UTIL_H | 2 | #define ISCSI_TARGET_UTIL_H |
3 | 3 | ||
4 | #include <linux/types.h> | ||
5 | #include <scsi/iscsi_proto.h> /* itt_t */ | ||
6 | |||
4 | #define MARKER_SIZE 8 | 7 | #define MARKER_SIZE 8 |
5 | 8 | ||
9 | struct iscsi_cmd; | ||
10 | struct iscsi_conn; | ||
11 | struct iscsi_conn_recovery; | ||
12 | struct iscsi_session; | ||
13 | |||
6 | extern int iscsit_add_r2t_to_list(struct iscsi_cmd *, u32, u32, int, u32); | 14 | extern int iscsit_add_r2t_to_list(struct iscsi_cmd *, u32, u32, int, u32); |
7 | extern struct iscsi_r2t *iscsit_get_r2t_for_eos(struct iscsi_cmd *, u32, u32); | 15 | extern struct iscsi_r2t *iscsit_get_r2t_for_eos(struct iscsi_cmd *, u32, u32); |
8 | extern struct iscsi_r2t *iscsit_get_r2t_from_list(struct iscsi_cmd *); | 16 | extern struct iscsi_r2t *iscsit_get_r2t_from_list(struct iscsi_cmd *); |
diff --git a/drivers/target/loopback/tcm_loop.h b/drivers/target/loopback/tcm_loop.h index 4346462094a1..a8a230b4e6b5 100644 --- a/drivers/target/loopback/tcm_loop.h +++ b/drivers/target/loopback/tcm_loop.h | |||
@@ -1,3 +1,7 @@ | |||
1 | #include <linux/types.h> | ||
2 | #include <linux/device.h> | ||
3 | #include <target/target_core_base.h> /* struct se_cmd */ | ||
4 | |||
1 | #define TCM_LOOP_VERSION "v2.1-rc2" | 5 | #define TCM_LOOP_VERSION "v2.1-rc2" |
2 | #define TL_WWN_ADDR_LEN 256 | 6 | #define TL_WWN_ADDR_LEN 256 |
3 | #define TL_TPGS_PER_HBA 32 | 7 | #define TL_TPGS_PER_HBA 32 |
diff --git a/drivers/target/sbp/sbp_target.c b/drivers/target/sbp/sbp_target.c index 58bb6ed18185..e5c3e5f827d0 100644 --- a/drivers/target/sbp/sbp_target.c +++ b/drivers/target/sbp/sbp_target.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/string.h> | 28 | #include <linux/string.h> |
29 | #include <linux/configfs.h> | 29 | #include <linux/configfs.h> |
30 | #include <linux/ctype.h> | 30 | #include <linux/ctype.h> |
31 | #include <linux/delay.h> | ||
31 | #include <linux/firewire.h> | 32 | #include <linux/firewire.h> |
32 | #include <linux/firewire-constants.h> | 33 | #include <linux/firewire-constants.h> |
33 | #include <scsi/scsi_proto.h> | 34 | #include <scsi/scsi_proto.h> |
@@ -928,7 +929,7 @@ static struct sbp_target_request *sbp_mgt_get_req(struct sbp_session *sess, | |||
928 | struct sbp_target_request *req; | 929 | struct sbp_target_request *req; |
929 | int tag; | 930 | int tag; |
930 | 931 | ||
931 | tag = percpu_ida_alloc(&se_sess->sess_tag_pool, GFP_ATOMIC); | 932 | tag = percpu_ida_alloc(&se_sess->sess_tag_pool, TASK_RUNNING); |
932 | if (tag < 0) | 933 | if (tag < 0) |
933 | return ERR_PTR(-ENOMEM); | 934 | return ERR_PTR(-ENOMEM); |
934 | 935 | ||
diff --git a/drivers/target/target_core_alua.c b/drivers/target/target_core_alua.c index 4c82bbe19003..f5e330099bfc 100644 --- a/drivers/target/target_core_alua.c +++ b/drivers/target/target_core_alua.c | |||
@@ -26,8 +26,11 @@ | |||
26 | #include <linux/slab.h> | 26 | #include <linux/slab.h> |
27 | #include <linux/spinlock.h> | 27 | #include <linux/spinlock.h> |
28 | #include <linux/configfs.h> | 28 | #include <linux/configfs.h> |
29 | #include <linux/delay.h> | ||
29 | #include <linux/export.h> | 30 | #include <linux/export.h> |
31 | #include <linux/fcntl.h> | ||
30 | #include <linux/file.h> | 32 | #include <linux/file.h> |
33 | #include <linux/fs.h> | ||
31 | #include <scsi/scsi_proto.h> | 34 | #include <scsi/scsi_proto.h> |
32 | #include <asm/unaligned.h> | 35 | #include <asm/unaligned.h> |
33 | 36 | ||
diff --git a/drivers/target/target_core_alua.h b/drivers/target/target_core_alua.h index 9b250f9b33bf..c69c11baf07f 100644 --- a/drivers/target/target_core_alua.h +++ b/drivers/target/target_core_alua.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef TARGET_CORE_ALUA_H | 1 | #ifndef TARGET_CORE_ALUA_H |
2 | #define TARGET_CORE_ALUA_H | 2 | #define TARGET_CORE_ALUA_H |
3 | 3 | ||
4 | #include <target/target_core_base.h> | ||
5 | |||
4 | /* | 6 | /* |
5 | * INQUIRY response data, TPGS Field | 7 | * INQUIRY response data, TPGS Field |
6 | * | 8 | * |
diff --git a/drivers/target/target_core_configfs.c b/drivers/target/target_core_configfs.c index a35a347ec357..54b36c9835be 100644 --- a/drivers/target/target_core_configfs.c +++ b/drivers/target/target_core_configfs.c | |||
@@ -144,12 +144,12 @@ static ssize_t target_core_item_dbroot_store(struct config_item *item, | |||
144 | return -EINVAL; | 144 | return -EINVAL; |
145 | } | 145 | } |
146 | if (!S_ISDIR(file_inode(fp)->i_mode)) { | 146 | if (!S_ISDIR(file_inode(fp)->i_mode)) { |
147 | filp_close(fp, 0); | 147 | filp_close(fp, NULL); |
148 | mutex_unlock(&g_tf_lock); | 148 | mutex_unlock(&g_tf_lock); |
149 | pr_err("db_root: not a directory: %s\n", db_root_stage); | 149 | pr_err("db_root: not a directory: %s\n", db_root_stage); |
150 | return -EINVAL; | 150 | return -EINVAL; |
151 | } | 151 | } |
152 | filp_close(fp, 0); | 152 | filp_close(fp, NULL); |
153 | 153 | ||
154 | strncpy(db_root, db_root_stage, read_bytes); | 154 | strncpy(db_root, db_root_stage, read_bytes); |
155 | 155 | ||
diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c index 6b423485c5d6..1ebd13ef7bd3 100644 --- a/drivers/target/target_core_device.c +++ b/drivers/target/target_core_device.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <linux/kthread.h> | 33 | #include <linux/kthread.h> |
34 | #include <linux/in.h> | 34 | #include <linux/in.h> |
35 | #include <linux/export.h> | 35 | #include <linux/export.h> |
36 | #include <linux/t10-pi.h> | ||
36 | #include <asm/unaligned.h> | 37 | #include <asm/unaligned.h> |
37 | #include <net/sock.h> | 38 | #include <net/sock.h> |
38 | #include <net/tcp.h> | 39 | #include <net/tcp.h> |
diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c index d545993df18b..87aa376a1a1a 100644 --- a/drivers/target/target_core_file.c +++ b/drivers/target/target_core_file.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <linux/module.h> | 32 | #include <linux/module.h> |
33 | #include <linux/vmalloc.h> | 33 | #include <linux/vmalloc.h> |
34 | #include <linux/falloc.h> | 34 | #include <linux/falloc.h> |
35 | #include <linux/uio.h> | ||
35 | #include <scsi/scsi_proto.h> | 36 | #include <scsi/scsi_proto.h> |
36 | #include <asm/unaligned.h> | 37 | #include <asm/unaligned.h> |
37 | 38 | ||
diff --git a/drivers/target/target_core_file.h b/drivers/target/target_core_file.h index 068966fce308..526595a072de 100644 --- a/drivers/target/target_core_file.h +++ b/drivers/target/target_core_file.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef TARGET_CORE_FILE_H | 1 | #ifndef TARGET_CORE_FILE_H |
2 | #define TARGET_CORE_FILE_H | 2 | #define TARGET_CORE_FILE_H |
3 | 3 | ||
4 | #include <target/target_core_base.h> | ||
5 | |||
4 | #define FD_VERSION "4.0" | 6 | #define FD_VERSION "4.0" |
5 | 7 | ||
6 | #define FD_MAX_DEV_NAME 256 | 8 | #define FD_MAX_DEV_NAME 256 |
diff --git a/drivers/target/target_core_iblock.h b/drivers/target/target_core_iblock.h index 01c2afd81500..718d3fcd3e7c 100644 --- a/drivers/target/target_core_iblock.h +++ b/drivers/target/target_core_iblock.h | |||
@@ -1,6 +1,9 @@ | |||
1 | #ifndef TARGET_CORE_IBLOCK_H | 1 | #ifndef TARGET_CORE_IBLOCK_H |
2 | #define TARGET_CORE_IBLOCK_H | 2 | #define TARGET_CORE_IBLOCK_H |
3 | 3 | ||
4 | #include <linux/atomic.h> | ||
5 | #include <target/target_core_base.h> | ||
6 | |||
4 | #define IBLOCK_VERSION "4.0" | 7 | #define IBLOCK_VERSION "4.0" |
5 | 8 | ||
6 | #define IBLOCK_MAX_CDBS 16 | 9 | #define IBLOCK_MAX_CDBS 16 |
diff --git a/drivers/target/target_core_internal.h b/drivers/target/target_core_internal.h index e2c970a9d61c..9ab7090f7c83 100644 --- a/drivers/target/target_core_internal.h +++ b/drivers/target/target_core_internal.h | |||
@@ -1,6 +1,11 @@ | |||
1 | #ifndef TARGET_CORE_INTERNAL_H | 1 | #ifndef TARGET_CORE_INTERNAL_H |
2 | #define TARGET_CORE_INTERNAL_H | 2 | #define TARGET_CORE_INTERNAL_H |
3 | 3 | ||
4 | #include <linux/configfs.h> | ||
5 | #include <linux/list.h> | ||
6 | #include <linux/types.h> | ||
7 | #include <target/target_core_base.h> | ||
8 | |||
4 | #define TARGET_CORE_NAME_MAX_LEN 64 | 9 | #define TARGET_CORE_NAME_MAX_LEN 64 |
5 | #define TARGET_FABRIC_NAME_SIZE 32 | 10 | #define TARGET_FABRIC_NAME_SIZE 32 |
6 | 11 | ||
diff --git a/drivers/target/target_core_pr.c b/drivers/target/target_core_pr.c index 47463c99c318..d761025144f9 100644 --- a/drivers/target/target_core_pr.c +++ b/drivers/target/target_core_pr.c | |||
@@ -29,6 +29,8 @@ | |||
29 | #include <linux/list.h> | 29 | #include <linux/list.h> |
30 | #include <linux/vmalloc.h> | 30 | #include <linux/vmalloc.h> |
31 | #include <linux/file.h> | 31 | #include <linux/file.h> |
32 | #include <linux/fcntl.h> | ||
33 | #include <linux/fs.h> | ||
32 | #include <scsi/scsi_proto.h> | 34 | #include <scsi/scsi_proto.h> |
33 | #include <asm/unaligned.h> | 35 | #include <asm/unaligned.h> |
34 | 36 | ||
@@ -253,8 +255,7 @@ target_scsi2_reservation_reserve(struct se_cmd *cmd) | |||
253 | 255 | ||
254 | if ((cmd->t_task_cdb[1] & 0x01) && | 256 | if ((cmd->t_task_cdb[1] & 0x01) && |
255 | (cmd->t_task_cdb[1] & 0x02)) { | 257 | (cmd->t_task_cdb[1] & 0x02)) { |
256 | pr_err("LongIO and Obselete Bits set, returning" | 258 | pr_err("LongIO and Obsolete Bits set, returning ILLEGAL_REQUEST\n"); |
257 | " ILLEGAL_REQUEST\n"); | ||
258 | return TCM_UNSUPPORTED_SCSI_OPCODE; | 259 | return TCM_UNSUPPORTED_SCSI_OPCODE; |
259 | } | 260 | } |
260 | /* | 261 | /* |
diff --git a/drivers/target/target_core_pr.h b/drivers/target/target_core_pr.h index e3d26e9126a0..847bd470339c 100644 --- a/drivers/target/target_core_pr.h +++ b/drivers/target/target_core_pr.h | |||
@@ -1,5 +1,9 @@ | |||
1 | #ifndef TARGET_CORE_PR_H | 1 | #ifndef TARGET_CORE_PR_H |
2 | #define TARGET_CORE_PR_H | 2 | #define TARGET_CORE_PR_H |
3 | |||
4 | #include <linux/types.h> | ||
5 | #include <target/target_core_base.h> | ||
6 | |||
3 | /* | 7 | /* |
4 | * PERSISTENT_RESERVE_OUT service action codes | 8 | * PERSISTENT_RESERVE_OUT service action codes |
5 | * | 9 | * |
diff --git a/drivers/target/target_core_pscsi.h b/drivers/target/target_core_pscsi.h index 6d2007e35df6..8a02fa47c7e8 100644 --- a/drivers/target/target_core_pscsi.h +++ b/drivers/target/target_core_pscsi.h | |||
@@ -15,11 +15,12 @@ | |||
15 | #define PS_TIMEOUT_DISK (15*HZ) | 15 | #define PS_TIMEOUT_DISK (15*HZ) |
16 | #define PS_TIMEOUT_OTHER (500*HZ) | 16 | #define PS_TIMEOUT_OTHER (500*HZ) |
17 | 17 | ||
18 | #include <linux/device.h> | 18 | #include <linux/cache.h> /* ___cacheline_aligned */ |
19 | #include <linux/kref.h> | 19 | #include <target/target_core_base.h> /* struct se_device */ |
20 | #include <linux/kobject.h> | ||
21 | 20 | ||
21 | struct block_device; | ||
22 | struct scsi_device; | 22 | struct scsi_device; |
23 | struct Scsi_Host; | ||
23 | 24 | ||
24 | struct pscsi_plugin_task { | 25 | struct pscsi_plugin_task { |
25 | unsigned char pscsi_sense[TRANSPORT_SENSE_BUFFER]; | 26 | unsigned char pscsi_sense[TRANSPORT_SENSE_BUFFER]; |
diff --git a/drivers/target/target_core_rd.c b/drivers/target/target_core_rd.c index 24b36fd785f1..ddc216c9f1f6 100644 --- a/drivers/target/target_core_rd.c +++ b/drivers/target/target_core_rd.c | |||
@@ -26,7 +26,9 @@ | |||
26 | 26 | ||
27 | #include <linux/string.h> | 27 | #include <linux/string.h> |
28 | #include <linux/parser.h> | 28 | #include <linux/parser.h> |
29 | #include <linux/highmem.h> | ||
29 | #include <linux/timer.h> | 30 | #include <linux/timer.h> |
31 | #include <linux/scatterlist.h> | ||
30 | #include <linux/slab.h> | 32 | #include <linux/slab.h> |
31 | #include <linux/spinlock.h> | 33 | #include <linux/spinlock.h> |
32 | #include <scsi/scsi_proto.h> | 34 | #include <scsi/scsi_proto.h> |
diff --git a/drivers/target/target_core_rd.h b/drivers/target/target_core_rd.h index cc46a6a89b38..91fc1a34791d 100644 --- a/drivers/target/target_core_rd.h +++ b/drivers/target/target_core_rd.h | |||
@@ -1,6 +1,10 @@ | |||
1 | #ifndef TARGET_CORE_RD_H | 1 | #ifndef TARGET_CORE_RD_H |
2 | #define TARGET_CORE_RD_H | 2 | #define TARGET_CORE_RD_H |
3 | 3 | ||
4 | #include <linux/module.h> | ||
5 | #include <linux/types.h> | ||
6 | #include <target/target_core_base.h> | ||
7 | |||
4 | #define RD_HBA_VERSION "v4.0" | 8 | #define RD_HBA_VERSION "v4.0" |
5 | #define RD_MCP_VERSION "4.0" | 9 | #define RD_MCP_VERSION "4.0" |
6 | 10 | ||
diff --git a/drivers/target/target_core_sbc.c b/drivers/target/target_core_sbc.c index 04f616b3ba0a..4879e70e2eef 100644 --- a/drivers/target/target_core_sbc.c +++ b/drivers/target/target_core_sbc.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/module.h> | 24 | #include <linux/module.h> |
25 | #include <linux/ratelimit.h> | 25 | #include <linux/ratelimit.h> |
26 | #include <linux/crc-t10dif.h> | 26 | #include <linux/crc-t10dif.h> |
27 | #include <linux/t10-pi.h> | ||
27 | #include <asm/unaligned.h> | 28 | #include <asm/unaligned.h> |
28 | #include <scsi/scsi_proto.h> | 29 | #include <scsi/scsi_proto.h> |
29 | #include <scsi/scsi_tcq.h> | 30 | #include <scsi/scsi_tcq.h> |
diff --git a/drivers/target/target_core_ua.h b/drivers/target/target_core_ua.h index bd6e78ba153d..97402856a8f0 100644 --- a/drivers/target/target_core_ua.h +++ b/drivers/target/target_core_ua.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef TARGET_CORE_UA_H | 1 | #ifndef TARGET_CORE_UA_H |
2 | #define TARGET_CORE_UA_H | 2 | #define TARGET_CORE_UA_H |
3 | 3 | ||
4 | #include <target/target_core_base.h> | ||
5 | |||
4 | /* | 6 | /* |
5 | * From spc4r17, Table D.1: ASC and ASCQ Assignement | 7 | * From spc4r17, Table D.1: ASC and ASCQ Assignement |
6 | */ | 8 | */ |
diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c index 2b3c8564ace8..8041710b6972 100644 --- a/drivers/target/target_core_user.c +++ b/drivers/target/target_core_user.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/uio_driver.h> | 27 | #include <linux/uio_driver.h> |
28 | #include <linux/stringify.h> | 28 | #include <linux/stringify.h> |
29 | #include <linux/bitops.h> | 29 | #include <linux/bitops.h> |
30 | #include <linux/highmem.h> | ||
30 | #include <net/genetlink.h> | 31 | #include <net/genetlink.h> |
31 | #include <scsi/scsi_common.h> | 32 | #include <scsi/scsi_common.h> |
32 | #include <scsi/scsi_proto.h> | 33 | #include <scsi/scsi_proto.h> |
@@ -537,7 +538,7 @@ tcmu_queue_cmd(struct se_cmd *se_cmd) | |||
537 | struct se_device *se_dev = se_cmd->se_dev; | 538 | struct se_device *se_dev = se_cmd->se_dev; |
538 | struct tcmu_dev *udev = TCMU_DEV(se_dev); | 539 | struct tcmu_dev *udev = TCMU_DEV(se_dev); |
539 | struct tcmu_cmd *tcmu_cmd; | 540 | struct tcmu_cmd *tcmu_cmd; |
540 | int ret; | 541 | sense_reason_t ret; |
541 | 542 | ||
542 | tcmu_cmd = tcmu_alloc_cmd(se_cmd); | 543 | tcmu_cmd = tcmu_alloc_cmd(se_cmd); |
543 | if (!tcmu_cmd) | 544 | if (!tcmu_cmd) |
@@ -685,8 +686,6 @@ static int tcmu_check_expired_cmd(int id, void *p, void *data) | |||
685 | target_complete_cmd(cmd->se_cmd, SAM_STAT_CHECK_CONDITION); | 686 | target_complete_cmd(cmd->se_cmd, SAM_STAT_CHECK_CONDITION); |
686 | cmd->se_cmd = NULL; | 687 | cmd->se_cmd = NULL; |
687 | 688 | ||
688 | kmem_cache_free(tcmu_cmd_cache, cmd); | ||
689 | |||
690 | return 0; | 689 | return 0; |
691 | } | 690 | } |
692 | 691 | ||
diff --git a/drivers/target/target_core_xcopy.c b/drivers/target/target_core_xcopy.c index 094a1440eacb..37d5caebffa6 100644 --- a/drivers/target/target_core_xcopy.c +++ b/drivers/target/target_core_xcopy.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/spinlock.h> | 25 | #include <linux/spinlock.h> |
26 | #include <linux/list.h> | 26 | #include <linux/list.h> |
27 | #include <linux/configfs.h> | 27 | #include <linux/configfs.h> |
28 | #include <linux/ratelimit.h> | ||
28 | #include <scsi/scsi_proto.h> | 29 | #include <scsi/scsi_proto.h> |
29 | #include <asm/unaligned.h> | 30 | #include <asm/unaligned.h> |
30 | 31 | ||
diff --git a/drivers/target/target_core_xcopy.h b/drivers/target/target_core_xcopy.h index 700a981c7b41..4d3d4dd060f2 100644 --- a/drivers/target/target_core_xcopy.h +++ b/drivers/target/target_core_xcopy.h | |||
@@ -1,3 +1,5 @@ | |||
1 | #include <target/target_core_base.h> | ||
2 | |||
1 | #define XCOPY_TARGET_DESC_LEN 32 | 3 | #define XCOPY_TARGET_DESC_LEN 32 |
2 | #define XCOPY_SEGMENT_DESC_LEN 28 | 4 | #define XCOPY_SEGMENT_DESC_LEN 28 |
3 | #define XCOPY_NAA_IEEE_REGEX_LEN 16 | 5 | #define XCOPY_NAA_IEEE_REGEX_LEN 16 |
diff --git a/drivers/target/tcm_fc/tcm_fc.h b/drivers/target/tcm_fc/tcm_fc.h index e28209b99b59..11d27b93b413 100644 --- a/drivers/target/tcm_fc/tcm_fc.h +++ b/drivers/target/tcm_fc/tcm_fc.h | |||
@@ -17,6 +17,9 @@ | |||
17 | #ifndef __TCM_FC_H__ | 17 | #ifndef __TCM_FC_H__ |
18 | #define __TCM_FC_H__ | 18 | #define __TCM_FC_H__ |
19 | 19 | ||
20 | #include <linux/types.h> | ||
21 | #include <target/target_core_base.h> | ||
22 | |||
20 | #define FT_VERSION "0.4" | 23 | #define FT_VERSION "0.4" |
21 | 24 | ||
22 | #define FT_NAMELEN 32 /* length of ASCII WWPNs including pad */ | 25 | #define FT_NAMELEN 32 /* length of ASCII WWPNs including pad */ |