From patchwork Tue Oct 9 06:39:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kent Overstreet X-Patchwork-Id: 1569001 Return-Path: X-Original-To: patchwork-dm-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from mx4-phx2.redhat.com (mx4-phx2.redhat.com [209.132.183.25]) by patchwork2.kernel.org (Postfix) with ESMTP id BDE30DFFCF for ; Tue, 9 Oct 2012 06:47:29 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q996dfEu001542; Tue, 9 Oct 2012 02:39:43 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q996ddPt027128 for ; Tue, 9 Oct 2012 02:39:39 -0400 Received: from mx1.redhat.com (ext-mx16.extmail.prod.ext.phx2.redhat.com [10.5.110.21]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q996dY7M029541 for ; Tue, 9 Oct 2012 02:39:34 -0400 Received: from mail-pa0-f46.google.com (mail-pa0-f46.google.com [209.85.220.46]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q996dWfG022959 for ; Tue, 9 Oct 2012 02:39:32 -0400 Received: by mail-pa0-f46.google.com with SMTP id hz1so4710396pad.33 for ; Mon, 08 Oct 2012 23:39:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=mEAksp0D7TeJl6iQPJUjh9gQsckraDYebUQJM5GMz18=; b=jh1QAcjDlVKrIOaa7oBgYKgP8tfDmX1SJ/ChzqlQe/YYkj4/Ef4V9Aqwt3r7eIwj4b EXOgp28pgYhJm2DKn+cN5UgmqdLtXN6fBhD9heZ/KPptZaw0xagWXq1doapc/k4ALrXJ UJSLcpRKpu0XanjCHAiLXuj/X3PKqmD0UPwWAZa3kZTARIALEMZQyZh//VNy2cjYbup6 L1PvOz59W6CWmOz4C5Uau+lULkCNSkKKHverQqo/PWro+QS4DjoANKTRXCRAiAACytX8 gZ105KtQhH9fcbd/VZxfpYy6KCiJcubv7zSQrWp4Bz8HaeGRFknmVaL2dcE1JCwSUBx8 wyWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:x-gm-message-state; bh=mEAksp0D7TeJl6iQPJUjh9gQsckraDYebUQJM5GMz18=; b=KMf4dE/64ksQahxN9hqjTKI9WpIWbRMaJrz972yhzOnVowMeruZBQbomuXMuVfkUyb hQV5QYdbiF6ONELw9nyRd3Cc0McG32pGsqDAjExx1ddc4FJkIKd6FmbAKtK2k0giXbCT bo2EA2y8TnkPbXKQs4dYFWoGvvnm6eNP1hQ49yI1Z0G/16DNXSPxuxzlzekf0jetp4bF KutCqPLb3GSb/LFJjT0+K2xSjZRAHwSWVQmTUsvxnGjYe+SeuJbbBK8WGLi9aA7O3agq fB/PcFomYiuFYRRjkBctlBZusTspz5qlnzBeBbXLWCmTck/vTMK/12LwTV9SFqfgcYUO ODXQ== Received: by 10.68.234.7 with SMTP id ua7mr61520272pbc.91.1349764772394; Mon, 08 Oct 2012 23:39:32 -0700 (PDT) Received: from moria.home.lan (c-67-188-232-164.hsd1.ca.comcast.net. [67.188.232.164]) by mx.google.com with ESMTPS id rr6sm11923736pbc.47.2012.10.08.23.39.30 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 08 Oct 2012 23:39:31 -0700 (PDT) From: Kent Overstreet To: linux-bcache@vger.kernel.org, linux-kernel@vger.kernel.org, dm-devel@redhat.com, tytso@mit.edu Date: Mon, 8 Oct 2012 23:39:16 -0700 Message-Id: <1349764760-21093-1-git-send-email-koverstreet@google.com> X-Gm-Message-State: ALoCoQm1xCZkShVhCeMnM+LqHTuHM9epHzN1Pd3WFpC+Rq4q8A/zDVN4JqWdZeOBKzzFWg4XeHVCIcQ0MlAOYZGjQJiEGYkQJCGjL7PjizTrF69+O5j0k+LWHEWuBcSqJF4sE8gUiTgT5nBJMeUoqKUMxxiAwRbz5AQv1h7GuROF/EXLUt28Yk5ZZ1EIcipYVLMztdkHLBcY X-RedHat-Spam-Score: -4.839 (BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD, SPF_PASS) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-Scanned-By: MIMEDefang 2.68 on 10.5.110.21 X-loop: dm-devel@redhat.com Cc: Kent Overstreet Subject: [dm-devel] [PATCH 1/5] aio: Kill return value of aio_complete() X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com 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 Acked-by: Zach Brown --- 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,