Commit e327dc88 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

staging: lustre: remove socket_t typedef

Use 'struct socket' like the rest of the kernel does.

Cc: Andreas Dilger <andreas.dilger@intel.com>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Cc: hpdd-discuss <hpdd-discuss@lists.01.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org
parent 691bc0eb
...@@ -89,18 +89,18 @@ static inline int __is_po2(unsigned long long val) ...@@ -89,18 +89,18 @@ static inline int __is_po2(unsigned long long val)
int libcfs_ipif_query(char *name, int *up, __u32 *ip, __u32 *mask); int libcfs_ipif_query(char *name, int *up, __u32 *ip, __u32 *mask);
int libcfs_ipif_enumerate(char ***names); int libcfs_ipif_enumerate(char ***names);
void libcfs_ipif_free_enumeration(char **names, int n); void libcfs_ipif_free_enumeration(char **names, int n);
int libcfs_sock_listen(socket_t **sockp, __u32 ip, int port, int backlog); int libcfs_sock_listen(struct socket **sockp, __u32 ip, int port, int backlog);
int libcfs_sock_accept(socket_t **newsockp, socket_t *sock); int libcfs_sock_accept(struct socket **newsockp, struct socket *sock);
void libcfs_sock_abort_accept(socket_t *sock); void libcfs_sock_abort_accept(struct socket *sock);
int libcfs_sock_connect(socket_t **sockp, int *fatal, int libcfs_sock_connect(struct socket **sockp, int *fatal,
__u32 local_ip, int local_port, __u32 local_ip, int local_port,
__u32 peer_ip, int peer_port); __u32 peer_ip, int peer_port);
int libcfs_sock_setbuf(socket_t *socket, int txbufsize, int rxbufsize); int libcfs_sock_setbuf(struct socket *socket, int txbufsize, int rxbufsize);
int libcfs_sock_getbuf(socket_t *socket, int *txbufsize, int *rxbufsize); int libcfs_sock_getbuf(struct socket *socket, int *txbufsize, int *rxbufsize);
int libcfs_sock_getaddr(socket_t *socket, int remote, __u32 *ip, int *port); int libcfs_sock_getaddr(struct socket *socket, int remote, __u32 *ip, int *port);
int libcfs_sock_write(socket_t *sock, void *buffer, int nob, int timeout); int libcfs_sock_write(struct socket *sock, void *buffer, int nob, int timeout);
int libcfs_sock_read(socket_t *sock, void *buffer, int nob, int timeout); int libcfs_sock_read(struct socket *sock, void *buffer, int nob, int timeout);
void libcfs_sock_release(socket_t *sock); void libcfs_sock_release(struct socket *sock);
/* need both kernel and user-land acceptor */ /* need both kernel and user-land acceptor */
#define LNET_ACCEPTOR_MIN_RESERVED_PORT 512 #define LNET_ACCEPTOR_MIN_RESERVED_PORT 512
......
...@@ -47,8 +47,6 @@ ...@@ -47,8 +47,6 @@
#include <net/sock.h> #include <net/sock.h>
typedef struct socket socket_t;
#define SOCK_SNDBUF(so) ((so)->sk->sk_sndbuf) #define SOCK_SNDBUF(so) ((so)->sk->sk_sndbuf)
#define SOCK_TEST_NOSPACE(so) test_bit(SOCK_NOSPACE, &(so)->flags) #define SOCK_TEST_NOSPACE(so) test_bit(SOCK_NOSPACE, &(so)->flags)
......
...@@ -829,7 +829,7 @@ void lnet_register_lnd(lnd_t *lnd); ...@@ -829,7 +829,7 @@ void lnet_register_lnd(lnd_t *lnd);
void lnet_unregister_lnd(lnd_t *lnd); void lnet_unregister_lnd(lnd_t *lnd);
int lnet_set_ip_niaddr(lnet_ni_t *ni); 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); __u32 local_ip, __u32 peer_ip, int peer_port);
void lnet_connect_console_error(int rc, lnet_nid_t peer_nid, void lnet_connect_console_error(int rc, lnet_nid_t peer_nid,
__u32 peer_ip, int port); __u32 peer_ip, int port);
......
...@@ -365,7 +365,7 @@ typedef struct lnet_lnd { ...@@ -365,7 +365,7 @@ typedef struct lnet_lnd {
void (*lnd_query)(struct lnet_ni *ni, lnet_nid_t peer, cfs_time_t *when); void (*lnd_query)(struct lnet_ni *ni, lnet_nid_t peer, cfs_time_t *when);
/* accept a new connection */ /* 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; } lnd_t;
......
...@@ -962,7 +962,7 @@ ksocknal_create_routes(ksock_peer_t *peer, int port, ...@@ -962,7 +962,7 @@ ksocknal_create_routes(ksock_peer_t *peer, int port,
} }
int int
ksocknal_accept (lnet_ni_t *ni, socket_t *sock) ksocknal_accept (lnet_ni_t *ni, struct socket *sock)
{ {
ksock_connreq_t *cr; ksock_connreq_t *cr;
int rc; int rc;
...@@ -1008,7 +1008,7 @@ ksocknal_connecting (ksock_peer_t *peer, __u32 ipaddr) ...@@ -1008,7 +1008,7 @@ ksocknal_connecting (ksock_peer_t *peer, __u32 ipaddr)
int int
ksocknal_create_conn (lnet_ni_t *ni, ksock_route_t *route, 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; rwlock_t *global_lock = &ksocknal_data.ksnd_global_lock;
LIST_HEAD (zombies); LIST_HEAD (zombies);
......
...@@ -262,7 +262,7 @@ typedef struct ksock_conn ...@@ -262,7 +262,7 @@ typedef struct ksock_conn
struct ksock_peer *ksnc_peer; /* owning peer */ struct ksock_peer *ksnc_peer; /* owning peer */
struct ksock_route *ksnc_route; /* owning route */ struct ksock_route *ksnc_route; /* owning route */
struct list_head ksnc_list; /* stash on peer's conn list */ 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_data_ready; /* socket's original data_ready() callback */
void *ksnc_saved_write_space; /* socket's original write_space() callback */ void *ksnc_saved_write_space; /* socket's original write_space() callback */
atomic_t ksnc_conn_refcount; /* conn refcount */ atomic_t ksnc_conn_refcount; /* conn refcount */
...@@ -362,7 +362,7 @@ typedef struct ksock_connreq ...@@ -362,7 +362,7 @@ typedef struct ksock_connreq
{ {
struct list_head ksncr_list; /* stash on ksnd_connd_connreqs */ struct list_head ksncr_list; /* stash on ksnd_connd_connreqs */
lnet_ni_t *ksncr_ni; /* chosen NI */ lnet_ni_t *ksncr_ni; /* chosen NI */
socket_t *ksncr_sock; /* accepted socket */ struct socket *ksncr_sock; /* accepted socket */
} ksock_connreq_t; } ksock_connreq_t;
extern ksock_nal_data_t ksocknal_data; extern ksock_nal_data_t ksocknal_data;
...@@ -527,14 +527,14 @@ int ksocknal_recv(lnet_ni_t *ni, void *private, lnet_msg_t *lntmsg, ...@@ -527,14 +527,14 @@ int ksocknal_recv(lnet_ni_t *ni, void *private, lnet_msg_t *lntmsg,
int delayed, unsigned int niov, int delayed, unsigned int niov,
struct iovec *iov, lnet_kiov_t *kiov, struct iovec *iov, lnet_kiov_t *kiov,
unsigned int offset, unsigned int mlen, unsigned int rlen); 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 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_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 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 void ksocknal_peer_failed (ksock_peer_t *peer);
extern int ksocknal_create_conn (lnet_ni_t *ni, ksock_route_t *route, 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_close_conn_locked (ksock_conn_t *conn, int why);
extern void ksocknal_terminate_conn (ksock_conn_t *conn); extern void ksocknal_terminate_conn (ksock_conn_t *conn);
extern void ksocknal_destroy_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); ...@@ -574,12 +574,12 @@ extern void ksocknal_read_callback(ksock_conn_t *conn);
extern void ksocknal_write_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 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_save_callback(struct socket *sock, ksock_conn_t *conn);
extern void ksocknal_lib_set_callback(socket_t *sock, ksock_conn_t *conn); extern void ksocknal_lib_set_callback(struct socket *sock, ksock_conn_t *conn);
extern void ksocknal_lib_reset_callback(socket_t *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 void ksocknal_lib_push_conn (ksock_conn_t *conn);
extern int ksocknal_lib_get_conn_addrs (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_iov (ksock_conn_t *conn, ksock_tx_t *tx);
extern int ksocknal_lib_send_kiov (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); extern void ksocknal_lib_eager_ack (ksock_conn_t *conn);
......
...@@ -1699,7 +1699,7 @@ ksocknal_recv_hello (lnet_ni_t *ni, ksock_conn_t *conn, ...@@ -1699,7 +1699,7 @@ ksocknal_recv_hello (lnet_ni_t *ni, ksock_conn_t *conn,
* EALREADY lost connection race * EALREADY lost connection race
* EPROTO protocol version mismatch * EPROTO protocol version mismatch
*/ */
socket_t *sock = conn->ksnc_sock; struct socket *sock = conn->ksnc_sock;
int active = (conn->ksnc_proto != NULL); int active = (conn->ksnc_proto != NULL);
int timeout; int timeout;
int proto_match; int proto_match;
...@@ -1844,7 +1844,7 @@ ksocknal_connect (ksock_route_t *route) ...@@ -1844,7 +1844,7 @@ ksocknal_connect (ksock_route_t *route)
ksock_peer_t *peer = route->ksnr_peer; ksock_peer_t *peer = route->ksnr_peer;
int type; int type;
int wanted; int wanted;
socket_t *sock; struct socket *sock;
cfs_time_t deadline; cfs_time_t deadline;
int retry_later = 0; int retry_later = 0;
int rc = 0; int rc = 0;
......
...@@ -452,7 +452,7 @@ ksocknal_handle_zcack(ksock_conn_t *conn, __u64 cookie1, __u64 cookie2) ...@@ -452,7 +452,7 @@ ksocknal_handle_zcack(ksock_conn_t *conn, __u64 cookie1, __u64 cookie2)
static int static int
ksocknal_send_hello_v1 (ksock_conn_t *conn, ksock_hello_msg_t *hello) 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_hdr_t *hdr;
lnet_magicversion_t *hmv; lnet_magicversion_t *hmv;
int rc; int rc;
...@@ -527,7 +527,7 @@ ksocknal_send_hello_v1 (ksock_conn_t *conn, ksock_hello_msg_t *hello) ...@@ -527,7 +527,7 @@ ksocknal_send_hello_v1 (ksock_conn_t *conn, ksock_hello_msg_t *hello)
static int static int
ksocknal_send_hello_v2 (ksock_conn_t *conn, ksock_hello_msg_t *hello) 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; int rc;
hello->kshm_magic = LNET_PROTO_MAGIC; hello->kshm_magic = LNET_PROTO_MAGIC;
...@@ -570,7 +570,7 @@ ksocknal_send_hello_v2 (ksock_conn_t *conn, ksock_hello_msg_t *hello) ...@@ -570,7 +570,7 @@ ksocknal_send_hello_v2 (ksock_conn_t *conn, ksock_hello_msg_t *hello)
static int static int
ksocknal_recv_hello_v1(ksock_conn_t *conn, ksock_hello_msg_t *hello,int timeout) 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; lnet_hdr_t *hdr;
int rc; int rc;
int i; int i;
...@@ -646,7 +646,7 @@ ksocknal_recv_hello_v1(ksock_conn_t *conn, ksock_hello_msg_t *hello,int timeout) ...@@ -646,7 +646,7 @@ ksocknal_recv_hello_v1(ksock_conn_t *conn, ksock_hello_msg_t *hello,int timeout)
static int static int
ksocknal_recv_hello_v2 (ksock_conn_t *conn, ksock_hello_msg_t *hello, int timeout) 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 rc;
int i; int i;
......
...@@ -44,7 +44,7 @@ static int accept_timeout = 5; ...@@ -44,7 +44,7 @@ static int accept_timeout = 5;
struct { struct {
int pta_shutdown; int pta_shutdown;
socket_t *pta_sock; struct socket *pta_sock;
struct completion pta_signal; struct completion pta_signal;
} lnet_acceptor_state; } lnet_acceptor_state;
...@@ -139,11 +139,11 @@ lnet_connect_console_error(int rc, lnet_nid_t peer_nid, ...@@ -139,11 +139,11 @@ lnet_connect_console_error(int rc, lnet_nid_t peer_nid,
EXPORT_SYMBOL(lnet_connect_console_error); EXPORT_SYMBOL(lnet_connect_console_error);
int 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) __u32 local_ip, __u32 peer_ip, int peer_port)
{ {
lnet_acceptor_connreq_t cr; lnet_acceptor_connreq_t cr;
socket_t *sock; struct socket *sock;
int rc; int rc;
int port; int port;
int fatal; int fatal;
...@@ -208,7 +208,7 @@ EXPORT_SYMBOL(lnet_connect); ...@@ -208,7 +208,7 @@ EXPORT_SYMBOL(lnet_connect);
/* Below is the code common for both kernel and MT user-space */ /* Below is the code common for both kernel and MT user-space */
int int
lnet_accept(socket_t *sock, __u32 magic) lnet_accept(struct socket *sock, __u32 magic)
{ {
lnet_acceptor_connreq_t cr; lnet_acceptor_connreq_t cr;
__u32 peer_ip; __u32 peer_ip;
...@@ -332,7 +332,7 @@ lnet_accept(socket_t *sock, __u32 magic) ...@@ -332,7 +332,7 @@ lnet_accept(socket_t *sock, __u32 magic)
int int
lnet_acceptor(void *arg) lnet_acceptor(void *arg)
{ {
socket_t *newsock; struct socket *newsock;
int rc; int rc;
__u32 magic; __u32 magic;
__u32 peer_ip; __u32 peer_ip;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment