summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--api/src/glfs-master.c6
-rw-r--r--api/src/glfs-mgmt.c7
-rw-r--r--glusterfsd/src/gf_attach.c2
-rw-r--r--heal/src/glfs-heal.c2
-rw-r--r--libglusterfs/src/async.c3
-rw-r--r--libglusterfs/src/common-utils.c3
-rw-r--r--libglusterfs/src/compat.c6
-rw-r--r--libglusterfs/src/daemon.c1
-rw-r--r--libglusterfs/src/default-args.c1
-rw-r--r--libglusterfs/src/dict.c6
-rw-r--r--libglusterfs/src/event-epoll.c6
-rw-r--r--libglusterfs/src/event.c2
-rw-r--r--libglusterfs/src/fd.c7
-rw-r--r--libglusterfs/src/gf-dirent.c1
-rw-r--r--libglusterfs/src/globals.c5
-rw-r--r--libglusterfs/src/glusterfs/circ-buff.h2
-rw-r--r--libglusterfs/src/glusterfs/cluster-syncop.h2
-rw-r--r--libglusterfs/src/glusterfs/common-utils.h4
-rw-r--r--libglusterfs/src/glusterfs/compat.h4
-rw-r--r--libglusterfs/src/glusterfs/dict.h1
-rw-r--r--libglusterfs/src/glusterfs/event-history.h6
-rw-r--r--libglusterfs/src/glusterfs/fd-lk.h4
-rw-r--r--libglusterfs/src/glusterfs/fd.h1
-rw-r--r--libglusterfs/src/glusterfs/hashfn.h2
-rw-r--r--libglusterfs/src/glusterfs/iobuf.h9
-rw-r--r--libglusterfs/src/glusterfs/mem-pool.h1
-rw-r--r--libglusterfs/src/glusterfs/rbthash.h12
-rw-r--r--libglusterfs/src/glusterfs/syncop.h4
-rw-r--r--libglusterfs/src/glusterfs/xlator.h17
-rw-r--r--libglusterfs/src/graph.c34
-rw-r--r--libglusterfs/src/hashfn.c12
-rw-r--r--libglusterfs/src/inode.c1
-rw-r--r--libglusterfs/src/latency.c3
-rw-r--r--libglusterfs/src/logging.c2
-rw-r--r--libglusterfs/src/mem-pool.c4
-rw-r--r--libglusterfs/src/parse-utils.c2
-rw-r--r--libglusterfs/src/statedump.c2
-rw-r--r--libglusterfs/src/store.c1
-rw-r--r--libglusterfs/src/timespec.c1
-rw-r--r--libglusterfs/src/trie.c2
-rw-r--r--rpc/rpc-lib/src/auth-glusterfs.c1
-rw-r--r--rpc/rpc-lib/src/auth-null.c1
-rw-r--r--rpc/rpc-lib/src/auth-unix.c1
-rw-r--r--rpc/rpc-lib/src/mgmt-pmap.c1
-rw-r--r--rpc/rpc-lib/src/rpc-clnt-ping.h1
-rw-r--r--rpc/rpc-lib/src/rpc-drc.c2
-rw-r--r--rpc/rpc-lib/src/rpc-transport.c4
-rw-r--r--rpc/rpc-lib/src/rpcsvc-auth.c1
-rw-r--r--rpc/rpc-lib/src/rpcsvc-common.h3
-rw-r--r--rpc/rpc-lib/src/rpcsvc.c4
-rw-r--r--rpc/rpc-lib/src/rpcsvc.h6
-rw-r--r--rpc/rpc-lib/src/xdr-rpc.c4
-rw-r--r--rpc/rpc-lib/src/xdr-rpc.h1
-rw-r--r--rpc/rpc-lib/src/xdr-rpcclnt.c4
-rw-r--r--rpc/rpc-lib/src/xdr-rpcclnt.h2
-rw-r--r--rpc/rpc-transport/socket/src/socket.c5
-rw-r--r--rpc/rpc-transport/socket/src/socket.h5
-rw-r--r--xlators/cluster/afr/src/afr-common.c2
-rw-r--r--xlators/cluster/afr/src/afr-dir-read.c7
-rw-r--r--xlators/cluster/afr/src/afr-dir-write.c4
-rw-r--r--xlators/cluster/afr/src/afr-inode-read.c3
-rw-r--r--xlators/cluster/afr/src/afr-inode-write.c6
-rw-r--r--xlators/cluster/afr/src/afr-open.c10
-rw-r--r--xlators/cluster/dht/src/dht-common.c4
-rw-r--r--xlators/cluster/dht/src/dht-common.h2
-rw-r--r--xlators/cluster/dht/src/dht-diskusage.c4
-rw-r--r--xlators/cluster/dht/src/dht-hashfn.c2
-rw-r--r--xlators/cluster/dht/src/dht-helper.c3
-rw-r--r--xlators/cluster/dht/src/dht-layout.c3
-rw-r--r--xlators/cluster/dht/src/dht-linkfile.c3
-rw-r--r--xlators/cluster/dht/src/dht-lock.h1
-rw-r--r--xlators/cluster/dht/src/dht-rebalance.c3
-rw-r--r--xlators/cluster/dht/src/dht-rename.c2
-rw-r--r--xlators/cluster/dht/src/dht-selfheal.c3
-rw-r--r--xlators/cluster/dht/src/dht.c1
-rw-r--r--xlators/cluster/ec/src/ec-common.h3
-rw-r--r--xlators/cluster/ec/src/ec-data.c1
-rw-r--r--xlators/cluster/ec/src/ec-dir-read.c4
-rw-r--r--xlators/cluster/ec/src/ec-dir-write.c3
-rw-r--r--xlators/cluster/ec/src/ec-galois.c3
-rw-r--r--xlators/cluster/ec/src/ec-generic.c3
-rw-r--r--xlators/cluster/ec/src/ec-heal.c2
-rw-r--r--xlators/cluster/ec/src/ec-heald.c1
-rw-r--r--xlators/cluster/ec/src/ec-heald.h6
-rw-r--r--xlators/cluster/ec/src/ec-inode-read.c3
-rw-r--r--xlators/cluster/ec/src/ec-inode-write.c4
-rw-r--r--xlators/cluster/ec/src/ec-locks.c4
-rw-r--r--xlators/cluster/ec/src/ec-method.h2
-rw-r--r--xlators/features/bit-rot/src/bitd/bit-rot.c3
-rw-r--r--xlators/features/bit-rot/src/stub/bit-rot-stub.c1
-rw-r--r--xlators/features/locks/src/common.c2
-rw-r--r--xlators/features/locks/src/common.h1
-rw-r--r--xlators/features/locks/src/inodelk.c4
-rw-r--r--xlators/features/locks/src/posix.c4
-rw-r--r--xlators/features/namespace/src/namespace.c1
-rw-r--r--xlators/features/quota/src/quota.c4
-rw-r--r--xlators/features/quota/src/quota.h3
-rw-r--r--xlators/features/quota/src/quotad.c1
-rw-r--r--xlators/features/read-only/src/read-only.c1
-rw-r--r--xlators/features/read-only/src/read-only.h5
-rw-r--r--xlators/features/snapview-server/src/snapview-server.h2
-rw-r--r--xlators/lib/src/libxlator.c2
-rw-r--r--xlators/lib/src/libxlator.h8
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-sm.h3
-rw-r--r--xlators/performance/io-cache/src/io-cache.h4
-rw-r--r--xlators/storage/posix/src/posix-aio.c2
-rw-r--r--xlators/storage/posix/src/posix-aio.h3
-rw-r--r--xlators/storage/posix/src/posix-common.c9
-rw-r--r--xlators/storage/posix/src/posix-entry-ops.c6
-rw-r--r--xlators/storage/posix/src/posix-gfid-path.c5
-rw-r--r--xlators/storage/posix/src/posix-gfid-path.h7
-rw-r--r--xlators/storage/posix/src/posix-handle.c3
-rw-r--r--xlators/storage/posix/src/posix-helpers.c8
-rw-r--r--xlators/storage/posix/src/posix-inode-fd-ops.c8
-rw-r--r--xlators/storage/posix/src/posix-inode-handle.h1
-rw-r--r--xlators/storage/posix/src/posix.h2
-rw-r--r--xlators/system/posix-acl/src/posix-acl.c2
-rw-r--r--xlators/system/posix-acl/src/posix-acl.h1
118 files changed, 82 insertions, 363 deletions
diff --git a/api/src/glfs-master.c b/api/src/glfs-master.c
index b4473b16604..4bc69d1f3d8 100644
--- a/api/src/glfs-master.c
+++ b/api/src/glfs-master.c
@@ -8,14 +8,8 @@
cases as published by the Free Software Foundation.
*/
-#include <unistd.h>
-#include <string.h>
-#include <stdlib.h>
#include <stdio.h>
-#include <inttypes.h>
-#include <limits.h>
-#include <glusterfs/xlator.h>
#include <glusterfs/glusterfs.h>
#include "glfs-internal.h"
diff --git a/api/src/glfs-mgmt.c b/api/src/glfs-mgmt.c
index 7476d5b64f3..66a13432f38 100644
--- a/api/src/glfs-mgmt.c
+++ b/api/src/glfs-mgmt.c
@@ -18,22 +18,15 @@
#include <glusterfs/glusterfs.h>
#include "glfs.h"
#include <glusterfs/dict.h>
-#include <glusterfs/gf-event.h>
-#include <glusterfs/defaults.h>
#include "rpc-clnt.h"
#include "protocol-common.h"
-#include "glusterfs3.h"
-#include "portmap-xdr.h"
-#include "xdr-common.h"
#include "xdr-generic.h"
#include "rpc-common-xdr.h"
#include <glusterfs/syncop.h>
-#include <glusterfs/xlator.h>
#include "glfs-internal.h"
-#include "glfs-mem-types.h"
#include "gfapi-messages.h"
#include <glusterfs/syscall.h>
diff --git a/glusterfsd/src/gf_attach.c b/glusterfsd/src/gf_attach.c
index 6293b9b6013..416cb491147 100644
--- a/glusterfsd/src/gf_attach.c
+++ b/glusterfsd/src/gf_attach.c
@@ -12,9 +12,7 @@
#include <stdlib.h>
#include <unistd.h>
-//#include "config.h"
#include <glusterfs/glusterfs.h>
-#include <glusterfs/globals.h>
#include "glfs-internal.h"
#include "rpc-clnt.h"
#include "protocol-common.h"
diff --git a/heal/src/glfs-heal.c b/heal/src/glfs-heal.c
index 7e37e479706..ce6925a281b 100644
--- a/heal/src/glfs-heal.c
+++ b/heal/src/glfs-heal.c
@@ -12,14 +12,12 @@
#include <stdlib.h>
#include <errno.h>
#include "glfs.h"
-#include "glfs-handles.h"
#include "glfs-internal.h"
#include "protocol-common.h"
#include <glusterfs/syscall.h>
#include <glusterfs/syncop.h>
#include <glusterfs/syncop-utils.h>
#include <string.h>
-#include <time.h>
#include <glusterfs/glusterfs.h>
#include <libgen.h>
diff --git a/libglusterfs/src/async.c b/libglusterfs/src/async.c
index ae7152ff7fa..1d6cfa374b6 100644
--- a/libglusterfs/src/async.c
+++ b/libglusterfs/src/async.c
@@ -63,9 +63,6 @@
#include <pthread.h>
#include <errno.h>
-//#include <urcu/uatomic.h>
-
-#include "glusterfs/logging.h"
#include "glusterfs/list.h"
#include "glusterfs/mem-types.h"
#include "glusterfs/async.h"
diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c
index 70d5d21916f..8e2ffa3accd 100644
--- a/libglusterfs/src/common-utils.c
+++ b/libglusterfs/src/common-utils.c
@@ -24,7 +24,6 @@
#include <time.h>
#include <locale.h>
#include <sys/socket.h>
-#include <sys/wait.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <signal.h>
@@ -35,13 +34,11 @@
#if defined(GF_BSD_HOST_OS) || defined(GF_DARWIN_HOST_OS)
#include <sys/sysctl.h>
#endif
-#include <libgen.h>
#ifndef GF_LINUX_HOST_OS
#include <sys/resource.h>
#endif
#include "glusterfs/compat-errno.h"
-#include "glusterfs/logging.h"
#include "glusterfs/common-utils.h"
#include "glusterfs/revision.h"
#include "glusterfs/glusterfs.h"
diff --git a/libglusterfs/src/compat.c b/libglusterfs/src/compat.c
index 9826dc089e9..877cda282de 100644
--- a/libglusterfs/src/compat.c
+++ b/libglusterfs/src/compat.c
@@ -8,7 +8,6 @@
cases as published by the Free Software Foundation.
*/
-#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdarg.h>
@@ -16,14 +15,9 @@
#include <sys/types.h>
#include <dirent.h>
-#ifdef GF_SOLARIS_HOST_OS
#include "glusterfs/logging.h"
-#endif /* GF_SOLARIS_HOST_OS */
-
#include "glusterfs/compat.h"
-#include "glusterfs/common-utils.h"
#include "glusterfs/iatt.h"
-#include "glusterfs/inode.h"
#include "glusterfs/syscall.h"
#include "glusterfs/run.h"
#include "glusterfs/libglusterfs-messages.h"
diff --git a/libglusterfs/src/daemon.c b/libglusterfs/src/daemon.c
index 83ff5fc4a93..0a3e5438325 100644
--- a/libglusterfs/src/daemon.c
+++ b/libglusterfs/src/daemon.c
@@ -8,7 +8,6 @@
cases as published by the Free Software Foundation.
*/
-#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
#include "glusterfs/daemon.h"
diff --git a/libglusterfs/src/default-args.c b/libglusterfs/src/default-args.c
index 9d4070449cd..a0ba1cfb299 100644
--- a/libglusterfs/src/default-args.c
+++ b/libglusterfs/src/default-args.c
@@ -13,7 +13,6 @@
#include "config.h"
#endif
-#include "glusterfs/xlator.h"
#include "glusterfs/defaults.h"
int
diff --git a/libglusterfs/src/dict.c b/libglusterfs/src/dict.c
index 6648be123b7..2a317e36981 100644
--- a/libglusterfs/src/dict.c
+++ b/libglusterfs/src/dict.c
@@ -16,21 +16,15 @@
#include <limits.h>
#include <fnmatch.h>
-#include "glusterfs/glusterfs.h"
-#include "glusterfs/common-utils.h"
#include "glusterfs/dict.h"
#define XXH_INLINE_ALL
#include "xxhash.h"
-#include "glusterfs/logging.h"
#include "glusterfs/compat.h"
#include "glusterfs/compat-errno.h"
#include "glusterfs/byte-order.h"
-#include "glusterfs/globals.h"
#include "glusterfs/statedump.h"
#include "glusterfs/libglusterfs-messages.h"
-#include "glusterfs-fops.h"
-
struct dict_cmp {
dict_t *dict;
gf_boolean_t (*value_ignore)(char *k);
diff --git a/libglusterfs/src/event-epoll.c b/libglusterfs/src/event-epoll.c
index 0cec47e6050..b48ef55cac1 100644
--- a/libglusterfs/src/event-epoll.c
+++ b/libglusterfs/src/event-epoll.c
@@ -8,17 +8,11 @@
cases as published by the Free Software Foundation.
*/
-#include <sys/poll.h>
#include <pthread.h>
-#include <unistd.h>
-#include <fcntl.h>
#include <stdlib.h>
#include <errno.h>
-#include <string.h>
-#include "glusterfs/logging.h"
#include "glusterfs/gf-event.h"
-#include "glusterfs/mem-pool.h"
#include "glusterfs/common-utils.h"
#include "glusterfs/syscall.h"
#include "glusterfs/libglusterfs-messages.h"
diff --git a/libglusterfs/src/event.c b/libglusterfs/src/event.c
index 527df5106fc..35a2f5c896f 100644
--- a/libglusterfs/src/event.c
+++ b/libglusterfs/src/event.c
@@ -16,9 +16,7 @@
#include <errno.h>
#include <string.h>
-#include "glusterfs/logging.h"
#include "glusterfs/gf-event.h"
-#include "glusterfs/mem-pool.h"
#include "glusterfs/common-utils.h"
#include "glusterfs/libglusterfs-messages.h"
#include "glusterfs/syscall.h"
diff --git a/libglusterfs/src/fd.c b/libglusterfs/src/fd.c
index b8aac726093..bceb77d6600 100644
--- a/libglusterfs/src/fd.c
+++ b/libglusterfs/src/fd.c
@@ -9,10 +9,11 @@
*/
#include "glusterfs/fd.h"
-#include "glusterfs/glusterfs.h"
-#include "glusterfs/dict.h"
+#include <errno.h> // for EINVAL, errno, ENOMEM
+#include <inttypes.h> // for PRIu64
+#include <stdint.h> // for UINT32_MAX
+#include <string.h> // for NULL, memcpy, memset, size_t
#include "glusterfs/statedump.h"
-#include "glusterfs/libglusterfs-messages.h"
static int
gf_fd_fdtable_expand(fdtable_t *fdtable, uint32_t nr);
diff --git a/libglusterfs/src/gf-dirent.c b/libglusterfs/src/gf-dirent.c
index f289723359e..9c8c74beb54 100644
--- a/libglusterfs/src/gf-dirent.c
+++ b/libglusterfs/src/gf-dirent.c
@@ -12,7 +12,6 @@
#include <string.h>
#include <stdint.h>
#include "glusterfs/compat.h"
-#include "glusterfs/xlator.h"
#include "glusterfs/syncop.h"
#define ONE 1ULL
diff --git a/libglusterfs/src/globals.c b/libglusterfs/src/globals.c
index 02098e6e9c7..63b6358bbe0 100644
--- a/libglusterfs/src/globals.c
+++ b/libglusterfs/src/globals.c
@@ -10,13 +10,8 @@
#include <pthread.h>
-#include "glusterfs/glusterfs.h"
-#include "glusterfs/globals.h"
-#include "glusterfs/xlator.h"
-#include "glusterfs/mem-pool.h"
#include "glusterfs/syncop.h"
#include "glusterfs/libglusterfs-messages.h"
-#include "glusterfs/upcall-utils.h"
const char *gf_fop_list[GF_FOP_MAXVALUE] = {
[GF_FOP_NULL] = "NULL",
diff --git a/libglusterfs/src/glusterfs/circ-buff.h b/libglusterfs/src/glusterfs/circ-buff.h
index 4453b8487cd..822345b641b 100644
--- a/libglusterfs/src/glusterfs/circ-buff.h
+++ b/libglusterfs/src/glusterfs/circ-buff.h
@@ -12,8 +12,6 @@
#define _CB_H
#include "glusterfs/common-utils.h"
-#include "glusterfs/logging.h"
-#include "glusterfs/mem-types.h"
#define BUFFER_SIZE 10
#define TOTAL_SIZE BUFFER_SIZE + 1
diff --git a/libglusterfs/src/glusterfs/cluster-syncop.h b/libglusterfs/src/glusterfs/cluster-syncop.h
index cfd3c338683..d0ad5ed548c 100644
--- a/libglusterfs/src/glusterfs/cluster-syncop.h
+++ b/libglusterfs/src/glusterfs/cluster-syncop.h
@@ -11,10 +11,10 @@
#ifndef _CLUSTER_SYNCOP_H
#define _CLUSTER_SYNCOP_H
-#include "glusterfs/xlator.h"
#include <sys/time.h>
#include <pthread.h>
#include <ucontext.h>
+
#include "glusterfs/defaults.h"
#include "glusterfs/default-args.h"
#include "glusterfs/syncop.h"
diff --git a/libglusterfs/src/glusterfs/common-utils.h b/libglusterfs/src/glusterfs/common-utils.h
index 49ebdba2fc2..d52904021e1 100644
--- a/libglusterfs/src/glusterfs/common-utils.h
+++ b/libglusterfs/src/glusterfs/common-utils.h
@@ -38,15 +38,11 @@ trap(void);
/* To solve type punned error */
#define VOID(ptr) ((void **)((void *)ptr))
-#include "glusterfs/logging.h"
-#include "glusterfs/glusterfs.h"
-#include "glusterfs/locking.h"
#include "glusterfs/mem-pool.h"
#include "glusterfs/compat-uuid.h"
#include "glusterfs/iatt.h"
#include "glusterfs/libglusterfs-messages.h"
#include "protocol-common.h"
-#include "glusterfs/iobuf.h"
#define STRINGIFY(val) #val
#define TOSTRING(val) STRINGIFY(val)
diff --git a/libglusterfs/src/glusterfs/compat.h b/libglusterfs/src/glusterfs/compat.h
index 9374b79f9af..d2686499973 100644
--- a/libglusterfs/src/glusterfs/compat.h
+++ b/libglusterfs/src/glusterfs/compat.h
@@ -40,10 +40,6 @@
#define GF_XATTR_NAME_MAX XATTR_NAME_MAX
#endif /* GF_LINUX_HOST_OS */
-#ifdef HAVE_XATTR_H
-#include <sys/xattr.h>
-#endif
-
/*
* Define the fallocate flags in case we do not have the header. This also
* accounts for older systems that do not define FALLOC_FL_PUNCH_HOLE.
diff --git a/libglusterfs/src/glusterfs/dict.h b/libglusterfs/src/glusterfs/dict.h
index 022f564f62a..7854c9feaa1 100644
--- a/libglusterfs/src/glusterfs/dict.h
+++ b/libglusterfs/src/glusterfs/dict.h
@@ -16,7 +16,6 @@
#include <pthread.h>
#include "glusterfs/common-utils.h"
-#include "glusterfs/libglusterfs-messages.h"
typedef struct _data data_t;
typedef struct _dict dict_t;
diff --git a/libglusterfs/src/glusterfs/event-history.h b/libglusterfs/src/glusterfs/event-history.h
index c1af8934c03..f0e0422418e 100644
--- a/libglusterfs/src/glusterfs/event-history.h
+++ b/libglusterfs/src/glusterfs/event-history.h
@@ -11,8 +11,10 @@
#ifndef _EH_H
#define _EH_H
-#include "glusterfs/mem-types.h"
-#include "glusterfs/circ-buff.h"
+#include <pthread.h> // for pthread_mutex_t
+#include <stddef.h> // for size_t
+#include "glusterfs/circ-buff.h" // for buffer_t, circular_buffer_t
+#include "glusterfs/glusterfs.h" // for gf_boolean_t
struct event_hist {
buffer_t *buffer;
diff --git a/libglusterfs/src/glusterfs/fd-lk.h b/libglusterfs/src/glusterfs/fd-lk.h
index 6465e6d3f58..76cc680306a 100644
--- a/libglusterfs/src/glusterfs/fd-lk.h
+++ b/libglusterfs/src/glusterfs/fd-lk.h
@@ -14,11 +14,7 @@
#include "glusterfs/fd.h"
#include "glusterfs/locking.h"
#include "glusterfs/list.h"
-#include "glusterfs/logging.h"
-#include "glusterfs/mem-pool.h"
-#include "glusterfs/mem-types.h"
#include "glusterfs/glusterfs.h"
-#include "glusterfs/common-utils.h"
#define get_lk_type(type) \
type == F_UNLCK ? "F_UNLCK" : (type == F_RDLCK ? "F_RDLCK" : "F_WRLCK")
diff --git a/libglusterfs/src/glusterfs/fd.h b/libglusterfs/src/glusterfs/fd.h
index cdbe2894bc3..28906d34e4d 100644
--- a/libglusterfs/src/glusterfs/fd.h
+++ b/libglusterfs/src/glusterfs/fd.h
@@ -17,7 +17,6 @@
#include "glusterfs/glusterfs.h"
#include "glusterfs/locking.h"
#include "glusterfs/fd-lk.h"
-#include "glusterfs/common-utils.h"
#define GF_ANON_FD_NO -2
#define GF_ANON_FD_FLAGS (O_RDWR | O_LARGEFILE)
diff --git a/libglusterfs/src/glusterfs/hashfn.h b/libglusterfs/src/glusterfs/hashfn.h
index a4cb33f072a..6e92e706d8c 100644
--- a/libglusterfs/src/glusterfs/hashfn.h
+++ b/libglusterfs/src/glusterfs/hashfn.h
@@ -20,6 +20,4 @@ SuperFastHash(const char *data, int32_t len);
uint32_t
gf_dm_hashfn(const char *msg, int len);
-uint32_t
-ReallySimpleHash(char *path, int len);
#endif /* __HASHFN_H__ */
diff --git a/libglusterfs/src/glusterfs/iobuf.h b/libglusterfs/src/glusterfs/iobuf.h
index 6de0f13ae36..792d4fe1529 100644
--- a/libglusterfs/src/glusterfs/iobuf.h
+++ b/libglusterfs/src/glusterfs/iobuf.h
@@ -11,11 +11,12 @@
#ifndef _IOBUF_H_
#define _IOBUF_H_
-#include "glusterfs/list.h"
-#include "glusterfs/common-utils.h"
-#include <pthread.h>
+#include <stddef.h> // for size_t
#include <sys/mman.h>
-#include <sys/uio.h>
+#include "glusterfs/atomic.h" // for gf_atomic_t
+#include <sys/uio.h> // for struct iovec
+#include "glusterfs/locking.h" // for gf_lock_t
+#include "glusterfs/list.h"
#define GF_VARIABLE_IOBUF_COUNT 32
diff --git a/libglusterfs/src/glusterfs/mem-pool.h b/libglusterfs/src/glusterfs/mem-pool.h
index 95579509866..004aa179b19 100644
--- a/libglusterfs/src/glusterfs/mem-pool.h
+++ b/libglusterfs/src/glusterfs/mem-pool.h
@@ -12,7 +12,6 @@
#define _MEM_POOL_H_
#include "glusterfs/list.h"
-#include "glusterfs/locking.h"
#include "glusterfs/atomic.h"
#include "glusterfs/logging.h"
#include "glusterfs/mem-types.h"
diff --git a/libglusterfs/src/glusterfs/rbthash.h b/libglusterfs/src/glusterfs/rbthash.h
index 3327ebf73c5..4c731de69c2 100644
--- a/libglusterfs/src/glusterfs/rbthash.h
+++ b/libglusterfs/src/glusterfs/rbthash.h
@@ -10,14 +10,12 @@
#ifndef __RBTHASH_TABLE_H_
#define __RBTHASH_TABLE_H_
-#include "rb.h"
-#include "glusterfs/locking.h"
-#include "glusterfs/mem-pool.h"
-#include "glusterfs/logging.h"
-#include "glusterfs/common-utils.h"
-#include "glusterfs/list.h"
-#include <pthread.h>
+#include <stdint.h> // for uint32_t
+#include "glusterfs/glusterfs.h" // for gf_boolean_t, glusterfs_ctx_t
+#include "glusterfs/list.h" // for list_head
+#include "glusterfs/locking.h" // for gf_lock_t
+struct mem_pool;
#define GF_RBTHASH_MEMPOOL 16384 // 1048576
#define GF_RBTHASH "rbthash"
diff --git a/libglusterfs/src/glusterfs/syncop.h b/libglusterfs/src/glusterfs/syncop.h
index e0f10175cea..b00988eeef1 100644
--- a/libglusterfs/src/glusterfs/syncop.h
+++ b/libglusterfs/src/glusterfs/syncop.h
@@ -11,11 +11,11 @@
#ifndef _SYNCOP_H
#define _SYNCOP_H
-#include "glusterfs/xlator.h"
#include <sys/time.h>
#include <pthread.h>
#include <ucontext.h>
-
+#include "glusterfs/dict.h" // for dict_t
+#include "glusterfs/stack.h" // for call_frame_t, STACK_DESTROY, STACK_...
#define SYNCENV_PROC_MAX 16
#define SYNCENV_PROC_MIN 2
#define SYNCPROC_IDLE_TIME 600
diff --git a/libglusterfs/src/glusterfs/xlator.h b/libglusterfs/src/glusterfs/xlator.h
index 1a0ed99774b..42cbdc1ac93 100644
--- a/libglusterfs/src/glusterfs/xlator.h
+++ b/libglusterfs/src/glusterfs/xlator.h
@@ -11,19 +11,16 @@
#ifndef _XLATOR_H
#define _XLATOR_H
-#include <stdio.h>
-#include <stdint.h>
-#include <inttypes.h>
-
+#include <stdint.h> // for int32_t
+#include <sys/types.h> // for off_t, mode_t, off64_t, dev_t
+#include "glusterfs-fops.h" // for GF_FOP_MAXVALUE, entrylk_cmd
+#include "glusterfs/atomic.h" // for gf_atomic_t
+#include "glusterfs/glusterfs.h" // for gf_boolean_t, glusterfs_ctx_t
+#include "glusterfs/compat-uuid.h" // for uuid_t
+#include "glusterfs/compat.h"
#include "glusterfs/event-history.h"
-#include "glusterfs/logging.h"
-#include "glusterfs/common-utils.h"
#include "glusterfs/dict.h"
-#include "glusterfs/compat.h"
-#include "glusterfs/list.h"
#include "glusterfs/latency.h"
-#include "glusterfs/compat-uuid.h"
-#include "glusterfs/syscall.h"
#define FIRST_CHILD(xl) (xl->children->xlator)
#define SECOND_CHILD(xl) (xl->children->next->xlator)
diff --git a/libglusterfs/src/graph.c b/libglusterfs/src/graph.c
index 437283b7972..cb1c0017cf1 100644
--- a/libglusterfs/src/graph.c
+++ b/libglusterfs/src/graph.c
@@ -8,16 +8,32 @@
cases as published by the Free Software Foundation.
*/
-#include "glusterfs/xlator.h"
-#include <dlfcn.h>
-#include <netdb.h>
-#include <fnmatch.h>
-#include <stdlib.h>
+#include <stdint.h> // for uint32_t
+#include <sys/time.h> // for timeval
+#include <errno.h> // for EIO, errno, EINVAL, ENOMEM
+#include <fnmatch.h> // for fnmatch, FNM_NOESCAPE
+#include <openssl/sha.h> // for SHA256_DIGEST_LENGTH
+#include <regex.h> // for regmatch_t, regcomp
+#include <stdio.h> // for fclose, fopen, snprintf
+#include <stdlib.h> // for NULL, atoi, mkstemp
+#include <string.h> // for strcmp, strerror, memcpy
+#include <strings.h> // for rindex
+#include <sys/stat.h> // for stat
+#include <sys/time.h> // for gettimeofday
+#include <unistd.h> // for gethostname, getpid
+#include "glusterfs-fops.h" // for GF_EVENT_GRAPH_NEW, GF_...
+#include "glusterfs/common-utils.h" // for gf_strncpy, gf_time_fmt
#include "glusterfs/defaults.h"
-#include <unistd.h>
-#include "glusterfs/syscall.h"
-#include <regex.h>
-#include "glusterfs/libglusterfs-messages.h"
+#include "glusterfs/dict.h" // for dict_foreach, dict_set_...
+#include "glusterfs/globals.h" // for xlator_t, xlator_list_t
+#include "glusterfs/glusterfs.h" // for glusterfs_graph_t, glus...
+#include "glusterfs/libglusterfs-messages.h" // for LG_MSG_GRAPH_ERROR, LG_...
+#include "glusterfs/list.h" // for list_add, list_del_init
+#include "glusterfs/logging.h" // for gf_msg, GF_LOG_ERROR
+#include "glusterfs/mem-pool.h" // for GF_FREE, gf_strdup, GF_...
+#include "glusterfs/mem-types.h" // for gf_common_mt_xlator_list_t
+#include "glusterfs/options.h" // for xlator_tree_reconfigure
+#include "glusterfs/syscall.h" // for sys_close, sys_stat
#if 0
static void
diff --git a/libglusterfs/src/hashfn.c b/libglusterfs/src/hashfn.c
index 5f6988417ea..d2237e99f83 100644
--- a/libglusterfs/src/hashfn.c
+++ b/libglusterfs/src/hashfn.c
@@ -11,24 +11,12 @@
#include <stdint.h>
#include <stdlib.h>
-#include "glusterfs/hashfn.h"
-
#define get16bits(d) (*((const uint16_t *)(d)))
#define DM_DELTA 0x9E3779B9
#define DM_FULLROUNDS 10 /* 32 is overkill, 16 is strong crypto */
#define DM_PARTROUNDS 6 /* 6 gets complete mixing */
-uint32_t
-ReallySimpleHash(char *path, int len)
-{
- uint32_t hash = 0;
- for (; len > 0; len--)
- hash ^= (char)path[len];
-
- return hash;
-}
-
/*
This is apparently the "fastest hash function for strings".
Written by Paul Hsieh <http://www.azillionmonkeys.com/qed/hash.html>
diff --git a/libglusterfs/src/inode.c b/libglusterfs/src/inode.c
index d143179edc7..3a1f097e1af 100644
--- a/libglusterfs/src/inode.c
+++ b/libglusterfs/src/inode.c
@@ -15,7 +15,6 @@
#include <sys/types.h>
#include <stdint.h>
#include "glusterfs/list.h"
-#include <time.h>
#include <assert.h>
#include "glusterfs/libglusterfs-messages.h"
diff --git a/libglusterfs/src/latency.c b/libglusterfs/src/latency.c
index e1e6de7d1ce..06a973e0e7c 100644
--- a/libglusterfs/src/latency.c
+++ b/libglusterfs/src/latency.c
@@ -14,10 +14,7 @@
*/
#include "glusterfs/glusterfs.h"
-#include "glusterfs/xlator.h"
-#include "glusterfs/common-utils.h"
#include "glusterfs/statedump.h"
-#include "glusterfs/libglusterfs-messages.h"
void
gf_update_latency(call_frame_t *frame)
diff --git a/libglusterfs/src/logging.c b/libglusterfs/src/logging.c
index 32d98e932e6..0134d237cb4 100644
--- a/libglusterfs/src/logging.c
+++ b/libglusterfs/src/logging.c
@@ -38,9 +38,7 @@
#define GF_LOG_TIMESTR_SIZE 256
#define GF_MAX_SLOG_PAIR_COUNT 100
-#include "glusterfs/xlator.h"
#include "glusterfs/logging.h"
-#include "glusterfs/defaults.h"
#include "glusterfs/glusterfs.h"
#include "glusterfs/timer.h"
#include "glusterfs/libglusterfs-messages.h"
diff --git a/libglusterfs/src/mem-pool.c b/libglusterfs/src/mem-pool.c
index df167b6650d..b4bd350b738 100644
--- a/libglusterfs/src/mem-pool.c
+++ b/libglusterfs/src/mem-pool.c
@@ -9,8 +9,8 @@
*/
#include "glusterfs/mem-pool.h"
-#include "glusterfs/logging.h"
-#include "glusterfs/xlator.h"
+#include "glusterfs/common-utils.h" // for GF_ASSERT, gf_thread_cr...
+#include "glusterfs/globals.h" // for xlator_t, THIS
#include <stdlib.h>
#include <stdarg.h>
diff --git a/libglusterfs/src/parse-utils.c b/libglusterfs/src/parse-utils.c
index 0ec331ad4b3..4531d5f0170 100644
--- a/libglusterfs/src/parse-utils.c
+++ b/libglusterfs/src/parse-utils.c
@@ -14,8 +14,6 @@
#include <regex.h>
#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
#include "glusterfs/parse-utils.h"
#include "glusterfs/mem-pool.h"
diff --git a/libglusterfs/src/statedump.c b/libglusterfs/src/statedump.c
index 7426b91a156..5e0f04f3217 100644
--- a/libglusterfs/src/statedump.c
+++ b/libglusterfs/src/statedump.c
@@ -11,10 +11,8 @@
#include <stdarg.h>
#include "glusterfs/glusterfs.h"
#include "glusterfs/logging.h"
-#include "glusterfs/iobuf.h"
#include "glusterfs/statedump.h"
#include "glusterfs/stack.h"
-#include "glusterfs/common-utils.h"
#include "glusterfs/syscall.h"
#ifdef HAVE_MALLOC_H
diff --git a/libglusterfs/src/store.c b/libglusterfs/src/store.c
index 0416a86d540..06ef75e3d35 100644
--- a/libglusterfs/src/store.c
+++ b/libglusterfs/src/store.c
@@ -13,7 +13,6 @@
#include "glusterfs/glusterfs.h"
#include "glusterfs/store.h"
-#include "glusterfs/dict.h"
#include "glusterfs/xlator.h"
#include "glusterfs/syscall.h"
#include "glusterfs/libglusterfs-messages.h"
diff --git a/libglusterfs/src/timespec.c b/libglusterfs/src/timespec.c
index c01527f009a..1b7cff37eb6 100644
--- a/libglusterfs/src/timespec.c
+++ b/libglusterfs/src/timespec.c
@@ -19,7 +19,6 @@
static mach_timebase_info_data_t gf_timebase;
#endif
-#include "glusterfs/logging.h"
#include "glusterfs/timespec.h"
#include "glusterfs/libglusterfs-messages.h"
#include "glusterfs/common-utils.h"
diff --git a/libglusterfs/src/trie.c b/libglusterfs/src/trie.c
index 86c6f5511de..809550b864c 100644
--- a/libglusterfs/src/trie.c
+++ b/libglusterfs/src/trie.c
@@ -10,8 +10,6 @@
#include <stdio.h>
#include <string.h>
-#include <stdlib.h>
-#include <ctype.h>
#include "glusterfs/common-utils.h"
#include "glusterfs/trie.h"
diff --git a/rpc/rpc-lib/src/auth-glusterfs.c b/rpc/rpc-lib/src/auth-glusterfs.c
index fe5fe030767..69a96f7512f 100644
--- a/rpc/rpc-lib/src/auth-glusterfs.c
+++ b/rpc/rpc-lib/src/auth-glusterfs.c
@@ -9,7 +9,6 @@
*/
#include "rpcsvc.h"
-#include <glusterfs/list.h>
#include <glusterfs/dict.h>
#include "xdr-rpc.h"
#include "xdr-common.h"
diff --git a/rpc/rpc-lib/src/auth-null.c b/rpc/rpc-lib/src/auth-null.c
index 820a2c03953..6d059b9da50 100644
--- a/rpc/rpc-lib/src/auth-null.c
+++ b/rpc/rpc-lib/src/auth-null.c
@@ -9,7 +9,6 @@
*/
#include "rpcsvc.h"
-#include <glusterfs/list.h>
#include <glusterfs/dict.h>
int
diff --git a/rpc/rpc-lib/src/auth-unix.c b/rpc/rpc-lib/src/auth-unix.c
index cacb1ff8008..61d475a5e84 100644
--- a/rpc/rpc-lib/src/auth-unix.c
+++ b/rpc/rpc-lib/src/auth-unix.c
@@ -9,7 +9,6 @@
*/
#include "rpcsvc.h"
-#include <glusterfs/list.h>
#include <glusterfs/dict.h>
#include "xdr-rpc.h"
diff --git a/rpc/rpc-lib/src/mgmt-pmap.c b/rpc/rpc-lib/src/mgmt-pmap.c
index 15f2b61cd05..25a7148e5a3 100644
--- a/rpc/rpc-lib/src/mgmt-pmap.c
+++ b/rpc/rpc-lib/src/mgmt-pmap.c
@@ -12,7 +12,6 @@
#include "protocol-common.h"
#include "rpc-clnt.h"
#include "xdr-generic.h"
-#include <glusterfs/xlator.h>
/* Defining a minimal RPC client program for portmap signout
*/
diff --git a/rpc/rpc-lib/src/rpc-clnt-ping.h b/rpc/rpc-lib/src/rpc-clnt-ping.h
index fcbac6f9e21..e5466a828c2 100644
--- a/rpc/rpc-lib/src/rpc-clnt-ping.h
+++ b/rpc/rpc-lib/src/rpc-clnt-ping.h
@@ -8,6 +8,7 @@
cases as published by the Free Software Foundation.
*/
+struct rpc_clnt;
#define RPC_DEFAULT_PING_TIMEOUT 30
void
rpc_clnt_check_and_start_ping(struct rpc_clnt *rpc_ptr);
diff --git a/rpc/rpc-lib/src/rpc-drc.c b/rpc/rpc-lib/src/rpc-drc.c
index bd8695c5ccf..d083db24fc5 100644
--- a/rpc/rpc-lib/src/rpc-drc.c
+++ b/rpc/rpc-lib/src/rpc-drc.c
@@ -13,8 +13,6 @@
#include "rpc-drc.h"
#endif
#include <glusterfs/locking.h>
-#include <glusterfs/hashfn.h>
-#include <glusterfs/common-utils.h>
#include <glusterfs/statedump.h>
#include <glusterfs/mem-pool.h>
diff --git a/rpc/rpc-lib/src/rpc-transport.c b/rpc/rpc-lib/src/rpc-transport.c
index baa8593f6c6..2b648717635 100644
--- a/rpc/rpc-lib/src/rpc-transport.c
+++ b/rpc/rpc-lib/src/rpc-transport.c
@@ -18,10 +18,6 @@
#include <glusterfs/logging.h>
#include "rpc-transport.h"
#include <glusterfs/glusterfs.h>
-/* FIXME: xlator.h is needed for volume_option_t, need to define the datatype
- * in some other header
- */
-#include <glusterfs/xlator.h>
#include <glusterfs/list.h>
#ifndef GF_OPTION_LIST_EMPTY
diff --git a/rpc/rpc-lib/src/rpcsvc-auth.c b/rpc/rpc-lib/src/rpcsvc-auth.c
index 18e6a133ebe..8e76b4188bb 100644
--- a/rpc/rpc-lib/src/rpcsvc-auth.c
+++ b/rpc/rpc-lib/src/rpcsvc-auth.c
@@ -9,7 +9,6 @@
*/
#include "rpcsvc.h"
-#include <glusterfs/logging.h>
#include <glusterfs/dict.h>
extern rpcsvc_auth_t *
diff --git a/rpc/rpc-lib/src/rpcsvc-common.h b/rpc/rpc-lib/src/rpcsvc-common.h
index d19b2d3f34c..734601eef0b 100644
--- a/rpc/rpc-lib/src/rpcsvc-common.h
+++ b/rpc/rpc-lib/src/rpcsvc-common.h
@@ -12,11 +12,8 @@
#define _RPCSVC_COMMON_H
#include <pthread.h>
-#include <glusterfs/list.h>
#include <glusterfs/compat.h>
-#include <glusterfs/glusterfs.h>
#include <glusterfs/dict.h>
-#include <glusterfs/xlator.h>
typedef enum {
RPCSVC_EVENT_ACCEPT,
diff --git a/rpc/rpc-lib/src/rpcsvc.c b/rpc/rpc-lib/src/rpcsvc.c
index cd5ca65cec3..5639abbb204 100644
--- a/rpc/rpc-lib/src/rpcsvc.c
+++ b/rpc/rpc-lib/src/rpcsvc.c
@@ -11,14 +11,10 @@
#include "rpcsvc.h"
#include "rpc-transport.h"
#include <glusterfs/dict.h>
-#include <glusterfs/logging.h>
#include <glusterfs/byte-order.h>
-#include <glusterfs/common-utils.h>
#include <glusterfs/compat-errno.h>
-#include <glusterfs/list.h>
#include "xdr-rpc.h"
#include <glusterfs/iobuf.h>
-#include <glusterfs/globals.h>
#include "xdr-common.h"
#include "xdr-generic.h"
#include "rpc-common-xdr.h"
diff --git a/rpc/rpc-lib/src/rpcsvc.h b/rpc/rpc-lib/src/rpcsvc.h
index a51edc73698..d9052392d47 100644
--- a/rpc/rpc-lib/src/rpcsvc.h
+++ b/rpc/rpc-lib/src/rpcsvc.h
@@ -13,14 +13,8 @@
#include <glusterfs/gf-event.h>
#include "rpc-transport.h"
-#include <glusterfs/logging.h>
#include <glusterfs/dict.h>
-#include <glusterfs/mem-pool.h>
-#include <glusterfs/list.h>
-#include <glusterfs/iobuf.h>
#include "xdr-rpc.h"
-#include <glusterfs/glusterfs.h>
-#include <glusterfs/xlator.h>
#include "rpcsvc-common.h"
#include <pthread.h>
diff --git a/rpc/rpc-lib/src/xdr-rpc.c b/rpc/rpc-lib/src/xdr-rpc.c
index 2cf39a8bdfc..4992dc5a7ce 100644
--- a/rpc/rpc-lib/src/xdr-rpc.c
+++ b/rpc/rpc-lib/src/xdr-rpc.c
@@ -9,16 +9,12 @@
*/
#include <rpc/rpc.h>
-#include <rpc/pmap_clnt.h>
-#include <arpa/inet.h>
#include <rpc/xdr.h>
#include <sys/uio.h>
#include <rpc/auth_unix.h>
-#include <glusterfs/mem-pool.h>
#include "xdr-rpc.h"
#include "xdr-common.h"
-#include <glusterfs/logging.h>
#include <glusterfs/common-utils.h>
/* Decodes the XDR format in msgbuf into rpc_msg.
diff --git a/rpc/rpc-lib/src/xdr-rpc.h b/rpc/rpc-lib/src/xdr-rpc.h
index a57cd9430be..7baed273846 100644
--- a/rpc/rpc-lib/src/xdr-rpc.h
+++ b/rpc/rpc-lib/src/xdr-rpc.h
@@ -20,7 +20,6 @@
#include <rpc/auth_sys.h>
#endif
-//#include <rpc/pmap_clnt.h>
#include <arpa/inet.h>
#include <rpc/xdr.h>
#include <sys/uio.h>
diff --git a/rpc/rpc-lib/src/xdr-rpcclnt.c b/rpc/rpc-lib/src/xdr-rpcclnt.c
index 8175cd00c3a..8dcdcfeda83 100644
--- a/rpc/rpc-lib/src/xdr-rpcclnt.c
+++ b/rpc/rpc-lib/src/xdr-rpcclnt.c
@@ -9,17 +9,13 @@
*/
#include <rpc/rpc.h>
-#include <rpc/pmap_clnt.h>
-#include <arpa/inet.h>
#include <rpc/xdr.h>
#include <sys/uio.h>
#include <rpc/auth_unix.h>
#include <errno.h>
-#include <glusterfs/mem-pool.h>
#include "xdr-rpc.h"
#include "xdr-common.h"
-#include <glusterfs/logging.h>
#include <glusterfs/common-utils.h>
/* Decodes the XDR format in msgbuf into rpc_msg.
diff --git a/rpc/rpc-lib/src/xdr-rpcclnt.h b/rpc/rpc-lib/src/xdr-rpcclnt.h
index 4d6e38d429c..58eda4892a9 100644
--- a/rpc/rpc-lib/src/xdr-rpcclnt.h
+++ b/rpc/rpc-lib/src/xdr-rpcclnt.h
@@ -11,8 +11,6 @@
#ifndef _XDR_RPCCLNT_H
#define _XDR_RPCCLNT_H
-//#include <rpc/rpc.h>
-//#include <rpc/pmap_clnt.h>
#include <arpa/inet.h>
#include <rpc/xdr.h>
#include <sys/uio.h>
diff --git a/rpc/rpc-transport/socket/src/socket.c b/rpc/rpc-transport/socket/src/socket.c
index 48f6116c458..4af8022f71d 100644
--- a/rpc/rpc-transport/socket/src/socket.c
+++ b/rpc/rpc-transport/socket/src/socket.c
@@ -12,20 +12,15 @@
#include "name.h"
#include <glusterfs/dict.h>
#include "rpc-transport.h"
-#include <glusterfs/logging.h>
-#include <glusterfs/xlator.h>
#include <glusterfs/syscall.h>
#include <glusterfs/byte-order.h>
-#include <glusterfs/common-utils.h>
#include <glusterfs/compat-errno.h>
#include "socket-mem-types.h"
-#include <glusterfs/timer.h>
/* ugly #includes below */
#include "protocol-common.h"
#include "glusterfs3-xdr.h"
#include "glusterfs4-xdr.h"
-#include "xdr-nfs3.h"
#include "rpcsvc.h"
/* for TCP_USER_TIMEOUT */
diff --git a/rpc/rpc-transport/socket/src/socket.h b/rpc/rpc-transport/socket/src/socket.h
index e7c00909192..44a727cc4a1 100644
--- a/rpc/rpc-transport/socket/src/socket.h
+++ b/rpc/rpc-transport/socket/src/socket.h
@@ -22,12 +22,7 @@
#include <openssl/ecdh.h>
#endif
-#include <glusterfs/gf-event.h>
#include "rpc-transport.h"
-#include <glusterfs/logging.h>
-#include <glusterfs/dict.h>
-#include <glusterfs/mem-pool.h>
-#include <glusterfs/globals.h>
#include <glusterfs/refcount.h>
#ifndef MAX_IOVEC
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c
index 27ee9d5f16b..96f13ce2cee 100644
--- a/xlators/cluster/afr/src/afr-common.c
+++ b/xlators/cluster/afr/src/afr-common.c
@@ -18,9 +18,7 @@
#include <glusterfs/glusterfs.h>
#include "afr.h"
#include <glusterfs/dict.h>
-#include <glusterfs/xlator.h>
#include <glusterfs/hashfn.h>
-#include <glusterfs/logging.h>
#include <glusterfs/list.h>
#include <glusterfs/call-stub.h>
#include <glusterfs/defaults.h>
diff --git a/xlators/cluster/afr/src/afr-dir-read.c b/xlators/cluster/afr/src/afr-dir-read.c
index e7ba4a5ddcc..f9fd48893ff 100644
--- a/xlators/cluster/afr/src/afr-dir-read.c
+++ b/xlators/cluster/afr/src/afr-dir-read.c
@@ -10,7 +10,6 @@
#include <libgen.h>
#include <unistd.h>
-#include <fnmatch.h>
#include <sys/time.h>
#include <stdlib.h>
#include <signal.h>
@@ -18,16 +17,10 @@
#include <glusterfs/glusterfs.h>
#include <glusterfs/dict.h>
-#include <glusterfs/xlator.h>
-#include <glusterfs/hashfn.h>
-#include <glusterfs/logging.h>
#include <glusterfs/list.h>
-#include <glusterfs/call-stub.h>
-#include <glusterfs/defaults.h>
#include <glusterfs/common-utils.h>
#include <glusterfs/compat-errno.h>
#include <glusterfs/compat.h>
-#include <glusterfs/checksum.h>
#include "afr.h"
#include "afr-transaction.h"
diff --git a/xlators/cluster/afr/src/afr-dir-write.c b/xlators/cluster/afr/src/afr-dir-write.c
index 84e2a344624..82a72fddd67 100644
--- a/xlators/cluster/afr/src/afr-dir-write.c
+++ b/xlators/cluster/afr/src/afr-dir-write.c
@@ -10,7 +10,6 @@
#include <libgen.h>
#include <unistd.h>
-#include <fnmatch.h>
#include <sys/time.h>
#include <stdlib.h>
#include <signal.h>
@@ -18,11 +17,8 @@
#include <glusterfs/glusterfs.h>
#include "afr.h"
#include <glusterfs/dict.h>
-#include <glusterfs/xlator.h>
-#include <glusterfs/hashfn.h>
#include <glusterfs/logging.h>
#include <glusterfs/list.h>
-#include <glusterfs/call-stub.h>
#include <glusterfs/defaults.h>
#include <glusterfs/common-utils.h>
#include <glusterfs/compat-errno.h>
diff --git a/xlators/cluster/afr/src/afr-inode-read.c b/xlators/cluster/afr/src/afr-inode-read.c
index 523a5b48880..9204add5b15 100644
--- a/xlators/cluster/afr/src/afr-inode-read.c
+++ b/xlators/cluster/afr/src/afr-inode-read.c
@@ -18,11 +18,8 @@
#include <glusterfs/glusterfs.h>
#include "afr.h"
#include <glusterfs/dict.h>
-#include <glusterfs/xlator.h>
-#include <glusterfs/hashfn.h>
#include <glusterfs/logging.h>
#include <glusterfs/list.h>
-#include <glusterfs/call-stub.h>
#include <glusterfs/byte-order.h>
#include <glusterfs/defaults.h>
#include <glusterfs/common-utils.h>
diff --git a/xlators/cluster/afr/src/afr-inode-write.c b/xlators/cluster/afr/src/afr-inode-write.c
index 7b16c5b0afb..8e9de3e12a6 100644
--- a/xlators/cluster/afr/src/afr-inode-write.c
+++ b/xlators/cluster/afr/src/afr-inode-write.c
@@ -8,9 +8,7 @@
cases as published by the Free Software Foundation.
*/
-#include <libgen.h>
#include <unistd.h>
-#include <fnmatch.h>
#include <sys/time.h>
#include <stdlib.h>
#include <signal.h>
@@ -18,11 +16,7 @@
#include <glusterfs/glusterfs.h>
#include "afr.h"
#include <glusterfs/dict.h>
-#include <glusterfs/xlator.h>
-#include <glusterfs/hashfn.h>
#include <glusterfs/logging.h>
-#include <glusterfs/list.h>
-#include <glusterfs/call-stub.h>
#include <glusterfs/defaults.h>
#include <glusterfs/common-utils.h>
#include <glusterfs/compat-errno.h>
diff --git a/xlators/cluster/afr/src/afr-open.c b/xlators/cluster/afr/src/afr-open.c
index dd568160521..1747a079fa6 100644
--- a/xlators/cluster/afr/src/afr-open.c
+++ b/xlators/cluster/afr/src/afr-open.c
@@ -8,9 +8,7 @@
cases as published by the Free Software Foundation.
*/
-#include <libgen.h>
#include <unistd.h>
-#include <fnmatch.h>
#include <sys/time.h>
#include <stdlib.h>
#include <signal.h>
@@ -18,11 +16,7 @@
#include <glusterfs/glusterfs.h>
#include "afr.h"
#include <glusterfs/dict.h>
-#include <glusterfs/xlator.h>
-#include <glusterfs/hashfn.h>
#include <glusterfs/logging.h>
-#include <glusterfs/list.h>
-#include <glusterfs/call-stub.h>
#include <glusterfs/defaults.h>
#include <glusterfs/common-utils.h>
#include <glusterfs/compat-errno.h>
@@ -30,10 +24,6 @@
#include <glusterfs/byte-order.h>
#include <glusterfs/statedump.h>
-#include "afr-inode-read.h"
-#include "afr-inode-write.h"
-#include "afr-dir-read.h"
-#include "afr-dir-write.h"
#include "afr-transaction.h"
gf_boolean_t
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 <glusterfs/glusterfs.h>
-#include <glusterfs/xlator.h>
#include "libxlator.h"
#include "dht-common.h"
#include "dht-lock.h"
-#include <glusterfs/defaults.h>
#include <glusterfs/byte-order.h>
#include <glusterfs/quota-common-utils.h>
#include <glusterfs/upcall-utils.h>
+#include "glusterfs/compat-errno.h" // for ENODATA on BSD
#include <sys/time.h>
#include <libgen.h>
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 <regex.h>
-#include <signal.h>
-#include <fnmatch.h>
#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 <glusterfs/glusterfs.h>
-#include <glusterfs/xlator.h>
#include "dht-common.h"
-#include "dht-messages.h"
-#include <glusterfs/defaults.h>
#include <sys/time.h>
#include <glusterfs/events.h>
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 <glusterfs/glusterfs.h>
-#include <glusterfs/xlator.h>
#include "dht-common.h"
#include <glusterfs/hashfn.h>
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 <glusterfs/glusterfs.h>
-#include <glusterfs/xlator.h>
#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 <glusterfs/glusterfs.h>
-#include <glusterfs/xlator.h>
#include "dht-common.h"
#include <glusterfs/byte-order.h>
-#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 <glusterfs/glusterfs.h>
-#include <glusterfs/xlator.h>
#include <glusterfs/compat.h>
#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 <glusterfs/xlator.h>
#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 <glusterfs/xlator.h>
#include <glusterfs/syscall.h>
-#include <signal.h>
#include <fnmatch.h>
#include <signal.h>
#include <glusterfs/events.h>
+#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 <glusterfs/glusterfs.h>
-#include <glusterfs/xlator.h>
#include "dht-common.h"
#include "dht-lock.h"
#include <glusterfs/defaults.h>
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 <glusterfs/glusterfs.h>
-#include <glusterfs/xlator.h>
#include "dht-common.h"
-#include "dht-messages.h"
#include "dht-lock.h"
#include <glusterfs/glusterfs-acl.h>
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 <glusterfs/statedump.h>
#include "dht-common.h"
struct xlator_fops dht_pt_fops = {
diff --git a/xlators/cluster/ec/src/ec-common.h b/xlators/cluster/ec/src/ec-common.h
index bf6c97d6aff..7296091fc90 100644
--- a/xlators/cluster/ec/src/ec-common.h
+++ b/xlators/cluster/ec/src/ec-common.h
@@ -11,8 +11,7 @@
#ifndef __EC_COMMON_H__
#define __EC_COMMON_H__
-#include <glusterfs/xlator.h>
-
+#include "glusterfs/compat-errno.h" // for ENODATA on BSD
#include "ec-data.h"
typedef enum { EC_DATA_TXN, EC_METADATA_TXN } ec_txn_t;
diff --git a/xlators/cluster/ec/src/ec-data.c b/xlators/cluster/ec/src/ec-data.c
index 8d2d9a1dfa2..06388833546 100644
--- a/xlators/cluster/ec/src/ec-data.c
+++ b/xlators/cluster/ec/src/ec-data.c
@@ -8,7 +8,6 @@
cases as published by the Free Software Foundation.
*/
-#include "ec-mem-types.h"
#include "ec-helpers.h"
#include "ec-common.h"
#include "ec-data.h"
diff --git a/xlators/cluster/ec/src/ec-dir-read.c b/xlators/cluster/ec/src/ec-dir-read.c
index 8310d4a1a8c..c3c6b89dba7 100644
--- a/xlators/cluster/ec/src/ec-dir-read.c
+++ b/xlators/cluster/ec/src/ec-dir-read.c
@@ -8,15 +8,11 @@
cases as published by the Free Software Foundation.
*/
-#include <glusterfs/xlator.h>
-#include <glusterfs/defaults.h>
-
#include "ec.h"
#include "ec-messages.h"
#include "ec-helpers.h"
#include "ec-common.h"
#include "ec-combine.h"
-#include "ec-method.h"
#include "ec-fops.h"
/****************************************************************
diff --git a/xlators/cluster/ec/src/ec-dir-write.c b/xlators/cluster/ec/src/ec-dir-write.c
index 0b8ee219f87..bd2544af862 100644
--- a/xlators/cluster/ec/src/ec-dir-write.c
+++ b/xlators/cluster/ec/src/ec-dir-write.c
@@ -8,9 +8,6 @@
cases as published by the Free Software Foundation.
*/
-#include <glusterfs/xlator.h>
-#include <glusterfs/defaults.h>
-
#include "ec.h"
#include "ec-messages.h"
#include "ec-helpers.h"
diff --git a/xlators/cluster/ec/src/ec-galois.c b/xlators/cluster/ec/src/ec-galois.c
index ee7662f52ce..6e4990c71f5 100644
--- a/xlators/cluster/ec/src/ec-galois.c
+++ b/xlators/cluster/ec/src/ec-galois.c
@@ -10,9 +10,6 @@
#include <string.h>
-#include <glusterfs/mem-pool.h>
-#include <glusterfs/list.h>
-
#include "ec-mem-types.h"
#include "ec-gf8.h"
#include "ec-helpers.h"
diff --git a/xlators/cluster/ec/src/ec-generic.c b/xlators/cluster/ec/src/ec-generic.c
index acc16b5d80f..6e7bd4bc7b2 100644
--- a/xlators/cluster/ec/src/ec-generic.c
+++ b/xlators/cluster/ec/src/ec-generic.c
@@ -8,8 +8,6 @@
cases as published by the Free Software Foundation.
*/
-#include <glusterfs/xlator.h>
-#include <glusterfs/defaults.h>
#include <glusterfs/byte-order.h>
#include "ec.h"
@@ -17,7 +15,6 @@
#include "ec-helpers.h"
#include "ec-common.h"
#include "ec-combine.h"
-#include "ec-method.h"
#include "ec-fops.h"
/* FOP: flush */
diff --git a/xlators/cluster/ec/src/ec-heal.c b/xlators/cluster/ec/src/ec-heal.c
index 237fea22356..b9fb8686a6d 100644
--- a/xlators/cluster/ec/src/ec-heal.c
+++ b/xlators/cluster/ec/src/ec-heal.c
@@ -8,7 +8,6 @@
cases as published by the Free Software Foundation.
*/
-#include <glusterfs/xlator.h>
#include <glusterfs/defaults.h>
#include <glusterfs/compat-errno.h>
#include <glusterfs/byte-order.h>
@@ -17,7 +16,6 @@
#include <glusterfs/cluster-syncop.h>
#include "ec.h"
-#include "ec-mem-types.h"
#include "ec-types.h"
#include "ec-messages.h"
#include "ec-helpers.h"
diff --git a/xlators/cluster/ec/src/ec-heald.c b/xlators/cluster/ec/src/ec-heald.c
index 5948a588be1..956e73c2088 100644
--- a/xlators/cluster/ec/src/ec-heald.c
+++ b/xlators/cluster/ec/src/ec-heald.c
@@ -8,7 +8,6 @@
cases as published by the Free Software Foundation.
*/
-#include <glusterfs/xlator.h>
#include <glusterfs/defaults.h>
#include <glusterfs/compat-errno.h>
#include "ec.h"
diff --git a/xlators/cluster/ec/src/ec-heald.h b/xlators/cluster/ec/src/ec-heald.h
index 8184cf4147c..6c7da4edc10 100644
--- a/xlators/cluster/ec/src/ec-heald.h
+++ b/xlators/cluster/ec/src/ec-heald.h
@@ -11,9 +11,9 @@
#ifndef __EC_HEALD_H__
#define __EC_HEALD_H__
-#include <glusterfs/xlator.h>
-
-#include "ec-types.h"
+#include "ec-types.h" // for ec_t
+#include "glusterfs/dict.h" // for dict_t
+#include "glusterfs/globals.h" // for xlator_t
int
ec_xl_op(xlator_t *this, dict_t *input, dict_t *output);
diff --git a/xlators/cluster/ec/src/ec-inode-read.c b/xlators/cluster/ec/src/ec-inode-read.c
index f87a94a1cf7..602c47d3673 100644
--- a/xlators/cluster/ec/src/ec-inode-read.c
+++ b/xlators/cluster/ec/src/ec-inode-read.c
@@ -8,9 +8,6 @@
cases as published by the Free Software Foundation.
*/
-#include <glusterfs/xlator.h>
-#include <glusterfs/defaults.h>
-
#include "ec.h"
#include "ec-messages.h"
#include "ec-helpers.h"
diff --git a/xlators/cluster/ec/src/ec-inode-write.c b/xlators/cluster/ec/src/ec-inode-write.c
index ea5514065ea..46f18c8807c 100644
--- a/xlators/cluster/ec/src/ec-inode-write.c
+++ b/xlators/cluster/ec/src/ec-inode-write.c
@@ -8,10 +8,6 @@
cases as published by the Free Software Foundation.
*/
-#include <glusterfs/xlator.h>
-#include <glusterfs/defaults.h>
-
-#include "ec.h"
#include "ec-messages.h"
#include "ec-helpers.h"
#include "ec-common.h"
diff --git a/xlators/cluster/ec/src/ec-locks.c b/xlators/cluster/ec/src/ec-locks.c
index ffcac074c4d..8e84977d2b3 100644
--- a/xlators/cluster/ec/src/ec-locks.c
+++ b/xlators/cluster/ec/src/ec-locks.c
@@ -8,13 +8,9 @@
cases as published by the Free Software Foundation.
*/
-#include <glusterfs/xlator.h>
-#include <glusterfs/defaults.h>
-
#include "ec-helpers.h"
#include "ec-common.h"
#include "ec-combine.h"
-#include "ec-method.h"
#include "ec-fops.h"
#include "ec-messages.h"
diff --git a/xlators/cluster/ec/src/ec-method.h b/xlators/cluster/ec/src/ec-method.h
index 2489fc84226..f91233b2f88 100644
--- a/xlators/cluster/ec/src/ec-method.h
+++ b/xlators/cluster/ec/src/ec-method.h
@@ -11,8 +11,6 @@
#ifndef __EC_METHOD_H__
#define __EC_METHOD_H__
-#include <glusterfs/xlator.h>
-
#include "ec-types.h"
#include "ec-galois.h"
diff --git a/xlators/features/bit-rot/src/bitd/bit-rot.c b/xlators/features/bit-rot/src/bitd/bit-rot.c
index 49528eabf71..6d0c0b5cead 100644
--- a/xlators/features/bit-rot/src/bitd/bit-rot.c
+++ b/xlators/features/bit-rot/src/bitd/bit-rot.c
@@ -9,10 +9,7 @@
*/
#include <ctype.h>
-#include <sys/uio.h>
-#include <glusterfs/glusterfs.h>
-#include <glusterfs/xlator.h>
#include <glusterfs/logging.h>
#include <glusterfs/compat-errno.h>
diff --git a/xlators/features/bit-rot/src/stub/bit-rot-stub.c b/xlators/features/bit-rot/src/stub/bit-rot-stub.c
index c3f81bcbb7b..e6d64de99a9 100644
--- a/xlators/features/bit-rot/src/stub/bit-rot-stub.c
+++ b/xlators/features/bit-rot/src/stub/bit-rot-stub.c
@@ -13,7 +13,6 @@
#include <signal.h>
#include <glusterfs/glusterfs.h>
-#include <glusterfs/xlator.h>
#include <glusterfs/logging.h>
#include "changelog.h"
#include <glusterfs/compat-errno.h>
diff --git a/xlators/features/locks/src/common.c b/xlators/features/locks/src/common.c
index ad1ce6c604d..429ce32803e 100644
--- a/xlators/features/locks/src/common.c
+++ b/xlators/features/locks/src/common.c
@@ -14,9 +14,7 @@
#include <glusterfs/glusterfs.h>
#include <glusterfs/compat.h>
-#include <glusterfs/xlator.h>
#include <glusterfs/logging.h>
-#include <glusterfs/common-utils.h>
#include <glusterfs/syncop.h>
#include "locks.h"
diff --git a/xlators/features/locks/src/common.h b/xlators/features/locks/src/common.h
index 55603ef9c42..4006062606e 100644
--- a/xlators/features/locks/src/common.h
+++ b/xlators/features/locks/src/common.h
@@ -10,7 +10,6 @@
#ifndef __COMMON_H__
#define __COMMON_H__
-#include <glusterfs/lkowner.h>
/*dump locks format strings */
#define RANGE_FMT "type=%s, whence=%hd, start=%llu, len=%llu"
#define ENTRY_FMT "type=%s on basename=%s"
diff --git a/xlators/features/locks/src/inodelk.c b/xlators/features/locks/src/inodelk.c
index 95afc902ffa..cf556ea12a2 100644
--- a/xlators/features/locks/src/inodelk.c
+++ b/xlators/features/locks/src/inodelk.c
@@ -9,16 +9,14 @@
*/
#include <glusterfs/glusterfs.h>
#include <glusterfs/compat.h>
-#include <glusterfs/xlator.h>
+#include <glusterfs/dict.h>
#include <glusterfs/logging.h>
-#include <glusterfs/common-utils.h>
#include <glusterfs/list.h>
#include <glusterfs/upcall-utils.h>
#include "locks.h"
#include "clear.h"
#include "common.h"
-#include "pl-messages.h"
void
__delete_inode_lock(pl_inode_lock_t *lock)
diff --git a/xlators/features/locks/src/posix.c b/xlators/features/locks/src/posix.c
index d723d798804..c37752da945 100644
--- a/xlators/features/locks/src/posix.c
+++ b/xlators/features/locks/src/posix.c
@@ -12,11 +12,8 @@
#include <limits.h>
#include <pthread.h>
-#include <glusterfs/glusterfs.h>
#include <glusterfs/compat.h>
-#include <glusterfs/xlator.h>
#include <glusterfs/logging.h>
-#include <glusterfs/common-utils.h>
#include "locks.h"
#include "common.h"
@@ -24,7 +21,6 @@
#include "clear.h"
#include <glusterfs/defaults.h>
#include <glusterfs/syncop.h>
-#include "pl-messages.h"
#ifndef LLONG_MAX
#define LLONG_MAX LONG_LONG_MAX /* compat with old gcc */
diff --git a/xlators/features/namespace/src/namespace.c b/xlators/features/namespace/src/namespace.c
index 59045e8647b..86c5ebee900 100644
--- a/xlators/features/namespace/src/namespace.c
+++ b/xlators/features/namespace/src/namespace.c
@@ -16,7 +16,6 @@
#include <sys/types.h>
#include <glusterfs/defaults.h>
-#include <glusterfs/glusterfs.h>
#include <glusterfs/hashfn.h>
#include <glusterfs/logging.h>
#include "namespace.h"
diff --git a/xlators/features/quota/src/quota.c b/xlators/features/quota/src/quota.c
index c787028e7b3..c014c99cbd2 100644
--- a/xlators/features/quota/src/quota.c
+++ b/xlators/features/quota/src/quota.c
@@ -7,13 +7,9 @@
later), or the GNU General Public License, version 2 (GPLv2), in all
cases as published by the Free Software Foundation.
*/
-#include <fnmatch.h>
#include "quota.h"
-#include <glusterfs/common-utils.h>
-#include <glusterfs/defaults.h>
#include <glusterfs/statedump.h>
-#include <glusterfs/quota-common-utils.h>
#include "quota-messages.h"
#include <glusterfs/events.h>
diff --git a/xlators/features/quota/src/quota.h b/xlators/features/quota/src/quota.h
index a5a99cac090..00012c22f46 100644
--- a/xlators/features/quota/src/quota.h
+++ b/xlators/features/quota/src/quota.h
@@ -10,10 +10,7 @@
#ifndef _QUOTA_H
#define _QUOTA_H
-#include <glusterfs/xlator.h>
#include <glusterfs/call-stub.h>
-#include <glusterfs/defaults.h>
-#include <glusterfs/common-utils.h>
#include "quota-mem-types.h"
#include <glusterfs/glusterfs.h>
#include <glusterfs/compat.h>
diff --git a/xlators/features/quota/src/quotad.c b/xlators/features/quota/src/quotad.c
index 146ec749930..643f25c9c2a 100644
--- a/xlators/features/quota/src/quotad.c
+++ b/xlators/features/quota/src/quotad.c
@@ -9,7 +9,6 @@
*/
#include "quota.h"
#include "quotad-aggregator.h"
-#include <glusterfs/common-utils.h>
int
qd_notify(xlator_t *this, int32_t event, void *data, ...)
diff --git a/xlators/features/read-only/src/read-only.c b/xlators/features/read-only/src/read-only.c
index ac966633c34..48654998e63 100644
--- a/xlators/features/read-only/src/read-only.c
+++ b/xlators/features/read-only/src/read-only.c
@@ -7,7 +7,6 @@
later), or the GNU General Public License, version 2 (GPLv2), in all
cases as published by the Free Software Foundation.
*/
-#include <glusterfs/defaults.h>
#include "read-only-common.h"
#include "read-only-mem-types.h"
#include "read-only.h"
diff --git a/xlators/features/read-only/src/read-only.h b/xlators/features/read-only/src/read-only.h
index fc32f82f8c5..aced5d3c577 100644
--- a/xlators/features/read-only/src/read-only.h
+++ b/xlators/features/read-only/src/read-only.h
@@ -11,8 +11,9 @@
#ifndef __READONLY_H__
#define __READONLY_H__
-#include "read-only-mem-types.h"
-#include <glusterfs/xlator.h>
+#include <stdint.h> // for uint64_t, uint8_t
+#include <sys/time.h> // for time_t
+#include "glusterfs/glusterfs.h" // for gf_boolean_t
typedef struct {
uint8_t worm : 1;
diff --git a/xlators/features/snapview-server/src/snapview-server.h b/xlators/features/snapview-server/src/snapview-server.h
index 42f22404b68..6472422e715 100644
--- a/xlators/features/snapview-server/src/snapview-server.h
+++ b/xlators/features/snapview-server/src/snapview-server.h
@@ -19,10 +19,8 @@
#include <ctype.h>
#include <sys/uio.h>
#include <glusterfs/glusterfs.h>
-#include <glusterfs/xlator.h>
#include <glusterfs/logging.h>
#include "glfs.h"
-#include <glusterfs/common-utils.h>
#include "glfs-handles.h"
#include "glfs-internal.h"
#include "glusterfs3-xdr.h"
diff --git a/xlators/lib/src/libxlator.c b/xlators/lib/src/libxlator.c
index 724ceef5f2a..8075fa0c29f 100644
--- a/xlators/lib/src/libxlator.c
+++ b/xlators/lib/src/libxlator.c
@@ -7,7 +7,7 @@
later), or the GNU General Public License, version 2 (GPLv2), in all
cases as published by the Free Software Foundation.
*/
-#include <glusterfs/mem-types.h>
+
#include "libxlator.h"
int marker_xtime_default_gauge[] = {
diff --git a/xlators/lib/src/libxlator.h b/xlators/lib/src/libxlator.h
index d17a1e21891..81da4060d55 100644
--- a/xlators/lib/src/libxlator.h
+++ b/xlators/lib/src/libxlator.h
@@ -10,10 +10,12 @@
#ifndef _LIBXLATOR_H
#define _LIBXLATOR_H
-#include <glusterfs/xlator.h>
-#include <glusterfs/logging.h>
#include <glusterfs/defaults.h>
-#include <glusterfs/common-utils.h>
+
+#include <stdint.h> // for int32_t
+#include "glusterfs/dict.h" // for dict_t, data_t
+#include "glusterfs/globals.h" // for xlator_t, loc_t
+#include "glusterfs/stack.h" // for call_frame_t
#include <glusterfs/compat.h>
#include <glusterfs/compat-errno.h>
diff --git a/xlators/mgmt/glusterd/src/glusterd-sm.h b/xlators/mgmt/glusterd/src/glusterd-sm.h
index ce008ac8dfa..11cbd85b3e3 100644
--- a/xlators/mgmt/glusterd/src/glusterd-sm.h
+++ b/xlators/mgmt/glusterd/src/glusterd-sm.h
@@ -15,11 +15,8 @@
#include "rpc-clnt.h"
#include <glusterfs/glusterfs.h>
-#include <glusterfs/xlator.h>
-#include <glusterfs/logging.h>
#include <glusterfs/call-stub.h>
#include <glusterfs/byte-order.h>
-//#include "glusterd.h"
#include "rpcsvc.h"
#include <glusterfs/store.h>
diff --git a/xlators/performance/io-cache/src/io-cache.h b/xlators/performance/io-cache/src/io-cache.h
index e99dfa455a2..4303c2fae13 100644
--- a/xlators/performance/io-cache/src/io-cache.h
+++ b/xlators/performance/io-cache/src/io-cache.h
@@ -15,13 +15,9 @@
#include <glusterfs/compat-errno.h>
#include <glusterfs/glusterfs.h>
-#include <glusterfs/logging.h>
#include <glusterfs/dict.h>
-#include <glusterfs/xlator.h>
-#include <glusterfs/common-utils.h>
#include <glusterfs/call-stub.h>
#include <glusterfs/rbthash.h>
-#include <glusterfs/hashfn.h>
#include <sys/time.h>
#include <fnmatch.h>
#include "io-cache-messages.h"
diff --git a/xlators/storage/posix/src/posix-aio.c b/xlators/storage/posix/src/posix-aio.c
index 971ace94754..d0cb0002bbf 100644
--- a/xlators/storage/posix/src/posix-aio.c
+++ b/xlators/storage/posix/src/posix-aio.c
@@ -7,8 +7,6 @@
later), or the GNU General Public License, version 2 (GPLv2), in all
cases as published by the Free Software Foundation.
*/
-#include <glusterfs/xlator.h>
-#include <glusterfs/glusterfs.h>
#include "posix.h"
#include <sys/uio.h>
#include "posix-messages.h"
diff --git a/xlators/storage/posix/src/posix-aio.h b/xlators/storage/posix/src/posix-aio.h
index d2589bffc07..b316deb3229 100644
--- a/xlators/storage/posix/src/posix-aio.h
+++ b/xlators/storage/posix/src/posix-aio.h
@@ -10,9 +10,6 @@
#ifndef _POSIX_AIO_H
#define _POSIX_AIO_H
-#include <glusterfs/xlator.h>
-#include <glusterfs/glusterfs.h>
-
// Maximum number of concurrently submitted IO events. The heaviest load
// GlusterFS has been able to handle had 60-80 concurrent calls
#define POSIX_AIO_MAX_NR_EVENTS 256
diff --git a/xlators/storage/posix/src/posix-common.c b/xlators/storage/posix/src/posix-common.c
index 31dc9495af1..a2b94256e3f 100644
--- a/xlators/storage/posix/src/posix-common.c
+++ b/xlators/storage/posix/src/posix-common.c
@@ -36,15 +36,7 @@
#include <fcntl.h>
#endif /* HAVE_LINKAT */
-#include <glusterfs/glusterfs.h>
-#include <glusterfs/checksum.h>
-#include <glusterfs/dict.h>
-#include <glusterfs/logging.h>
-#include "posix.h"
#include "posix-inode-handle.h"
-#include <glusterfs/xlator.h>
-#include <glusterfs/defaults.h>
-#include <glusterfs/common-utils.h>
#include <glusterfs/compat-errno.h>
#include <glusterfs/compat.h>
#include <glusterfs/byte-order.h>
@@ -53,7 +45,6 @@
#include <glusterfs/locking.h>
#include <glusterfs/timer.h>
#include "glusterfs3-xdr.h"
-#include <glusterfs/hashfn.h>
#include "posix-aio.h"
#include <glusterfs/glusterfs-acl.h>
#include "posix-messages.h"
diff --git a/xlators/storage/posix/src/posix-entry-ops.c b/xlators/storage/posix/src/posix-entry-ops.c
index 0b612dcc99c..aab88f0d20a 100644
--- a/xlators/storage/posix/src/posix-entry-ops.c
+++ b/xlators/storage/posix/src/posix-entry-ops.c
@@ -36,15 +36,10 @@
#include <fcntl.h>
#endif /* HAVE_LINKAT */
-#include <glusterfs/glusterfs.h>
-#include <glusterfs/checksum.h>
#include <glusterfs/dict.h>
#include <glusterfs/logging.h>
#include "posix.h"
#include "posix-handle.h"
-#include <glusterfs/xlator.h>
-#include <glusterfs/defaults.h>
-#include <glusterfs/common-utils.h>
#include <glusterfs/compat-errno.h>
#include <glusterfs/compat.h>
#include <glusterfs/byte-order.h>
@@ -53,7 +48,6 @@
#include <glusterfs/locking.h>
#include <glusterfs/timer.h>
#include "glusterfs3-xdr.h"
-#include <glusterfs/hashfn.h>
#include "posix-aio.h"
#include <glusterfs/glusterfs-acl.h>
#include "posix-messages.h"
diff --git a/xlators/storage/posix/src/posix-gfid-path.c b/xlators/storage/posix/src/posix-gfid-path.c
index 64b5c6c3f09..d7ba324a95f 100644
--- a/xlators/storage/posix/src/posix-gfid-path.c
+++ b/xlators/storage/posix/src/posix-gfid-path.c
@@ -8,8 +8,9 @@
cases as published by the Free Software Foundation.
*/
-#include <glusterfs/common-utils.h>
-#include <glusterfs/xlator.h>
+#include <stdint.h>
+
+#include <glusterfs/compat-errno.h>
#include <glusterfs/syscall.h>
#include <glusterfs/logging.h>
#include "posix-messages.h"
diff --git a/xlators/storage/posix/src/posix-gfid-path.h b/xlators/storage/posix/src/posix-gfid-path.h
index 323f11429a8..63b2a8c61fa 100644
--- a/xlators/storage/posix/src/posix-gfid-path.h
+++ b/xlators/storage/posix/src/posix-gfid-path.h
@@ -11,10 +11,13 @@
#ifndef _POSIX_GFID_PATH_H
#define _POSIX_GFID_PATH_H
-#include <glusterfs/xlator.h>
-#include <glusterfs/common-utils.h>
#include <glusterfs/compat-errno.h>
+#include <stdint.h> // for int32_t
+#include "glusterfs/dict.h" // for dict_t
+#include "glusterfs/glusterfs.h" // for gf_boolean_t
+#include "glusterfs/inode.h" // for inode_t
+#include "uuid.h" // for uuid_t
#define MAX_GFID2PATH_LINK_SUP 500
int32_t
diff --git a/xlators/storage/posix/src/posix-handle.c b/xlators/storage/posix/src/posix-handle.c
index dac55e17118..4764c47cbae 100644
--- a/xlators/storage/posix/src/posix-handle.c
+++ b/xlators/storage/posix/src/posix-handle.c
@@ -16,11 +16,8 @@
#include <alloca.h>
#endif
-#include <glusterfs/common-utils.h>
-
#include "posix-handle.h"
#include "posix.h"
-#include <glusterfs/xlator.h>
#include <glusterfs/syscall.h>
#include "posix-messages.h"
#include "posix-metadata.h"
diff --git a/xlators/storage/posix/src/posix-helpers.c b/xlators/storage/posix/src/posix-helpers.c
index bab79f42c2f..686b0becbc2 100644
--- a/xlators/storage/posix/src/posix-helpers.c
+++ b/xlators/storage/posix/src/posix-helpers.c
@@ -33,17 +33,10 @@
#endif /* GF_BSD_HOST_OS */
#include <fnmatch.h>
-#include <glusterfs/glusterfs.h>
-#include <glusterfs/checksum.h>
-#include <glusterfs/dict.h>
-#include <glusterfs/logging.h>
#include "posix.h"
#include "posix-messages.h"
#include "posix-metadata.h"
#include "posix-handle.h"
-#include <glusterfs/xlator.h>
-#include <glusterfs/defaults.h>
-#include <glusterfs/common-utils.h>
#include <glusterfs/compat-errno.h>
#include <glusterfs/compat.h>
#include <glusterfs/byte-order.h>
@@ -52,7 +45,6 @@
#include <glusterfs/locking.h>
#include <glusterfs/timer.h>
#include "glusterfs3-xdr.h"
-#include <glusterfs/hashfn.h>
#include <glusterfs/glusterfs-acl.h>
#include "posix-gfid-path.h"
#include <glusterfs/events.h>
diff --git a/xlators/storage/posix/src/posix-inode-fd-ops.c b/xlators/storage/posix/src/posix-inode-fd-ops.c
index 8beb80d7696..e3b2692ad9c 100644
--- a/xlators/storage/posix/src/posix-inode-fd-ops.c
+++ b/xlators/storage/posix/src/posix-inode-fd-ops.c
@@ -37,14 +37,10 @@
#include <fcntl.h>
#endif /* HAVE_LINKAT */
-#include <glusterfs/glusterfs.h>
#include <glusterfs/checksum.h>
#include <glusterfs/dict.h>
#include <glusterfs/logging.h>
-#include "posix.h"
-#include <glusterfs/xlator.h>
-#include <glusterfs/defaults.h>
-#include <glusterfs/common-utils.h>
+#include "posix-handle.h"
#include <glusterfs/compat-errno.h>
#include <glusterfs/compat.h>
#include <glusterfs/byte-order.h>
@@ -53,8 +49,6 @@
#include <glusterfs/locking.h>
#include <glusterfs/timer.h>
#include "glusterfs3-xdr.h"
-#include <glusterfs/hashfn.h>
-#include "posix-aio.h"
#include <glusterfs/glusterfs-acl.h>
#include "posix-messages.h"
#include "posix-metadata.h"
diff --git a/xlators/storage/posix/src/posix-inode-handle.h b/xlators/storage/posix/src/posix-inode-handle.h
index 2009421cdba..78a85b34c31 100644
--- a/xlators/storage/posix/src/posix-inode-handle.h
+++ b/xlators/storage/posix/src/posix-inode-handle.h
@@ -12,7 +12,6 @@
#include <limits.h>
#include <sys/types.h>
-#include <glusterfs/xlator.h>
#include <glusterfs/gf-dirent.h>
#include "posix.h"
diff --git a/xlators/storage/posix/src/posix.h b/xlators/storage/posix/src/posix.h
index 02e7003a57b..da590b53e1b 100644
--- a/xlators/storage/posix/src/posix.h
+++ b/xlators/storage/posix/src/posix.h
@@ -32,11 +32,9 @@
#include <sys/extattr.h>
#endif
-#include <glusterfs/xlator.h>
#include <glusterfs/compat.h>
#include <glusterfs/timer.h>
#include "posix-mem-types.h"
-#include "posix-handle.h"
#include <glusterfs/call-stub.h>
#ifdef HAVE_LIBAIO
diff --git a/xlators/system/posix-acl/src/posix-acl.c b/xlators/system/posix-acl/src/posix-acl.c
index bae47bdfcac..cd8d5e53aa1 100644
--- a/xlators/system/posix-acl/src/posix-acl.c
+++ b/xlators/system/posix-acl/src/posix-acl.c
@@ -10,8 +10,6 @@
#include <errno.h>
-#include <glusterfs/xlator.h>
-#include <glusterfs/glusterfs.h>
#include <glusterfs/defaults.h>
#include "posix-acl.h"
diff --git a/xlators/system/posix-acl/src/posix-acl.h b/xlators/system/posix-acl/src/posix-acl.h
index 024c402f952..f54a96f058b 100644
--- a/xlators/system/posix-acl/src/posix-acl.h
+++ b/xlators/system/posix-acl/src/posix-acl.h
@@ -12,7 +12,6 @@
#define _POSIX_ACL_H
#include <glusterfs/xlator.h>
-#include <glusterfs/common-utils.h>
#include <glusterfs/byte-order.h>
#include <glusterfs/glusterfs-acl.h>