Commit e8d70ce1 authored by David Howells's avatar David Howells

rxrpc: Prune the contents of the rxrpc_conn_proto struct

Prune the contents of the rxrpc_conn_proto struct.  Most of the fields aren't
used anymore.
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
parent 001c1122
...@@ -229,18 +229,12 @@ struct rxrpc_peer { ...@@ -229,18 +229,12 @@ struct rxrpc_peer {
* Keys for matching a connection. * Keys for matching a connection.
*/ */
struct rxrpc_conn_proto { struct rxrpc_conn_proto {
unsigned long hash_key; union {
struct rxrpc_local *local; /* Representation of local endpoint */ struct {
u32 epoch; /* epoch of this connection */ u32 epoch; /* epoch of this connection */
u32 cid; /* connection ID */ u32 cid; /* connection ID */
u8 in_clientflag; /* RXRPC_CLIENT_INITIATED if we are server */ };
u8 addr_size; /* Size of the address */ u64 index_key;
sa_family_t family; /* Transport protocol */
__be16 port; /* Peer UDP/UDP6 port */
union { /* Peer address */
struct in_addr ipv4_addr;
struct in6_addr ipv6_addr;
u32 raw_addr[0];
}; };
}; };
...@@ -584,7 +578,7 @@ static inline bool rxrpc_conn_is_client(const struct rxrpc_connection *conn) ...@@ -584,7 +578,7 @@ static inline bool rxrpc_conn_is_client(const struct rxrpc_connection *conn)
static inline bool rxrpc_conn_is_service(const struct rxrpc_connection *conn) static inline bool rxrpc_conn_is_service(const struct rxrpc_connection *conn)
{ {
return conn->proto.in_clientflag; return !rxrpc_conn_is_client(conn);
} }
static inline void rxrpc_get_connection(struct rxrpc_connection *conn) static inline void rxrpc_get_connection(struct rxrpc_connection *conn)
......
...@@ -566,7 +566,7 @@ struct rxrpc_call *rxrpc_incoming_call(struct rxrpc_sock *rx, ...@@ -566,7 +566,7 @@ struct rxrpc_call *rxrpc_incoming_call(struct rxrpc_sock *rx,
} }
call->epoch = conn->proto.epoch; call->epoch = conn->proto.epoch;
call->service_id = conn->params.service_id; call->service_id = conn->params.service_id;
call->in_clientflag = conn->proto.in_clientflag; call->in_clientflag = RXRPC_CLIENT_INITIATED;
/* Add the new call to the hashtable */ /* Add the new call to the hashtable */
rxrpc_call_hash_add(call); rxrpc_call_hash_add(call);
......
...@@ -132,22 +132,11 @@ rxrpc_alloc_client_connection(struct rxrpc_conn_parameters *cp, gfp_t gfp) ...@@ -132,22 +132,11 @@ rxrpc_alloc_client_connection(struct rxrpc_conn_parameters *cp, gfp_t gfp)
} }
conn->params = *cp; conn->params = *cp;
conn->proto.local = cp->local;
conn->proto.epoch = rxrpc_epoch; conn->proto.epoch = rxrpc_epoch;
conn->proto.cid = 0; conn->proto.cid = 0;
conn->proto.in_clientflag = 0;
conn->proto.family = cp->peer->srx.transport.family;
conn->out_clientflag = RXRPC_CLIENT_INITIATED; conn->out_clientflag = RXRPC_CLIENT_INITIATED;
conn->state = RXRPC_CONN_CLIENT; conn->state = RXRPC_CONN_CLIENT;
switch (conn->proto.family) {
case AF_INET:
conn->proto.addr_size = sizeof(conn->proto.ipv4_addr);
conn->proto.ipv4_addr = cp->peer->srx.transport.sin.sin_addr;
conn->proto.port = cp->peer->srx.transport.sin.sin_port;
break;
}
ret = rxrpc_get_client_connection_id(conn, gfp); ret = rxrpc_get_client_connection_id(conn, gfp);
if (ret < 0) if (ret < 0)
goto error_0; goto error_0;
......
...@@ -70,10 +70,8 @@ struct rxrpc_connection *rxrpc_incoming_connection(struct rxrpc_local *local, ...@@ -70,10 +70,8 @@ struct rxrpc_connection *rxrpc_incoming_connection(struct rxrpc_local *local,
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
} }
candidate->proto.local = local;
candidate->proto.epoch = sp->hdr.epoch; candidate->proto.epoch = sp->hdr.epoch;
candidate->proto.cid = sp->hdr.cid & RXRPC_CIDMASK; candidate->proto.cid = sp->hdr.cid & RXRPC_CIDMASK;
candidate->proto.in_clientflag = RXRPC_CLIENT_INITIATED;
candidate->params.local = local; candidate->params.local = local;
candidate->params.peer = peer; candidate->params.peer = peer;
candidate->params.service_id = sp->hdr.serviceId; candidate->params.service_id = sp->hdr.serviceId;
......
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