Remove superfluous #include directives from the include/target/*.h files. Add missing #include directives to other *.h and *.c files. Use forward declarations for structures where possible. This change reduces the build time for make M=drivers/target on my laptop from 27.1s to 18.7s or by about 30%.
Showing the changes to include/target (6 of 51 files). Show all
Unified · Split
| @@ -1,12 +1,14 @@ | |||
| 1 | #ifndef ISCSI_TARGET_CORE_H | 1 | #ifndef ISCSI_TARGET_CORE_H |
| 2 | #define ISCSI_TARGET_CORE_H | 2 | #define ISCSI_TARGET_CORE_H |
| 3 | 3 | ||
| 4 | #include <linux/in.h> | 4 | #include <linux/dma-direction.h> /* enum dma_data_direction */ |
| 5 | #include <linux/configfs.h> | 5 | #include <linux/list.h> /* struct list_head */ |
| 6 | #include <net/sock.h> | 6 | #include <linux/socket.h> /* struct sockaddr_storage */ |
| 7 | #include <net/tcp.h> | 7 | #include <linux/types.h> /* u8 */ |
| 8 | #include <scsi/iscsi_proto.h> | 8 | #include <scsi/iscsi_proto.h> /* itt_t */ |
| 9 | #include <target/target_core_base.h> | 9 | #include <target/target_core_base.h> /* struct se_cmd */ |
| 10 | |||
| 11 | struct sock; | ||
| 10 | 12 | ||
| 11 | #define ISCSIT_VERSION "v4.1.0" | 13 | #define ISCSIT_VERSION "v4.1.0" |
| 12 | #define ISCSI_MAX_DATASN_MISSING_COUNT 16 | 14 | #define ISCSI_MAX_DATASN_MISSING_COUNT 16 |
| @@ -1,6 +1,10 @@ | |||
| 1 | #ifndef ISCSI_TARGET_STAT_H | 1 | #ifndef ISCSI_TARGET_STAT_H |
| 2 | #define ISCSI_TARGET_STAT_H | 2 | #define ISCSI_TARGET_STAT_H |
| 3 | 3 | ||
| 4 | #include <linux/types.h> | ||
| 5 | #include <linux/spinlock.h> | ||
| 6 | #include <linux/socket.h> | ||
| 7 | |||
| 4 | /* | 8 | /* |
| 5 | * For struct iscsi_tiqn->tiqn_wwn default groups | 9 | * For struct iscsi_tiqn->tiqn_wwn default groups |
| 6 | */ | 10 | */ |
| @@ -1,6 +1,6 @@ | |||
| 1 | #include <linux/module.h> | 1 | #include "iscsi_target_core.h" /* struct iscsi_cmd */ |
| 2 | #include <linux/list.h> | 2 | |
| 3 | #include "iscsi_target_core.h" | 3 | struct sockaddr_storage; |
| 4 | 4 | ||
| 5 | struct iscsit_transport { | 5 | struct iscsit_transport { |
| 6 | #define ISCSIT_TRANSPORT_NAME 16 | 6 | #define ISCSIT_TRANSPORT_NAME 16 |
| @@ -1,8 +1,14 @@ | |||
| 1 | #ifndef TARGET_CORE_BACKEND_H | 1 | #ifndef TARGET_CORE_BACKEND_H |
| 2 | #define TARGET_CORE_BACKEND_H | 2 | #define TARGET_CORE_BACKEND_H |
| 3 | 3 | ||
| 4 | #include <linux/types.h> | ||
| 5 | #include <target/target_core_base.h> | ||
| 6 | |||
| 4 | #define TRANSPORT_FLAG_PASSTHROUGH 1 | 7 | #define TRANSPORT_FLAG_PASSTHROUGH 1 |
| 5 | 8 | ||
| 9 | struct request_queue; | ||
| 10 | struct scatterlist; | ||
| 11 | |||
| 6 | struct target_backend_ops { | 12 | struct target_backend_ops { |
| 7 | char name[16]; | 13 | char name[16]; |
| 8 | char inquiry_prod[16]; | 14 | char inquiry_prod[16]; |
| @@ -1,14 +1,10 @@ | |||
| 1 | #ifndef TARGET_CORE_BASE_H | 1 | #ifndef TARGET_CORE_BASE_H |
| 2 | #define TARGET_CORE_BASE_H | 2 | #define TARGET_CORE_BASE_H |
| 3 | 3 | ||
| 4 | #include <linux/in.h> | 4 | #include <linux/configfs.h> /* struct config_group */ |
| 5 | #include <linux/configfs.h> | 5 | #include <linux/dma-direction.h> /* enum dma_data_direction */ |
| 6 | #include <linux/dma-mapping.h> | 6 | #include <linux/percpu_ida.h> /* struct percpu_ida */ |
| 7 | #include <linux/blkdev.h> | 7 | #include <linux/semaphore.h> /* struct semaphore */ |
| 8 | #include <linux/percpu_ida.h> | ||
| 9 | #include <linux/t10-pi.h> | ||
| 10 | #include <net/sock.h> | ||
| 11 | #include <net/tcp.h> | ||
| 12 | 8 | ||
| 13 | #define TARGET_CORE_VERSION "v5.0" | 9 | #define TARGET_CORE_VERSION "v5.0" |
| 14 | 10 | ||
| @@ -1,6 +1,10 @@ | |||
| 1 | #ifndef TARGET_CORE_FABRIC_H | 1 | #ifndef TARGET_CORE_FABRIC_H |
| 2 | #define TARGET_CORE_FABRIC_H | 2 | #define TARGET_CORE_FABRIC_H |
| 3 | 3 | ||
| 4 | #include <linux/configfs.h> | ||
| 5 | #include <linux/types.h> | ||
| 6 | #include <target/target_core_base.h> | ||
| 7 | |||
| 4 | struct target_core_fabric_ops { | 8 | struct target_core_fabric_ops { |
| 5 | struct module *module; | 9 | struct module *module; |
| 6 | const char *name; | 10 | const char *name; |