diff options
| author | David Howells <dhowells@redhat.com> | 2016-06-30 07:16:21 -0400 |
|---|---|---|
| committer | David Howells <dhowells@redhat.com> | 2016-07-06 05:51:14 -0400 |
| commit | e8d70ce177eeb4fbd1c218c60118d2c19c2496a6 (patch) | |
| tree | 4f66f921714003b8743b59c92d9c01ec6a785ffa | |
| parent | 001c11224910b25e59a65ce1b49cfecdb4c631c0 (diff) | |
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: David Howells <dhowells@redhat.com>
| -rw-r--r-- | net/rxrpc/ar-internal.h | 20 | ||||
| -rw-r--r-- | net/rxrpc/call_object.c | 2 | ||||
| -rw-r--r-- | net/rxrpc/conn_client.c | 11 | ||||
| -rw-r--r-- | net/rxrpc/conn_service.c | 2 |
4 files changed, 8 insertions, 27 deletions
diff --git a/net/rxrpc/ar-internal.h b/net/rxrpc/ar-internal.h index d8e4d6e6a030..6fdee761dd0b 100644 --- a/net/rxrpc/ar-internal.h +++ b/net/rxrpc/ar-internal.h | |||
| @@ -229,18 +229,12 @@ struct rxrpc_peer { | |||
| 229 | * Keys for matching a connection. | 229 | * Keys for matching a connection. |
| 230 | */ | 230 | */ |
| 231 | struct rxrpc_conn_proto { | 231 | struct rxrpc_conn_proto { |
| 232 | unsigned long hash_key; | 232 | union { |
| 233 | struct rxrpc_local *local; /* Representation of local endpoint */ | 233 | struct { |
| 234 | u32 epoch; /* epoch of this connection */ | 234 | u32 epoch; /* epoch of this connection */ |
| 235 | u32 cid; /* connection ID */ | 235 | u32 cid; /* connection ID */ |
| 236 | u8 in_clientflag; /* RXRPC_CLIENT_INITIATED if we are server */ | 236 | }; |
| 237 | u8 addr_size; /* Size of the address */ | 237 | u64 index_key; |
| 238 | sa_family_t family; /* Transport protocol */ | ||
| 239 | __be16 port; /* Peer UDP/UDP6 port */ | ||
| 240 | union { /* Peer address */ | ||
| 241 | struct in_addr ipv4_addr; | ||
| 242 | struct in6_addr ipv6_addr; | ||
| 243 | u32 raw_addr[0]; | ||
| 244 | }; | 238 | }; |
| 245 | }; | 239 | }; |
| 246 | 240 | ||
| @@ -584,7 +578,7 @@ static inline bool rxrpc_conn_is_client(const struct rxrpc_connection *conn) | |||
| 584 | 578 | ||
| 585 | static inline bool rxrpc_conn_is_service(const struct rxrpc_connection *conn) | 579 | static inline bool rxrpc_conn_is_service(const struct rxrpc_connection *conn) |
| 586 | { | 580 | { |
| 587 | return conn->proto.in_clientflag; | 581 | return !rxrpc_conn_is_client(conn); |
| 588 | } | 582 | } |
| 589 | 583 | ||
| 590 | static inline void rxrpc_get_connection(struct rxrpc_connection *conn) | 584 | static inline void rxrpc_get_connection(struct rxrpc_connection *conn) |
diff --git a/net/rxrpc/call_object.c b/net/rxrpc/call_object.c index 3f278721269e..ebbd7dd5292f 100644 --- a/net/rxrpc/call_object.c +++ b/net/rxrpc/call_object.c | |||
| @@ -566,7 +566,7 @@ struct rxrpc_call *rxrpc_incoming_call(struct rxrpc_sock *rx, | |||
| 566 | } | 566 | } |
| 567 | call->epoch = conn->proto.epoch; | 567 | call->epoch = conn->proto.epoch; |
| 568 | call->service_id = conn->params.service_id; | 568 | call->service_id = conn->params.service_id; |
| 569 | call->in_clientflag = conn->proto.in_clientflag; | 569 | call->in_clientflag = RXRPC_CLIENT_INITIATED; |
| 570 | /* Add the new call to the hashtable */ | 570 | /* Add the new call to the hashtable */ |
| 571 | rxrpc_call_hash_add(call); | 571 | rxrpc_call_hash_add(call); |
| 572 | 572 | ||
diff --git a/net/rxrpc/conn_client.c b/net/rxrpc/conn_client.c index aa21462f3236..917db48d7f59 100644 --- a/net/rxrpc/conn_client.c +++ b/net/rxrpc/conn_client.c | |||
| @@ -132,22 +132,11 @@ rxrpc_alloc_client_connection(struct rxrpc_conn_parameters *cp, gfp_t gfp) | |||
| 132 | } | 132 | } |
| 133 | 133 | ||
| 134 | conn->params = *cp; | 134 | conn->params = *cp; |
| 135 | conn->proto.local = cp->local; | ||
| 136 | conn->proto.epoch = rxrpc_epoch; | 135 | conn->proto.epoch = rxrpc_epoch; |
| 137 | conn->proto.cid = 0; | 136 | conn->proto.cid = 0; |
| 138 | conn->proto.in_clientflag = 0; | ||
| 139 | conn->proto.family = cp->peer->srx.transport.family; | ||
| 140 | conn->out_clientflag = RXRPC_CLIENT_INITIATED; | 137 | conn->out_clientflag = RXRPC_CLIENT_INITIATED; |
| 141 | conn->state = RXRPC_CONN_CLIENT; | 138 | conn->state = RXRPC_CONN_CLIENT; |
| 142 | 139 | ||
| 143 | switch (conn->proto.family) { | ||
| 144 | case AF_INET: | ||
| 145 | conn->proto.addr_size = sizeof(conn->proto.ipv4_addr); | ||
| 146 | conn->proto.ipv4_addr = cp->peer->srx.transport.sin.sin_addr; | ||
| 147 | conn->proto.port = cp->peer->srx.transport.sin.sin_port; | ||
| 148 | break; | ||
| 149 | } | ||
| 150 | |||
| 151 | ret = rxrpc_get_client_connection_id(conn, gfp); | 140 | ret = rxrpc_get_client_connection_id(conn, gfp); |
| 152 | if (ret < 0) | 141 | if (ret < 0) |
| 153 | goto error_0; | 142 | goto error_0; |
diff --git a/net/rxrpc/conn_service.c b/net/rxrpc/conn_service.c index 77a509e6003a..c6db2e8400a2 100644 --- a/net/rxrpc/conn_service.c +++ b/net/rxrpc/conn_service.c | |||
| @@ -70,10 +70,8 @@ struct rxrpc_connection *rxrpc_incoming_connection(struct rxrpc_local *local, | |||
| 70 | return ERR_PTR(-ENOMEM); | 70 | return ERR_PTR(-ENOMEM); |
| 71 | } | 71 | } |
| 72 | 72 | ||
| 73 | candidate->proto.local = local; | ||
| 74 | candidate->proto.epoch = sp->hdr.epoch; | 73 | candidate->proto.epoch = sp->hdr.epoch; |
| 75 | candidate->proto.cid = sp->hdr.cid & RXRPC_CIDMASK; | 74 | candidate->proto.cid = sp->hdr.cid & RXRPC_CIDMASK; |
| 76 | candidate->proto.in_clientflag = RXRPC_CLIENT_INITIATED; | ||
| 77 | candidate->params.local = local; | 75 | candidate->params.local = local; |
| 78 | candidate->params.peer = peer; | 76 | candidate->params.peer = peer; |
| 79 | candidate->params.service_id = sp->hdr.serviceId; | 77 | candidate->params.service_id = sp->hdr.serviceId; |
