summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-09-07 14:10:27 -0700
committerSage Weil <sage@inktank.com>2013-09-07 14:10:27 -0700
commit49dfb6cedffa04e853526f9c43f00a48a0ab508b (patch)
tree311914549f21efd601538cba3bf9722dbbfd3929
parent624e084ac0a198112d66fedbeb55f27d9cb9648f (diff)
parent99c6be2fcf15cc3f13eb735fdd55d6e9f2107104 (diff)
downloadceph-49dfb6cedffa04e853526f9c43f00a48a0ab508b.tar.gz
Merge pull request #575 from roaldvanloon/wip-automake-prepare
Wip automake prepare Reviewed-by: Sage Weil <sage@inktank.com>
-rw-r--r--configure.ac4
-rw-r--r--m4/ax_check_compile_flag.m472
-rw-r--r--src/Makefile.am69
-rw-r--r--src/auth/AuthMethodList.h3
-rw-r--r--src/client/ioctl.h3
-rw-r--r--src/cls/rbd/cls_rbd.cc4
-rw-r--r--src/cls/rgw/cls_rgw.cc6
-rw-r--r--src/common/Formatter.cc3
-rw-r--r--src/common/Formatter.h3
-rw-r--r--src/common/OutputDataSocket.cc3
-rw-r--r--src/common/addr_parsing.c (renamed from src/include/addr_parsing.c)0
-rw-r--r--src/common/admin_socket.cc3
-rw-r--r--src/common/admin_socket_client.cc3
-rw-r--r--src/common/blkdev.cc4
-rw-r--r--src/common/ceph_frag.cc (renamed from src/include/ceph_frag.cc)2
-rw-r--r--src/common/ceph_fs.cc (renamed from src/include/ceph_fs.cc)2
-rw-r--r--src/common/ceph_hash.cc (renamed from src/include/ceph_hash.cc)2
-rw-r--r--src/common/ceph_strings.cc (renamed from src/include/ceph_strings.cc)2
-rw-r--r--src/common/crc32c_intel_baseline.c3
-rw-r--r--src/common/crc32c_intel_baseline.h2
-rw-r--r--src/common/crc32c_intel_fast.c3
-rw-r--r--src/common/hobject.cc (renamed from src/os/hobject.cc)0
-rw-r--r--src/common/hobject.h (renamed from src/os/hobject.h)0
-rw-r--r--src/common/perf_counters.cc3
-rw-r--r--src/crush/crush.h3
-rw-r--r--src/crush/hash.c3
-rw-r--r--src/include/buffer.h4
-rw-r--r--src/include/crc32c.h3
-rw-r--r--src/include/encoding.h4
-rw-r--r--src/include/int_types.h75
-rw-r--r--src/include/inttypes.h28
-rw-r--r--src/include/linux_fiemap.h4
-rw-r--r--src/include/rados/librados.h3
-rw-r--r--src/include/types.h3
-rw-r--r--src/librbd/AioRequest.h4
-rw-r--r--src/librbd/ImageCtx.h2
-rw-r--r--src/librbd/SnapInfo.h2
-rw-r--r--src/librbd/WatchCtx.h2
-rw-r--r--src/librbd/internal.cc3
-rw-r--r--src/librbd/internal.h2
-rw-r--r--src/librbd/librbd.cc2
-rw-r--r--src/mds/CInode.cc3
-rw-r--r--src/mds/locks.c4
-rw-r--r--src/mds/mdstypes.h3
-rw-r--r--src/os/BtrfsFileStoreBackend.cc5
-rw-r--r--src/os/DBObjectMap.cc6
-rw-r--r--src/os/FDCache.h2
-rw-r--r--src/os/FileStore.cc6
-rw-r--r--src/os/GenericFileStoreBackend.cc5
-rw-r--r--src/os/WBThrottle.h2
-rw-r--r--src/os/ZFSFileStoreBackend.cc5
-rw-r--r--src/os/chain_xattr.cc7
-rw-r--r--src/osd/SnapMapper.h2
-rw-r--r--src/osd/osd_types.h2
-rw-r--r--src/rbd.cc2
-rw-r--r--src/rbd_fuse/rbd-fuse.c3
-rw-r--r--src/test/barclass.cc (renamed from src/barclass.cc)0
-rw-r--r--src/test/buildtest_skeleton.cc (renamed from src/test/test_libcommon_build.cc)0
-rw-r--r--src/test/encoding/types.h2
-rw-r--r--src/test/fooclass.cc (renamed from src/fooclass.cc)0
-rw-r--r--src/test/libcephfs/caps.cc2
-rw-r--r--src/test/librbd/test_librbd.cc2
-rw-r--r--src/test/osd/RadosModel.h3
-rw-r--r--src/test/perf_counters.cc8
-rw-r--r--src/test/streamtest.cc (renamed from src/streamtest.cc)0
-rw-r--r--src/test/test_trans.cc (renamed from src/test_trans.cc)0
-rw-r--r--src/test/testclass.cc (renamed from src/testclass.cc)0
-rw-r--r--src/test/testcrypto.cc (renamed from src/testcrypto.cc)0
-rw-r--r--src/test/testkeys.cc (renamed from src/testkeys.cc)0
-rw-r--r--src/test/testmsgr.cc (renamed from src/testmsgr.cc)0
-rw-r--r--src/tools/ceph_authtool.cc (renamed from src/ceph_authtool.cc)0
-rw-r--r--src/tools/ceph_conf.cc (renamed from src/ceph_conf.cc)0
-rw-r--r--src/tools/crushtool.cc (renamed from src/crushtool.cc)0
-rw-r--r--src/tools/dupstore.cc (renamed from src/dupstore.cc)0
-rw-r--r--src/tools/mon_store_converter.cc (renamed from src/mon_store_converter.cc)0
-rw-r--r--src/tools/monmaptool.cc (renamed from src/monmaptool.cc)0
-rw-r--r--src/tools/osdmaptool.cc (renamed from src/osdmaptool.cc)0
-rw-r--r--src/tools/psim.cc (renamed from src/psim.cc)0
-rw-r--r--src/tools/rados/rados.cc (renamed from src/rados.cc)0
-rw-r--r--src/tools/rados/rados_export.cc (renamed from src/rados_export.cc)2
-rw-r--r--src/tools/rados/rados_import.cc (renamed from src/rados_import.cc)2
-rw-r--r--src/tools/rados/rados_sync.cc (renamed from src/rados_sync.cc)2
-rw-r--r--src/tools/rados/rados_sync.h (renamed from src/rados_sync.h)0
-rw-r--r--src/tools/radosacl.cc (renamed from src/radosacl.cc)0
-rw-r--r--src/tools/scratchtool.c (renamed from src/scratchtool.c)0
-rw-r--r--src/tools/scratchtoolpp.cc (renamed from src/scratchtoolpp.cc)0
86 files changed, 285 insertions, 141 deletions
diff --git a/configure.ac b/configure.ac
index d042d3d2821..d2bf5959881 100644
--- a/configure.ac
+++ b/configure.ac
@@ -109,6 +109,10 @@ AC_CHECK_CC_FLAG([-Wignored-qualifiers], [WARN_IGNORED_QUALIFIERS])
# Checks for architecture stuff
AM_CONDITIONAL([ENABLE_FPU_NEON], [case $target_cpu in arm*) true;; *) false;; esac])
+# Check for compiler VTA support
+AX_CHECK_COMPILE_FLAG([-fvar-tracking-assignments], [HAS_VTA_SUPPORT=1], [HAS_VTA_SUPPORT=0])
+AM_CONDITIONAL(COMPILER_HAS_VTA, [test "$HAS_VTA_SUPPORT" = 1])
+
# Checks for libraries.
ACX_PTHREAD
AC_CHECK_LIB([uuid], [uuid_parse], [true], AC_MSG_FAILURE([libuuid not found]))
diff --git a/m4/ax_check_compile_flag.m4 b/m4/ax_check_compile_flag.m4
new file mode 100644
index 00000000000..c3a8d695a1b
--- /dev/null
+++ b/m4/ax_check_compile_flag.m4
@@ -0,0 +1,72 @@
+# ===========================================================================
+# http://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS])
+#
+# DESCRIPTION
+#
+# Check whether the given FLAG works with the current language's compiler
+# or gives an error. (Warnings, however, are ignored)
+#
+# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
+# success/failure.
+#
+# If EXTRA-FLAGS is defined, it is added to the current language's default
+# flags (e.g. CFLAGS) when the check is done. The check is thus made with
+# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to
+# force the compiler to issue an error when a bad flag is given.
+#
+# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
+# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation, either version 3 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+# Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. You
+# need not follow the terms of the GNU General Public License when using
+# or distributing such scripts, even though portions of the text of the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+#serial 2
+
+AC_DEFUN([AX_CHECK_COMPILE_FLAG],
+[AC_PREREQ(2.59)dnl for _AC_LANG_PREFIX
+AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
+AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
+ ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
+ _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
+ [AS_VAR_SET(CACHEVAR,[yes])],
+ [AS_VAR_SET(CACHEVAR,[no])])
+ _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
+AS_IF([test x"AS_VAR_GET(CACHEVAR)" = xyes],
+ [m4_default([$2], :)],
+ [m4_default([$3], :)])
+AS_VAR_POPDEF([CACHEVAR])dnl
+])dnl AX_CHECK_COMPILE_FLAGS
diff --git a/src/Makefile.am b/src/Makefile.am
index 236ea51e375..4a67214a1e1 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -86,7 +86,7 @@ ceph_mon_LDADD = libmon.a $(LIBOS_LDA) $(LIBGLOBAL_LDA)
ceph_mon_CXXFLAGS = ${CRYPTO_CXXFLAGS} ${AM_CXXFLAGS}
bin_PROGRAMS += ceph-mon
-ceph_mon_store_converter_SOURCES = mon_store_converter.cc \
+ceph_mon_store_converter_SOURCES = tools/mon_store_converter.cc \
mon/MonitorStore.cc
ceph_mon_store_converter_LDFLAGS = ${AM_LDFLAGS}
ceph_mon_store_converter_LDADD = $(LIBOS_LDA) $(LIBGLOBAL_LDA)
@@ -112,10 +112,10 @@ ceph_mds_CXXFLAGS = ${AM_CXXFLAGS}
# admin tools
-ceph_conf_SOURCES = ceph_conf.cc
+ceph_conf_SOURCES = tools/ceph_conf.cc
ceph_conf_LDADD = $(LIBGLOBAL_LDA)
ceph_conf_CXXFLAGS = ${AM_CXXFLAGS}
-ceph_authtool_SOURCES = ceph_authtool.cc
+ceph_authtool_SOURCES = tools/ceph_authtool.cc
ceph_authtool_LDADD = $(LIBGLOBAL_LDA)
ceph_filestore_dump_SOURCES = tools/ceph-filestore-dump.cc
ceph_filestore_dump_SOURCES += perfglue/disabled_heap_profiler.cc
@@ -139,11 +139,11 @@ ceph_monstore_tool_LDADD = $(LIBOS_LDA) $(LIBGLOBAL_LDA) -lboost_program_option
ceph_monstore_tool_CXXFLAGS = ${AM_CXXFLAGS} ${UNITTEST_CXXFLAGS}
bin_DEBUGPROGRAMS += ceph-monstore-tool
-monmaptool_SOURCES = monmaptool.cc
+monmaptool_SOURCES = tools/monmaptool.cc
monmaptool_LDADD = $(LIBGLOBAL_LDA)
-crushtool_SOURCES = crushtool.cc
+crushtool_SOURCES = tools/crushtool.cc
crushtool_LDADD = $(LIBGLOBAL_LDA)
-osdmaptool_SOURCES = osdmaptool.cc
+osdmaptool_SOURCES = tools/osdmaptool.cc
osdmaptool_LDADD = $(LIBGLOBAL_LDA)
bin_PROGRAMS += monmaptool crushtool osdmaptool
@@ -162,7 +162,7 @@ ceph_dencoder_LDADD = $(LIBGLOBAL_LDA) libcls_lock_client.a \
libosd.a libmds.a libosdc.la $(LIBOS_LDA) libmon.a
bin_PROGRAMS += ceph-dencoder
-mount_ceph_SOURCES = mount/mount.ceph.c common/armor.c common/safe_io.c common/secret.c include/addr_parsing.c
+mount_ceph_SOURCES = mount/mount.ceph.c common/armor.c common/safe_io.c common/secret.c common/addr_parsing.c
mount_ceph_LDADD = -lkeyutils
if LINUX
sbin_PROGRAMS += mount.ceph
@@ -227,7 +227,7 @@ ceph_mon_SOURCES += perfglue/disabled_heap_profiler.cc
endif # WITH_TCMALLOC
# debug targets
-ceph_psim_SOURCES = psim.cc
+ceph_psim_SOURCES = tools/psim.cc
ceph_psim_LDADD = $(LIBGLOBAL_LDA)
bin_DEBUGPROGRAMS += ceph_psim
@@ -239,22 +239,22 @@ ceph_test_rewrite_latency_SOURCES = test/test_rewrite_latency.cc
ceph_test_rewrite_latency_LDADD = libcommon.la $(PTHREAD_LIBS) -lm $(CRYPTO_LIBS) $(EXTRALIBS)
bin_DEBUGPROGRAMS += ceph_test_rewrite_latency
-ceph_test_msgr_SOURCES = testmsgr.cc
+ceph_test_msgr_SOURCES = test/testmsgr.cc
ceph_test_msgr_LDADD = $(LIBGLOBAL_LDA)
bin_DEBUGPROGRAMS += ceph_test_msgr
ceph_test_ioctls_SOURCES = client/test_ioctls.c
bin_DEBUGPROGRAMS += ceph_test_ioctls
-ceph_dupstore_SOURCES = dupstore.cc
+ceph_dupstore_SOURCES = tools/dupstore.cc
ceph_dupstore_CXXFLAGS= ${CRYPTO_CXXFLAGS} ${AM_CXXFLAGS}
ceph_dupstore_LDADD = $(LIBOS_LDA) $(LIBGLOBAL_LDA)
-ceph_streamtest_SOURCES = streamtest.cc
+ceph_streamtest_SOURCES = test/streamtest.cc
ceph_streamtest_CXXFLAGS= ${CRYPTO_CXXFLAGS} ${AM_CXXFLAGS}
ceph_streamtest_LDADD = $(LIBOS_LDA) $(LIBGLOBAL_LDA)
bin_DEBUGPROGRAMS += ceph_dupstore ceph_streamtest
-ceph_test_trans_SOURCES = test_trans.cc
+ceph_test_trans_SOURCES = test/test_trans.cc
ceph_test_trans_CXXFLAGS= ${CRYPTO_CXXFLAGS} ${AM_CXXFLAGS}
ceph_test_trans_LDADD = $(LIBOS_LDA) $(LIBGLOBAL_LDA)
bin_DEBUGPROGRAMS += ceph_test_trans
@@ -298,22 +298,22 @@ ceph_multi_stress_watch_LDADD = librados.la $(LIBGLOBAL_LDA)
bin_DEBUGPROGRAMS += ceph_multi_stress_watch
if WITH_BUILD_TESTS
-ceph_test_libcommon_build_SOURCES = test/test_libcommon_build.cc $(libcommon_files)
+ceph_test_libcommon_build_SOURCES = test/buildtest_skeleton.cc $(libcommon_files)
ceph_test_libcommon_build_LDADD = libcrc.la $(PTHREAD_LIBS) -lm $(CRYPTO_LIBS) $(EXTRALIBS)
bin_DEBUGPROGRAMS += ceph_test_libcommon_build
-ceph_test_librados_build_SOURCES = test/test_libcommon_build.cc $(libcommon_files) $(librados_SOURCES)
+ceph_test_librados_build_SOURCES = test/buildtest_skeleton.cc $(libcommon_files) $(librados_SOURCES)
ceph_test_librados_build_LDADD = libcrc.la $(PTHREAD_LIBS) -lm $(CRYPTO_LIBS) $(EXTRALIBS)
ceph_test_librados_build_CXXFLAGS = $(AM_CXXFLAGS)
bin_DEBUGPROGRAMS += ceph_test_librados_build
-ceph_test_librgw_build_SOURCES = test/test_libcommon_build.cc $(libcommon_files) \
+ceph_test_librgw_build_SOURCES = test/buildtest_skeleton.cc $(libcommon_files) \
$(librados_SOURCES) $(librgw_la_SOURCES)
ceph_test_librgw_build_LDADD = libcrc.la -lexpat $(PTHREAD_LIBS) -lm $(CRYPTO_LIBS) $(EXTRALIBS)
ceph_test_librgw_build_CXXFLAGS = $(AM_CXXFLAGS)
bin_DEBUGPROGRAMS += ceph_test_librgw_build
-ceph_test_libcephfs_build_SOURCES = test/test_libcommon_build.cc $(libcommon_files) \
+ceph_test_libcephfs_build_SOURCES = test/buildtest_skeleton.cc $(libcommon_files) \
$(libosdc_la_SOURCES)
ceph_test_libcephfs_build_LDADD = libcrc.la libcephfs.la -lexpat $(PTHREAD_LIBS) -lm $(CRYPTO_LIBS) $(EXTRALIBS)
ceph_test_libcephfs_build_CXXFLAGS = $(AM_CXXFLAGS)
@@ -321,7 +321,7 @@ bin_DEBUGPROGRAMS += ceph_test_libcephfs_build
endif
if WITH_HADOOPCLIENT
-ceph_test_libhadoopcephfs_build_SOURCES = test/test_libcommon_build.cc \
+ceph_test_libhadoopcephfs_build_SOURCES = test/buildtest_skeleton.cc \
$(libhadoopcephfs_la_SOURCES) \
$(libosdc_la_SOURCES) $(libcommon_files)
ceph_test_libhadoopcephfs_build_LDADD = libcrc.la libcephfs.la -lexpat $(PTHREAD_LIBS) -lm $(CRYPTO_LIBS) $(EXTRALIBS)
@@ -479,7 +479,12 @@ librbd_la_LDFLAGS = ${AM_LDFLAGS} -version-info 1:0:0 \
-export-symbols-regex '^rbd_.*' $(PTHREAD_LIBS) $(EXTRALIBS)
lib_LTLIBRARIES += librbd.la
-rados_SOURCES = rados.cc rados_import.cc rados_export.cc rados_sync.cc common/obj_bencher.cc
+rados_SOURCES = \
+ tools/rados/rados.cc \
+ tools/rados/rados_import.cc \
+ tools/rados/rados_export.cc \
+ tools/rados/rados_sync.cc \
+ common/obj_bencher.cc
rados_LDADD = libcls_lock_client.a librados.la $(LIBGLOBAL_LDA)
bin_PROGRAMS += rados
@@ -500,11 +505,11 @@ endif
endif
-ceph_scratchtool_SOURCES = scratchtool.c
+ceph_scratchtool_SOURCES = tools/scratchtool.c
ceph_scratchtool_LDADD = librados.la $(PTHREAD_LIBS) -lm $(CRYPTO_LIBS) $(EXTRALIBS)
-ceph_scratchtoolpp_SOURCES = scratchtoolpp.cc
+ceph_scratchtoolpp_SOURCES = tools/scratchtoolpp.cc
ceph_scratchtoolpp_LDADD = librados.la $(PTHREAD_LIBS) -lm
-ceph_radosacl_SOURCES = radosacl.cc
+ceph_radosacl_SOURCES = tools/radosacl.cc
ceph_radosacl_LDADD = librados.la $(PTHREAD_LIBS) -lm $(CRYPTO_LIBS) $(EXTRALIBS)
bin_DEBUGPROGRAMS += ceph_scratchtool ceph_scratchtoolpp ceph_radosacl
@@ -516,12 +521,12 @@ bin_PROGRAMS += rbd
endif
-ceph_test_crypto_SOURCES = testcrypto.cc
+ceph_test_crypto_SOURCES = test/testcrypto.cc
ceph_test_crypto_LDADD = $(LIBGLOBAL_LDA)
ceph_test_crypto_CXXFLAGS = ${AM_CXXFLAGS}
bin_DEBUGPROGRAMS += ceph_test_crypto
-ceph_test_keys_SOURCES = testkeys.cc
+ceph_test_keys_SOURCES = test/testkeys.cc
ceph_test_keys_LDADD = libmon.a $(LIBGLOBAL_LDA)
ceph_test_keys_CXXFLAGS = ${AM_CXXFLAGS}
bin_DEBUGPROGRAMS += ceph_test_keys
@@ -1594,7 +1599,7 @@ libcommon_files = \
msg/Pipe.cc \
msg/SimpleMessenger.cc \
msg/msg_types.cc \
- os/hobject.cc \
+ common/hobject.cc \
osd/OSDMap.cc \
osd/osd_types.cc \
mds/MDSMap.cc \
@@ -1613,10 +1618,10 @@ libcommon_files = \
common/Thread.cc \
common/Formatter.cc \
common/HeartbeatMap.cc \
- include/ceph_fs.cc \
- include/ceph_hash.cc \
- include/ceph_strings.cc \
- include/ceph_frag.cc \
+ common/ceph_fs.cc \
+ common/ceph_hash.cc \
+ common/ceph_strings.cc \
+ common/ceph_frag.cc \
common/config.cc \
common/utf8.c \
common/mime.c \
@@ -1631,7 +1636,7 @@ libcommon_files = \
common/ceph_json.cc \
common/ipaddr.cc \
common/pick_address.cc \
- include/addr_parsing.c \
+ common/addr_parsing.c \
$(crush_files)
if WITH_PROFILER
@@ -1784,7 +1789,7 @@ python_PYTHON = pybind/rados.py \
# headers... and everything else we want to include in a 'make dist'
# that autotools doesn't magically identify.
noinst_HEADERS = \
- rados_sync.h \
+ tools/rados/rados_sync.h \
arch/probe.h \
arch/intel.h \
arch/neon.h \
@@ -1976,7 +1981,7 @@ noinst_HEADERS = \
include/hash.h\
include/intarith.h\
include/interval_set.h\
- include/inttypes.h\
+ include/int_types.h\
include/ipaddr.h\
include/linux_fiemap.h\
include/lru.h\
@@ -2240,7 +2245,7 @@ noinst_HEADERS = \
os/btrfs_ioctl.h\
os/ZFS.h\
os/chain_xattr.h\
- os/hobject.h \
+ common/hobject.h \
os/CollectionIndex.h\
os/FileJournal.h\
os/FileStore.h\
diff --git a/src/auth/AuthMethodList.h b/src/auth/AuthMethodList.h
index 7b21b325aeb..b5aae0bba49 100644
--- a/src/auth/AuthMethodList.h
+++ b/src/auth/AuthMethodList.h
@@ -15,7 +15,8 @@
#ifndef CEPH_AUTHMETHODLIST_H
#define CEPH_AUTHMETHODLIST_H
-#include "include/inttypes.h"
+#include "include/int_types.h"
+
#include <list>
#include <set>
#include <string>
diff --git a/src/client/ioctl.h b/src/client/ioctl.h
index c15d3340a76..35b4ce4ac0f 100644
--- a/src/client/ioctl.h
+++ b/src/client/ioctl.h
@@ -1,13 +1,14 @@
#ifndef FS_CEPH_IOCTL_H
#define FS_CEPH_IOCTL_H
+#include "include/int_types.h"
+
#if defined(__linux__)
#include <linux/ioctl.h>
#include <linux/types.h>
#elif defined(__FreeBSD__)
#include <sys/ioctl.h>
#include <sys/types.h>
-#include "include/inttypes.h"
#endif
#define CEPH_IOCTL_MAGIC 0x97
diff --git a/src/cls/rbd/cls_rbd.cc b/src/cls/rbd/cls_rbd.cc
index 420de514ee6..12947a08540 100644
--- a/src/cls/rbd/cls_rbd.cc
+++ b/src/cls/rbd/cls_rbd.cc
@@ -25,6 +25,8 @@
* parameters as the client sees them - it would be silly to mention
* in each one that they take an input and an output bufferlist.
*/
+#include "include/int_types.h"
+#include "include/types.h"
#include <algorithm>
#include <cstring>
@@ -35,10 +37,8 @@
#include <sstream>
#include <vector>
-#include "include/types.h"
#include "objclass/objclass.h"
#include "include/rbd_types.h"
-#include <inttypes.h>
#include "cls/rbd/cls_rbd.h"
diff --git a/src/cls/rgw/cls_rgw.cc b/src/cls/rgw/cls_rgw.cc
index 6cda4cba5c3..2f5711ecb32 100644
--- a/src/cls/rgw/cls_rgw.cc
+++ b/src/cls/rgw/cls_rgw.cc
@@ -1,14 +1,14 @@
// -*- mode:C; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
-#include <iostream>
+#include "include/int_types.h"
+#include "include/types.h"
+#include <iostream>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
-#include <inttypes.h>
-#include "include/types.h"
#include "include/utime.h"
#include "objclass/objclass.h"
#include "cls/rgw/cls_rgw_ops.h"
diff --git a/src/common/Formatter.cc b/src/common/Formatter.cc
index c08ea5b9a20..4ef833a45f8 100644
--- a/src/common/Formatter.cc
+++ b/src/common/Formatter.cc
@@ -14,11 +14,12 @@
#define LARGE_SIZE 1024
+#include "include/int_types.h"
+
#include "assert.h"
#include "Formatter.h"
#include "common/escape.h"
-#include <inttypes.h>
#include <iostream>
#include <sstream>
#include <stdarg.h>
diff --git a/src/common/Formatter.h b/src/common/Formatter.h
index da730103f41..27089ce04f2 100644
--- a/src/common/Formatter.h
+++ b/src/common/Formatter.h
@@ -1,8 +1,9 @@
#ifndef CEPH_FORMATTER_H
#define CEPH_FORMATTER_H
+#include "include/int_types.h"
+
#include <deque>
-#include <inttypes.h>
#include <iostream>
#include <list>
#include <ostream>
diff --git a/src/common/OutputDataSocket.cc b/src/common/OutputDataSocket.cc
index e4d21fe13ee..3051ca02dbe 100644
--- a/src/common/OutputDataSocket.cc
+++ b/src/common/OutputDataSocket.cc
@@ -12,6 +12,8 @@
*
*/
+#include "include/int_types.h"
+
#include "common/Thread.h"
#include "common/OutputDataSocket.h"
#include "common/config.h"
@@ -25,7 +27,6 @@
#include <errno.h>
#include <fcntl.h>
-#include <inttypes.h>
#include <map>
#include <poll.h>
#include <set>
diff --git a/src/include/addr_parsing.c b/src/common/addr_parsing.c
index c01f817772c..c01f817772c 100644
--- a/src/include/addr_parsing.c
+++ b/src/common/addr_parsing.c
diff --git a/src/common/admin_socket.cc b/src/common/admin_socket.cc
index 1a507e606bf..12e5868b409 100644
--- a/src/common/admin_socket.cc
+++ b/src/common/admin_socket.cc
@@ -12,6 +12,8 @@
*
*/
+#include "include/int_types.h"
+
#include "common/Thread.h"
#include "common/admin_socket.h"
#include "common/config.h"
@@ -26,7 +28,6 @@
#include <errno.h>
#include <fcntl.h>
-#include <inttypes.h>
#include <map>
#include <poll.h>
#include <set>
diff --git a/src/common/admin_socket_client.cc b/src/common/admin_socket_client.cc
index 782e808ad86..335695f9b4b 100644
--- a/src/common/admin_socket_client.cc
+++ b/src/common/admin_socket_client.cc
@@ -12,6 +12,8 @@
*
*/
+#include "include/int_types.h"
+
#include "common/admin_socket.h"
#include "common/ceph_context.h"
#include "common/errno.h"
@@ -21,7 +23,6 @@
#include <arpa/inet.h>
#include <errno.h>
#include <fcntl.h>
-#include <inttypes.h>
#include <map>
#include <poll.h>
#include <sstream>
diff --git a/src/common/blkdev.cc b/src/common/blkdev.cc
index 22b0aa67b3e..b0dc0a54e9e 100644
--- a/src/common/blkdev.cc
+++ b/src/common/blkdev.cc
@@ -1,8 +1,8 @@
-#include <inttypes.h>
+#include "include/int_types.h"
+
#include <fcntl.h>
#include <sys/ioctl.h>
#include <errno.h>
-
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/mount.h>
diff --git a/src/include/ceph_frag.cc b/src/common/ceph_frag.cc
index ab6cf35c409..444b910c24e 100644
--- a/src/include/ceph_frag.cc
+++ b/src/common/ceph_frag.cc
@@ -1,7 +1,7 @@
/*
* Ceph 'frag' type
*/
-#include "types.h"
+#include "include/types.h"
int ceph_frag_compare(__u32 a, __u32 b)
{
diff --git a/src/include/ceph_fs.cc b/src/common/ceph_fs.cc
index 6e3c143361e..3172c577162 100644
--- a/src/include/ceph_fs.cc
+++ b/src/common/ceph_fs.cc
@@ -9,7 +9,7 @@
/*
* Some non-inline ceph helpers
*/
-#include "types.h"
+#include "include/types.h"
/*
* return true if @layout appears to be valid
diff --git a/src/include/ceph_hash.cc b/src/common/ceph_hash.cc
index d6081dfa97d..c581806d83d 100644
--- a/src/include/ceph_hash.cc
+++ b/src/common/ceph_hash.cc
@@ -1,5 +1,5 @@
-#include "types.h"
+#include "include/types.h"
/*
* Robert Jenkin's hash function.
diff --git a/src/include/ceph_strings.cc b/src/common/ceph_strings.cc
index e86aae4fd50..cd08083967a 100644
--- a/src/include/ceph_strings.cc
+++ b/src/common/ceph_strings.cc
@@ -1,7 +1,7 @@
/*
* Ceph string constants
*/
-#include "types.h"
+#include "include/types.h"
const char *ceph_entity_type_name(int type)
{
diff --git a/src/common/crc32c_intel_baseline.c b/src/common/crc32c_intel_baseline.c
index cfcfec624ae..3a92c77b63c 100644
--- a/src/common/crc32c_intel_baseline.c
+++ b/src/common/crc32c_intel_baseline.c
@@ -34,7 +34,8 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <inttypes.h>
+#include "include/int_types.h"
+
#include <stdlib.h>
#define MAX_ITER 8
diff --git a/src/common/crc32c_intel_baseline.h b/src/common/crc32c_intel_baseline.h
index 5b14ddfc07e..e463575e28c 100644
--- a/src/common/crc32c_intel_baseline.h
+++ b/src/common/crc32c_intel_baseline.h
@@ -1,6 +1,8 @@
#ifndef CEPH_COMMON_CRC32C_INTEL_BASELINE_H
#define CEPH_COMMON_CRC32C_INTEL_BASELINE_H
+#include "include/int_types.h"
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/src/common/crc32c_intel_fast.c b/src/common/crc32c_intel_fast.c
index 49305088aff..0532dd261cf 100644
--- a/src/common/crc32c_intel_fast.c
+++ b/src/common/crc32c_intel_fast.c
@@ -1,5 +1,6 @@
-#include <inttypes.h>
#include "acconfig.h"
+#include "include/int_types.h"
+
#include "common/crc32c_intel_baseline.h"
extern unsigned int crc32_iscsi_00(unsigned char const *buffer, int len, unsigned int crc);
diff --git a/src/os/hobject.cc b/src/common/hobject.cc
index d6273693c62..d6273693c62 100644
--- a/src/os/hobject.cc
+++ b/src/common/hobject.cc
diff --git a/src/os/hobject.h b/src/common/hobject.h
index 633e471dffc..633e471dffc 100644
--- a/src/os/hobject.h
+++ b/src/common/hobject.h
diff --git a/src/common/perf_counters.cc b/src/common/perf_counters.cc
index 339ff6a372b..4fe1354fa63 100644
--- a/src/common/perf_counters.cc
+++ b/src/common/perf_counters.cc
@@ -12,13 +12,14 @@
*
*/
+#include "include/int_types.h"
+
#include "common/perf_counters.h"
#include "common/dout.h"
#include "common/errno.h"
#include "common/Formatter.h"
#include <errno.h>
-#include <inttypes.h>
#include <map>
#include <sstream>
#include <stdint.h>
diff --git a/src/crush/crush.h b/src/crush/crush.h
index 82d032879d9..4adabcbf331 100644
--- a/src/crush/crush.h
+++ b/src/crush/crush.h
@@ -1,11 +1,12 @@
#ifndef CEPH_CRUSH_CRUSH_H
#define CEPH_CRUSH_CRUSH_H
+#include "include/int_types.h"
+
#if defined(__linux__)
#include <linux/types.h>
#elif defined(__FreeBSD__)
#include <sys/types.h>
-#include "include/inttypes.h"
#endif
/*
diff --git a/src/crush/hash.c b/src/crush/hash.c
index 9f7f3257ebd..9b15321d783 100644
--- a/src/crush/hash.c
+++ b/src/crush/hash.c
@@ -1,10 +1,11 @@
+#include "include/int_types.h"
#if defined(__linux__)
#include <linux/types.h>
#elif defined(__FreeBSD__)
#include <sys/types.h>
-#include "include/inttypes.h"
#endif
+
#include "hash.h"
/*
diff --git a/src/include/buffer.h b/src/include/buffer.h
index 8e637d658c5..077cf0d9b0b 100644
--- a/src/include/buffer.h
+++ b/src/include/buffer.h
@@ -11,16 +11,16 @@
* Foundation. See file COPYING.
*
*/
-
#ifndef CEPH_BUFFER_H
#define CEPH_BUFFER_H
+#include "include/int_types.h"
+
#if defined(__linux__)
#include <stdlib.h>
#include <linux/types.h>
#elif defined(__FreeBSD__)
#include <sys/types.h>
-#include "include/inttypes.h"
#include <stdlib.h>
#endif
diff --git a/src/include/crc32c.h b/src/include/crc32c.h
index d5f7388be56..8e22c624636 100644
--- a/src/include/crc32c.h
+++ b/src/include/crc32c.h
@@ -1,7 +1,8 @@
#ifndef CEPH_CRC32C_H
#define CEPH_CRC32C_H
-#include "include/inttypes.h"
+#include "include/int_types.h"
+
#include <string.h>
typedef uint32_t (*ceph_crc32c_func_t)(uint32_t crc, unsigned char const *data, unsigned length);
diff --git a/src/include/encoding.h b/src/include/encoding.h
index a091f7f69e9..fedc8b31299 100644
--- a/src/include/encoding.h
+++ b/src/include/encoding.h
@@ -11,13 +11,13 @@
* Foundation. See file COPYING.
*
*/
-
#ifndef CEPH_ENCODING_H
#define CEPH_ENCODING_H
+#include "include/int_types.h"
+
#include <tr1/memory>
-#include "inttypes.h"
#include "byteorder.h"
#include "buffer.h"
#include "assert.h"
diff --git a/src/include/int_types.h b/src/include/int_types.h
new file mode 100644
index 00000000000..f290f9d8d23
--- /dev/null
+++ b/src/include/int_types.h
@@ -0,0 +1,75 @@
+#ifndef CEPH_INTTYPES_H
+#define CEPH_INTTYPES_H
+
+#include "acconfig.h"
+
+#if defined(__linux__)
+#include <linux/types.h>
+#endif
+
+/*
+ * Get 64b integers either from inttypes.h or glib.h
+ */
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+//#else
+//# ifdef HAVE_GLIB
+//# include <glib.h>
+//# endif
+#endif
+
+/*
+ * C99 says inttypes.h includes stdint.h, but that's not true on all
+ * systems. If it's there, include it always - just in case.
+ */
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
+/*
+ * Emergency replacements for PRI*64 modifiers. Some systems have
+ * an inttypes.h that doesn't define all the PRI[doxu]64 macros.
+ */
+#if !defined(PRIu64)
+# if defined(HAVE_INTTYPES_H) || defined(HAVE_GLIB)
+/* If we have inttypes or glib, assume we have 64-bit long long int */
+# define PRIu64 "llu"
+# define PRIi64 "lli"
+# define PRIx64 "llx"
+# define PRIX64 "llX"
+# define PRIo64 "llo"
+# define PRId64 "lld"
+# else
+/* Assume that we don't have long long, so use long int modifiers */
+# define PRIu64 "lu"
+# define PRIi64 "li"
+# define PRIx64 "lx"
+# define PRIX64 "lX"
+# define PRIo64 "lo"
+# define PRId64 "ld"
+# endif
+#endif
+
+#if defined(__FreeBSD__)
+#include <sys/types.h>
+
+typedef int8_t __s8;
+typedef uint8_t __u8;
+typedef int16_t __s16;
+typedef uint16_t __u16;
+typedef int32_t __s32;
+typedef uint32_t __u32;
+typedef int64_t __s64;
+typedef uint64_t __u64;
+
+#define __bitwise__
+
+typedef __u16 __bitwise__ __le16;
+typedef __u16 __bitwise__ __be16;
+typedef __u32 __bitwise__ __le32;
+typedef __u32 __bitwise__ __be32;
+typedef __u64 __bitwise__ __le64;
+typedef __u64 __bitwise__ __be64;
+
+#endif
+#endif
diff --git a/src/include/inttypes.h b/src/include/inttypes.h
deleted file mode 100644
index 656e2bb0a0f..00000000000
--- a/src/include/inttypes.h
+++ /dev/null
@@ -1,28 +0,0 @@
-#ifndef CEPH_INTTYPES_H
-#define CEPH_INTTYPES_H
-
-#include <stdint.h>
-#if defined(__linux__)
-#include <linux/types.h>
-#elif defined(__FreeBSD__)
-#include <sys/types.h>
-typedef int8_t __s8;
-typedef uint8_t __u8;
-typedef int16_t __s16;
-typedef uint16_t __u16;
-typedef int32_t __s32;
-typedef uint32_t __u32;
-typedef int64_t __s64;
-typedef uint64_t __u64;
-
-#define __bitwise__
-
-typedef __u16 __bitwise__ __le16;
-typedef __u16 __bitwise__ __be16;
-typedef __u32 __bitwise__ __le32;
-typedef __u32 __bitwise__ __be32;
-typedef __u64 __bitwise__ __le64;
-typedef __u64 __bitwise__ __be64;
-
-#endif
-#endif
diff --git a/src/include/linux_fiemap.h b/src/include/linux_fiemap.h
index ba5cb6657fa..352208b2207 100644
--- a/src/include/linux_fiemap.h
+++ b/src/include/linux_fiemap.h
@@ -7,15 +7,15 @@
* Kalpak Shah <kalpak.shah@sun.com>
* Andreas Dilger <adilger@sun.com>
*/
-
#ifndef _LINUX_FIEMAP_H
#define _LINUX_FIEMAP_H
+#include "include/int_types.h"
+
#if defined(__linux__)
#include <linux/types.h>
#elif defined(__FreeBSD_)
#include <sys/types.h>
-#include "include/inttypes.h"
#endif
struct fiemap_extent {
diff --git a/src/include/rados/librados.h b/src/include/rados/librados.h
index 6f5e454c8e8..a85ef3057bc 100644
--- a/src/include/rados/librados.h
+++ b/src/include/rados/librados.h
@@ -1,6 +1,8 @@
#ifndef CEPH_LIBRADOS_H
#define CEPH_LIBRADOS_H
+#include "include/int_types.h"
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -10,7 +12,6 @@ extern "C" {
#include <linux/types.h>
#elif defined(__FreeBSD__)
#include <sys/types.h>
-#include "include/inttypes.h"
#endif
#include <string.h>
#include "rados_types.h"
diff --git a/src/include/types.h b/src/include/types.h
index 7e6ddb7117e..1f9756b22c7 100644
--- a/src/include/types.h
+++ b/src/include/types.h
@@ -11,12 +11,11 @@
* Foundation. See file COPYING.
*
*/
-
#ifndef CEPH_TYPES_H
#define CEPH_TYPES_H
// this is needed for ceph_fs to compile in userland
-#include "inttypes.h"
+#include "int_types.h"
#include "byteorder.h"
#include "uuid.h"
diff --git a/src/librbd/AioRequest.h b/src/librbd/AioRequest.h
index 7625bdd7ff3..cf50ee2c049 100644
--- a/src/librbd/AioRequest.h
+++ b/src/librbd/AioRequest.h
@@ -3,9 +3,9 @@
#ifndef CEPH_LIBRBD_AIOREQUEST_H
#define CEPH_LIBRBD_AIOREQUEST_H
-#include <map>
+#include "include/int_types.h"
-#include "inttypes.h"
+#include <map>
#include "common/snap_types.h"
#include "include/buffer.h"
diff --git a/src/librbd/ImageCtx.h b/src/librbd/ImageCtx.h
index 29ca2f197ea..c9e74393e13 100644
--- a/src/librbd/ImageCtx.h
+++ b/src/librbd/ImageCtx.h
@@ -3,7 +3,7 @@
#ifndef CEPH_LIBRBD_IMAGECTX_H
#define CEPH_LIBRBD_IMAGECTX_H
-#include <inttypes.h>
+#include "include/int_types.h"
#include <map>
#include <set>
diff --git a/src/librbd/SnapInfo.h b/src/librbd/SnapInfo.h
index 5a7852c3c66..44dd4cf208e 100644
--- a/src/librbd/SnapInfo.h
+++ b/src/librbd/SnapInfo.h
@@ -3,7 +3,7 @@
#ifndef CEPH_LIBRBD_SNAPINFO_H
#define CEPH_LIBRBD_SNAPINFO_H
-#include <inttypes.h>
+#include "include/int_types.h"
#include "include/rados/librados.hpp"
diff --git a/src/librbd/WatchCtx.h b/src/librbd/WatchCtx.h
index 0c0802a4035..9872c84307b 100644
--- a/src/librbd/WatchCtx.h
+++ b/src/librbd/WatchCtx.h
@@ -3,7 +3,7 @@
#ifndef CEPH_LIBRBD_WATCHCTX_H
#define CEPH_LIBRBD_WATCHCTX_H
-#include <inttypes.h>
+#include "include/int_types.h"
#include "common/Mutex.h"
#include "include/buffer.h"
diff --git a/src/librbd/internal.cc b/src/librbd/internal.cc
index abc6ff92a28..b8a757ab333 100644
--- a/src/librbd/internal.cc
+++ b/src/librbd/internal.cc
@@ -1,5 +1,7 @@
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
+#include "include/int_types.h"
+
#include <errno.h>
#include <limits.h>
@@ -8,7 +10,6 @@
#include "common/errno.h"
#include "common/Throttle.h"
#include "cls/lock/cls_lock_client.h"
-#include "include/inttypes.h"
#include "include/stringify.h"
#include "cls/rbd/cls_rbd.h"
diff --git a/src/librbd/internal.h b/src/librbd/internal.h
index 33f5191706d..43458886b43 100644
--- a/src/librbd/internal.h
+++ b/src/librbd/internal.h
@@ -3,7 +3,7 @@
#ifndef CEPH_LIBRBD_INTERNAL_H
#define CEPH_LIBRBD_INTERNAL_H
-#include <inttypes.h>
+#include "include/int_types.h"
#include <map>
#include <set>
diff --git a/src/librbd/librbd.cc b/src/librbd/librbd.cc
index af413dda04f..cad0c5eb172 100644
--- a/src/librbd/librbd.cc
+++ b/src/librbd/librbd.cc
@@ -11,9 +11,9 @@
* Foundation. See file COPYING.
*
*/
+#include "include/int_types.h"
#include <errno.h>
-#include <inttypes.h>
#include "common/Cond.h"
#include "common/dout.h"
diff --git a/src/mds/CInode.cc b/src/mds/CInode.cc
index dd483263b6d..46f8d33cfd8 100644
--- a/src/mds/CInode.cc
+++ b/src/mds/CInode.cc
@@ -12,7 +12,8 @@
*
*/
-#include <inttypes.h>
+#include "include/int_types.h"
+
#include <string>
#include <stdio.h>
diff --git a/src/mds/locks.c b/src/mds/locks.c
index 37e3f5ea764..f367eda29d2 100644
--- a/src/mds/locks.c
+++ b/src/mds/locks.c
@@ -1,15 +1,15 @@
-
// there must be a better way?
typedef char bool;
#define false 0
#define true 1
+#include "include/int_types.h"
+
#include <netinet/in.h>
#if defined(__linux__)
#include <linux/types.h>
#elif defined(__FreeBSD__)
#include <sys/types.h>
-#include "include/inttypes.h"
#endif
#include <string.h>
#include <fcntl.h>
diff --git a/src/mds/mdstypes.h b/src/mds/mdstypes.h
index 4fcf584fb8c..902e3104aa8 100644
--- a/src/mds/mdstypes.h
+++ b/src/mds/mdstypes.h
@@ -3,7 +3,8 @@
#ifndef CEPH_MDSTYPES_H
#define CEPH_MDSTYPES_H
-#include <inttypes.h>
+#include "include/int_types.h"
+
#include <math.h>
#include <ostream>
#include <set>
diff --git a/src/os/BtrfsFileStoreBackend.cc b/src/os/BtrfsFileStoreBackend.cc
index ac7d1014ac7..bb11a45e10b 100644
--- a/src/os/BtrfsFileStoreBackend.cc
+++ b/src/os/BtrfsFileStoreBackend.cc
@@ -12,7 +12,9 @@
*
*/
-#include <inttypes.h>
+#include "include/int_types.h"
+#include "include/types.h"
+
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
@@ -22,7 +24,6 @@
#include <sys/ioctl.h>
#include "include/compat.h"
#include "include/linux_fiemap.h"
-#include "include/types.h"
#include "include/color.h"
#include "include/buffer.h"
#include "include/assert.h"
diff --git a/src/os/DBObjectMap.cc b/src/os/DBObjectMap.cc
index 5142f4d7420..90c840bbe9c 100644
--- a/src/os/DBObjectMap.cc
+++ b/src/os/DBObjectMap.cc
@@ -1,13 +1,13 @@
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
-#include <iostream>
-#include <inttypes.h>
+#include "include/int_types.h"
#include "include/buffer.h"
+
+#include <iostream>
#include <set>
#include <map>
#include <string>
#include <tr1/memory>
-
#include <vector>
#include "ObjectMap.h"
diff --git a/src/os/FDCache.h b/src/os/FDCache.h
index f0f40e7bbf4..00e632f3e0f 100644
--- a/src/os/FDCache.h
+++ b/src/os/FDCache.h
@@ -18,7 +18,7 @@
#include <memory>
#include <errno.h>
#include <cstdio>
-#include "hobject.h"
+#include "common/hobject.h"
#include "common/Mutex.h"
#include "common/Cond.h"
#include "common/shared_cache.hpp"
diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc
index d4d540df876..7ef415213b0 100644
--- a/src/os/FileStore.cc
+++ b/src/os/FileStore.cc
@@ -11,8 +11,8 @@
* Foundation. See file COPYING.
*
*/
+#include "include/int_types.h"
-#include <inttypes.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/types.h>
@@ -30,10 +30,6 @@
#include <iostream>
#include <map>
-#if defined(__FreeBSD__)
-#include "include/inttypes.h"
-#endif
-
#include "include/compat.h"
#include "include/linux_fiemap.h"
diff --git a/src/os/GenericFileStoreBackend.cc b/src/os/GenericFileStoreBackend.cc
index d0b3df5f6f2..461158fdfab 100644
--- a/src/os/GenericFileStoreBackend.cc
+++ b/src/os/GenericFileStoreBackend.cc
@@ -12,7 +12,9 @@
*
*/
-#include <inttypes.h>
+#include "include/int_types.h"
+#include "include/types.h"
+
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
@@ -27,7 +29,6 @@
#include "include/compat.h"
#include "include/linux_fiemap.h"
-#include "include/types.h"
#include <iostream>
#include <fstream>
diff --git a/src/os/WBThrottle.h b/src/os/WBThrottle.h
index 070de08e123..d480a6b751c 100644
--- a/src/os/WBThrottle.h
+++ b/src/os/WBThrottle.h
@@ -20,7 +20,7 @@
#include <tr1/memory>
#include "include/buffer.h"
#include "common/Formatter.h"
-#include "os/hobject.h"
+#include "common/hobject.h"
#include "include/interval_set.h"
#include "FDCache.h"
#include "common/Thread.h"
diff --git a/src/os/ZFSFileStoreBackend.cc b/src/os/ZFSFileStoreBackend.cc
index 0f01bd20ee7..aa52b8d2933 100644
--- a/src/os/ZFSFileStoreBackend.cc
+++ b/src/os/ZFSFileStoreBackend.cc
@@ -1,7 +1,9 @@
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
-#include <inttypes.h>
+#include "include/int_types.h"
+#include "include/types.h"
+
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
@@ -12,7 +14,6 @@
#include "include/compat.h"
#include "include/linux_fiemap.h"
-#include "include/types.h"
#include "include/color.h"
#include "include/buffer.h"
#include "include/assert.h"
diff --git a/src/os/chain_xattr.cc b/src/os/chain_xattr.cc
index 96f334f8d00..62733e390d3 100644
--- a/src/os/chain_xattr.cc
+++ b/src/os/chain_xattr.cc
@@ -3,7 +3,8 @@
#include "chain_xattr.h"
-#include <inttypes.h>
+#include "include/int_types.h"
+
#include <unistd.h>
#include <stdlib.h>
#include <sys/types.h>
@@ -21,10 +22,6 @@
#include <linux/fs.h>
#endif
-#if defined(__FreeBSD__)
-#include "include/inttypes.h"
-#endif
-
#include "common/xattr.h"
/*
diff --git a/src/osd/SnapMapper.h b/src/osd/SnapMapper.h
index 560cc43497f..f0d0baa2190 100644
--- a/src/osd/SnapMapper.h
+++ b/src/osd/SnapMapper.h
@@ -21,7 +21,7 @@
#include <string.h>
#include "common/map_cacher.hpp"
-#include "os/hobject.h"
+#include "common/hobject.h"
#include "include/buffer.h"
#include "include/encoding.h"
#include "include/object.h"
diff --git a/src/osd/osd_types.h b/src/osd/osd_types.h
index 312eb81e3fd..da139b853b1 100644
--- a/src/osd/osd_types.h
+++ b/src/osd/osd_types.h
@@ -26,7 +26,7 @@
#include "include/interval_set.h"
#include "common/snap_types.h"
#include "common/Formatter.h"
-#include "os/hobject.h"
+#include "common/hobject.h"
#include "Watch.h"
#define CEPH_OSD_ONDISK_MAGIC "ceph osd volume v026"
diff --git a/src/rbd.cc b/src/rbd.cc
index eba91958d8c..eea9733c4b9 100644
--- a/src/rbd.cc
+++ b/src/rbd.cc
@@ -8,6 +8,7 @@
* LGPL2. See file COPYING.
*
*/
+#include "include/int_types.h"
#include "mon/MonClient.h"
#include "mon/MonMap.h"
@@ -33,7 +34,6 @@
#include <boost/scoped_ptr.hpp>
#include <dirent.h>
#include <errno.h>
-#include <inttypes.h>
#include <iostream>
#include <memory>
#include <sstream>
diff --git a/src/rbd_fuse/rbd-fuse.c b/src/rbd_fuse/rbd-fuse.c
index 5a4bfe2702c..eea6edb9eb8 100644
--- a/src/rbd_fuse/rbd-fuse.c
+++ b/src/rbd_fuse/rbd-fuse.c
@@ -3,6 +3,8 @@
*/
#define FUSE_USE_VERSION 26
+#include "include/int_types.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
@@ -15,7 +17,6 @@
#include <sys/types.h>
#include <unistd.h>
#include <getopt.h>
-#include <inttypes.h>
#include "include/rbd/librbd.h"
diff --git a/src/barclass.cc b/src/test/barclass.cc
index f5354f1e0f3..f5354f1e0f3 100644
--- a/src/barclass.cc
+++ b/src/test/barclass.cc
diff --git a/src/test/test_libcommon_build.cc b/src/test/buildtest_skeleton.cc
index 8215a05dbda..8215a05dbda 100644
--- a/src/test/test_libcommon_build.cc
+++ b/src/test/buildtest_skeleton.cc
diff --git a/src/test/encoding/types.h b/src/test/encoding/types.h
index a6f7cfb7883..514c76fc1a8 100644
--- a/src/test/encoding/types.h
+++ b/src/test/encoding/types.h
@@ -75,7 +75,7 @@ TYPE(ObjectStore::Transaction)
#include "os/SequencerPosition.h"
TYPE(SequencerPosition)
-#include "os/hobject.h"
+#include "common/hobject.h"
TYPE(hobject_t)
#include "mon/AuthMonitor.h"
diff --git a/src/fooclass.cc b/src/test/fooclass.cc
index 2db2d815bb0..2db2d815bb0 100644
--- a/src/fooclass.cc
+++ b/src/test/fooclass.cc
diff --git a/src/test/libcephfs/caps.cc b/src/test/libcephfs/caps.cc
index 96f1a90024d..9fa92cf29dc 100644
--- a/src/test/libcephfs/caps.cc
+++ b/src/test/libcephfs/caps.cc
@@ -11,11 +11,11 @@
* Foundation. See file COPYING.
*
*/
+#include "include/int_types.h"
#include "gtest/gtest.h"
#include "include/cephfs/libcephfs.h"
#include <linux/types.h>
-#include <inttypes.h>
#include "include/ceph_fs.h"
#include <errno.h>
#include <sys/fcntl.h>
diff --git a/src/test/librbd/test_librbd.cc b/src/test/librbd/test_librbd.cc
index 562be6a6bcf..84bf3477aff 100644
--- a/src/test/librbd/test_librbd.cc
+++ b/src/test/librbd/test_librbd.cc
@@ -12,6 +12,7 @@
*
*/
+#include "include/int_types.h"
#include "include/rados/librados.h"
#include "include/rbd_types.h"
#include "include/rbd/librbd.h"
@@ -20,7 +21,6 @@
#include "gtest/gtest.h"
#include <errno.h>
-#include <inttypes.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/src/test/osd/RadosModel.h b/src/test/osd/RadosModel.h
index b9967d7af50..4f1aa4c3582 100644
--- a/src/test/osd/RadosModel.h
+++ b/src/test/osd/RadosModel.h
@@ -1,4 +1,6 @@
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+#include "include/int_types.h"
+
#include "common/Mutex.h"
#include "common/Cond.h"
#include "include/rados/librados.hpp"
@@ -15,7 +17,6 @@
#include <time.h>
#include "Object.h"
#include "TestOpStat.h"
-#include "inttypes.h"
#include "test/librados/test.h"
#ifndef RADOSMODEL_H
diff --git a/src/test/perf_counters.cc b/src/test/perf_counters.cc
index d0b05f9f049..c44a15ef856 100644
--- a/src/test/perf_counters.cc
+++ b/src/test/perf_counters.cc
@@ -11,6 +11,10 @@
* Foundation. See file COPYING.
*
*/
+#include "include/int_types.h"
+#include "include/types.h" // FIXME: ordering shouldn't be important, but right
+ // now, this include has to come before the others.
+
#include "common/perf_counters.h"
#include "common/admin_socket_client.h"
@@ -19,9 +23,6 @@
#include "common/errno.h"
#include "common/safe_io.h"
-#include "include/types.h" // FIXME: ordering shouldn't be important, but right
- // now, this include has to come before the others.
-
#include "common/code_environment.h"
#include "global/global_context.h"
#include "global/global_init.h"
@@ -30,7 +31,6 @@
#include <errno.h>
#include <fcntl.h>
-#include <inttypes.h>
#include <map>
#include <poll.h>
#include <sstream>
diff --git a/src/streamtest.cc b/src/test/streamtest.cc
index 21693ac8713..21693ac8713 100644
--- a/src/streamtest.cc
+++ b/src/test/streamtest.cc
diff --git a/src/test_trans.cc b/src/test/test_trans.cc
index 43821c13aec..43821c13aec 100644
--- a/src/test_trans.cc
+++ b/src/test/test_trans.cc
diff --git a/src/testclass.cc b/src/test/testclass.cc
index 22a97be6dcb..22a97be6dcb 100644
--- a/src/testclass.cc
+++ b/src/test/testclass.cc
diff --git a/src/testcrypto.cc b/src/test/testcrypto.cc
index 0b7a9d54742..0b7a9d54742 100644
--- a/src/testcrypto.cc
+++ b/src/test/testcrypto.cc
diff --git a/src/testkeys.cc b/src/test/testkeys.cc
index 27c38124ade..27c38124ade 100644
--- a/src/testkeys.cc
+++ b/src/test/testkeys.cc
diff --git a/src/testmsgr.cc b/src/test/testmsgr.cc
index 4de779b5d7f..4de779b5d7f 100644
--- a/src/testmsgr.cc
+++ b/src/test/testmsgr.cc
diff --git a/src/ceph_authtool.cc b/src/tools/ceph_authtool.cc
index f66a3c66eee..f66a3c66eee 100644
--- a/src/ceph_authtool.cc
+++ b/src/tools/ceph_authtool.cc
diff --git a/src/ceph_conf.cc b/src/tools/ceph_conf.cc
index b2286f4e094..b2286f4e094 100644
--- a/src/ceph_conf.cc
+++ b/src/tools/ceph_conf.cc
diff --git a/src/crushtool.cc b/src/tools/crushtool.cc
index 75c26c098b6..75c26c098b6 100644
--- a/src/crushtool.cc
+++ b/src/tools/crushtool.cc
diff --git a/src/dupstore.cc b/src/tools/dupstore.cc
index e17eb2201a7..e17eb2201a7 100644
--- a/src/dupstore.cc
+++ b/src/tools/dupstore.cc
diff --git a/src/mon_store_converter.cc b/src/tools/mon_store_converter.cc
index 1c0d3af98e2..1c0d3af98e2 100644
--- a/src/mon_store_converter.cc
+++ b/src/tools/mon_store_converter.cc
diff --git a/src/monmaptool.cc b/src/tools/monmaptool.cc
index 57843aa350d..57843aa350d 100644
--- a/src/monmaptool.cc
+++ b/src/tools/monmaptool.cc
diff --git a/src/osdmaptool.cc b/src/tools/osdmaptool.cc
index 2e55026076c..2e55026076c 100644
--- a/src/osdmaptool.cc
+++ b/src/tools/osdmaptool.cc
diff --git a/src/psim.cc b/src/tools/psim.cc
index c1adc7580fb..c1adc7580fb 100644
--- a/src/psim.cc
+++ b/src/tools/psim.cc
diff --git a/src/rados.cc b/src/tools/rados/rados.cc
index 0b7cc2b9cb7..0b7cc2b9cb7 100644
--- a/src/rados.cc
+++ b/src/tools/rados/rados.cc
diff --git a/src/rados_export.cc b/src/tools/rados/rados_export.cc
index 5b8a899d3b8..bf6654114c5 100644
--- a/src/rados_export.cc
+++ b/src/tools/rados/rados_export.cc
@@ -11,6 +11,7 @@
* Foundation. See file COPYING.
*
*/
+#include "include/int_types.h"
#include "rados_sync.h"
#include "common/errno.h"
@@ -20,7 +21,6 @@
#include <dirent.h>
#include <errno.h>
#include <fstream>
-#include <inttypes.h>
#include <iostream>
#include <sstream>
#include <stdlib.h>
diff --git a/src/rados_import.cc b/src/tools/rados/rados_import.cc
index da968a7cc50..a6a398d767b 100644
--- a/src/rados_import.cc
+++ b/src/tools/rados/rados_import.cc
@@ -11,11 +11,11 @@
* Foundation. See file COPYING.
*
*/
+#include "include/int_types.h"
#include <dirent.h>
#include <errno.h>
#include <fstream>
-#include <inttypes.h>
#include <iostream>
#include <sstream>
#include <stdlib.h>
diff --git a/src/rados_sync.cc b/src/tools/rados/rados_sync.cc
index d16894c6ea9..03293d3402a 100644
--- a/src/rados_sync.cc
+++ b/src/tools/rados/rados_sync.cc
@@ -11,6 +11,7 @@
* Foundation. See file COPYING.
*
*/
+#include "include/int_types.h"
#include "common/ceph_argparse.h"
#include "common/config.h"
@@ -27,7 +28,6 @@
#include <dirent.h>
#include <errno.h>
#include <fstream>
-#include <inttypes.h>
#include <iostream>
#include <memory>
#include <sstream>
diff --git a/src/rados_sync.h b/src/tools/rados/rados_sync.h
index 0f7226e0239..0f7226e0239 100644
--- a/src/rados_sync.h
+++ b/src/tools/rados/rados_sync.h
diff --git a/src/radosacl.cc b/src/tools/radosacl.cc
index d2f7ca5c488..d2f7ca5c488 100644
--- a/src/radosacl.cc
+++ b/src/tools/radosacl.cc
diff --git a/src/scratchtool.c b/src/tools/scratchtool.c
index 22cf2bdf531..22cf2bdf531 100644
--- a/src/scratchtool.c
+++ b/src/tools/scratchtool.c
diff --git a/src/scratchtoolpp.cc b/src/tools/scratchtoolpp.cc
index 62096920300..62096920300 100644
--- a/src/scratchtoolpp.cc
+++ b/src/tools/scratchtoolpp.cc