Skip to content

Commit d29c445

Browse files
Kent Overstreetbcrl
authored andcommitted
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>
1 parent 57282d8 commit d29c445

3 files changed

Lines changed: 2 additions & 14 deletions

File tree

‎fs/aio.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -705,8 +705,6 @@ static void kiocb_free(struct kiocb *req)
705705
fput(req->ki_filp);
706706
if (req->ki_eventfd != NULL)
707707
eventfd_ctx_put(req->ki_eventfd);
708-
if (req->ki_dtor)
709-
req->ki_dtor(req);
710708
kmem_cache_free(kiocb_cachep, req);
711709
}
712710

‎include/linux/aio.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ struct kiocb {
3333
struct file *ki_filp;
3434
struct kioctx *ki_ctx; /* NULL for sync ops */
3535
kiocb_cancel_fn *ki_cancel;
36-
void (*ki_dtor)(struct kiocb *);
3736
void *private;
3837

3938
union {

‎net/socket.c‎

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -854,11 +854,6 @@ int kernel_recvmsg(struct socket *sock, struct msghdr *msg,
854854
}
855855
EXPORT_SYMBOL(kernel_recvmsg);
856856

857-
static void sock_aio_dtor(struct kiocb *iocb)
858-
{
859-
kfree(iocb->private);
860-
}
861-
862857
static ssize_t sock_sendpage(struct file *file, struct page *page,
863858
int offset, size_t size, loff_t *ppos, int more)
864859
{
@@ -889,12 +884,8 @@ static ssize_t sock_splice_read(struct file *file, loff_t *ppos,
889884
static struct sock_iocb *alloc_sock_iocb(struct kiocb *iocb,
890885
struct sock_iocb *siocb)
891886
{
892-
if (!is_sync_kiocb(iocb)) {
893-
siocb = kmalloc(sizeof(*siocb), GFP_KERNEL);
894-
if (!siocb)
895-
return NULL;
896-
iocb->ki_dtor = sock_aio_dtor;
897-
}
887+
if (!is_sync_kiocb(iocb))
888+
BUG();
898889

899890
siocb->kiocb = iocb;
900891
iocb->private = siocb;

0 commit comments

Comments
 (0)