linux-bcache.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] aio: Kill return value of aio_complete()
@ 2012-10-09  6:39 Kent Overstreet
       [not found] ` <1349764760-21093-1-git-send-email-koverstreet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
                   ` (2 more replies)
  0 siblings, 3 replies; 35+ messages in thread
From: Kent Overstreet @ 2012-10-09  6:39 UTC (permalink / raw)
  To: linux-bcache-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	dm-devel-H+wXaHxf7aLQT0dZR+AlfA, tytso-3s7WtUTddSA
  Cc: Kent Overstreet

Nothing used the return value, and it probably wasn't possible to use it
safely for the locked versions (aio_complete(), aio_put_req()). Just
kill it.

Signed-off-by: Kent Overstreet <koverstreet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
---
 fs/aio.c            |   19 +++++++------------
 include/linux/aio.h |    8 ++++----
 2 files changed, 11 insertions(+), 16 deletions(-)

diff --git a/fs/aio.c b/fs/aio.c
index 71f613c..1ad2d97 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -548,7 +548,7 @@ static inline void really_put_req(struct kioctx *ctx, struct kiocb *req)
 /* __aio_put_req
  *	Returns true if this put was the last user of the request.
  */
-static int __aio_put_req(struct kioctx *ctx, struct kiocb *req)
+static void __aio_put_req(struct kioctx *ctx, struct kiocb *req)
 {
 	dprintk(KERN_DEBUG "aio_put(%p): f_count=%ld\n",
 		req, atomic_long_read(&req->ki_filp->f_count));
@@ -558,7 +558,7 @@ static int __aio_put_req(struct kioctx *ctx, struct kiocb *req)
 	req->ki_users--;
 	BUG_ON(req->ki_users < 0);
 	if (likely(req->ki_users))
-		return 0;
+		return;
 	list_del(&req->ki_list);		/* remove from active_reqs */
 	req->ki_cancel = NULL;
 	req->ki_retry = NULL;
@@ -566,21 +566,18 @@ static int __aio_put_req(struct kioctx *ctx, struct kiocb *req)
 	fput(req->ki_filp);
 	req->ki_filp = NULL;
 	really_put_req(ctx, req);
-	return 1;
 }
 
 /* aio_put_req
  *	Returns true if this put was the last user of the kiocb,
  *	false if the request is still in use.
  */
-int aio_put_req(struct kiocb *req)
+void aio_put_req(struct kiocb *req)
 {
 	struct kioctx *ctx = req->ki_ctx;
-	int ret;
 	spin_lock_irq(&ctx->ctx_lock);
-	ret = __aio_put_req(ctx, req);
+	__aio_put_req(ctx, req);
 	spin_unlock_irq(&ctx->ctx_lock);
-	return ret;
 }
 EXPORT_SYMBOL(aio_put_req);
 
@@ -889,7 +886,7 @@ EXPORT_SYMBOL(kick_iocb);
  *	Returns true if this is the last user of the request.  The 
  *	only other user of the request can be the cancellation code.
  */
