Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
056fb9ae
Commit
056fb9ae
authored
22 years ago
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ia64/ppc64/s390x/sparc64/x86_64]: Update for sock->ops->recvmsg AIO changes.
parent
a16c20c7
No related merge requests found
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
143 additions
and
60 deletions
+143
-60
arch/ia64/ia32/sys_ia32.c
arch/ia64/ia32/sys_ia32.c
+25
-10
arch/ppc64/kernel/sys_ppc32.c
arch/ppc64/kernel/sys_ppc32.c
+24
-10
arch/s390x/kernel/linux32.c
arch/s390x/kernel/linux32.c
+46
-20
arch/sparc64/kernel/sys_sparc32.c
arch/sparc64/kernel/sys_sparc32.c
+24
-10
arch/x86_64/ia32/socket32.c
arch/x86_64/ia32/socket32.c
+24
-10
No files found.
arch/ia64/ia32/sys_ia32.c
View file @
056fb9ae
...
...
@@ -1763,7 +1763,6 @@ sys32_recvmsg (int fd, struct msghdr32 *msg, unsigned int flags)
struct
msghdr
msg_sys
;
unsigned
long
cmsg_ptr
;
int
err
,
iov_size
,
total_len
,
len
;
struct
scm_cookie
scm
;
/* kernel mode address */
char
addr
[
MAX_SOCK_ADDR
];
...
...
@@ -1811,20 +1810,35 @@ sys32_recvmsg (int fd, struct msghdr32 *msg, unsigned int flags)
if
(
sock
->
file
->
f_flags
&
O_NONBLOCK
)
flags
|=
MSG_DONTWAIT
;
memset
(
&
scm
,
0
,
sizeof
(
scm
));
/* XXX This code needs massive updating... -DaveM */
lock_kernel
();
{
err
=
sock
->
ops
->
recvmsg
(
sock
,
&
msg_sys
,
total_len
,
flags
,
&
scm
);
struct
sock_iocb
*
si
;
struct
kiocb
iocb
;
init_sync_kiocb
(
&
iocb
,
NULL
);
si
=
kiocb_to_siocb
(
&
iocb
);
si
->
sock
=
sock
;
si
->
scm
=
&
si
->
async_scm
;
si
->
msg
=
&
msg_sys
;
si
->
size
=
total_len
;
si
->
flags
=
flags
;
memset
(
si
->
scm
,
0
,
sizeof
(
*
si
->
scm
));
err
=
sock
->
ops
->
recvmsg
(
&
iocb
,
sock
,
&
msg_sys
,
total_len
,
flags
,
si
->
scm
);
if
(
-
EIOCBQUEUED
==
err
)
err
=
wait_on_sync_kiocb
(
&
iocb
);
if
(
err
<
0
)
goto
out_unlock_freeiov
;
len
=
err
;
if
(
!
msg_sys
.
msg_control
)
{
if
(
sock
->
passcred
||
s
cm
.
fp
)
if
(
sock
->
passcred
||
s
i
->
scm
->
fp
)
msg_sys
.
msg_flags
|=
MSG_CTRUNC
;
if
(
s
cm
.
fp
)
__scm_destroy
(
&
scm
);
if
(
s
i
->
scm
->
fp
)
__scm_destroy
(
si
->
scm
);
}
else
{
/*
* If recvmsg processing itself placed some control messages into
...
...
@@ -1837,9 +1851,10 @@ sys32_recvmsg (int fd, struct msghdr32 *msg, unsigned int flags)
/* Wheee... */
if
(
sock
->
passcred
)
put_cmsg32
(
&
msg_sys
,
SOL_SOCKET
,
SCM_CREDENTIALS
,
sizeof
(
scm
.
creds
),
&
scm
.
creds
);
if
(
scm
.
fp
!=
NULL
)
scm_detach_fds32
(
&
msg_sys
,
&
scm
);
sizeof
(
si
->
scm
->
creds
),
&
si
->
scm
->
creds
);
if
(
si
->
scm
->
fp
!=
NULL
)
scm_detach_fds32
(
&
msg_sys
,
si
->
scm
);
}
}
unlock_kernel
();
...
...
This diff is collapsed.
Click to expand it.
arch/ppc64/kernel/sys_ppc32.c
View file @
056fb9ae
...
...
@@ -3320,20 +3320,33 @@ asmlinkage long sys32_recvmsg(int fd, struct msghdr32* user_msg, unsigned int us
sock
=
sockfd_lookup
(
fd
,
&
err
);
if
(
sock
!=
NULL
)
{
struct
scm_cookie
scm
;
struct
sock_iocb
*
si
;
struct
kiocb
iocb
;
if
(
sock
->
file
->
f_flags
&
O_NONBLOCK
)
user_flags
|=
MSG_DONTWAIT
;
memset
(
&
scm
,
0
,
sizeof
(
scm
));
err
=
sock
->
ops
->
recvmsg
(
sock
,
&
kern_msg
,
total_len
,
user_flags
,
&
scm
);
init_sync_kiocb
(
&
iocb
,
NULL
);
si
=
kiocb_to_siocb
(
&
iocb
);
si
->
sock
=
sock
;
si
->
scm
=
&
si
->
async_scm
;
si
->
msg
=
&
kern_msg
;
si
->
size
=
total_len
;
si
->
flags
=
user_flags
;
memset
(
si
->
scm
,
0
,
sizeof
(
*
si
->
scm
));
err
=
sock
->
ops
->
recvmsg
(
&
iocb
,
sock
,
&
kern_msg
,
total_len
,
user_flags
,
si
->
scm
);
if
(
-
EIOCBQUEUED
==
err
)
err
=
wait_on_sync_kiocb
(
&
iocb
);
if
(
err
>=
0
)
{
len
=
err
;
if
(
!
kern_msg
.
msg_control
)
{
if
(
sock
->
passcred
||
s
cm
.
fp
)
if
(
sock
->
passcred
||
s
i
->
scm
->
fp
)
kern_msg
.
msg_flags
|=
MSG_CTRUNC
;
if
(
s
cm
.
fp
)
__scm_destroy
(
&
scm
);
if
(
s
i
->
scm
->
fp
)
__scm_destroy
(
si
->
scm
);
}
else
{
/* If recvmsg processing itself placed some
* control messages into user space, it's is
...
...
@@ -3347,9 +3360,10 @@ asmlinkage long sys32_recvmsg(int fd, struct msghdr32* user_msg, unsigned int us
if
(
sock
->
passcred
)
put_cmsg32
(
&
kern_msg
,
SOL_SOCKET
,
SCM_CREDENTIALS
,
sizeof
(
scm
.
creds
),
&
scm
.
creds
);
if
(
scm
.
fp
!=
NULL
)
scm_detach_fds32
(
&
kern_msg
,
&
scm
);
sizeof
(
si
->
scm
->
creds
),
&
si
->
scm
->
creds
);
if
(
si
->
scm
->
fp
!=
NULL
)
scm_detach_fds32
(
&
kern_msg
,
si
->
scm
);
}
}
sockfd_put
(
sock
);
...
...
This diff is collapsed.
Click to expand it.
arch/s390x/kernel/linux32.c
View file @
056fb9ae
...
...
@@ -2596,20 +2596,33 @@ asmlinkage int sys32_recvmsg(int fd, struct msghdr32 *user_msg, unsigned int use
sock = sockfd_lookup(fd, &err);
if (sock != NULL) {
struct scm_cookie scm;
struct sock_iocb *si;
struct kiocb iocb;
if (sock->file->f_flags & O_NONBLOCK)
user_flags |= MSG_DONTWAIT;
memset(&scm, 0, sizeof(scm));
err = sock->ops->recvmsg(sock, &kern_msg, total_len,
user_flags, &scm);
init_sync_kiocb(&iocb, NULL);
si = kiocb_to_siocb(&iocb);
si->sock = sock;
si->scm = &si->async_scm;
si->msg = &kern_msg;
si->size = total_len;
si->flags = user_flags;
memset(si->scm, 0, sizeof(*si->scm));
err = sock->ops->recvmsg(&iocb, sock, &kern_msg, total_len,
user_flags, si->scm);
if (-EIOCBQUEUED == err)
err = wait_on_sync_kiocb(&iocb);
if(err >= 0) {
len = err;
if(!kern_msg.msg_control) {
if(sock->passcred || s
cm.
fp)
if(sock->passcred || s
i->scm->
fp)
kern_msg.msg_flags |= MSG_CTRUNC;
if(s
cm.
fp)
__scm_destroy(
&
scm);
if(s
i->scm->
fp)
__scm_destroy(
si->
scm);
} else {
/* If recvmsg processing itself placed some
* control messages into user space, it's is
...
...
@@ -2623,9 +2636,10 @@ asmlinkage int sys32_recvmsg(int fd, struct msghdr32 *user_msg, unsigned int use
if(sock->passcred)
put_cmsg32(&kern_msg,
SOL_SOCKET, SCM_CREDENTIALS,
sizeof(scm.creds), &scm.creds);
if(scm.fp != NULL)
scm_detach_fds32(&kern_msg, &scm);
sizeof(si->scm->creds),
&si->scm->creds);
if(si->scm->fp != NULL)
scm_detach_fds32(&kern_msg, si->scm);
}
}
sockfd_put(sock);
...
...
@@ -2746,6 +2760,8 @@ sys32_recvmsg (int fd, struct msghdr32 *msg, unsigned int flags)
struct
msghdr
msg_sys
;
unsigned
long
cmsg_ptr
;
int
err
,
iov_size
,
total_len
,
len
;
struct
sock_iocb
*
si
;
struct
kiocb
iocb
;
/* kernel mode address */
char
addr
[
MAX_SOCK_ADDR
];
...
...
@@ -2753,7 +2769,6 @@ sys32_recvmsg (int fd, struct msghdr32 *msg, unsigned int flags)
/* user mode address pointers */
struct
sockaddr
*
uaddr
;
int
*
uaddr_len
;
struct
scm_cookie
scm
;
err
=-
EFAULT
;
if
(
msghdr_from_user32_to_kern
(
&
msg_sys
,
msg
))
...
...
@@ -2793,9 +2808,20 @@ sys32_recvmsg (int fd, struct msghdr32 *msg, unsigned int flags)
if
(
sock
->
file
->
f_flags
&
O_NONBLOCK
)
flags
|=
MSG_DONTWAIT
;
memset
(
&
scm
,
0
,
sizeof
(
scm
));
err
=
sock
->
ops
->
recvmsg
(
sock
,
&
msg_sys
,
total_len
,
flags
,
&
scm
);
init_sync_kiocb
(
&
iocb
,
NULL
);
si
=
kiocb_to_siocb
(
&
iocb
);
si
->
sock
=
sock
;
si
->
scm
=
&
si
->
async_scm
;
si
->
msg
=
&
msg_sys
;
si
->
size
=
total_len
;
si
->
flags
=
flags
;
memset
(
si
->
scm
,
0
,
sizeof
(
*
si
->
scm
));
err
=
sock
->
ops
->
recvmsg
(
&
iocb
,
sock
,
&
msg_sys
,
total_len
,
flags
,
si
->
scm
);
if
(
-
EIOCBQUEUED
==
err
)
err
=
wait_on_sync_kiocb
(
&
iocb
);
if
(
err
<
0
)
goto
out_freeiov
;
len
=
err
;
...
...
@@ -2808,10 +2834,10 @@ sys32_recvmsg (int fd, struct msghdr32 *msg, unsigned int flags)
goto
out_freeiov
;
}
if
(
!
msg_sys
.
msg_control
)
{
if
(
sock
->
passcred
||
s
cm
.
fp
)
if
(
sock
->
passcred
||
s
i
->
scm
->
fp
)
msg_sys
.
msg_flags
|=
MSG_CTRUNC
;
if
(
s
cm
.
fp
)
__scm_destroy
(
&
scm
);
if
(
s
i
->
scm
->
fp
)
__scm_destroy
(
si
->
scm
);
}
else
{
/* If recvmsg processing itself placed some
* control messages into user space, it's is
...
...
@@ -2824,9 +2850,9 @@ sys32_recvmsg (int fd, struct msghdr32 *msg, unsigned int flags)
if
(
sock
->
passcred
)
put_cmsg32
(
&
msg_sys
,
SOL_SOCKET
,
SCM_CREDENTIALS
,
sizeof
(
s
cm
.
creds
),
&
scm
.
creds
);
if
(
s
cm
.
fp
!=
NULL
)
scm_detach_fds32
(
&
msg_sys
,
&
scm
);
sizeof
(
s
i
->
scm
->
creds
),
&
si
->
scm
->
creds
);
if
(
s
i
->
scm
->
fp
!=
NULL
)
scm_detach_fds32
(
&
msg_sys
,
si
->
scm
);
}
out_freeiov:
...
...
This diff is collapsed.
Click to expand it.
arch/sparc64/kernel/sys_sparc32.c
View file @
056fb9ae
...
...
@@ -2599,20 +2599,33 @@ asmlinkage int sys32_recvmsg(int fd, struct msghdr32 *user_msg, unsigned int use
sock
=
sockfd_lookup
(
fd
,
&
err
);
if
(
sock
!=
NULL
)
{
struct
scm_cookie
scm
;
struct
sock_iocb
*
si
;
struct
kiocb
iocb
;
if
(
sock
->
file
->
f_flags
&
O_NONBLOCK
)
user_flags
|=
MSG_DONTWAIT
;
memset
(
&
scm
,
0
,
sizeof
(
scm
));
err
=
sock
->
ops
->
recvmsg
(
sock
,
&
kern_msg
,
total_len
,
user_flags
,
&
scm
);
init_sync_kiocb
(
&
iocb
,
NULL
);
si
=
kiocb_to_siocb
(
&
iocb
);
si
->
sock
=
sock
;
si
->
scm
=
&
si
->
async_scm
;
si
->
msg
=
&
kern_msg
;
si
->
size
=
total_len
;
si
->
flags
=
user_flags
;
memset
(
si
->
scm
,
0
,
sizeof
(
*
si
->
scm
));
err
=
sock
->
ops
->
recvmsg
(
&
iocb
,
sock
,
&
kern_msg
,
total_len
,
user_flags
,
si
->
scm
);
if
(
-
EIOCBQUEUED
==
err
)
err
=
wait_on_sync_kiocb
(
&
iocb
);
if
(
err
>=
0
)
{
len
=
err
;
if
(
!
kern_msg
.
msg_control
)
{
if
(
sock
->
passcred
||
s
cm
.
fp
)
if
(
sock
->
passcred
||
s
i
->
scm
->
fp
)
kern_msg
.
msg_flags
|=
MSG_CTRUNC
;
if
(
s
cm
.
fp
)
__scm_destroy
(
&
scm
);
if
(
s
i
->
scm
->
fp
)
__scm_destroy
(
si
->
scm
);
}
else
{
/* If recvmsg processing itself placed some
* control messages into user space, it's is
...
...
@@ -2626,9 +2639,10 @@ asmlinkage int sys32_recvmsg(int fd, struct msghdr32 *user_msg, unsigned int use
if
(
sock
->
passcred
)
put_cmsg32
(
&
kern_msg
,
SOL_SOCKET
,
SCM_CREDENTIALS
,
sizeof
(
scm
.
creds
),
&
scm
.
creds
);
if
(
scm
.
fp
!=
NULL
)
scm_detach_fds32
(
&
kern_msg
,
&
scm
);
sizeof
(
si
->
scm
->
creds
),
&
si
->
scm
->
creds
);
if
(
si
->
scm
->
fp
!=
NULL
)
scm_detach_fds32
(
&
kern_msg
,
si
->
scm
);
}
}
sockfd_put
(
sock
);
...
...
This diff is collapsed.
Click to expand it.
arch/x86_64/ia32/socket32.c
View file @
056fb9ae
...
...
@@ -436,20 +436,33 @@ asmlinkage int sys32_recvmsg(int fd, struct msghdr32 *user_msg, unsigned int use
sock
=
sockfd_lookup
(
fd
,
&
err
);
if
(
sock
!=
NULL
)
{
struct
scm_cookie
scm
;
struct
sock_iocb
*
si
;
struct
kiocb
iocb
;
if
(
sock
->
file
->
f_flags
&
O_NONBLOCK
)
user_flags
|=
MSG_DONTWAIT
;
memset
(
&
scm
,
0
,
sizeof
(
scm
));
err
=
sock
->
ops
->
recvmsg
(
sock
,
&
kern_msg
,
total_len
,
user_flags
,
&
scm
);
init_sync_kiocb
(
&
iocb
,
NULL
);
si
=
kiocb_to_siocb
(
&
iocb
);
si
->
sock
=
sock
;
si
->
scm
=
&
si
->
async_scm
;
si
->
msg
=
&
kern_msg
;
si
->
size
=
total_len
;
si
->
flags
=
user_flags
;
memset
(
si
->
scm
,
0
,
sizeof
(
*
si
->
scm
));
err
=
sock
->
ops
->
recvmsg
(
&
iocb
,
sock
,
&
kern_msg
,
total_len
,
user_flags
,
si
->
scm
);
if
(
-
EIOCBQUEUED
==
err
)
err
=
wait_on_sync_kiocb
(
&
iocb
);
if
(
err
>=
0
)
{
len
=
err
;
if
(
!
kern_msg
.
msg_control
)
{
if
(
sock
->
passcred
||
s
cm
.
fp
)
if
(
sock
->
passcred
||
s
i
->
scm
->
fp
)
kern_msg
.
msg_flags
|=
MSG_CTRUNC
;
if
(
s
cm
.
fp
)
__scm_destroy
(
&
scm
);
if
(
s
i
->
scm
->
fp
)
__scm_destroy
(
si
->
scm
);
}
else
{
/* If recvmsg processing itself placed some
* control messages into user space, it's is
...
...
@@ -463,9 +476,10 @@ asmlinkage int sys32_recvmsg(int fd, struct msghdr32 *user_msg, unsigned int use
if
(
sock
->
passcred
)
put_cmsg32
(
&
kern_msg
,
SOL_SOCKET
,
SCM_CREDENTIALS
,
sizeof
(
scm
.
creds
),
&
scm
.
creds
);
if
(
scm
.
fp
!=
NULL
)
scm_detach_fds32
(
&
kern_msg
,
&
scm
);
sizeof
(
si
->
scm
->
creds
),
&
si
->
scm
->
creds
);
if
(
si
->
scm
->
fp
!=
NULL
)
scm_detach_fds32
(
&
kern_msg
,
si
->
scm
);
}
}
sockfd_put
(
sock
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment