diff options
| author | Bart Van Assche <bart.vanassche@sandisk.com> | 2016-11-14 18:47:14 -0500 |
|---|---|---|
| committer | Bart Van Assche <bart.vanassche@sandisk.com> | 2016-12-09 13:22:28 -0500 |
| commit | 8dcf07be2d0bcbfcebc49b9451a4feaf83e3428b (patch) | |
| tree | a02df7bcdab36e16170b06c950dedb407a10d179 /include | |
| parent | f5045724578babc7bd3460087f34cc787a8b0e20 (diff) | |
target: Minimize #include directives
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%.
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Bryant G. Ly <bryantly@linux.vnet.ibm.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/target/iscsi/iscsi_target_core.h | 14 | ||||
| -rw-r--r-- | include/target/iscsi/iscsi_target_stat.h | 4 | ||||
| -rw-r--r-- | include/target/iscsi/iscsi_transport.h | 6 | ||||
| -rw-r--r-- | include/target/target_core_backend.h | 6 | ||||
| -rw-r--r-- | include/target/target_core_base.h | 12 | ||||
| -rw-r--r-- | include/target/target_core_fabric.h | 4 |
6 files changed, 29 insertions, 17 deletions
diff --git a/include/target/iscsi/iscsi_target_core.h b/include/target/iscsi/iscsi_target_core.h index 4ac24f5a3308..275581d483dd 100644 --- a/include/target/iscsi/iscsi_target_core.h +++ b/include/target/iscsi/iscsi_target_core.h | |||
| @@ -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 |
diff --git a/include/target/iscsi/iscsi_target_stat.h b/include/target/iscsi/iscsi_target_stat.h index e615bb485d0b..c27dd471656d 100644 --- a/include/target/iscsi/iscsi_target_stat.h +++ b/include/target/iscsi/iscsi_target_stat.h | |||
| @@ -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 | */ |
diff --git a/include/target/iscsi/iscsi_transport.h b/include/target/iscsi/iscsi_transport.h index 40ac7cd80150..1277e9ba0318 100644 --- a/include/target/iscsi/iscsi_transport.h +++ b/include/target/iscsi/iscsi_transport.h | |||
| @@ -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 |
diff --git a/include/target/target_core_backend.h b/include/target/target_core_backend.h index f6f3bc52c1ac..b54b98dc2d4a 100644 --- a/include/target/target_core_backend.h +++ b/include/target/target_core_backend.h | |||
| @@ -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]; |
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h index c2119008990a..ca8ec7218f39 100644 --- a/include/target/target_core_base.h +++ b/include/target/target_core_base.h | |||
| @@ -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 | ||
diff --git a/include/target/target_core_fabric.h b/include/target/target_core_fabric.h index 5cd6faa6e0d1..358041bad1da 100644 --- a/include/target/target_core_fabric.h +++ b/include/target/target_core_fabric.h | |||
| @@ -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; |
