History

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%.

Bart Van Assche committed 10 years ago

Commit 8dcf07b1 parent f50457251 files · +187 −25Browse files

Showing the changes to include/target (6 of 51 files). Show all

Unified · Split

6 files
  1. include/target/iscsi/iscsi_target_core.h +8 −6
  2. include/target/iscsi/iscsi_target_stat.h +4 −0
  3. include/target/iscsi/iscsi_transport.h +3 −3
  4. include/target/target_core_backend.h +6 −0
  5. include/target/target_core_base.h +4 −8
  6. include/target/target_core_fabric.h +4 −0
include/target/iscsi/iscsi_target_core.h+8−6
@@ -1,12 +1,14 @@
11 #ifndef ISCSI_TARGET_CORE_H
22 #define ISCSI_TARGET_CORE_H
33
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;
1012
1113 #define ISCSIT_VERSION "v4.1.0"
1214 #define ISCSI_MAX_DATASN_MISSING_COUNT 16
include/target/iscsi/iscsi_target_stat.h+4−0
@@ -1,6 +1,10 @@
11 #ifndef ISCSI_TARGET_STAT_H
22 #define ISCSI_TARGET_STAT_H
33
4+#include <linux/types.h>
5+#include <linux/spinlock.h>
6+#include <linux/socket.h>
7+
48 /*
59 * For struct iscsi_tiqn->tiqn_wwn default groups
610 */
include/target/iscsi/iscsi_transport.h+3−3
@@ -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;
44
55 struct iscsit_transport {
66 #define ISCSIT_TRANSPORT_NAME 16
include/target/target_core_backend.h+6−0
@@ -1,8 +1,14 @@
11 #ifndef TARGET_CORE_BACKEND_H
22 #define TARGET_CORE_BACKEND_H
33
4+#include <linux/types.h>
5+#include <target/target_core_base.h>
6+
47 #define TRANSPORT_FLAG_PASSTHROUGH 1
58
9+struct request_queue;
10+struct scatterlist;
11+
612 struct target_backend_ops {
713 char name[16];
814 char inquiry_prod[16];
include/target/target_core_base.h+4−8
@@ -1,14 +1,10 @@
11 #ifndef TARGET_CORE_BASE_H
22 #define TARGET_CORE_BASE_H
33
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 */
128
139 #define TARGET_CORE_VERSION "v5.0"
1410
include/target/target_core_fabric.h+4−0
@@ -1,6 +1,10 @@
11 #ifndef TARGET_CORE_FABRIC_H
22 #define TARGET_CORE_FABRIC_H
33
4+#include <linux/configfs.h>
5+#include <linux/types.h>
6+#include <target/target_core_base.h>
7+
48 struct target_core_fabric_ops {
59 struct module *module;
610 const char *name;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t