From patchwork Mon Jun 20 14:05:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 9187639 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 916B9601C0 for ; Mon, 20 Jun 2016 14:37:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7F20D2793D for ; Mon, 20 Jun 2016 14:37:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7400A27B2F; Mon, 20 Jun 2016 14:37:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 964B52793D for ; Mon, 20 Jun 2016 14:37:43 +0000 (UTC) Received: from localhost ([::1]:44022 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bF0Ka-0008Lf-Sw for patchwork-qemu-devel@patchwork.kernel.org; Mon, 20 Jun 2016 10:37:40 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47789) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bEzqA-000834-KM for qemu-devel@nongnu.org; Mon, 20 Jun 2016 10:06:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bEzq3-00077l-EW for qemu-devel@nongnu.org; Mon, 20 Jun 2016 10:06:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48099) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bEzq3-00077Y-5r for qemu-devel@nongnu.org; Mon, 20 Jun 2016 10:06:07 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7A2ADC07EFCC; Mon, 20 Jun 2016 14:06:06 +0000 (UTC) Received: from localhost (ovpn-112-59.ams2.redhat.com [10.36.112.59]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u5KE65pQ016391; Mon, 20 Jun 2016 10:06:06 -0400 From: Stefan Hajnoczi To: Date: Mon, 20 Jun 2016 15:05:25 +0100 Message-Id: <1466431531-17806-15-git-send-email-stefanha@redhat.com> In-Reply-To: <1466431531-17806-1-git-send-email-stefanha@redhat.com> References: <1466431531-17806-1-git-send-email-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 20 Jun 2016 14:06:06 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 14/20] blockjob: rename block_job_is_paused() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Stefan Hajnoczi Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP The block_job_is_paused() function name is not great because callers only use it to determine whether pausing has been requested. Rename it to highlight those semantics and remove it from the public header file as there are no external callers. Signed-off-by: Stefan Hajnoczi Reviewed-by: Paolo Bonzini Reviewed-by: Fam Zheng Message-id: 1466096189-6477-3-git-send-email-stefanha@redhat.com --- blockjob.c | 6 +++--- include/block/blockjob.h | 9 --------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/blockjob.c b/blockjob.c index 5137dce..21cc3ee 100644 --- a/blockjob.c +++ b/blockjob.c @@ -252,7 +252,7 @@ void block_job_pause(BlockJob *job) job->pause_count++; } -bool block_job_is_paused(BlockJob *job) +static bool block_job_should_pause(BlockJob *job) { return job->pause_count > 0; } @@ -361,11 +361,11 @@ void block_job_sleep_ns(BlockJob *job, QEMUClockType type, int64_t ns) } job->busy = false; - if (!block_job_is_paused(job)) { + if (!block_job_should_pause(job)) { co_aio_sleep_ns(blk_get_aio_context(job->blk), type, ns); } /* The job can be paused while sleeping, so check this again */ - if (block_job_is_paused(job)) { + if (block_job_should_pause(job)) { qemu_coroutine_yield(); } job->busy = true; diff --git a/include/block/blockjob.h b/include/block/blockjob.h index 00ac418..8fcecf9 100644 --- a/include/block/blockjob.h +++ b/include/block/blockjob.h @@ -348,15 +348,6 @@ void block_job_event_completed(BlockJob *job, const char *msg); void block_job_event_ready(BlockJob *job); /** - * block_job_is_paused: - * @job: The job being queried. - * - * Returns whether the job is currently paused, or will pause - * as soon as it reaches a sleeping point. - */ -bool block_job_is_paused(BlockJob *job); - -/** * block_job_cancel_sync: * @job: The job to be canceled. *