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
This commit is contained in:
parent
691bc0eb29
commit
e327dc882d
@ -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_enumerate(char ***names);
|
||||
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_accept(socket_t **newsockp, socket_t *sock);
|
||||
void libcfs_sock_abort_accept(socket_t *sock);
|
||||
int libcfs_sock_connect(socket_t **sockp, int *fatal,
|
||||
int libcfs_sock_listen(struct socket **sockp, __u32 ip, int port, int backlog);
|
||||
int libcfs_sock_accept(struct socket **newsockp, struct socket *sock);
|
||||
void libcfs_sock_abort_accept(struct socket *sock);
|
||||
int libcfs_sock_connect(struct socket **sockp, int *fatal,
|
||||
__u32 local_ip, int local_port,
|
||||
__u32 peer_ip, int peer_port);
|
||||
int libcfs_sock_setbuf(socket_t *socket, int txbufsize, int rxbufsize);
|
||||
int libcfs_sock_getbuf(socket_t *socket, int *txbufsize, int *rxbufsize);
|
||||
int libcfs_sock_getaddr(socket_t *socket, int remote, __u32 *ip, int *port);
|
||||
int libcfs_sock_write(socket_t *sock, void *buffer, int nob, int timeout);
|
||||
int libcfs_sock_read(socket_t *sock, void *buffer, int nob, int timeout);
|
||||
void libcfs_sock_release(socket_t *sock);
|
||||
int libcfs_sock_setbuf(struct socket *socket, int txbufsize, int rxbufsize);
|
||||
int libcfs_sock_getbuf(struct socket *socket, int *txbufsize, int *rxbufsize);
|
||||
int libcfs_sock_getaddr(struct socket *socket, int remote, __u32 *ip, int *port);
|
||||
int libcfs_sock_write(struct socket *sock, void *buffer, int nob, int timeout);
|
||||
int libcfs_sock_read(struct socket *sock, void *buffer, int nob, int timeout);
|
||||
void libcfs_sock_release(struct socket *sock);
|
||||
|
||||
/* need both kernel and user-land acceptor */
|
||||
#define LNET_ACCEPTOR_MIN_RESERVED_PORT 512
|
||||
|
@ -47,8 +47,6 @@
|
||||
|
||||
#include <net/sock.h>
|
||||
|
||||
typedef struct socket socket_t;
|
||||
|
||||
#define SOCK_SNDBUF(so) ((so)->sk->sk_sndbuf)
|
||||
#define SOCK_TEST_NOSPACE(so) test_bit(SOCK_NOSPACE, &(so)->flags)
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user