From 4faeedc99284ce4e6b86bec39309b949fb5423ac Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Wed, 14 Nov 2012 12:23:36 +0530 Subject: "gcc -pedantic": made 'inline' functions as 'static inline' functions for passing the build with -pedantic flag Change-Id: I80fd9528321e4c6ea5bec32bf5cdc54cc4e4f65e BUG: 875913 Signed-off-by: Amar Tumballi Reviewed-on: http://review.gluster.org/4186 Reviewed-by: Jeff Darcy Tested-by: Gluster Build System Reviewed-by: Anand Avati --- libglusterfs/src/fd.h | 2 +- libglusterfs/src/rbthash.c | 4 ++-- rpc/rpc-lib/src/rpc-clnt.c | 2 +- rpc/rpc-lib/src/rpcsvc.c | 10 +++++----- rpc/rpc-lib/src/rpcsvc.h | 2 +- rpc/rpc-transport/rdma/src/rdma.c | 10 +++++----- rpc/rpc-transport/socket/src/socket.c | 24 ++++++++++++------------ xlators/performance/io-cache/src/io-cache.c | 8 ++++---- xlators/performance/io-cache/src/io-cache.h | 2 -- 9 files changed, 31 insertions(+), 33 deletions(-) diff --git a/libglusterfs/src/fd.h b/libglusterfs/src/fd.h index a70707bc1..e2f54bc9d 100644 --- a/libglusterfs/src/fd.h +++ b/libglusterfs/src/fd.h @@ -84,7 +84,7 @@ typedef struct _fdtable fdtable_t; #include "xlator.h" -inline void +void gf_fd_put (fdtable_t *fdtable, int32_t fd); diff --git a/libglusterfs/src/rbthash.c b/libglusterfs/src/rbthash.c index cced943a3..0d7b9e521 100644 --- a/libglusterfs/src/rbthash.c +++ b/libglusterfs/src/rbthash.c @@ -227,7 +227,7 @@ rbthash_deinit_entry (rbthash_table_t *tbl, rbthash_entry_t *entry) } -inline struct rbthash_bucket * +static inline struct rbthash_bucket * rbthash_entry_bucket (rbthash_table_t *tbl, rbthash_entry_t * entry) { int nbucket = 0; @@ -301,7 +301,7 @@ err: return ret; } -inline struct rbthash_bucket * +static inline struct rbthash_bucket * rbthash_key_bucket (rbthash_table_t *tbl, void *key, int keylen) { uint32_t keyhash = 0; diff --git a/rpc/rpc-lib/src/rpc-clnt.c b/rpc/rpc-lib/src/rpc-clnt.c index b3f88d2ea..e6c681df8 100644 --- a/rpc/rpc-lib/src/rpc-clnt.c +++ b/rpc/rpc-lib/src/rpc-clnt.c @@ -944,7 +944,7 @@ rpc_clnt_connection_deinit (rpc_clnt_connection_t *conn) } -inline int +static inline int rpc_clnt_connection_init (struct rpc_clnt *clnt, glusterfs_ctx_t *ctx, dict_t *options, char *name) { diff --git a/rpc/rpc-lib/src/rpcsvc.c b/rpc/rpc-lib/src/rpcsvc.c index 1c49c09b1..bb14f11be 100644 --- a/rpc/rpc-lib/src/rpcsvc.c +++ b/rpc/rpc-lib/src/rpcsvc.c @@ -223,7 +223,7 @@ err: /* this procedure can only pass 4 arguments to registered notifyfn. To send more * arguments call wrapper->notify directly. */ -inline void +static inline void rpcsvc_program_notify (rpcsvc_listener_t *listener, rpcsvc_event_t event, void *data) { @@ -246,7 +246,7 @@ out: } -inline int +static inline int rpcsvc_accept (rpcsvc_t *svc, rpc_transport_t *listen_trans, rpc_transport_t *new_trans) { @@ -719,7 +719,7 @@ err: return txrecord; } -inline int +static inline int rpcsvc_get_callid (rpcsvc_t *rpc) { return GF_UNIVERSAL_ANSWER; @@ -905,7 +905,7 @@ out: return ret; } -inline int +static inline int rpcsvc_transport_submit (rpc_transport_t *trans, struct iovec *hdrvec, int hdrcount, struct iovec *proghdr, int proghdrcount, struct iovec *progpayload, int progpayloadcount, @@ -1174,7 +1174,7 @@ out: } -inline int +static inline int rpcsvc_program_unregister_portmap (rpcsvc_program_t *prog) { int ret = 0; diff --git a/rpc/rpc-lib/src/rpcsvc.h b/rpc/rpc-lib/src/rpcsvc.h index 39ae383f4..c0cb7fcac 100644 --- a/rpc/rpc-lib/src/rpcsvc.h +++ b/rpc/rpc-lib/src/rpcsvc.h @@ -451,7 +451,7 @@ rpcsvc_error_reply (rpcsvc_request_t *req); extern int rpcsvc_transport_peername (rpc_transport_t *trans, char *hostname, int hostlen); -extern inline int +extern int rpcsvc_transport_peeraddr (rpc_transport_t *trans, char *addrstr, int addrlen, struct sockaddr_storage *returnsa, socklen_t sasize); diff --git a/rpc/rpc-transport/rdma/src/rdma.c b/rpc/rpc-transport/rdma/src/rdma.c index 9e5879364..a44e8995f 100644 --- a/rpc/rpc-transport/rdma/src/rdma.c +++ b/rpc/rpc-transport/rdma/src/rdma.c @@ -711,7 +711,7 @@ out: } -inline void +static inline void __gf_rdma_deregister_mr (struct ibv_mr **mr, int count) { int i = 0; @@ -1114,7 +1114,7 @@ out: } -inline void +static inline void __gf_rdma_fill_reply_header (gf_rdma_header_t *header, struct iovec *rpchdr, gf_rdma_reply_info_t *reply_info, int credits) { @@ -1263,7 +1263,7 @@ out: } -inline int32_t +static inline int32_t __gf_rdma_register_local_mr_for_rdma (gf_rdma_peer_t *peer, struct iovec *vector, int count, gf_rdma_post_context_t *ctx) @@ -2765,7 +2765,7 @@ out: } -inline int32_t +static inline int32_t gf_rdma_decode_error_msg (gf_rdma_peer_t *peer, gf_rdma_post_t *post, size_t bytes_in_post) { @@ -3307,7 +3307,7 @@ out: } -inline int32_t +static inline int32_t gf_rdma_recv_request (gf_rdma_peer_t *peer, gf_rdma_post_t *post, gf_rdma_read_chunk_t *readch) { diff --git a/rpc/rpc-transport/socket/src/socket.c b/rpc/rpc-transport/socket/src/socket.c index 91d386be1..9494362bc 100644 --- a/rpc/rpc-transport/socket/src/socket.c +++ b/rpc/rpc-transport/socket/src/socket.c @@ -1071,7 +1071,7 @@ out: } -inline int +static inline int __socket_read_simple_msg (rpc_transport_t *this) { int ret = 0; @@ -1140,7 +1140,7 @@ out: } -inline int +static inline int __socket_read_simple_request (rpc_transport_t *this) { return __socket_read_simple_msg (this); @@ -1157,7 +1157,7 @@ __socket_read_simple_request (rpc_transport_t *this) #define rpc_progver_addr(buf) (buf + RPC_MSGTYPE_SIZE + 8) #define rpc_procnum_addr(buf) (buf + RPC_MSGTYPE_SIZE + 12) -inline int +static inline int __socket_read_vectored_request (rpc_transport_t *this, rpcsvc_vector_sizer vector_sizer) { socket_private_t *priv = NULL; @@ -1329,7 +1329,7 @@ out: return ret; } -inline int +static inline int __socket_read_request (rpc_transport_t *this) { socket_private_t *priv = NULL; @@ -1410,7 +1410,7 @@ out: } -inline int +static inline int __socket_read_accepted_successful_reply (rpc_transport_t *this) { socket_private_t *priv = NULL; @@ -1537,7 +1537,7 @@ out: #define rpc_reply_verflen_addr(fragcurrent) ((char *)fragcurrent - 4) #define rpc_reply_accept_status_addr(fragcurrent) ((char *)fragcurrent - 4) -inline int +static inline int __socket_read_accepted_reply (rpc_transport_t *this) { socket_private_t *priv = NULL; @@ -1633,7 +1633,7 @@ out: } -inline int +static inline int __socket_read_denied_reply (rpc_transport_t *this) { return __socket_read_simple_msg (this); @@ -1643,7 +1643,7 @@ __socket_read_denied_reply (rpc_transport_t *this) #define rpc_reply_status_addr(fragcurrent) ((char *)fragcurrent - 4) -inline int +static inline int __socket_read_vectored_reply (rpc_transport_t *this) { socket_private_t *priv = NULL; @@ -1709,7 +1709,7 @@ out: } -inline int +static inline int __socket_read_simple_reply (rpc_transport_t *this) { return __socket_read_simple_msg (this); @@ -1717,7 +1717,7 @@ __socket_read_simple_reply (rpc_transport_t *this) #define rpc_xid_addr(buf) (buf) -inline int +static inline int __socket_read_reply (rpc_transport_t *this) { socket_private_t *priv = NULL; @@ -1787,7 +1787,7 @@ out: /* returns the number of bytes yet to be read in a fragment */ -inline int +static inline int __socket_read_frag (rpc_transport_t *this) { socket_private_t *priv = NULL; @@ -1856,7 +1856,7 @@ out: } -inline +static inline void __socket_reset_priv (socket_private_t *priv) { struct gf_sock_incoming *in = NULL; diff --git a/xlators/performance/io-cache/src/io-cache.c b/xlators/performance/io-cache/src/io-cache.c index 0793e6043..a7459a9a3 100644 --- a/xlators/performance/io-cache/src/io-cache.c +++ b/xlators/performance/io-cache/src/io-cache.c @@ -31,7 +31,7 @@ ioc_get_priority (ioc_table_t *table, const char *path); struct volume_options options[]; -inline uint32_t +static inline uint32_t ioc_hashfn (void *data, int len) { off_t offset; @@ -41,7 +41,7 @@ ioc_hashfn (void *data, int len) return (offset >> ioc_log2_page_size); } -inline ioc_inode_t * +static inline ioc_inode_t * ioc_inode_reupdate (ioc_inode_t *ioc_inode) { ioc_table_t *table = NULL; @@ -54,7 +54,7 @@ ioc_inode_reupdate (ioc_inode_t *ioc_inode) return ioc_inode; } -inline ioc_inode_t * +static inline ioc_inode_t * ioc_get_inode (dict_t *dict, char *name) { ioc_inode_t *ioc_inode = NULL; @@ -489,7 +489,7 @@ out: return ret; } -inline uint32_t +static inline uint32_t is_match (const char *path, const char *pattern) { int32_t ret = 0; diff --git a/xlators/performance/io-cache/src/io-cache.h b/xlators/performance/io-cache/src/io-cache.h index 41bbeea8b..46d758a66 100644 --- a/xlators/performance/io-cache/src/io-cache.h +++ b/xlators/performance/io-cache/src/io-cache.h @@ -329,6 +329,4 @@ ioc_prune (ioc_table_t *table); int32_t ioc_need_prune (ioc_table_t *table); -inline uint32_t -ioc_hashfn (void *data, int len); #endif /* __IO_CACHE_H */ -- cgit