-int aio_complete(struct kiocb *iocb, long res, long res2)
+void aio_complete(struct kiocb *iocb, long res, long res2)
 {
 	struct kioctx	*ctx = iocb->ki_ctx;
 	struct aio_ring_info	*info;
@@ -897,7 +894,6 @@ int aio_complete(struct kiocb *iocb, long res, long res2)
 	struct io_event	*event;
 	unsigned long	flags;
 	unsigned long	tail;
-	int		ret;
 
 	/*
 	 * Special case handling for sync iocbs:
@@ -911,7 +907,7 @@ int aio_complete(struct kiocb *iocb, long res, long res2)
 		iocb->ki_user_data = res;
 		iocb->ki_users = 0;
 		wake_up_process(iocb->ki_obj.tsk);
-		return 1;
+		return;
 	}
 
 	info = &ctx->ring_info;
@@ -973,7 +969,7 @@ int aio_complete(struct kiocb *iocb, long res, long res2)
 
 put_rq:
 	/* everything turned out well, dispose of the aiocb. */
-	ret = __aio_put_req(ctx, iocb);
+	__aio_put_req(ctx, iocb);
 
 	/*
 	 * We have to order our ring_info tail store above and test
@@ -987,7 +983,6 @@ put_rq:
 		wake_up(&ctx->wait);
 
 	spin_unlock_irqrestore(&ctx->ctx_lock, flags);
-	return ret;
 }
 EXPORT_SYMBOL(aio_complete);
 
diff --git a/include/linux/aio.h b/include/linux/aio.h
index 31ff6db..4cde86d 100644
--- a/include/linux/aio.h
+++ b/include/linux/aio.h
@@ -211,18 +211,18 @@ extern unsigned aio_max_size;
 
 #ifdef CONFIG_AIO
 extern ssize_t wait_on_sync_kiocb(struct kiocb *iocb);
-extern int aio_put_req(struct kiocb *iocb);
+extern void aio_put_req(struct kiocb *iocb);
 extern void kick_iocb(struct kiocb *iocb);
-extern int aio_complete(struct kiocb *iocb, long res, long res2);
+extern void aio_complete(struct kiocb *iocb, long res, long res2);
 struct mm_struct;
 extern void exit_aio(struct mm_struct *mm);
 extern long do_io_submit(aio_context_t ctx_id, long nr,
 			 struct iocb __user *__user *iocbpp, bool compat);
 #else
 static inline ssize_t wait_on_sync_kiocb(struct kiocb *iocb) { return 0; }
-static inline int aio_put_req(struct kiocb *iocb) { return 0; }
+static inline void aio_put_req(struct kiocb *iocb) { }
 static inline void kick_iocb(struct kiocb *iocb) { }
-static inline int aio_complete(struct kiocb *iocb, long res, long res2) { return 0; }
+static inline void aio_complete(struct kiocb *iocb, long res, long res2) { }
 struct mm_struct;
 static inline void exit_aio(struct mm_struct *mm) { }
 static inline long do_io_submit(aio_context_t ctx_id, long nr,
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 35+ messages in thread

end of thread, other threads:[~2012-10-11 16:43 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-09  6:39 [PATCH 1/5] aio: Kill return value of aio_complete() Kent Overstreet
     [not found] ` <1349764760-21093-1-git-send-email-koverstreet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-10-09  6:39   ` [PATCH 2/5] aio: kiocb_cancel() Kent Overstreet
     [not found]     ` <1349764760-21093-2-git-send-email-koverstreet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-10-09 18:26       ` Zach Brown
     [not found]         ` <20121009182625.GM26187-fypN+1c5dIyjpB87vu3CluTW4wlIGRCZ@public.gmane.org>
2012-10-09 21:37           ` Kent Overstreet
     [not found]             ` <20121009213700.GF29494-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-10-10 11:03               ` Theodore Ts'o
     [not found]                 ` <20121010110356.GA11468-AKGzg7BKzIDYtjvyW6yDsg@public.gmane.org>
2012-10-10 21:20                   ` Zach Brown
     [not found]                     ` <20121010212051.GD6371-fypN+1c5dIyjpB87vu3CluTW4wlIGRCZ@public.gmane.org>
2012-10-10 23:21                       ` Theodore Ts'o
2012-10-11  2:41                   ` Kent Overstreet
2012-10-09  6:39   ` [PATCH 5/5] aio: Refactor aio_read_evt, use cmxchg(), fix bug Kent Overstreet
     [not found]     ` <1349764760-21093-5-git-send-email-koverstreet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-10-09 18:37       ` Zach Brown
     [not found]         ` <20121009183753.GP26187-fypN+1c5dIyjpB87vu3CluTW4wlIGRCZ@public.gmane.org>
2012-10-09 21:27           ` Kent Overstreet
     [not found]             ` <20121009212724.GD29494-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-10-09 22:47               ` Zach Brown
     [not found]                 ` <20121009224703.GT26187-fypN+1c5dIyjpB87vu3CluTW4wlIGRCZ@public.gmane.org>
2012-10-09 22:55                   ` Kent Overstreet
     [not found]                     ` <20121009225509.GA26835-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-10-09 23:10                       ` Zach Brown
     [not found]                         ` <20121009231059.GV26187-fypN+1c5dIyjpB87vu3CluTW4wlIGRCZ@public.gmane.org>
2012-10-10  0:06                           ` Kent Overstreet
     [not found]                             ` <20121010000600.GB26835-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-10-10  0:26                               ` Zach Brown
     [not found]                                 ` <20121010002634.GX26187-fypN+1c5dIyjpB87vu3CluTW4wlIGRCZ@public.gmane.org>
2012-10-10  0:47                                   ` Kent Overstreet
     [not found]                                     ` <20121010004746.GF26835-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-10-10 21:43                                       ` Zach Brown
     [not found]                                         ` <20121010214315.GE6371-fypN+1c5dIyjpB87vu3CluTW4wlIGRCZ@public.gmane.org>
2012-10-11  2:51                                           ` Kent Overstreet
     [not found]                                             ` <20121011025102.GE24174-jC9Py7bek1znysI04z7BkA@public.gmane.org>
2012-10-11 16:43                                               ` Zach Brown
2012-10-09 18:25   ` [PATCH 1/5] aio: Kill return value of aio_complete() Zach Brown
2012-10-09  6:39 ` [PATCH 3/5] aio: Rewrite refcounting Kent Overstreet
     [not found]   ` <1349764760-21093-3-git-send-email-koverstreet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-10-09 18:27     ` Zach Brown
     [not found]       ` <20121009182755.GN26187-fypN+1c5dIyjpB87vu3CluTW4wlIGRCZ@public.gmane.org>
2012-10-09 22:21         ` Kent Overstreet
     [not found]           ` <20121009222153.GG29494-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-10-09 22:35             ` Zach Brown
     [not found]               ` <20121009223504.GS26187-fypN+1c5dIyjpB87vu3CluTW4wlIGRCZ@public.gmane.org>
2012-10-10  0:17                 ` Kent Overstreet
2012-10-09  6:39 ` [PATCH 4/5] aio: vmap ringbuffer Kent Overstreet
     [not found]   ` <1349764760-21093-4-git-send-email-koverstreet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-10-09 18:29     ` Zach Brown
2012-10-09 21:31       ` Kent Overstreet
     [not found]         ` <20121009213111.GE29494-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-10-09 22:32           ` Zach Brown
2012-10-09 22:44             ` Kent Overstreet
     [not found]               ` <20121009224428.GH29494-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-10-09 22:58                 ` Zach Brown
     [not found]                   ` <20121009225836.GU26187-fypN+1c5dIyjpB87vu3CluTW4wlIGRCZ@public.gmane.org>
2012-10-10  0:16                     ` Kent Overstreet
     [not found]                       ` <20121010001630.GC26835-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-10-10  0:36                         ` Zach Brown
     [not found]                           ` <20121010003626.GY26187-fypN+1c5dIyjpB87vu3CluTW4wlIGRCZ@public.gmane.org>
2012-10-10  1:09                             ` Kent Overstreet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).