Skip to content

Commit 7530e44

Browse files
committed
Merge branch 'sctp-cleanups'
Xin Long says: ==================== sctp: some cleanups for sctp There are some unused function and redundant rcu locks should be removed. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents bd4508e + 1cd4d5c commit 7530e44

File tree

4 files changed

+2
-18
lines changed

4 files changed

+2
-18
lines changed

include/net/sctp/structs.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,6 @@ struct sctp_datamsg {
535535
struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *,
536536
struct sctp_sndrcvinfo *,
537537
struct iov_iter *);
538-
void sctp_datamsg_free(struct sctp_datamsg *);
539538
void sctp_datamsg_put(struct sctp_datamsg *);
540539
void sctp_chunk_fail(struct sctp_chunk *, int error);
541540
int sctp_chunk_abandoned(struct sctp_chunk *);

net/sctp/chunk.c

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -70,19 +70,6 @@ static struct sctp_datamsg *sctp_datamsg_new(gfp_t gfp)
7070
return msg;
7171
}
7272

73-
void sctp_datamsg_free(struct sctp_datamsg *msg)
74-
{
75-
struct sctp_chunk *chunk;
76-
77-
/* This doesn't have to be a _safe vairant because
78-
* sctp_chunk_free() only drops the refs.
79-
*/
80-
list_for_each_entry(chunk, &msg->chunks, frag_list)
81-
sctp_chunk_free(chunk);
82-
83-
sctp_datamsg_put(msg);
84-
}
85-
8673
/* Final destructruction of datamsg memory. */
8774
static void sctp_datamsg_destroy(struct sctp_datamsg *msg)
8875
{

net/sctp/input.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -937,7 +937,6 @@ static struct sctp_association *__sctp_lookup_association(
937937
struct sctp_transport *t;
938938
struct sctp_association *asoc = NULL;
939939

940-
rcu_read_lock();
941940
t = sctp_addrs_lookup_transport(net, local, peer);
942941
if (!t || !sctp_transport_hold(t))
943942
goto out;
@@ -949,7 +948,6 @@ static struct sctp_association *__sctp_lookup_association(
949948
sctp_transport_put(t);
950949

951950
out:
952-
rcu_read_unlock();
953951
return asoc;
954952
}
955953

@@ -962,7 +960,9 @@ struct sctp_association *sctp_lookup_association(struct net *net,
962960
{
963961
struct sctp_association *asoc;
964962

963+
rcu_read_lock();
965964
asoc = __sctp_lookup_association(net, laddr, paddr, transportp);
965+
rcu_read_unlock();
966966

967967
return asoc;
968968
}

net/sctp/proc.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ static void sctp_seq_dump_remote_addrs(struct seq_file *seq, struct sctp_associa
161161
struct sctp_af *af;
162162

163163
primary = &assoc->peer.primary_addr;
164-
rcu_read_lock();
165164
list_for_each_entry_rcu(transport, &assoc->peer.transport_addr_list,
166165
transports) {
167166
addr = &transport->ipaddr;
@@ -172,7 +171,6 @@ static void sctp_seq_dump_remote_addrs(struct seq_file *seq, struct sctp_associa
172171
}
173172
af->seq_dump_addr(seq, addr);
174173
}
175-
rcu_read_unlock();
176174
}
177175

178176
static void *sctp_eps_seq_start(struct seq_file *seq, loff_t *pos)

0 commit comments

Comments
 (0)