From: Greg Kroah-Hartman Date: Sat, 12 Jul 2014 06:42:52 +0000 (-0700) Subject: staging: lustre: remove socket_t typedef X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=e327dc882d1136882889ae5a302a06e4a591ed9c;p=openwrt%2Fstaging%2Fblogic.git staging: lustre: remove socket_t typedef Use 'struct socket' like the rest of the kernel does. Cc: Andreas Dilger Cc: Oleg Drokin Cc: hpdd-discuss Signed-off-by: Greg Kroah-Hartman -typedef struct socket socket_t; - #define SOCK_SNDBUF(so) ((so)->sk->sk_sndbuf) #define SOCK_TEST_NOSPACE(so) test_bit(SOCK_NOSPACE, &(so)->flags) diff --git a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h index 5c5c2f989c80..e5c72eb49467 100644 --- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h +++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h @@ -829,7 +829,7 @@ void lnet_register_lnd(lnd_t *lnd); void lnet_unregister_lnd(lnd_t *lnd); int lnet_set_ip_niaddr(lnet_ni_t *ni); -int lnet_connect(socket_t **sockp, lnet_nid_t peer_nid, +int lnet_connect(struct socket **sockp, lnet_nid_t peer_nid, __u32 local_ip, __u32 peer_ip, int peer_port); void lnet_connect_console_error(int rc, lnet_nid_t peer_nid, __u32 peer_ip, int port); diff --git a/drivers/staging/lustre/include/linux/lnet/lib-types.h b/drivers/staging/lustre/include/linux/lnet/lib-types.h index d0b0c261ba03..936b829b947a 100644 --- a/drivers/staging/lustre/include/linux/lnet/lib-types.h +++ b/drivers/staging/lustre/include/linux/lnet/lib-types.h @@ -365,7 +365,7 @@ typedef struct lnet_lnd { void (*lnd_query)(struct lnet_ni *ni, lnet_nid_t peer, cfs_time_t *when); /* accept a new connection */ - int (*lnd_accept)(struct lnet_ni *ni, socket_t *sock); + int (*lnd_accept)(struct lnet_ni *ni, struct socket *sock); } lnd_t; diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c index 425c0fb17bc6..237394ca4ed9 100644 --- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c +++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c @@ -962,7 +962,7 @@ ksocknal_create_routes(ksock_peer_t *peer, int port, } int -ksocknal_accept (lnet_ni_t *ni, socket_t *sock) +ksocknal_accept (lnet_ni_t *ni, struct socket *sock) { ksock_connreq_t *cr; int rc; @@ -1008,7 +1008,7 @@ ksocknal_connecting (ksock_peer_t *peer, __u32 ipaddr) int ksocknal_create_conn (lnet_ni_t *ni, ksock_route_t *route, - socket_t *sock, int type) + struct socket *sock, int type) { rwlock_t *global_lock = &ksocknal_data.ksnd_global_lock; LIST_HEAD (zombies); diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h index 256cfc00015b..0446d5081e71 100644 --- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h +++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h @@ -262,7 +262,7 @@ typedef struct ksock_conn struct ksock_peer *ksnc_peer; /* owning peer */ struct ksock_route *ksnc_route; /* owning route */ struct list_head ksnc_list; /* stash on peer's conn list */ - socket_t *ksnc_sock; /* actual socket */ + struct socket *ksnc_sock; /* actual socket */ void *ksnc_saved_data_ready; /* socket's original data_ready() callback */ void *ksnc_saved_write_space; /* socket's original write_space() callback */ atomic_t ksnc_conn_refcount; /* conn refcount */ @@ -362,7 +362,7 @@ typedef struct ksock_connreq { struct list_head ksncr_list; /* stash on ksnd_connd_connreqs */ lnet_ni_t *ksncr_ni; /* chosen NI */ - socket_t *ksncr_sock; /* accepted socket */ + struct socket *ksncr_sock; /* accepted socket */ } ksock_connreq_t; extern ksock_nal_data_t ksocknal_data; @@ -527,14 +527,14 @@ int ksocknal_recv(lnet_ni_t *ni, void *private, lnet_msg_t *lntmsg, int delayed, unsigned int niov, struct iovec *iov, lnet_kiov_t *kiov, unsigned int offset, unsigned int mlen, unsigned int rlen); -int ksocknal_accept(lnet_ni_t *ni, socket_t *sock); +int ksocknal_accept(lnet_ni_t *ni, struct socket *sock); extern int ksocknal_add_peer(lnet_ni_t *ni, lnet_process_id_t id, __u32 ip, int port); extern ksock_peer_t *ksocknal_find_peer_locked (lnet_ni_t *ni, lnet_process_id_t id); extern ksock_peer_t *ksocknal_find_peer (lnet_ni_t *ni, lnet_process_id_t id); extern void ksocknal_peer_failed (ksock_peer_t *peer); extern int ksocknal_create_conn (lnet_ni_t *ni, ksock_route_t *route, - socket_t *sock, int type); + struct socket *sock, int type); extern void ksocknal_close_conn_locked (ksock_conn_t *conn, int why); extern void ksocknal_terminate_conn (ksock_conn_t *conn); extern void ksocknal_destroy_conn (ksock_conn_t *conn); @@ -574,12 +574,12 @@ extern void ksocknal_read_callback(ksock_conn_t *conn); extern void ksocknal_write_callback(ksock_conn_t *conn); extern int ksocknal_lib_zc_capable(ksock_conn_t *conn); -extern void ksocknal_lib_save_callback(socket_t *sock, ksock_conn_t *conn); -extern void ksocknal_lib_set_callback(socket_t *sock, ksock_conn_t *conn); -extern void ksocknal_lib_reset_callback(socket_t *sock, ksock_conn_t *conn); +extern void ksocknal_lib_save_callback(struct socket *sock, ksock_conn_t *conn); +extern void ksocknal_lib_set_callback(struct socket *sock, ksock_conn_t *conn); +extern void ksocknal_lib_reset_callback(struct socket *sock, ksock_conn_t *conn); extern void ksocknal_lib_push_conn (ksock_conn_t *conn); extern int ksocknal_lib_get_conn_addrs (ksock_conn_t *conn); -extern int ksocknal_lib_setup_sock (socket_t *so); +extern int ksocknal_lib_setup_sock (struct socket *so); extern int ksocknal_lib_send_iov (ksock_conn_t *conn, ksock_tx_t *tx); extern int ksocknal_lib_send_kiov (ksock_conn_t *conn, ksock_tx_t *tx); extern void ksocknal_lib_eager_ack (ksock_conn_t *conn); diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c index 75bd6583493e..3d0e59dd054e 100644 --- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c +++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c @@ -1699,7 +1699,7 @@ ksocknal_recv_hello (lnet_ni_t *ni, ksock_conn_t *conn, * EALREADY lost connection race * EPROTO protocol version mismatch */ - socket_t *sock = conn->ksnc_sock; + struct socket *sock = conn->ksnc_sock; int active = (conn->ksnc_proto != NULL); int timeout; int proto_match; @@ -1844,7 +1844,7 @@ ksocknal_connect (ksock_route_t *route) ksock_peer_t *peer = route->ksnr_peer; int type; int wanted; - socket_t *sock; + struct socket *sock; cfs_time_t deadline; int retry_later = 0; int rc = 0; diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_proto.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_proto.c index 2d91571cbab2..c2e49a76177a 100644 --- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_proto.c +++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_proto.c @@ -452,7 +452,7 @@ ksocknal_handle_zcack(ksock_conn_t *conn, __u64 cookie1, __u64 cookie2) static int ksocknal_send_hello_v1 (ksock_conn_t *conn, ksock_hello_msg_t *hello) { - socket_t *sock = conn->ksnc_sock; + struct socket *sock = conn->ksnc_sock; lnet_hdr_t *hdr; lnet_magicversion_t *hmv; int rc; @@ -527,7 +527,7 @@ out: static int ksocknal_send_hello_v2 (ksock_conn_t *conn, ksock_hello_msg_t *hello) { - socket_t *sock = conn->ksnc_sock; + struct socket *sock = conn->ksnc_sock; int rc; hello->kshm_magic = LNET_PROTO_MAGIC; @@ -570,7 +570,7 @@ ksocknal_send_hello_v2 (ksock_conn_t *conn, ksock_hello_msg_t *hello) static int ksocknal_recv_hello_v1(ksock_conn_t *conn, ksock_hello_msg_t *hello,int timeout) { - socket_t *sock = conn->ksnc_sock; + struct socket *sock = conn->ksnc_sock; lnet_hdr_t *hdr; int rc; int i; @@ -646,7 +646,7 @@ out: static int ksocknal_recv_hello_v2 (ksock_conn_t *conn, ksock_hello_msg_t *hello, int timeout) { - socket_t *sock = conn->ksnc_sock; + struct socket *sock = conn->ksnc_sock; int rc; int i; diff --git a/drivers/staging/lustre/lnet/lnet/acceptor.c b/drivers/staging/lustre/lnet/lnet/acceptor.c index 640daa173b02..001c4b7ed0ce 100644 --- a/drivers/staging/lustre/lnet/lnet/acceptor.c +++ b/drivers/staging/lustre/lnet/lnet/acceptor.c @@ -44,7 +44,7 @@ static int accept_timeout = 5; struct { int pta_shutdown; - socket_t *pta_sock; + struct socket *pta_sock; struct completion pta_signal; } lnet_acceptor_state; @@ -139,11 +139,11 @@ lnet_connect_console_error(int rc, lnet_nid_t peer_nid, EXPORT_SYMBOL(lnet_connect_console_error); int -lnet_connect(socket_t **sockp, lnet_nid_t peer_nid, +lnet_connect(struct socket **sockp, lnet_nid_t peer_nid, __u32 local_ip, __u32 peer_ip, int peer_port) { lnet_acceptor_connreq_t cr; - socket_t *sock; + struct socket *sock; int rc; int port; int fatal; @@ -208,7 +208,7 @@ EXPORT_SYMBOL(lnet_connect); /* Below is the code common for both kernel and MT user-space */ int -lnet_accept(socket_t *sock, __u32 magic) +lnet_accept(struct socket *sock, __u32 magic) { lnet_acceptor_connreq_t cr; __u32 peer_ip; @@ -332,7 +332,7 @@ lnet_accept(socket_t *sock, __u32 magic) int lnet_acceptor(void *arg) { - socket_t *newsock; + struct socket *newsock; int rc; __u32 magic; __u32 peer_ip;