Skip to content

Commit

Permalink
Merge pull request ceph#15042 from badone/wip-redundant-headers-3
Browse files Browse the repository at this point in the history
common: Remove redundant includes

Reviewed-by: Kefu Chai <[email protected]>
  • Loading branch information
yuriw authored May 16, 2017
2 parents 0e03291 + bfec53f commit a49d9c5
Show file tree
Hide file tree
Showing 22 changed files with 40 additions and 61 deletions.
7 changes: 5 additions & 2 deletions src/auth/AuthServiceHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@
#ifndef CEPH_AUTHSERVICEHANDLER_H
#define CEPH_AUTHSERVICEHANDLER_H

#include "include/types.h"
#include "Auth.h"
#include <stddef.h> // for NULL
#include <stdint.h> // for uint64_t
#include "common/entity_name.h" // for EntityName
#include "include/buffer_fwd.h" // for bufferlist

class CephContext;
class KeyServer;
struct AuthCapsInfo;

struct AuthServiceHandler {
protected:
Expand Down
1 change: 0 additions & 1 deletion src/cls/journal/cls_journal_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include "include/encoding.h"
#include <iosfwd>
#include <list>
#include <set>
#include <string>

namespace ceph {
Expand Down
5 changes: 1 addition & 4 deletions src/cls/lua/cls_lua_client.cc
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#include <errno.h>
#include <string>
#include <vector>
#include "include/encoding.h"
#include "include/rados.h"
#include "include/rados/librados.h"
#include "include/types.h"
#include "include/rados/librados.hpp" // for IoCtx
#include "cls_lua_client.h"
#include "cls_lua_ops.h"

Expand Down
8 changes: 6 additions & 2 deletions src/cls/lua/cls_lua_client.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
#ifndef CLS_LUA_CLIENT_HPP
#define CLS_LUA_CLIENT_HPP
#include <string>
#include <vector>
#include "include/rados/librados.hpp"

#include "include/buffer_fwd.h" // for bufferlist

namespace librados {
class IoCtx;
}

namespace cls_lua_client {
int exec(librados::IoCtx& ioctx, const std::string& oid,
Expand Down
4 changes: 2 additions & 2 deletions src/cls/lua/cls_lua_ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#define CEPH_CLS_LUA_OPS_H

struct cls_lua_eval_op {
string script;
string handler;
std::string script;
std::string handler;
bufferlist input;

void encode(bufferlist &bl) const {
Expand Down
3 changes: 0 additions & 3 deletions src/common/Graylog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
#include "Graylog.h"

#include <iostream>
#include <sstream>

#include <arpa/inet.h>

#include "common/Formatter.h"
#include "common/LogEntry.h"
Expand Down
1 change: 0 additions & 1 deletion src/common/TextTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

#include <vector>
#include <sstream>
#include <iomanip>
#include <string>
#include "include/assert.h"

Expand Down
1 change: 0 additions & 1 deletion src/common/addr_parsing.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
*
*/

#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Expand Down
4 changes: 0 additions & 4 deletions src/common/buffer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,17 @@
#include "include/atomic.h"
#include "common/RWLock.h"
#include "include/types.h"
#include "include/compat.h"
#include "include/inline_memory.h"
#include "include/scope_guard.h"
#if defined(HAVE_XIO)
#include "msg/xio/XioMsg.h"
#endif

#include <errno.h>
#include <fstream>
#include <sstream>
#include <sys/uio.h>
#include <limits.h>

#include <atomic>
#include <ostream>

#define CEPH_BUFFER_ALLOC_UNIT (MIN(CEPH_PAGE_SIZE, 4096))
#define CEPH_BUFFER_APPEND_SIZE (CEPH_BUFFER_ALLOC_UNIT - sizeof(raw_combined))
Expand Down
2 changes: 2 additions & 0 deletions src/common/entity_name.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
#ifndef CEPH_COMMON_ENTITY_NAME_H
#define CEPH_COMMON_ENTITY_NAME_H

#include <ifaddrs.h>
#include <netinet/in.h>
#include <iosfwd>
#include <stdint.h>
#include <string>
Expand Down
7 changes: 5 additions & 2 deletions src/common/ipaddr.cc
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
#include "include/ipaddr.h"

#include <sys/socket.h>
#include <alloca.h>
#include <arpa/inet.h>
#include <ifaddrs.h>
#include <netinet/in.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>

#include <sys/socket.h>

static void netmask_ipv4(const struct in_addr *addr,
unsigned int prefix_len,
Expand Down
2 changes: 0 additions & 2 deletions src/common/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/wait.h>
#include <unistd.h>

/*
* TODO: Switch to libkmod when we abandon older platforms. The APIs
Expand Down
1 change: 1 addition & 0 deletions src/common/pick_address.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

#include <netdb.h>
#include <errno.h>
#include <ifaddrs.h>

#include "include/ipaddr.h"
#include "include/str_list.h"
Expand Down
2 changes: 0 additions & 2 deletions src/common/secret.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@

#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <fcntl.h>
#include <keyutils.h>
#include <sys/types.h>

#include "common/armor.h"
#include "common/safe_io.h"
Expand Down
5 changes: 1 addition & 4 deletions src/crush/builder.c
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
#include <string.h>
#include <limits.h>
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <errno.h>

#include "include/int_types.h"

#include "crush/crush.h"
#include "builder.h"
#include "hash.h"

#define dprintk(args...) /* printf(args) */

Expand Down
7 changes: 6 additions & 1 deletion src/crush/builder.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
#ifndef CEPH_CRUSH_BUILDER_H
#define CEPH_CRUSH_BUILDER_H

#include "crush.h"
#include "include/int_types.h"

struct crush_bucket;
struct crush_choose_arg;
struct crush_map;
struct crush_rule;

/** @ingroup API
*
Expand Down
1 change: 0 additions & 1 deletion src/include/fs_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#define CEPH_INCLUDE_FS_TYPES_H

#include "types.h"
#include "utime.h"

// --------------------------------------
// ino
Expand Down
4 changes: 0 additions & 4 deletions src/include/ipaddr.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#ifndef CEPH_IPADDR_H
#define CEPH_IPADDR_H

#include <netinet/in.h>
#include <sys/types.h>
#include <ifaddrs.h>

/*
Find an IP address that is in the wanted subnet.
Expand Down
2 changes: 1 addition & 1 deletion src/librados/RadosXattrIter.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <string>
#include <map>

#include "include/buffer.h"
#include "include/buffer.h" // for bufferlist

namespace librados {

Expand Down
24 changes: 6 additions & 18 deletions src/os/filestore/chain_xattr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,17 @@
// vim: ts=8 sw=2 smarttab

#include "chain_xattr.h"

#include "include/int_types.h"

#include <unistd.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/file.h>
#include <errno.h>
#include <dirent.h>
#include <sys/ioctl.h>
#include <string.h>
#include <stdio.h>
#include "include/assert.h"
#include <errno.h> // for ERANGE, ENODATA, ENOMEM
#include <stdio.h> // for size_t, snprintf
#include <stdlib.h> // for free, malloc
#include <string.h> // for strcpy, strlen
#include "include/assert.h" // for assert
#include "include/buffer.h"

#if defined(__linux__)
#include <linux/fs.h>
#endif

#include "common/xattr.h"
#include "include/compat.h"

/*
* chaining xattrs
*
Expand Down
9 changes: 3 additions & 6 deletions src/os/filestore/chain_xattr.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,11 @@
#ifndef __CEPH_OSD_CHAIN_XATTR_H
#define __CEPH_OSD_CHAIN_XATTR_H

#include "include/compat.h"
#include <errno.h>
#include <stdio.h>
#include "common/xattr.h"
#include "include/assert.h"
#include "include/buffer.h"
#include <string.h>
#include <stdio.h>

#include <errno.h>
#include "include/buffer_fwd.h"

#if defined(__linux__)
#include <linux/limits.h>
Expand Down
1 change: 1 addition & 0 deletions src/test/test_ipaddr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <sys/socket.h>
#endif
#include <arpa/inet.h>
#include <ifaddrs.h>

static void ipv4(struct sockaddr_in *addr, const char *s) {
int err;
Expand Down

0 comments on commit a49d9c5

Please sign in to comment.