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 @@
1#ifndef ISCSI_TARGET_CORE_H1#ifndef ISCSI_TARGET_CORE_H
2#define ISCSI_TARGET_CORE_H2#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
11struct sock;
10 12
11#define ISCSIT_VERSION "v4.1.0"13#define ISCSIT_VERSION "v4.1.0"
12#define ISCSI_MAX_DATASN_MISSING_COUNT 1614#define ISCSI_MAX_DATASN_MISSING_COUNT 16
include/target/iscsi/iscsi_target_stat.h+4−0
@@ -1,6 +1,10 @@
1#ifndef ISCSI_TARGET_STAT_H1#ifndef ISCSI_TARGET_STAT_H
2#define ISCSI_TARGET_STAT_H2#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 groups9 * For struct iscsi_tiqn->tiqn_wwn default groups
6 */10 */
include/target/iscsi/iscsi_transport.h+3−3
@@ -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"3struct sockaddr_storage;
4 4
5struct iscsit_transport {5struct iscsit_transport {
6#define ISCSIT_TRANSPORT_NAME 166#define ISCSIT_TRANSPORT_NAME 16
include/target/target_core_backend.h+6−0
@@ -1,8 +1,14 @@
1#ifndef TARGET_CORE_BACKEND_H1#ifndef TARGET_CORE_BACKEND_H
2#define TARGET_CORE_BACKEND_H2#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 17#define TRANSPORT_FLAG_PASSTHROUGH 1
5 8
9struct request_queue;
10struct scatterlist;
11
6struct target_backend_ops {12struct target_backend_ops {
7 char name[16];13 char name[16];
8 char inquiry_prod[16];14 char inquiry_prod[16];
include/target/target_core_base.h+4−8
@@ -1,14 +1,10 @@
1#ifndef TARGET_CORE_BASE_H1#ifndef TARGET_CORE_BASE_H
2#define TARGET_CORE_BASE_H2#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
include/target/target_core_fabric.h+4−0
@@ -1,6 +1,10 @@
1#ifndef TARGET_CORE_FABRIC_H1#ifndef TARGET_CORE_FABRIC_H
2#define TARGET_CORE_FABRIC_H2#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
4struct target_core_fabric_ops {8struct target_core_fabric_ops {
5 struct module *module;9 struct module *module;
6 const char *name;10 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