From patchwork Thu Jul 14 13:33:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Denis V. Lunev" X-Patchwork-Id: 9229851 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 847F9607D0 for ; Thu, 14 Jul 2016 14:02:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 75FFF27FA9 for ; Thu, 14 Jul 2016 14:02:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 69B59281A7; Thu, 14 Jul 2016 14:02:25 +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 764E827FA9 for ; Thu, 14 Jul 2016 14:02:23 +0000 (UTC) Received: from localhost ([::1]:54104 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNhDa-0005LR-JE for patchwork-qemu-devel@patchwork.kernel.org; Thu, 14 Jul 2016 10:02:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53521) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNglq-00058i-EB for qemu-devel@nongnu.org; Thu, 14 Jul 2016 09:33:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bNgln-0007te-By for qemu-devel@nongnu.org; Thu, 14 Jul 2016 09:33:42 -0400 Received: from mailhub.sw.ru ([195.214.232.25]:13051 helo=relay.sw.ru) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNglm-0007st-SD for qemu-devel@nongnu.org; Thu, 14 Jul 2016 09:33:39 -0400 Received: from hades.sw.ru ([10.30.8.132]) by relay.sw.ru (8.13.4/8.13.4) with ESMTP id u6CM5xph025252; Wed, 13 Jul 2016 01:06:01 +0300 (MSK) From: "Denis V. Lunev" To: qemu-block@nongnu.org, qemu-devel@nongnu.org Date: Thu, 14 Jul 2016 16:33:26 +0300 Message-Id: <1468503209-19498-6-git-send-email-den@openvz.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1468503209-19498-1-git-send-email-den@openvz.org> References: <1468503209-19498-1-git-send-email-den@openvz.org> X-detected-operating-system: by eggs.gnu.org: OpenBSD 3.x X-Received-From: 195.214.232.25 Subject: [Qemu-devel] [PATCH v3 5/8] block: remove extra condition in bdrv_can_write_zeroes_with_unmap 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: Kevin Wolf , den@openvz.org, Jeff Cody , Stefan Hajnoczi , Max Reitz Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP All .bdrv_co_write_zeroes callbacks nowadays work perfectly even with backing store attached. If future new callbacks would be unable to do that - they have a chance to block this in bdrv_get_info(). Signed-off-by: Denis V. Lunev Reviewed-by: Eric Blake Reviewed-by: John Snow Reviewed-by: Fam Zheng CC: Stefan Hajnoczi CC: Kevin Wolf CC: Max Reitz CC: Jeff Cody --- block.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block.c b/block.c index 823ff1d..c2fb8bd 100644 --- a/block.c +++ b/block.c @@ -2834,7 +2834,7 @@ bool bdrv_can_write_zeroes_with_unmap(BlockDriverState *bs) { BlockDriverInfo bdi; - if (bs->backing || !(bs->open_flags & BDRV_O_UNMAP)) { + if (!(bs->open_flags & BDRV_O_UNMAP)) { return false; }