Message ID | 1509551048-129830-6-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 CA578602B5 for <patchwork-qemu-devel@patchwork.kernel.org>; Wed, 1 Nov 2017 15:54:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CBB6228622 for <patchwork-qemu-devel@patchwork.kernel.org>; Wed, 1 Nov 2017 15:54:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BA868286B1; Wed, 1 Nov 2017 15:54:42 +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.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, 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 2898E28622 for <patchwork-qemu-devel@patchwork.kernel.org>; Wed, 1 Nov 2017 15:54:41 +0000 (UTC) Received: from localhost ([::1]:56415 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 1e9vLk-0007FK-KX for patchwork-qemu-devel@patchwork.kernel.org; Wed, 01 Nov 2017 11:54:40 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60534) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <anton.nefedov@virtuozzo.com>) id 1e9vCB-00087t-KF for qemu-devel@nongnu.org; Wed, 01 Nov 2017 11:44:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <anton.nefedov@virtuozzo.com>) id 1e9vC7-0006dm-Bv for qemu-devel@nongnu.org; Wed, 01 Nov 2017 11:44:47 -0400 Received: from mail-eopbgr40093.outbound.protection.outlook.com ([40.107.4.93]:2721 helo=EUR03-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 1e9vC6-0006d1-ST; Wed, 01 Nov 2017 11:44: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=3AbMClhLwnoHBt0Mhec5U7i/+zH9R4XFw+hObujukmo=; b=iAyyHRARG8GXC37Ihz5XBaWeb8hiapSwUorUQD9X00cp5u5oHppbJ6aiG7aA1Hfj9yIGVCifIbV4rVDvlmht7WK6xf8M+PBG3eYAO9XATAk6M09bOBf1hgNxvJUizDQQx5JLB8ucxt+V1u2svEW7C5YiiouIOx5IIdL1DMU+lwg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=anton.nefedov@virtuozzo.com; Received: from xantnef-ws.sw.ru (195.214.232.6) by AM5PR0801MB1987.eurprd08.prod.outlook.com (2603:10a6:203:4b::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.178.6; Wed, 1 Nov 2017 15:44:39 +0000 From: Anton Nefedov <anton.nefedov@virtuozzo.com> To: qemu-devel@nongnu.org Date: Wed, 1 Nov 2017 18:43:58 +0300 Message-Id: <1509551048-129830-6-git-send-email-anton.nefedov@virtuozzo.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1509551048-129830-1-git-send-email-anton.nefedov@virtuozzo.com> References: <1509551048-129830-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: VI1PR0501CA0017.eurprd05.prod.outlook.com (2603:10a6:800:92::27) To AM5PR0801MB1987.eurprd08.prod.outlook.com (2603:10a6:203:4b::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: dc56e665-b4d7-4c31-4138-08d5213f770d X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(4534020)(4602075)(2017052603199); SRVR:AM5PR0801MB1987; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1987; 3:GHtxjX9alSz/NXy8tMU9VknKmOu+XnNA/up1T4OLPoZJEQ5gyenhkk4feGeL2vnvTz871LhHGy2/uze3o2XYscv+pG9kJ80pf1ZlxZsnajyR3l+5KilPp78PJRAXvi/PUbUkPtZi9VqrxPTqii8lK81z5hkdKytEa6OCDYqtVXg2y4dpezsuihmznLi8kvb72IJAWGR9ocJafmK4CvNXrbXU23y80gp9HD5Lbx0swp+ezu+RS4FBq/20GHbPlX5m; 25:0pllyJOSqV5WQAs2ULXyaJ5lfiJKNeCyAuYVI5/FquojYqY/R6F0RdeI1N5P+iYxIiGfhDQHdR4LBt5emeZV1hKrJSwVMQqG2arscpJLjrvrrq7S5yJOy2WI/YKs+7uiMqAbTTllJdwx0vnc8DBg5Pf8DjGtySNuGglSrjSPXVRNtbrobXhw+q8vSQSqIKexq6Gk/qS+oNZJ1o1zK0Lyy+ddUQubqUtYTdr01uUiVsnqL2pIouSnuyO6oamv4z4Sk4gDVK1GIxBoYjj9bt2ePXXRmhPyCaNEB7Alaw+cZq8Ij8b18SqJwmAXM+b/3QfOR+n4KI0tAufBOffMxFsutg==; 31:yew/rJtdPTHMe4zgGLAP69RzcE5bmDHb0IX0tdGi3UISIpNY2dwbSrde7iN/pIImp0CJGQSOaN0HVcZ1r5/YGpdagUrkNeTIT7/aW/UZ1Q4knJsdLHuEzFhUwRarH0nkGjy+NnnXg4BMGdP58SAiQEU0tSkE9NAed+tCt4jopplM5McGZxkqzNCDB1mSEZMepFkWIqDHZ/PtwVPjg3PG8/I5EuCdY3omjyi0xeSzMCE= X-MS-TrafficTypeDiagnostic: AM5PR0801MB1987: X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1987; 20:Tr5MwVV3kNWMrzsU4t/KTHS/GPtydoIp0gjLKf+0YRvrHeVPJkvN1YtYmRAHFDEqc4QQhXngqfsV+xmSfbYOhb03zguhghTIEUthfs7y8Y/t8tzZhZEDRJprhReHLhJsPlTFKeyM0glQLXpj4FcUpFAQ7wIbDB9fq0iCAXVcV80ATrJJJznV1hqpv7KGYAivl2LELoE2lbw8gc6aTWpvzG8m29MeMi0PqSJZlVCH0Vouc19BZukpHvz9eA0K/9hPFdzmrn7jlmWDzuMd2XGEmt5vU2lUIpo17BoCrsXKbraq9lUxPBEA9E3ffdJxu6I8xVWa0VHeMXiTaJhryYEmIfRgoQMTN07aQLrWIXR2Ru0B7yfScDC0xNELCDVvbgUgJJQz8jorsbgYqVTVd9C3zEg2RY67VPy4qB2NqHnrVQ4=; 4:ELKgdIaWEEGGTVF+2r7XvyCaiAVkKjFjyHO7DRNZS2X7IkXFvOaV/BdD3+nBkCeeVoBjIieOHHgwLFaeFEbGb2Bk6M0r4dRBMcLGTvishWtpGvb0+VZ/lrFgYtuzbrkx0vm2c8KttQo9idMBLMqOV5KX0EY1uhM7KBbDkJSadRdxguVtyv+BzZl0PldKa9Gmnoee48TerIa9+Cr+MWTRr+JggT85VCMN16zOIJcbcy2+o3+DPxTjCACmh9a3a/geOFhmYuyIFXcdAbtmCsn+hA== X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: <AM5PR0801MB1987E299DA1DB4B317FCAC13F85F0@AM5PR0801MB1987.eurprd08.prod.outlook.com> X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(10201501046)(93006095)(93001095)(3231020)(100000703101)(100105400095)(3002001)(6041248)(20161123555025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123564025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:AM5PR0801MB1987; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:AM5PR0801MB1987; X-Forefront-PRVS: 0478C23FE0 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(376002)(346002)(189002)(199003)(6666003)(16526018)(53936002)(107886003)(48376002)(86362001)(6916009)(2950100002)(3846002)(6116002)(101416001)(50986999)(76176999)(106356001)(69596002)(5660300001)(25786009)(105586002)(316002)(53416004)(2351001)(16586007)(2361001)(33646002)(4326008)(5003940100001)(478600001)(66066001)(36756003)(50226002)(6512007)(47776003)(2906002)(8936002)(6506006)(97736004)(6486002)(68736007)(305945005)(50466002)(81166006)(81156014)(8676002)(189998001)(7736002); DIR:OUT; SFP:1102; SCL:1; SRVR:AM5PR0801MB1987; H:xantnef-ws.sw.ru; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM5PR0801MB1987; 23:OPDCafZVVSqlfIGxcTCtkE6SWbfU7hd4ns/Z853?= =?us-ascii?Q?XRxgps7WT4PL0oqzxJoUmZ8c7zX6iBn5ZDh2fLv91JwUGKHNai7nqPKy0ldS?= =?us-ascii?Q?WfOtBX1n4vU8hiQG5Wy+sczNCaFIlr9sbRpElxRuw2/y8OjnoIX4E4K9ZFe+?= =?us-ascii?Q?a0dNuAe7k4MMoZsnAM2nQGyEwkddDn/mOJmfCX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oNsHgbLPOnVmrsS7coa91 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1987; 20:m/jGU42XQ7Fvm0Icngpowiz6EPlh4NK67O5FNEDIbAaV1U2iKQ1Oq1eYTpoQbe1biMBCct7+BgXPJdkWfpEyirp7RPIjydUpuReH163FbE8MdMHYkcjjcijQQwJzUO0YfiueiDF3T4X6yU6M4w9mU314BQxFvAlaZXdG3VUhTvU= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2017 15:44:39.8525 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dc56e665-b4d7-4c31-4138-08d5213f770d X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0801MB1987 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.4.93 Subject: [Qemu-devel] [PATCH v5 05/15] 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 |
diff --git a/block/file-posix.c b/block/file-posix.c index 36ee89e..c36e156 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -558,7 +558,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 @@ -593,6 +596,7 @@ 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 @@ -1413,6 +1417,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;