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 | 1 | #ifndef ISCSI_TARGET_CORE_H |
| 2 | 2 | #define ISCSI_TARGET_CORE_H |
| 3 | 3 | |
| 4 | −#include <linux/in.h> | |
| 5 | −#include <linux/configfs.h> | |
| 6 | −#include <net/sock.h> | |
| 7 | −#include <net/tcp.h> | |
| 8 | −#include <scsi/iscsi_proto.h> | |
| 9 | −#include <target/target_core_base.h> | |
| 4 | +#include <linux/dma-direction.h> /* enum dma_data_direction */ | |
| 5 | +#include <linux/list.h> /* struct list_head */ | |
| 6 | +#include <linux/socket.h> /* struct sockaddr_storage */ | |
| 7 | +#include <linux/types.h> /* u8 */ | |
| 8 | +#include <scsi/iscsi_proto.h> /* itt_t */ | |
| 9 | +#include <target/target_core_base.h> /* struct se_cmd */ | |
| 10 | + | |
| 11 | +struct sock; | |
| 10 | 12 | |
| 11 | 13 | #define ISCSIT_VERSION "v4.1.0" |
| 12 | 14 | #define ISCSI_MAX_DATASN_MISSING_COUNT 16 |
| @@ -1,6 +1,10 @@ | ||
| 1 | 1 | #ifndef ISCSI_TARGET_STAT_H |
| 2 | 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 | 9 | * For struct iscsi_tiqn->tiqn_wwn default groups |
| 6 | 10 | */ |
| @@ -1,6 +1,6 @@ | ||
| 1 | −#include <linux/module.h> | |
| 2 | −#include <linux/list.h> | |
| 3 | −#include "iscsi_target_core.h" | |
| 1 | +#include "iscsi_target_core.h" /* struct iscsi_cmd */ | |
| 2 | + | |
| 3 | +struct sockaddr_storage; | |
| 4 | 4 | |
| 5 | 5 | struct iscsit_transport { |
| 6 | 6 | #define ISCSIT_TRANSPORT_NAME 16 |
| @@ -1,8 +1,14 @@ | ||
| 1 | 1 | #ifndef TARGET_CORE_BACKEND_H |
| 2 | 2 | #define TARGET_CORE_BACKEND_H |
| 3 | 3 | |
| 4 | +#include <linux/types.h> | |
| 5 | +#include <target/target_core_base.h> | |
| 6 | + | |
| 4 | 7 | #define TRANSPORT_FLAG_PASSTHROUGH 1 |
| 5 | 8 | |
| 9 | +struct request_queue; | |
| 10 | +struct scatterlist; | |
| 11 | + | |
| 6 | 12 | struct target_backend_ops { |
| 7 | 13 | char name[16]; |
| 8 | 14 | char inquiry_prod[16]; |
| @@ -1,14 +1,10 @@ | ||
| 1 | 1 | #ifndef TARGET_CORE_BASE_H |
| 2 | 2 | #define TARGET_CORE_BASE_H |
| 3 | 3 | |
| 4 | −#include <linux/in.h> | |
| 5 | −#include <linux/configfs.h> | |
| 6 | −#include <linux/dma-mapping.h> | |
| 7 | −#include <linux/blkdev.h> | |
| 8 | −#include <linux/percpu_ida.h> | |
| 9 | −#include <linux/t10-pi.h> | |
| 10 | −#include <net/sock.h> | |
| 11 | −#include <net/tcp.h> | |
| 4 | +#include <linux/configfs.h> /* struct config_group */ | |
| 5 | +#include <linux/dma-direction.h> /* enum dma_data_direction */ | |
| 6 | +#include <linux/percpu_ida.h> /* struct percpu_ida */ | |
| 7 | +#include <linux/semaphore.h> /* struct semaphore */ | |
| 12 | 8 | |
| 13 | 9 | #define TARGET_CORE_VERSION "v5.0" |
| 14 | 10 | |
| @@ -1,6 +1,10 @@ | ||
| 1 | 1 | #ifndef TARGET_CORE_FABRIC_H |
| 2 | 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 | 8 | struct target_core_fabric_ops { |
| 5 | 9 | struct module *module; |
| 6 | 10 | const char *name; |