mirror of https://gitee.com/openkylin/linux.git
aio: Kill ki_dtor
sock_aio_dtor() is dead code - and stuff that does need to do cleanup can simply do it before calling aio_complete(). Signed-off-by: Kent Overstreet <koverstreet@google.com> Cc: Zach Brown <zab@redhat.com> Cc: Felipe Balbi <balbi@ti.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Mark Fasheh <mfasheh@suse.com> Cc: Joel Becker <jlbec@evilplan.org> Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: Jens Axboe <axboe@kernel.dk> Cc: Asai Thambi S P <asamymuthupa@micron.com> Cc: Selvan Mani <smani@micron.com> Cc: Sam Bradshaw <sbradshaw@micron.com> Cc: Jeff Moyer <jmoyer@redhat.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Benjamin LaHaise <bcrl@kvack.org> Cc: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Benjamin LaHaise <bcrl@kvack.org>
This commit is contained in:
parent
57282d8fd7
commit
d29c445b63
2
fs/aio.c
2
fs/aio.c
|
@ -705,8 +705,6 @@ static void kiocb_free(struct kiocb *req)
|
||||||
fput(req->ki_filp);
|
fput(req->ki_filp);
|
||||||
if (req->ki_eventfd != NULL)
|
if (req->ki_eventfd != NULL)
|
||||||
eventfd_ctx_put(req->ki_eventfd);
|
eventfd_ctx_put(req->ki_eventfd);
|
||||||
if (req->ki_dtor)
|
|
||||||
req->ki_dtor(req);
|
|
||||||
kmem_cache_free(kiocb_cachep, req);
|
kmem_cache_free(kiocb_cachep, req);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,6 @@ struct kiocb {
|
||||||
struct file *ki_filp;
|
struct file *ki_filp;
|
||||||
struct kioctx *ki_ctx; /* NULL for sync ops */
|
struct kioctx *ki_ctx; /* NULL for sync ops */
|
||||||
kiocb_cancel_fn *ki_cancel;
|
kiocb_cancel_fn *ki_cancel;
|
||||||
void (*ki_dtor)(struct kiocb *);
|
|
||||||
void *private;
|
void *private;
|
||||||
|
|
||||||
union {
|
union {
|
||||||
|
|
13
net/socket.c
13
net/socket.c
|
@ -854,11 +854,6 @@ int kernel_recvmsg(struct socket *sock, struct msghdr *msg,
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(kernel_recvmsg);
|
EXPORT_SYMBOL(kernel_recvmsg);
|
||||||
|
|
||||||
static void sock_aio_dtor(struct kiocb *iocb)
|
|
||||||
{
|
|
||||||
kfree(iocb->private);
|
|
||||||
}
|
|
||||||
|
|
||||||
static ssize_t sock_sendpage(struct file *file, struct page *page,
|
static ssize_t sock_sendpage(struct file *file, struct page *page,
|
||||||
int offset, size_t size, loff_t *ppos, int more)
|
int offset, size_t size, loff_t *ppos, int more)
|
||||||
{
|
{
|
||||||
|
@ -889,12 +884,8 @@ static ssize_t sock_splice_read(struct file *file, loff_t *ppos,
|
||||||
static struct sock_iocb *alloc_sock_iocb(struct kiocb *iocb,
|
static struct sock_iocb *alloc_sock_iocb(struct kiocb *iocb,
|
||||||
struct sock_iocb *siocb)
|
struct sock_iocb *siocb)
|
||||||
{
|
{
|
||||||
if (!is_sync_kiocb(iocb)) {
|
if (!is_sync_kiocb(iocb))
|
||||||
siocb = kmalloc(sizeof(*siocb), GFP_KERNEL);
|
BUG();
|
||||||
if (!siocb)
|
|
||||||
return NULL;
|
|
||||||
iocb->ki_dtor = sock_aio_dtor;
|
|
||||||
}
|
|
||||||
|
|
||||||
siocb->kiocb = iocb;
|
siocb->kiocb = iocb;
|
||||||
iocb->private = siocb;
|
iocb->private = siocb;
|
||||||
|
|
Loading…
Reference in New Issue