Whamcloud - gitweb
LU-2335 lnet: remove unnecessary libcfs include
authorPeng Tao <tao.peng@emc.com>
Thu, 15 Nov 2012 09:13:02 +0000 (17:13 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 22 Mar 2013 18:26:58 +0000 (14:26 -0400)
libcfs_pack/unpack.h are only needed for WINNT.
Only include them when necessary.

Signed-off-by: Peng Tao <tao.peng@emc.com>
Change-Id: Ibe6230d37534fd087c2afe6166d10259fd59c076
Reviewed-on: http://review.whamcloud.com/4647
Tested-by: Hudson
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: John Hammond <johnlockwoodhammond@gmail.com>
lnet/include/lnet/lib-types.h
lnet/include/lnet/lnetst.h
lnet/include/lnet/socklnd.h
lnet/selftest/rpc.h

index 4d4ca7c..73b9580 100644 (file)
@@ -48,6 +48,8 @@
 #include <lnet/darwin/lib-types.h>
 #elif defined(__WINNT__)
 #include <lnet/winnt/lib-types.h>
 #include <lnet/darwin/lib-types.h>
 #elif defined(__WINNT__)
 #include <lnet/winnt/lib-types.h>
+#include <libcfs/libcfs_pack.h>
+#include <libcfs/libcfs_unpack.h>
 #else
 #error Unsupported Operating System
 #endif
 #else
 #error Unsupported Operating System
 #endif
@@ -59,7 +61,6 @@
 #define WIRE_ATTR       __attribute__((packed))
 
 /* Packed version of lnet_process_id_t to transfer via network */
 #define WIRE_ATTR       __attribute__((packed))
 
 /* Packed version of lnet_process_id_t to transfer via network */
-#include <libcfs/libcfs_pack.h>
 typedef struct {
         lnet_nid_t nid;
         lnet_pid_t pid;   /* node id / process id */
 typedef struct {
         lnet_nid_t nid;
         lnet_pid_t pid;   /* node id / process id */
@@ -73,7 +74,6 @@ typedef struct {
         __u64 wh_interface_cookie;
         __u64 wh_object_cookie;
 } WIRE_ATTR lnet_handle_wire_t;
         __u64 wh_interface_cookie;
         __u64 wh_object_cookie;
 } WIRE_ATTR lnet_handle_wire_t;
-#include <libcfs/libcfs_unpack.h>
 
 typedef enum {
         LNET_MSG_ACK = 0,
 
 typedef enum {
         LNET_MSG_ACK = 0,
@@ -87,7 +87,6 @@ typedef enum {
  * byte boundary in the message header.  Note that all types used in these
  * wire structs MUST be fixed size and the smaller types are placed at the
  * end. */
  * byte boundary in the message header.  Note that all types used in these
  * wire structs MUST be fixed size and the smaller types are placed at the
  * end. */
-#include <libcfs/libcfs_pack.h>
 typedef struct lnet_ack {
         lnet_handle_wire_t  dst_wmd;
         __u64               match_bits;
 typedef struct lnet_ack {
         lnet_handle_wire_t  dst_wmd;
         __u64               match_bits;
@@ -177,7 +176,6 @@ typedef struct {
         __u32       acr_version;                /* protocol version */
         __u64       acr_nid;                    /* target NID */
 } WIRE_ATTR lnet_acceptor_connreq_t;
         __u32       acr_version;                /* protocol version */
         __u64       acr_nid;                    /* target NID */
 } WIRE_ATTR lnet_acceptor_connreq_t;
-#include <libcfs/libcfs_unpack.h>
 
 #define LNET_PROTO_ACCEPTOR_VERSION       1
 
 
 #define LNET_PROTO_ACCEPTOR_VERSION       1
 
@@ -557,7 +555,6 @@ typedef struct {
         lnet_kiov_t            rb_kiov[0];          /* the buffer space */
 } lnet_rtrbuf_t;
 
         lnet_kiov_t            rb_kiov[0];          /* the buffer space */
 } lnet_rtrbuf_t;
 
-#include <libcfs/libcfs_pack.h>
 typedef struct {
         __u32        msgs_alloc;
         __u32        msgs_max;
 typedef struct {
         __u32        msgs_alloc;
         __u32        msgs_max;
@@ -571,7 +568,6 @@ typedef struct {
         __u64        route_length;
         __u64        drop_length;
 } WIRE_ATTR lnet_counters_t;
         __u64        route_length;
         __u64        drop_length;
 } WIRE_ATTR lnet_counters_t;
-#include <libcfs/libcfs_unpack.h>
 
 #define LNET_PEER_HASHSIZE   503                /* prime! */
 
 
 #define LNET_PEER_HASHSIZE   503                /* prime! */
 
index 6375423..22e3527 100644 (file)
@@ -469,7 +469,10 @@ typedef struct {
 } lst_test_ping_param_t;
 
 /* more tests */
 } lst_test_ping_param_t;
 
 /* more tests */
+#ifdef __WINNT__
 #include <libcfs/libcfs_pack.h>
 #include <libcfs/libcfs_pack.h>
+#include <libcfs/libcfs_unpack.h>
+#endif
 typedef struct {
         __u32 errors;
         __u32 rpcs_sent;
 typedef struct {
         __u32 errors;
         __u32 rpcs_sent;
@@ -488,6 +491,5 @@ typedef struct {
         __u32 brw_errors;
         __u32 ping_errors;
 } WIRE_ATTR sfw_counters_t;
         __u32 brw_errors;
         __u32 ping_errors;
 } WIRE_ATTR sfw_counters_t;
-#include <libcfs/libcfs_unpack.h>
 
 #endif
 
 #endif
index 8a20eaf..120fedd 100644 (file)
 
 #define SOCKLND_CONN_ACK        SOCKLND_CONN_BULK_IN
 
 
 #define SOCKLND_CONN_ACK        SOCKLND_CONN_BULK_IN
 
+#ifdef __WINNT__
 #include <libcfs/libcfs_pack.h>
 #include <libcfs/libcfs_pack.h>
+#include <libcfs/libcfs_unpack.h>
+#endif
 typedef struct {
         __u32                   kshm_magic;     /* magic number of socklnd message */
         __u32                   kshm_version;   /* version of socklnd message */
 typedef struct {
         __u32                   kshm_magic;     /* magic number of socklnd message */
         __u32                   kshm_version;   /* version of socklnd message */
@@ -93,8 +96,6 @@ socklnd_init_msg(ksock_msg_t *msg, int type)
         msg->ksm_zc_cookies[0]  = msg->ksm_zc_cookies[1]  = 0;
 }
 
         msg->ksm_zc_cookies[0]  = msg->ksm_zc_cookies[1]  = 0;
 }
 
-#include <libcfs/libcfs_unpack.h>
-
 #define KSOCK_MSG_NOOP          0xc0            /* ksm_u empty */
 #define KSOCK_MSG_LNET          0xc1            /* lnet msg */
 
 #define KSOCK_MSG_NOOP          0xc0            /* ksm_u empty */
 #define KSOCK_MSG_LNET          0xc1            /* lnet msg */
 
index 71b9054..d9cdca5 100644 (file)
@@ -65,7 +65,10 @@ typedef enum {
         SRPC_MSG_JOIN_REPLY     = 17,
 } srpc_msg_type_t;
 
         SRPC_MSG_JOIN_REPLY     = 17,
 } srpc_msg_type_t;
 
+#ifdef __WINNT__
 #include <libcfs/libcfs_pack.h>
 #include <libcfs/libcfs_pack.h>
+#include <libcfs/libcfs_unpack.h>
+#endif
 
 /* CAVEAT EMPTOR:
  * All srpc_*_reqst_t's 1st field must be matchbits of reply buffer,
 
 /* CAVEAT EMPTOR:
  * All srpc_*_reqst_t's 1st field must be matchbits of reply buffer,
@@ -284,8 +287,6 @@ typedef struct srpc_msg {
         }     msg_body;
 } WIRE_ATTR srpc_msg_t;
 
         }     msg_body;
 } WIRE_ATTR srpc_msg_t;
 
-#include <libcfs/libcfs_unpack.h>
-
 static inline void
 srpc_unpack_msg_hdr(srpc_msg_t *msg)
 {
 static inline void
 srpc_unpack_msg_hdr(srpc_msg_t *msg)
 {