Skip to content

Commit e8d70ce

Browse files
committed
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 <[email protected]>
1 parent 001c112 commit e8d70ce

File tree

4 files changed

+8
-27
lines changed

4 files changed

+8
-27
lines changed

net/rxrpc/ar-internal.h

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -229,18 +229,12 @@ struct rxrpc_peer {
229229
* Keys for matching a connection.
230230
*/
231231
struct rxrpc_conn_proto {
232-
unsigned long hash_key;
233-
struct rxrpc_local *local; /* Representation of local endpoint */
234-
u32 epoch; /* epoch of this connection */
235-
u32 cid; /* connection ID */
236-
u8 in_clientflag; /* RXRPC_CLIENT_INITIATED if we are server */
237-
u8 addr_size; /* Size of the address */
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];
232+
union {
233+
struct {
234+
u32 epoch; /* epoch of this connection */
235+
u32 cid; /* connection ID */
236+
};
237+
u64 index_key;
244238
};
245239
};
246240

@@ -584,7 +578,7 @@ static inline bool rxrpc_conn_is_client(const struct rxrpc_connection *conn)
584578

585579
static inline bool rxrpc_conn_is_service(const struct rxrpc_connection *conn)
586580
{
587-
return conn->proto.in_clientflag;
581+
return !rxrpc_conn_is_client(conn);
588582
}
589583

590584
static inline void rxrpc_get_connection(struct rxrpc_connection *conn)

net/rxrpc/call_object.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ struct rxrpc_call *rxrpc_incoming_call(struct rxrpc_sock *rx,
566566
}
567567
call->epoch = conn->proto.epoch;
568568
call->service_id = conn->params.service_id;
569-
call->in_clientflag = conn->proto.in_clientflag;
569+
call->in_clientflag = RXRPC_CLIENT_INITIATED;
570570
/* Add the new call to the hashtable */
571571
rxrpc_call_hash_add(call);
572572

net/rxrpc/conn_client.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -132,22 +132,11 @@ rxrpc_alloc_client_connection(struct rxrpc_conn_parameters *cp, gfp_t gfp)
132132
}
133133

134134
conn->params = *cp;
135-
conn->proto.local = cp->local;
136135
conn->proto.epoch = rxrpc_epoch;
137136
conn->proto.cid = 0;
138-
conn->proto.in_clientflag = 0;
139-
conn->proto.family = cp->peer->srx.transport.family;
140137
conn->out_clientflag = RXRPC_CLIENT_INITIATED;
141138
conn->state = RXRPC_CONN_CLIENT;
142139

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-
151140
ret = rxrpc_get_client_connection_id(conn, gfp);
152141
if (ret < 0)
153142
goto error_0;

net/rxrpc/conn_service.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,8 @@ struct rxrpc_connection *rxrpc_incoming_connection(struct rxrpc_local *local,
7070
return ERR_PTR(-ENOMEM);
7171
}
7272

73-
candidate->proto.local = local;
7473
candidate->proto.epoch = sp->hdr.epoch;
7574
candidate->proto.cid = sp->hdr.cid & RXRPC_CIDMASK;
76-
candidate->proto.in_clientflag = RXRPC_CLIENT_INITIATED;
7775
candidate->params.local = local;
7876
candidate->params.peer = peer;
7977
candidate->params.service_id = sp->hdr.serviceId;

0 commit comments

Comments
 (0)