Message ID | 1516107870-8110-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 B1C0E60325 for <patchwork-qemu-devel@patchwork.kernel.org>; Tue, 16 Jan 2018 13:12:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A5C4628488 for <patchwork-qemu-devel@patchwork.kernel.org>; Tue, 16 Jan 2018 13:12:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9A7C628522; Tue, 16 Jan 2018 13:12:49 +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 0778C28488 for <patchwork-qemu-devel@patchwork.kernel.org>; Tue, 16 Jan 2018 13:12:48 +0000 (UTC) Received: from localhost ([::1]:35333 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 1ebR2l-0000hF-QT for patchwork-qemu-devel@patchwork.kernel.org; Tue, 16 Jan 2018 08:12:47 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55714) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <anton.nefedov@virtuozzo.com>) id 1ebQvS-0002mK-KE for qemu-devel@nongnu.org; Tue, 16 Jan 2018 08:05:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <anton.nefedov@virtuozzo.com>) id 1ebQvJ-0006Uu-8R for qemu-devel@nongnu.org; Tue, 16 Jan 2018 08:05:14 -0500 Received: from mail-ve1eur01on0099.outbound.protection.outlook.com ([104.47.1.99]:39168 helo=EUR01-VE1-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 1ebQvI-0006T2-QJ; Tue, 16 Jan 2018 08:05:05 -0500 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=gnR3bHpqvUFIIqd/LCma2waUTEv4X3LW1lj2gueTuCOO1fSAdbf4mcb7sXYBWhDFn0TI+pEYDLLUwReoQQafwRb6cn15XDqLmw2qLhIXEIjDMIgDNq2ftaEublebtvob8V5SuEX0v56ME5ZTi8r5CR10Qc9zNFLI3aLl1zOxj9k= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=anton.nefedov@virtuozzo.com; Received: from xantnef-ws.sw.ru (195.214.232.6) by VI1PR0801MB2000.eurprd08.prod.outlook.com (2603:10a6:800:8a::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.407.7; Tue, 16 Jan 2018 13:05:02 +0000 From: Anton Nefedov <anton.nefedov@virtuozzo.com> To: qemu-devel@nongnu.org Date: Tue, 16 Jan 2018 16:04:26 +0300 Message-Id: <1516107870-8110-6-git-send-email-anton.nefedov@virtuozzo.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516107870-8110-1-git-send-email-anton.nefedov@virtuozzo.com> References: <1516107870-8110-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: HE1P190CA0006.EURP190.PROD.OUTLOOK.COM (2603:10a6:3:bc::16) To VI1PR0801MB2000.eurprd08.prod.outlook.com (2603:10a6:800:8a::21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: dbe05d9a-db10-47be-5d37-08d55ce1c1d7 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:VI1PR0801MB2000; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0801MB2000; 3:Far6qt0vKenj/t6WE4DR04/q6l0pToEamAefPJl49BkpkYJCwo1wNaQfzujZZi0unvatUp58amajYIloLLyYVT2wRCLmgPkw0VQmYMR2yFze+X/3fPU+8k9XUq3VrNB9xBWAvFIg7bi+mQjOF/HiXCPqJQaNLPRdpQ057LDs9BqmNTUf3rNONWVduOPAHVDh0DMAEMkEBYbayvO9il6cpd6azo+3/PlJXfJY8hLEH94ob3Oqq8ob4UddUHPUlWXM; 25:1ylCiGPe7uwzoeyg4y4TrJqK93yJcbuavzo2xzu3uxBuAoqPOZiCNL88mSOsJEQyAwaVBh9xjC6gMz/us3ikyDn6tceOE+AmOWqipLU62ZwIVKFJU7V7WsvglUR3TdRvlPhxEIToOXNw51FL5nxO6ATldHcK+3L2aO+O+0vgBUeg96jOaeJ9LMDiFcPHTP+6s1S/8+9jRMOAZFVzW4gPfa29UUHB8YgJUhwH7BG5X64/OzeU1F1U285anGZyqaom+JU1rXFlvIRm2WV8yHty3hV89BkOUleqbZEYY6RVnLt7kHvJzvhEpAMMKL88iK60JDrR86WvfyVZqPtGPJC1jg==; 31:t0PHO+ELJ4k2rDHwIv/qrSHbgMyYFOD7UKbcgvLn64LmycnCp2vYJeFmAJj/QRQeP9C4NWaIOCtvlz1otnBEhUouOEMBqILcV9mhzZrJWRtccn+QrZAFuOsO5XHvc9jElUmyjoL/5Vl8U3DDzMDCRFao6Ue7jiYD7MZpXtjcccLhfi0FDJn87MLh5QWH6j1P68MNZDOuBfrDibKbygmCYS1bUBz10pRx0srIRwRbZgY= X-MS-TrafficTypeDiagnostic: VI1PR0801MB2000: X-Microsoft-Exchange-Diagnostics: 1; VI1PR0801MB2000; 20:DqFgSIeg6cL8BZTInwy/mISP2tr3t3f/ey+L5DDiAu8MrqiZaE2z5vdmluqKNJvyvZQlYI5eCjbLuekNpQkOdHQyz9IggCSUcEEMEISGLg29P5GN8Zc3qD416m6dVUffHunvIsvwpPH1neU89DRvZu0UjYt1l7SfsseWDFoKaH0kasmZz0aqLaqaAHAflRZeqSdpH1Fo2zkjniesIEQ1sfCSRGJkWZPiRwlECG61oDQBHU8RpadQNX1ka29y7wNjo+mtKFlvXuNZu3Fr6QCUU8VR6AXX0Y0PK4Sa0ItNZH4hdL7L3RjBS9dkIWwKlHoCHNz74VA98K07qiugIs4R17EiDXGZCnb7qUDXsLpZ+UAZUu3UALlEJewRdGdZ4qSdSJhn02epgOs7kWmwKYO6Q8sg3FjVmeddRHrkKj757Is=; 4:oHscA/RS1VT9cECnjjlFDYLVrS4qyt4fvZcmASaunHhtsocSDx5mWcfk06L8NVDWKaS6SbXrrvPyn5AyoI6wyIRbijIfQU2XlgnlzeCnmN522WOvJUAnfn/MLa0dvK1KYjiOby0CWVoiyU6+84nrBTjRcTMAg6ccc5QR9Pzx93mR05sJ3N4HELMALmwPyyjciTNrYOJJnhAkiPuHP7E7TWky+7sE9ufkmjNAG0hq9Sn1sqSA5EBejq0pmGsrcV73B9ieZltqLManY4JyOcUqEQ== X-Microsoft-Antispam-PRVS: <VI1PR0801MB20005C8475B885409662F8EAF8EA0@VI1PR0801MB2000.eurprd08.prod.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(5005006)(8121501046)(93006095)(93001095)(3002001)(3231023)(944501161)(10201501046)(6041268)(20161123564045)(20161123558120)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:VI1PR0801MB2000; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:VI1PR0801MB2000; X-Forefront-PRVS: 0554B1F54F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(346002)(396003)(366004)(39380400002)(376002)(39840400004)(189003)(199004)(105586002)(2906002)(48376002)(6916009)(2950100002)(5660300001)(53416004)(66066001)(6512007)(53936002)(26005)(50466002)(47776003)(16526018)(6666003)(2351001)(478600001)(36756003)(106356001)(2361001)(69596002)(51416003)(305945005)(68736007)(4326008)(8936002)(81166006)(386003)(52116002)(3846002)(25786009)(8676002)(81156014)(6486002)(50226002)(76176011)(6116002)(6506007)(97736004)(316002)(16586007)(86362001)(107886003)(7736002); DIR:OUT; SFP:1102; SCL:1; SRVR:VI1PR0801MB2000; 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; VI1PR0801MB2000; 23:PptHC5cdayO8zEc2Y2aZ0yppOe3mo89SRnJPoDQ?= =?us-ascii?Q?KRIZ3n4Et7at+E5YobFrceXddrhgGPNYKopUrOwR4yIbl3Y5QBRC28eg7KBq?= =?us-ascii?Q?C4CRBe7+Fahg/fdYi9TJomuamt0ND9Qaj17KFcVWFA4wabb49IH8srybTNIh?= =?us-ascii?Q?+wZF7bXM/Haty6ubn6p9+aY4fF2y27mDYRN5DMC889mUe2hXe6L8oxVdH5f9?= =?us-ascii?Q?js87DfyPgTOJWv+/5YlIK4gWCJDa8IKSyRD+mSRacXdJu9qCU57KGR6MOzRf?= =?us-ascii?Q?72vnkEB42ICElHV7CCU68HXchmRdSf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q?BglgWtemyo0C48QM=3D?= X-Microsoft-Exchange-Diagnostics: 1; VI1PR0801MB2000; 6:BbiAtbubhNZpvMwxfj3UAC5k+drSebXmmM4TZaLgy+R1bursJ5f5yJYfjdlkMdLFR/16bYfcPwDxEcUk30HHyc1nWDGwiU55TKzIxPDNBdfwFntOsnQjPz3tRZI4oBrG06QSbIg6L19CffzrLHE8ZmBAQkIqgU5g+imHHD7mTJNeA4ESs+RPn8ioGXtauqRixBh4AxDjKQZXj35QeSeM6Q581R6EK0ewg9RYY0DRd7t3HKOjBK1/Vb77cm1GbZKC7Any6rpta1JcYmAeonQXfXEbaGFj7m7l7VRm3LK99ovIaHO5ZehQ21Fv8H/CbU6GqqgJP02DeyfEpS4YHkujCREjKuy1QgiVu1OEkancDMk=; 5:BlCofmLohv5kxvIw/GpJWuY3uZKBppMa3T3iytowBVk5uo4FzrHh8U++IsG/i32hj9XIL1H1kPCxX79/3ZLs4qnHS+N7psRoCZ5+/xghyyHmxTMC/BKoiof+jRCOHa7QHhAYFPDMKKpaY/lhR2H6n3CdJeOsqUDdmd+CDg8R31k=; 24:71oKruCQ1bYvHM9vO7vvZzaSNGJUTr2J2O/HXIQyZFyDU74JCRUlGB+epIdqSEux8bqxDFbru6La+YYe8D3Eb3EICv0ZJb597PSv8eysh1g=; 7:WNU/mR4oVJGSZee9eW/lUk0SZGkoK6SQhsS9qPuSX4rhAqcgJ7k6iz9xt7ZZ8PYzpoRz1mWKf4Exz9S/L4aSqON/3ux09U3JvVhRuKqoZ5hNTlGPYuQccHkdH2IoqwZluODanUu0yNqKIjqHPYDLvnd5ANB06L3l4LAYG09/ECvF7HUTlKgpFZGC2yb+2xRxUaDGLve7cvrvZuRm5FPUAYzRQlKHjesGtzws/jO1hGFtjjI1Ux5wUTMkIM3cacYO SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; VI1PR0801MB2000; 20:EfjHyZyzN5mZBY7781+34Ro7TOZ5IAHWCiJBctrhAScU/ZaB0ob7DWFIB2I3l63mwBaOgqTIOUBFcjqx8JIM/reC0CDiYc3FAxDKMOa5d+wj6IsyDyVG09QpTL/jAXR1QIAcZ0fTq2aIvhYK1gpGZwQ+zgryTp5VPfHWGqJD8V0= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jan 2018 13:05:02.5275 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dbe05d9a-db10-47be-5d37-08d55ce1c1d7 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0801MB2000 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.1.99 Subject: [Qemu-devel] [PATCH v6 5/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 |
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;