From 0a6fe8551ac9807a8b6ad62241ec8048cf9f9025 Mon Sep 17 00:00:00 2001 From: Yaniv Kaul Date: Sun, 9 Jun 2019 13:31:31 +0300 Subject: multiple files: another attempt to remove includes There are many include statements that are not needed. A previous more ambitious attempt failed because of *BSD plafrom (see https://review.gluster.org/#/c/glusterfs/+/21929/ ) Now trying a more conservative reduction. It does not solve all circular deps that we have, but it does reduce some of them. There is just too much to handle reasonably (dht-common.h includes dht-lock.h which includes dht-common.h ...), but it does reduce the overall number of lines of include we need to look at in the future to understand and fix the mess later one. Change-Id: I550cd001bdefb8be0fe67632f783c0ef6bee3f9f updates: bz#1193929 Signed-off-by: Yaniv Kaul --- xlators/cluster/dht/src/dht-common.c | 4 +--- xlators/cluster/dht/src/dht-common.h | 2 -- xlators/cluster/dht/src/dht-diskusage.c | 4 ---- xlators/cluster/dht/src/dht-hashfn.c | 2 -- xlators/cluster/dht/src/dht-helper.c | 3 +-- xlators/cluster/dht/src/dht-layout.c | 3 --- xlators/cluster/dht/src/dht-linkfile.c | 3 --- xlators/cluster/dht/src/dht-lock.h | 1 - xlators/cluster/dht/src/dht-rebalance.c | 3 +-- xlators/cluster/dht/src/dht-rename.c | 2 -- xlators/cluster/dht/src/dht-selfheal.c | 3 --- xlators/cluster/dht/src/dht.c | 1 - 12 files changed, 3 insertions(+), 28 deletions(-) (limited to 'xlators/cluster/dht') diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index e1edb380204..04b5f1c2fe6 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -10,15 +10,13 @@ /* TODO: add NS locking */ -#include -#include #include "libxlator.h" #include "dht-common.h" #include "dht-lock.h" -#include #include #include #include +#include "glusterfs/compat-errno.h" // for ENODATA on BSD #include #include diff --git a/xlators/cluster/dht/src/dht-common.h b/xlators/cluster/dht/src/dht-common.h index c516271228e..0389b534d5f 100644 --- a/xlators/cluster/dht/src/dht-common.h +++ b/xlators/cluster/dht/src/dht-common.h @@ -9,8 +9,6 @@ */ #include -#include -#include #include "dht-mem-types.h" #include "dht-messages.h" diff --git a/xlators/cluster/dht/src/dht-diskusage.c b/xlators/cluster/dht/src/dht-diskusage.c index 4d3905ab741..27097ca2475 100644 --- a/xlators/cluster/dht/src/dht-diskusage.c +++ b/xlators/cluster/dht/src/dht-diskusage.c @@ -10,11 +10,7 @@ /* TODO: add NS locking */ -#include -#include #include "dht-common.h" -#include "dht-messages.h" -#include #include #include diff --git a/xlators/cluster/dht/src/dht-hashfn.c b/xlators/cluster/dht/src/dht-hashfn.c index 3def6b17666..c1405edbdd4 100644 --- a/xlators/cluster/dht/src/dht-hashfn.c +++ b/xlators/cluster/dht/src/dht-hashfn.c @@ -8,8 +8,6 @@ cases as published by the Free Software Foundation. */ -#include -#include #include "dht-common.h" #include diff --git a/xlators/cluster/dht/src/dht-helper.c b/xlators/cluster/dht/src/dht-helper.c index 4c57e0d2efc..c7bc8c3aaf2 100644 --- a/xlators/cluster/dht/src/dht-helper.c +++ b/xlators/cluster/dht/src/dht-helper.c @@ -8,10 +8,9 @@ cases as published by the Free Software Foundation. */ -#include -#include #include "dht-common.h" #include "dht-lock.h" +#include "glusterfs/compat-errno.h" // for ENODATA on BSD static void dht_free_fd_ctx(dht_fd_ctx_t *fd_ctx) diff --git a/xlators/cluster/dht/src/dht-layout.c b/xlators/cluster/dht/src/dht-layout.c index 35bd3fbd25e..9cbb0f72171 100644 --- a/xlators/cluster/dht/src/dht-layout.c +++ b/xlators/cluster/dht/src/dht-layout.c @@ -8,11 +8,8 @@ cases as published by the Free Software Foundation. */ -#include -#include #include "dht-common.h" #include -#include "dht-messages.h" #include "unittest/unittest.h" #define layout_base_size (sizeof(dht_layout_t)) diff --git a/xlators/cluster/dht/src/dht-linkfile.c b/xlators/cluster/dht/src/dht-linkfile.c index e17c354bea6..2f4e1813be0 100644 --- a/xlators/cluster/dht/src/dht-linkfile.c +++ b/xlators/cluster/dht/src/dht-linkfile.c @@ -8,11 +8,8 @@ cases as published by the Free Software Foundation. */ -#include -#include #include #include "dht-common.h" -#include "dht-messages.h" int dht_linkfile_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this, diff --git a/xlators/cluster/dht/src/dht-lock.h b/xlators/cluster/dht/src/dht-lock.h index 1cea8ae51ea..6485c03fb6e 100644 --- a/xlators/cluster/dht/src/dht-lock.h +++ b/xlators/cluster/dht/src/dht-lock.h @@ -11,7 +11,6 @@ #ifndef _DHT_LOCK_H #define _DHT_LOCK_H -#include #include "dht-common.h" void diff --git a/xlators/cluster/dht/src/dht-rebalance.c b/xlators/cluster/dht/src/dht-rebalance.c index 2580dd24ed2..ea63c3c5e74 100644 --- a/xlators/cluster/dht/src/dht-rebalance.c +++ b/xlators/cluster/dht/src/dht-rebalance.c @@ -9,12 +9,11 @@ */ #include "dht-common.h" -#include #include -#include #include #include #include +#include "glusterfs/compat-errno.h" // for ENODATA on BSD #define GF_DISK_SECTOR_SIZE 512 #define DHT_REBALANCE_PID 4242 /* Change it if required */ diff --git a/xlators/cluster/dht/src/dht-rename.c b/xlators/cluster/dht/src/dht-rename.c index 893b4513628..861e2fb4f9f 100644 --- a/xlators/cluster/dht/src/dht-rename.c +++ b/xlators/cluster/dht/src/dht-rename.c @@ -11,8 +11,6 @@ /* TODO: link(oldpath, newpath) fails if newpath already exists. DHT should * delete the newpath if it gets EEXISTS from link() call. */ -#include -#include #include "dht-common.h" #include "dht-lock.h" #include diff --git a/xlators/cluster/dht/src/dht-selfheal.c b/xlators/cluster/dht/src/dht-selfheal.c index f5dfff9a11f..b140aad4c69 100644 --- a/xlators/cluster/dht/src/dht-selfheal.c +++ b/xlators/cluster/dht/src/dht-selfheal.c @@ -8,10 +8,7 @@ cases as published by the Free Software Foundation. */ -#include -#include #include "dht-common.h" -#include "dht-messages.h" #include "dht-lock.h" #include diff --git a/xlators/cluster/dht/src/dht.c b/xlators/cluster/dht/src/dht.c index 934eace1ad1..53de8292704 100644 --- a/xlators/cluster/dht/src/dht.c +++ b/xlators/cluster/dht/src/dht.c @@ -8,7 +8,6 @@ cases as published by the Free Software Foundation. */ -#include #include "dht-common.h" struct xlator_fops dht_pt_fops = { -- cgit