Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Xin Long and committed by
David S. Miller
83dbc3d4 64519440

+13 -19
+2 -2
include/net/sctp/structs.h
··· 1077 1077 void sctp_outq_init(struct sctp_association *, struct sctp_outq *); 1078 1078 void sctp_outq_teardown(struct sctp_outq *); 1079 1079 void sctp_outq_free(struct sctp_outq*); 1080 - int sctp_outq_tail(struct sctp_outq *, struct sctp_chunk *chunk, gfp_t); 1080 + void sctp_outq_tail(struct sctp_outq *, struct sctp_chunk *chunk, gfp_t); 1081 1081 int sctp_outq_sack(struct sctp_outq *, struct sctp_chunk *); 1082 1082 int sctp_outq_is_empty(const struct sctp_outq *); 1083 1083 void sctp_outq_restart(struct sctp_outq *); ··· 1085 1085 void sctp_retransmit(struct sctp_outq *, struct sctp_transport *, 1086 1086 sctp_retransmit_reason_t); 1087 1087 void sctp_retransmit_mark(struct sctp_outq *, struct sctp_transport *, __u8); 1088 - int sctp_outq_uncork(struct sctp_outq *, gfp_t gfp); 1088 + void sctp_outq_uncork(struct sctp_outq *, gfp_t gfp); 1089 1089 void sctp_prsctp_prune(struct sctp_association *asoc, 1090 1090 struct sctp_sndrcvinfo *sinfo, int msg_len); 1091 1091 /* Uncork and flush an outqueue. */
+7 -12
net/sctp/outqueue.c
··· 68 68 69 69 static void sctp_generate_fwdtsn(struct sctp_outq *q, __u32 sack_ctsn); 70 70 71 - static int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout, gfp_t gfp); 71 + static void sctp_outq_flush(struct sctp_outq *q, int rtx_timeout, gfp_t gfp); 72 72 73 73 /* Add data to the front of the queue. */ 74 74 static inline void sctp_outq_head_data(struct sctp_outq *q, ··· 285 285 } 286 286 287 287 /* Put a new chunk in an sctp_outq. */ 288 - int sctp_outq_tail(struct sctp_outq *q, struct sctp_chunk *chunk, gfp_t gfp) 288 + void sctp_outq_tail(struct sctp_outq *q, struct sctp_chunk *chunk, gfp_t gfp) 289 289 { 290 290 struct net *net = sock_net(q->asoc->base.sk); 291 - int error = 0; 292 291 293 292 pr_debug("%s: outq:%p, chunk:%p[%s]\n", __func__, q, chunk, 294 293 chunk && chunk->chunk_hdr ? ··· 317 318 } 318 319 319 320 if (!q->cork) 320 - error = sctp_outq_flush(q, 0, gfp); 321 - 322 - return error; 321 + sctp_outq_flush(q, 0, gfp); 323 322 } 324 323 325 324 /* Insert a chunk into the sorted list based on the TSNs. The retransmit list ··· 745 748 } 746 749 747 750 /* Cork the outqueue so queued chunks are really queued. */ 748 - int sctp_outq_uncork(struct sctp_outq *q, gfp_t gfp) 751 + void sctp_outq_uncork(struct sctp_outq *q, gfp_t gfp) 749 752 { 750 753 if (q->cork) 751 754 q->cork = 0; 752 755 753 - return sctp_outq_flush(q, 0, gfp); 756 + sctp_outq_flush(q, 0, gfp); 754 757 } 755 758 756 759 ··· 763 766 * locking concerns must be made. Today we use the sock lock to protect 764 767 * this function. 765 768 */ 766 - static int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout, gfp_t gfp) 769 + static void sctp_outq_flush(struct sctp_outq *q, int rtx_timeout, gfp_t gfp) 767 770 { 768 771 struct sctp_packet *packet; 769 772 struct sctp_packet singleton; ··· 888 891 error = sctp_packet_transmit(&singleton, gfp); 889 892 if (error < 0) { 890 893 asoc->base.sk->sk_err = -error; 891 - return 0; 894 + return; 892 895 } 893 896 break; 894 897 ··· 1172 1175 /* Clear the burst limited state, if any */ 1173 1176 sctp_transport_burst_reset(t); 1174 1177 } 1175 - 1176 - return 0; 1177 1178 } 1178 1179 1179 1180 /* Update unack_data based on the incoming SACK chunk */
+4 -5
net/sctp/sm_sideeffect.c
··· 1421 1421 local_cork = 1; 1422 1422 } 1423 1423 /* Send a chunk to our peer. */ 1424 - error = sctp_outq_tail(&asoc->outqueue, cmd->obj.chunk, 1425 - gfp); 1424 + sctp_outq_tail(&asoc->outqueue, cmd->obj.chunk, gfp); 1426 1425 break; 1427 1426 1428 1427 case SCTP_CMD_SEND_PKT: ··· 1675 1676 case SCTP_CMD_FORCE_PRIM_RETRAN: 1676 1677 t = asoc->peer.retran_path; 1677 1678 asoc->peer.retran_path = asoc->peer.primary_path; 1678 - error = sctp_outq_uncork(&asoc->outqueue, gfp); 1679 + sctp_outq_uncork(&asoc->outqueue, gfp); 1679 1680 local_cork = 0; 1680 1681 asoc->peer.retran_path = t; 1681 1682 break; ··· 1732 1733 */ 1733 1734 if (asoc && SCTP_EVENT_T_CHUNK == event_type && chunk) { 1734 1735 if (chunk->end_of_packet || chunk->singleton) 1735 - error = sctp_outq_uncork(&asoc->outqueue, gfp); 1736 + sctp_outq_uncork(&asoc->outqueue, gfp); 1736 1737 } else if (local_cork) 1737 - error = sctp_outq_uncork(&asoc->outqueue, gfp); 1738 + sctp_outq_uncork(&asoc->outqueue, gfp); 1738 1739 1739 1740 if (sp->data_ready_signalled) 1740 1741 sp->data_ready_signalled = 0;