Message ID | 1525791496-125188-7-git-send-email-anton.nefedov@virtuozzo.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org> 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 4BA9760353 for <patchwork-qemu-devel@patchwork.kernel.org>; Tue, 8 May 2018 15:10:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2939F28F43 for <patchwork-qemu-devel@patchwork.kernel.org>; Tue, 8 May 2018 15:10:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 261CA28E7E; Tue, 8 May 2018 15:10:35 +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=-7.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 5FF7528F67 for <patchwork-qemu-devel@patchwork.kernel.org>; Tue, 8 May 2018 15:10:32 +0000 (UTC) Received: from localhost ([::1]:51718 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org>) id 1fG4G7-0001yh-89 for patchwork-qemu-devel@patchwork.kernel.org; Tue, 08 May 2018 11:10:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47892) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <anton.nefedov@virtuozzo.com>) id 1fG44l-0000Id-Rj for qemu-devel@nongnu.org; Tue, 08 May 2018 10:58:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <anton.nefedov@virtuozzo.com>) id 1fG44h-0001Z3-DF for qemu-devel@nongnu.org; Tue, 08 May 2018 10:58:47 -0400 Received: from mail-db5eur01on0136.outbound.protection.outlook.com ([104.47.2.136]:52463 helo=EUR01-DB5-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from <anton.nefedov@virtuozzo.com>) id 1fG44h-0001Xd-6b; Tue, 08 May 2018 10:58:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=W6aSNrgqLwqoNEcV2Y9Q9T+6EaunAd8M+5KvHnValAQ=; b=XxGo/pZxRjV4gd0ncg1nrL1BrJ60ZoZfJnMRlC8qykmcmOj/Vi2xD2+MTQZmXKQDVdf2nyoCILj9apK2X/1zrGluf8Do3EMpHWOvta/H4JtORUwAEBJVBNldRjsZMcOe4Y0rPKQr438jqAvf2N4aLd9BRfK90hqWiVXOzDLtKik= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=anton.nefedov@virtuozzo.com; Received: from xantnef-ws.sw.ru (195.214.232.6) by AM0PR08MB3347.eurprd08.prod.outlook.com (2603:10a6:208:5f::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.755.16; Tue, 8 May 2018 14:58:41 +0000 From: Anton Nefedov <anton.nefedov@virtuozzo.com> To: qemu-devel@nongnu.org Date: Tue, 8 May 2018 17:58:13 +0300 Message-Id: <1525791496-125188-7-git-send-email-anton.nefedov@virtuozzo.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1525791496-125188-1-git-send-email-anton.nefedov@virtuozzo.com> References: <1525791496-125188-1-git-send-email-anton.nefedov@virtuozzo.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: DB6PR07CA0020.eurprd07.prod.outlook.com (2603:10a6:6:2d::30) To AM0PR08MB3347.eurprd08.prod.outlook.com (2603:10a6:208:5f::20) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(5600026)(2017052603328)(7153060)(7193020); SRVR:AM0PR08MB3347; X-Microsoft-Exchange-Diagnostics: 1; AM0PR08MB3347; 3:R3Mn6Uo6+KkE7YSTIo4boowjrtfuWbpZLhAoL/VNDug2b0XoRM9QjgGPwleduXJx0XoYBRDEF9F75LPj3JfwhK5fCGq/iGngQ/I1fl+u3wLi5liXgsYdA+rK6N/eorLPow2MKmULg2Xkf7g+QoiO3FFGokfK4GeAbHNvNLERI6qob2EiyRPo8xVYt7E6oUlwFtFaob66unrSWP5pZ9CoOQjyzzQaZSv1NCnC7arIRUSZmTBvB45Wt3f+YkT3mWxJ; 25:gKzQfkzuKcan3Xp96uCQxRo8bnOpASzBSoje5OZybI+rmId5gjLUZStlcuTP/u2m0h6LNZqodUR9lYYgoknJveMxHztLPBQQzeyXLT52CHk+uHuA+76vIuxdLfuHozXA/YsnaSBopSUDkq6PWKgciiRklmUH0XARH6GHXqYo++9BZuB422cATiYQtJlVqm27WZb0ONx4YRQle5KJ9urTiYcGI8+J71w7orYiklISYID+1GGqG5QJXkxF7AfiSt73r2kO2lYpgd9iaIjqoVRP0hFGU7eCJ+zitd3/M10ywxNE3dxYkB9iWVO3I8Smm91SxL6H4F6I7JZsBxgBGdoVNQ==; 31:X5vd8VG7JurjH59v83MtNPVSCFWOjXj+4sitC2Gx9LtaBlYbn4RYO1xWD+nDqANkDDh+p6UK0vUwvX7oJeWxa4InF+LrbKoO7i9JOC/3dQPdIUl9BM+iXVpsjGxYdwgl0EGNmG1324lNlnRZmTSEBxWiGWFiBj7LR7mkWVHLuToBd4G1/QfPAtUx17E+d9k+11ZvmADSV4lxDrFJER/LC75+FTMHEA+2sCwOMPUXGU0= X-MS-TrafficTypeDiagnostic: AM0PR08MB3347: X-Microsoft-Exchange-Diagnostics: 1; AM0PR08MB3347; 20:YDsoKaD2ID4X1rsxHLKsFrNTzv5erxc5fDEphauncziWfB4T5epOEL7gwR/pr0iNmx2Dj3pWZbYzfevbcgmSRmRBSFcP0m3cIIadfW1g0iXh2pp6+sRGK8tBKeHV7d1AO+lPV6yvlEjJtBiWUr/nxenK44esR8dlyrHc00rVHm2GqbC7+tImAhdUi2zJ4S4eOzUKOt+oqcldEb9O/OFVzUyffZIgGEPTfPOlLyihOWz/odl43sbGETkYrfcRH/28sQfRYpZhbNTNgmRtNKxq54W7konI3+MEYq7RUIv4Crr71E1eeyLlEeDaeSgStKiYS1xLJYxuReSes8ekzqfSwW5ta8WKiXrfw11ln93sfQF9lskvhEtLcofgNyIOZMIY7zfUNO29zAHnXcThpll+/7duDDYguTdjiFWgGwSxL+ZHjginyrV2kqoF4aUX5tTs5G6hGpbOVl/0SM9MUWjoME6iwC/9T6FSXtWyZcdhnKXqacgxwaMf4YU9jZH/M4NH; 4:s0IfW4hm2vp1NW726Fb85a8M7bWNDR/HWh0t135Rsx1bZXRtNN2w1GuUbuO5HP2ragHDsZvRCki8gVtsa/qNWrI5zsxVMwoNFBExFR+h1q5zZOSbVINSrhPoa/O54GRUxWLeALr/0BYD994304dQmGGfyKaClsE4OU4nczBLUcPiBOPyZ+8J1CT799L87Td98eXtWEEKBsQI3Y8p5dHx6fSN8VrlTqzVVaM+h0aAvOPfLYZyPHWxtO7zLhAVEgD1ECXr4Y1iMkl9CEtQmPSccg== X-Microsoft-Antispam-PRVS: <AM0PR08MB3347ECB5692E7AC852791757F89A0@AM0PR08MB3347.eurprd08.prod.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(5005006)(8121501046)(10201501046)(93006095)(93001095)(3231254)(944501410)(52105095)(3002001)(149027)(150027)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011); SRVR:AM0PR08MB3347; BCL:0; PCL:0; RULEID:; SRVR:AM0PR08MB3347; X-Forefront-PRVS: 0666E15D35 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(39850400004)(366004)(376002)(396003)(346002)(39380400002)(199004)(189003)(5660300001)(6486002)(81156014)(8676002)(81166006)(97736004)(2361001)(6116002)(3846002)(2351001)(446003)(2616005)(44832011)(16586007)(956004)(486006)(316002)(305945005)(476003)(86362001)(11346002)(25786009)(68736007)(6916009)(6666003)(36756003)(69596002)(51416003)(66066001)(47776003)(386003)(6506007)(52116002)(8936002)(26005)(53416004)(55236004)(76176011)(105586002)(186003)(106356001)(16526019)(107886003)(53936002)(4326008)(7736002)(50226002)(50466002)(59450400001)(48376002)(478600001)(6512007)(2906002); DIR:OUT; SFP:1102; SCL:1; SRVR:AM0PR08MB3347; H:xantnef-ws.sw.ru; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM0PR08MB3347; 23:PFVmxrdQvCZqSG2DCEU632azANTswcOcZLLq7zw19?= =?us-ascii?Q?/2MtrKCMQz5ZBPRh1s/sV0MrH8r5V8jPIbjzrUcFTxDFUhVTq2POOZANWa20?= =?us-ascii?Q?9GOrRIq8QmbkuOdhcg3d1uUMzHEh/8grtiEAO1nZWxCYQn/QeFz5v26sRhuV?= =?us-ascii?Q?YiSz5Ww8O4BtLK0gnLYrAqyBDYyJdTQcf4omtwKJngXIueIZXiE9XPfuR8NO?= =?us-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6u8nyKDeRSu6EYJ+74enhqoY1hOtr60EF7V+evJknjMK/h44CBgvBvVjO9REnXilI4SCa3zcDkRIvUN/Okhh8Qa5KYGjshxStxcV8fXOmgFmROkNp8MGfTdXUSqOlOs0XfPgrvGBuylvvj9yjSI6STm2iG2QUzRrnpNylShE=; 24:XjHUizGRsqqeMFWh8xeA6NBt2/UItxLtMUsDYwPlIL0E7+y0+4iOsvs3EInWt36BXhCPI+9i8W6S7vBnvStqSgI8uvdbN4Vf+f7uGqSEnp0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM0PR08MB3347; 7:fEJt3CTfU92gM9jmp4091ph8AO5bG+TzdP8yWIuFhwZr+feK8SsOyKV3WYnO7G6HCWkoQ6q954riUQ0YWn0mKT8HRmA+eYQTrU4brNF8TUusimsYAnYKGW3aJH1rLSxYFlANK0ffAgBXi0QMlC+EUJumNo2QslmWBHBBDDU/R7TZZihMHCkcU2QK8l6N1MGes6MtoqdDcO6qYY3aVyND5B0UGLnlKkhajX9f8wpIqaefuau8H3GJPNriRAoshKHL; 20:m3MS5/ctMgQFZYNULl4bdNZFS9Rab2s+GP8Xfhf1qapFikxwi+Zbcxh2YmWhNDyh0xxZ1lCB511GeKQJrPn/XACyX/xsLwQghPW5ZzoD2pq9SSimepgRFgfXvdpvEMMTHzLqNujMeKRJU67+bOs1mt58X8Bt3fIwR11UtDvbtd4= X-MS-Office365-Filtering-Correlation-Id: 39527534-42cc-4814-b5dd-08d5b4f43062 X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 May 2018 14:58:41.1776 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 39527534-42cc-4814-b5dd-08d5b4f43062 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB3347 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.2.136 Subject: [Qemu-devel] [PATCH v9 6/9] file-posix: support BDRV_REQ_ALLOCATE X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <http://lists.nongnu.org/archive/html/qemu-devel/> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: kwolf@redhat.com, Anton Nefedov <anton.nefedov@virtuozzo.com>, berto@igalia.com, den@virtuozzo.com, qemu-block@nongnu.org, mreitz@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org> X-Virus-Scanned: ClamAV using ClamSMTP |
On Tue 08 May 2018 04:58:13 PM CEST, Anton Nefedov wrote: > Current write_zeroes implementation is good enough to satisfy this flag too > > Signed-off-by: Anton Nefedov <anton.nefedov@virtuozzo.com> Reviewed-by: Alberto Garcia <berto@igalia.com> Berto
diff --git a/block/file-posix.c b/block/file-posix.c index 3794c00..3795e1c 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -560,7 +560,10 @@ static int raw_open_common(BlockDriverState *bs, QDict *options, } if (S_ISREG(st.st_mode)) { s->discard_zeroes = true; +#ifdef CONFIG_FALLOCATE s->has_fallocate = true; + bs->supported_zero_flags |= BDRV_REQ_ALLOCATE; +#endif } if (S_ISBLK(st.st_mode)) { #ifdef BLKDISCARDZEROES @@ -595,10 +598,11 @@ static int raw_open_common(BlockDriverState *bs, QDict *options, #ifdef CONFIG_XFS if (platform_test_xfs_fd(s->fd)) { s->is_xfs = true; + bs->supported_zero_flags |= BDRV_REQ_ALLOCATE; } #endif - bs->supported_zero_flags = s->discard_zeroes ? BDRV_REQ_MAY_UNMAP : 0; + bs->supported_zero_flags |= s->discard_zeroes ? BDRV_REQ_MAY_UNMAP : 0; ret = 0; fail: if (filename && (bdrv_flags & BDRV_O_TEMPORARY)) { @@ -1416,6 +1420,10 @@ static ssize_t handle_aiocb_write_zeroes(RawPosixAIOData *aiocb) } s->has_fallocate = false; } + + if (!s->has_fallocate) { + aiocb->bs->supported_zero_flags &= ~BDRV_REQ_ALLOCATE; + } #endif return -ENOTSUP;
Current write_zeroes implementation is good enough to satisfy this flag too Signed-off-by: Anton Nefedov <anton.nefedov@virtuozzo.com> --- block/file-posix.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)