net: remove sock_iocb
The sock_iocb structure is allocate on stack for each read/write-like operation on sockets, and contains various fields of which only the embedded msghdr and sometimes a pointer to the scm_cookie is ever used. Get rid of the sock_iocb and put a msghdr directly on the stack and pass the scm_cookie explicitly to netlink_mmap_sendmsg. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
a154e6f6ef
commit
7cc0566268
@@ -1374,29 +1374,6 @@ void sk_prot_clear_portaddr_nulls(struct sock *sk, int size);
|
||||
#define SOCK_BINDADDR_LOCK 4
|
||||
#define SOCK_BINDPORT_LOCK 8
|
||||
|
||||
/* sock_iocb: used to kick off async processing of socket ios */
|
||||
struct sock_iocb {
|
||||
struct list_head list;
|
||||
|
||||
int flags;
|
||||
int size;
|
||||
struct socket *sock;
|
||||
struct sock *sk;
|
||||
struct scm_cookie *scm;
|
||||
struct msghdr *msg, async_msg;
|
||||
struct kiocb *kiocb;
|
||||
};
|
||||
|
||||
static inline struct sock_iocb *kiocb_to_siocb(struct kiocb *iocb)
|
||||
{
|
||||
return (struct sock_iocb *)iocb->private;
|
||||
}
|
||||
|
||||
static inline struct kiocb *siocb_to_kiocb(struct sock_iocb *si)
|
||||
{
|
||||
return si->kiocb;
|
||||
}
|
||||
|
||||
struct socket_alloc {
|
||||
struct socket socket;
|
||||
struct inode vfs_inode;
|
||||
|
Reference in New Issue
Block a user