Skip to content

Commit b848b26

Browse files
dhowellskuba-moo
authored andcommitted
net: Kill MSG_SENDPAGE_NOTLAST
Now that ->sendpage() has been removed, MSG_SENDPAGE_NOTLAST can be cleaned up. Things were converted to use MSG_MORE instead, but the protocol sendpage stubs still convert MSG_SENDPAGE_NOTLAST to MSG_MORE, which is now unnecessary. Signed-off-by: David Howells <[email protected]> cc: Jens Axboe <[email protected]> cc: Matthew Wilcox <[email protected]> cc: [email protected] cc: [email protected] cc: [email protected] cc: [email protected] cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent dc97391 commit b848b26

File tree

6 files changed

+5
-12
lines changed

6 files changed

+5
-12
lines changed

include/linux/socket.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,6 @@ struct ucred {
319319
#define MSG_MORE 0x8000 /* Sender will send more */
320320
#define MSG_WAITFORONE 0x10000 /* recvmmsg(): block until 1+ packets avail */
321321
#define MSG_SENDPAGE_NOPOLICY 0x10000 /* sendpage() internal : do no apply policy */
322-
#define MSG_SENDPAGE_NOTLAST 0x20000 /* sendpage() internal : not the last page */
323322
#define MSG_BATCH 0x40000 /* sendmmsg(): more messages coming */
324323
#define MSG_EOF MSG_FIN
325324
#define MSG_NO_SHARED_FRAGS 0x80000 /* sendpage() internal : page frags are not shared */
@@ -341,8 +340,7 @@ struct ucred {
341340

342341
/* Flags to be cleared on entry by sendmsg and sendmmsg syscalls */
343342
#define MSG_INTERNAL_SENDMSG_FLAGS \
344-
(MSG_SPLICE_PAGES | MSG_SENDPAGE_NOPOLICY | MSG_SENDPAGE_NOTLAST | \
345-
MSG_SENDPAGE_DECRYPTED)
343+
(MSG_SPLICE_PAGES | MSG_SENDPAGE_NOPOLICY | MSG_SENDPAGE_DECRYPTED)
346344

347345
/* Setsockoptions(2) level. Thanks to BSD these must match IPPROTO_xxx */
348346
#define SOL_IP 0

net/tls/tls_device.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,8 +441,7 @@ static int tls_push_data(struct sock *sk,
441441
long timeo;
442442

443443
if (flags &
444-
~(MSG_MORE | MSG_DONTWAIT | MSG_NOSIGNAL | MSG_SENDPAGE_NOTLAST |
445-
MSG_SPLICE_PAGES))
444+
~(MSG_MORE | MSG_DONTWAIT | MSG_NOSIGNAL | MSG_SPLICE_PAGES))
446445
return -EOPNOTSUPP;
447446

448447
if (unlikely(sk->sk_err))

net/tls/tls_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ int tls_push_sg(struct sock *sk,
127127
{
128128
struct bio_vec bvec;
129129
struct msghdr msg = {
130-
.msg_flags = MSG_SENDPAGE_NOTLAST | MSG_SPLICE_PAGES | flags,
130+
.msg_flags = MSG_SPLICE_PAGES | flags,
131131
};
132132
int ret = 0;
133133
struct page *p;

net/tls/tls_sw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1194,7 +1194,7 @@ int tls_sw_sendmsg(struct sock *sk, struct msghdr *msg, size_t size)
11941194

11951195
if (msg->msg_flags & ~(MSG_MORE | MSG_DONTWAIT | MSG_NOSIGNAL |
11961196
MSG_CMSG_COMPAT | MSG_SPLICE_PAGES |
1197-
MSG_SENDPAGE_NOTLAST | MSG_SENDPAGE_NOPOLICY))
1197+
MSG_SENDPAGE_NOPOLICY))
11981198
return -EOPNOTSUPP;
11991199

12001200
ret = mutex_lock_interruptible(&tls_ctx->tx_lock);

tools/perf/trace/beauty/include/linux/socket.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,6 @@ struct ucred {
318318
#define MSG_MORE 0x8000 /* Sender will send more */
319319
#define MSG_WAITFORONE 0x10000 /* recvmmsg(): block until 1+ packets avail */
320320
#define MSG_SENDPAGE_NOPOLICY 0x10000 /* sendpage() internal : do no apply policy */
321-
#define MSG_SENDPAGE_NOTLAST 0x20000 /* sendpage() internal : not the last page */
322321
#define MSG_BATCH 0x40000 /* sendmmsg(): more messages coming */
323322
#define MSG_EOF MSG_FIN
324323
#define MSG_NO_SHARED_FRAGS 0x80000 /* sendpage() internal : page frags are not shared */

tools/perf/trace/beauty/msg_flags.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
#ifndef MSG_WAITFORONE
99
#define MSG_WAITFORONE 0x10000
1010
#endif
11-
#ifndef MSG_SENDPAGE_NOTLAST
12-
#define MSG_SENDPAGE_NOTLAST 0x20000
13-
#endif
1411
#ifndef MSG_FASTOPEN
1512
#define MSG_FASTOPEN 0x20000000
1613
#endif
@@ -50,7 +47,7 @@ static size_t syscall_arg__scnprintf_msg_flags(char *bf, size_t size,
5047
P_MSG_FLAG(NOSIGNAL);
5148
P_MSG_FLAG(MORE);
5249
P_MSG_FLAG(WAITFORONE);
53-
P_MSG_FLAG(SENDPAGE_NOTLAST);
50+
P_MSG_FLAG(SPLICE_PAGES);
5451
P_MSG_FLAG(FASTOPEN);
5552
P_MSG_FLAG(CMSG_CLOEXEC);
5653
#undef P_MSG_FLAG

0 commit comments

Comments
 (0)