summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src
diff options
context:
space:
mode:
authorYaniv Kaul <ykaul@redhat.com>2019-06-09 13:31:31 +0300
committerAmar Tumballi <amarts@redhat.com>2019-06-14 16:50:32 +0000
commit0a6fe8551ac9807a8b6ad62241ec8048cf9f9025 (patch)
tree7f6d6b7920ed775c75ca7b4a3dd14aceef5eec38 /libglusterfs/src
parent65e3624091e895ca32cd91468552589f34d17595 (diff)
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 <ykaul@redhat.com>
Diffstat (limited to 'libglusterfs/src')
-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
36 files changed, 55 insertions, 119 deletions
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"