Commit 83dbc3d4 authored by Xin Long's avatar Xin Long Committed by David S. Miller

sctp: make sctp_outq_flush/tail/uncork return void

sctp_outq_flush return value is meaningless now, this patch is
to make sctp_outq_flush return void, as well as sctp_outq_fail
and sctp_outq_uncork.
Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 64519440
...@@ -1077,7 +1077,7 @@ struct sctp_outq { ...@@ -1077,7 +1077,7 @@ struct sctp_outq {
void sctp_outq_init(struct sctp_association *, struct sctp_outq *); void sctp_outq_init(struct sctp_association *, struct sctp_outq *);
void sctp_outq_teardown(struct sctp_outq *); void sctp_outq_teardown(struct sctp_outq *);
void sctp_outq_free(struct sctp_outq*); void sctp_outq_free(struct sctp_outq*);
int sctp_outq_tail(struct sctp_outq *, struct sctp_chunk *chunk, gfp_t); void sctp_outq_tail(struct sctp_outq *, struct sctp_chunk *chunk, gfp_t);
int sctp_outq_sack(struct sctp_outq *, struct sctp_chunk *); int sctp_outq_sack(struct sctp_outq *, struct sctp_chunk *);
int sctp_outq_is_empty(const struct sctp_outq *); int sctp_outq_is_empty(const struct sctp_outq *);
void sctp_outq_restart(struct sctp_outq *); void sctp_outq_restart(struct sctp_outq *);
...@@ -1085,7 +1085,7 @@ void sctp_outq_restart(struct sctp_outq *); ...@@ -1085,7 +1085,7 @@ void sctp_outq_restart(struct sctp_outq *);
void sctp_retransmit(struct sctp_outq *, struct sctp_transport *, void sctp_retransmit(struct sctp_outq *, struct sctp_transport *,
sctp_retransmit_reason_t); sctp_retransmit_reason_t);
void sctp_retransmit_mark(struct sctp_outq *, struct sctp_transport *, __u8); void sctp_retransmit_mark(struct sctp_outq *, struct sctp_transport *, __u8);
int sctp_outq_uncork(struct sctp_outq *, gfp_t gfp); void sctp_outq_uncork(struct sctp_outq *, gfp_t gfp);
void sctp_prsctp_prune(struct sctp_association *asoc, void sctp_prsctp_prune(struct sctp_association *asoc,
struct sctp_sndrcvinfo *sinfo, int msg_len); struct sctp_sndrcvinfo *sinfo, int msg_len);
/* Uncork and flush an outqueue. */ /* Uncork and flush an outqueue. */
......
...@@ -68,7 +68,7 @@ static void sctp_mark_missing(struct sctp_outq *q, ...@@ -68,7 +68,7 @@ static void sctp_mark_missing(struct sctp_outq *q,
static void sctp_generate_fwdtsn(struct sctp_outq *q, __u32 sack_ctsn); static void sctp_generate_fwdtsn(struct sctp_outq *q, __u32 sack_ctsn);
static int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout, gfp_t gfp); static void sctp_outq_flush(struct sctp_outq *q, int rtx_timeout, gfp_t gfp);
/* Add data to the front of the queue. */ /* Add data to the front of the queue. */
static inline void sctp_outq_head_data(struct sctp_outq *q, static inline void sctp_outq_head_data(struct sctp_outq *q,
...@@ -285,10 +285,9 @@ void sctp_outq_free(struct sctp_outq *q) ...@@ -285,10 +285,9 @@ void sctp_outq_free(struct sctp_outq *q)
} }
/* Put a new chunk in an sctp_outq. */ /* Put a new chunk in an sctp_outq. */
int sctp_outq_tail(struct sctp_outq *q, struct sctp_chunk *chunk, gfp_t gfp) void sctp_outq_tail(struct sctp_outq *q, struct sctp_chunk *chunk, gfp_t gfp)
{ {
struct net *net = sock_net(q->asoc->base.sk); struct net *net = sock_net(q->asoc->base.sk);
int error = 0;
pr_debug("%s: outq:%p, chunk:%p[%s]\n", __func__, q, chunk, pr_debug("%s: outq:%p, chunk:%p[%s]\n", __func__, q, chunk,
chunk && chunk->chunk_hdr ? chunk && chunk->chunk_hdr ?
...@@ -318,9 +317,7 @@ int sctp_outq_tail(struct sctp_outq *q, struct sctp_chunk *chunk, gfp_t gfp) ...@@ -318,9 +317,7 @@ int sctp_outq_tail(struct sctp_outq *q, struct sctp_chunk *chunk, gfp_t gfp)
} }
if (!q->cork) if (!q->cork)
error = sctp_outq_flush(q, 0, gfp); sctp_outq_flush(q, 0, gfp);
return error;
} }
/* Insert a chunk into the sorted list based on the TSNs. The retransmit list /* Insert a chunk into the sorted list based on the TSNs. The retransmit list
...@@ -748,12 +745,12 @@ static int sctp_outq_flush_rtx(struct sctp_outq *q, struct sctp_packet *pkt, ...@@ -748,12 +745,12 @@ static int sctp_outq_flush_rtx(struct sctp_outq *q, struct sctp_packet *pkt,
} }
/* Cork the outqueue so queued chunks are really queued. */ /* Cork the outqueue so queued chunks are really queued. */
int sctp_outq_uncork(struct sctp_outq *q, gfp_t gfp) void sctp_outq_uncork(struct sctp_outq *q, gfp_t gfp)
{ {
if (q->cork) if (q->cork)
q->cork = 0; q->cork = 0;
return sctp_outq_flush(q, 0, gfp); sctp_outq_flush(q, 0, gfp);
} }
...@@ -766,7 +763,7 @@ int sctp_outq_uncork(struct sctp_outq *q, gfp_t gfp) ...@@ -766,7 +763,7 @@ int sctp_outq_uncork(struct sctp_outq *q, gfp_t gfp)
* locking concerns must be made. Today we use the sock lock to protect * locking concerns must be made. Today we use the sock lock to protect
* this function. * this function.
*/ */
static int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout, gfp_t gfp) static void sctp_outq_flush(struct sctp_outq *q, int rtx_timeout, gfp_t gfp)
{ {
struct sctp_packet *packet; struct sctp_packet *packet;
struct sctp_packet singleton; struct sctp_packet singleton;
...@@ -891,7 +888,7 @@ static int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout, gfp_t gfp) ...@@ -891,7 +888,7 @@ static int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout, gfp_t gfp)
error = sctp_packet_transmit(&singleton, gfp); error = sctp_packet_transmit(&singleton, gfp);
if (error < 0) { if (error < 0) {
asoc->base.sk->sk_err = -error; asoc->base.sk->sk_err = -error;
return 0; return;
} }
break; break;
...@@ -1175,8 +1172,6 @@ static int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout, gfp_t gfp) ...@@ -1175,8 +1172,6 @@ static int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout, gfp_t gfp)
/* Clear the burst limited state, if any */ /* Clear the burst limited state, if any */
sctp_transport_burst_reset(t); sctp_transport_burst_reset(t);
} }
return 0;
} }
/* Update unack_data based on the incoming SACK chunk */ /* Update unack_data based on the incoming SACK chunk */
......
...@@ -1421,8 +1421,7 @@ static int sctp_cmd_interpreter(sctp_event_t event_type, ...@@ -1421,8 +1421,7 @@ static int sctp_cmd_interpreter(sctp_event_t event_type,
local_cork = 1; local_cork = 1;
} }
/* Send a chunk to our peer. */ /* Send a chunk to our peer. */
error = sctp_outq_tail(&asoc->outqueue, cmd->obj.chunk, sctp_outq_tail(&asoc->outqueue, cmd->obj.chunk, gfp);
gfp);
break; break;
case SCTP_CMD_SEND_PKT: case SCTP_CMD_SEND_PKT:
...@@ -1676,7 +1675,7 @@ static int sctp_cmd_interpreter(sctp_event_t event_type, ...@@ -1676,7 +1675,7 @@ static int sctp_cmd_interpreter(sctp_event_t event_type,
case SCTP_CMD_FORCE_PRIM_RETRAN: case SCTP_CMD_FORCE_PRIM_RETRAN:
t = asoc->peer.retran_path; t = asoc->peer.retran_path;
asoc->peer.retran_path = asoc->peer.primary_path; asoc->peer.retran_path = asoc->peer.primary_path;
error = sctp_outq_uncork(&asoc->outqueue, gfp); sctp_outq_uncork(&asoc->outqueue, gfp);
local_cork = 0; local_cork = 0;
asoc->peer.retran_path = t; asoc->peer.retran_path = t;
break; break;
...@@ -1733,9 +1732,9 @@ static int sctp_cmd_interpreter(sctp_event_t event_type, ...@@ -1733,9 +1732,9 @@ static int sctp_cmd_interpreter(sctp_event_t event_type,
*/ */
if (asoc && SCTP_EVENT_T_CHUNK == event_type && chunk) { if (asoc && SCTP_EVENT_T_CHUNK == event_type && chunk) {
if (chunk->end_of_packet || chunk->singleton) if (chunk->end_of_packet || chunk->singleton)
error = sctp_outq_uncork(&asoc->outqueue, gfp); sctp_outq_uncork(&asoc->outqueue, gfp);
} else if (local_cork) } else if (local_cork)
error = sctp_outq_uncork(&asoc->outqueue, gfp); sctp_outq_uncork(&asoc->outqueue, gfp);
if (sp->data_ready_signalled) if (sp->data_ready_signalled)
sp->data_ready_signalled = 0; sp->data_ready_signalled = 0;
......
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