From nobody Thu May 2 14:29:44 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=none dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1587975930; cv=pass; d=zohomail.com; s=zohoarc; b=HM2G/PMj+FNMSgHLwfUjr4JNVvC6bGg0b0QWsGXP/wYXvNebeuMkMdAaWBG+/2nbQ9ehwiYK3j5z1Q67T2HMs3OxwuQGxTiWQBSG5jHJd0czqOplqLShLiUAA8Mslu31vohDzrlvqf7SWoQ7XjyzaaN/JM2umsAzKwZGp8pVxCc= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587975930; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=bywV2kQhRAsO6mK2zK138swjP/Qw4WGsm8vFDGVzkxY=; b=oGIck3AYug9SdnVZhjI6aRis5i6jtDpDwCrK53p2C5VeyBBygye3WXt9ds55MBaviEbpuRxFbZzsm97OIQ3+zpzMCAF2zH5jQNbcuRMxUFuU+b7V9b4ieYZhtbguDh9L5XHHgTVYaNZaT1fAjCQ/o6v5nnabKapwXPeP1hnhjvs= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1587975930344185.17794667400233; Mon, 27 Apr 2020 01:25:30 -0700 (PDT) Received: from localhost ([::1]:58232 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSz4y-0004sS-Vy for importer@patchew.org; Mon, 27 Apr 2020 04:25:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48782) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSz3W-00029e-GZ for qemu-devel@nongnu.org; Mon, 27 Apr 2020 04:23:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jSz3V-0007YE-Ux for qemu-devel@nongnu.org; Mon, 27 Apr 2020 04:23:58 -0400 Received: from mail-eopbgr70114.outbound.protection.outlook.com ([40.107.7.114]:29366 helo=EUR04-HE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jSz3U-0007Ta-8e; Mon, 27 Apr 2020 04:23:56 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM7PR08MB5463.eurprd08.prod.outlook.com (2603:10a6:20b:106::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.22; Mon, 27 Apr 2020 08:23:53 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::acfa:5:88c8:b7b9]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::acfa:5:88c8:b7b9%3]) with mapi id 15.20.2937.020; Mon, 27 Apr 2020 08:23:53 +0000 Received: from localhost.localdomain (185.215.60.182) by FR2P281CA0004.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Mon, 27 Apr 2020 08:23:51 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kbzSySsHYxsuFRE3YE5Mb7sJd+N5kK4/i0aMr1uBpp9LgxyO6RapponiLo1awlyBSAa02EwvXfBR3of+s9joj+hw/1u4/reKoiCXLg881ulBg6LaJQx0cUzq9gWp2Zn72WTusizLTE3ot7H3uAZ3I+pHV6rVc/nULIgR1jQrS/2FvJqLr9n1V3XWZcIpL7m+UYuBS8lnAWqa2IUl7W6QxidicxmGDugRBys0gc+itws4X+0oj5gWPCNQ5oNxhHital67DTRf0/g7kUmMt98EPLLYgImcyvfPndHkSaKpYVE1pQLm8KvzwTHE56xfrj7ojiLWz2Xz91/VwrwG/1RUKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bywV2kQhRAsO6mK2zK138swjP/Qw4WGsm8vFDGVzkxY=; b=UX9XBn6etyh8DGpLMpBwNmHHZp7OJ7jbbOvYduMdd43joHhFgi10NkI0+PCu2MLsCN3BZwTvoM/ZJq1rXBqBoFHJAbWn18LyqPcQ3oaX5keuu5XzeGw7IM5WHX5OAG4AuZlMxwU6cZDwhLt/8F8EiUOFPDkQAicvvmVJcRf8/tXYsOKalutDb8XjsXALm19kCURjKqlof6x0sILX0rXmCez0/kRNj+gklLsWIJcQ3MhwZJcSWgRDTxgb8H9cnmUuIwNXatcSAZnZvWkvFYInqp8MQvwq96ZlsCeaBZ9cNtARk651bj2oW5JpQK6M3qxmi3tUNsp0oBbUxHqwilHE0Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bywV2kQhRAsO6mK2zK138swjP/Qw4WGsm8vFDGVzkxY=; b=loHVBIrwM+Y6PgKubbu0TisV3Aj6gB52RLzQFVU/cB3p7EJ4A4WdDC+nlyLcA6URWAtvdw6Bb6u9anKlPqPdimTCwuKms5HqqRvvFd1u6FAbqW+wZqWNVSzp/Hmo1y07H7JDBOeyGQLnyKnncYjFJ3Z5Rk9oChrxucDk3HWY6g8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=vsementsov@virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Subject: [PATCH v2 01/17] block/throttle-groups: throttle_group_co_io_limits_intercept(): 64bit bytes Date: Mon, 27 Apr 2020 11:23:09 +0300 Message-Id: <20200427082325.10414-2-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200427082325.10414-1-vsementsov@virtuozzo.com> References: <20200427082325.10414-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: FR2P281CA0004.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::14) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Mailer: git-send-email 2.21.0 X-Originating-IP: [185.215.60.182] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5f3a1ff9-95f9-4115-0005-08d7ea845201 X-MS-TrafficTypeDiagnostic: AM7PR08MB5463: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1227; X-Forefront-PRVS: 0386B406AA X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(366004)(136003)(396003)(376002)(346002)(39840400004)(2906002)(81156014)(6486002)(26005)(8676002)(8936002)(4326008)(6916009)(478600001)(66556008)(7416002)(66946007)(66476007)(6666004)(16526019)(316002)(2616005)(1076003)(186003)(5660300002)(52116002)(6506007)(956004)(36756003)(107886003)(6512007)(69590400007)(86362001); DIR:OUT; SFP:1102; Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3ve2K1Nyr37xp4wNd14WnJXmI/xGHRNuPagvTxFMpYQSGl0qaHwNVyEygzd2J7gLh7OOIwpxX5Sq5RLvIyrpX2p8bnbwBYGECN1wdgiODvA9cgpWFc1llpXDVTgFioHLWE9pBs1lbYGjpQyDbs87IBk00iiT5hlC3HvUKerOu+K/BNcXDY+GccypU66znnzzsPDbDaod0ZHlbYcFNaK2+mAeYhDAKDu34gw4TmkROnEWIgAdbgvJGZjCoR1IRPrFo3JXoD8n6qMUfByjSw+47+GmPrSlhLJMT28xqsFTSBxsbrg4ewGMgKKjBZCWzBTrlVyrnAttNlUvh6SJrufAcz0BQQ8TtAkXPHJe4smHEEUN8hqlV7FE9MC2KJkcBGGFMpMJ/42TVqwFsOaIEDL5/fEp99k2Yw6G1voRSt5b7NeGF600T4NYl5xtovenLQHRL1i7P834F00YTVBkfQlbgaeTF66GM4J6Sn18Nj4VATSTBYfurSzITL6ByofEqcS9 X-MS-Exchange-AntiSpam-MessageData: MsTVWoFLRG5cJe7Ry+4anGCg4+tuvY0fwi8HJpFGgbV/KYDngKsaeMeO6n3JQHcid0CWdSnYjFbpncf5ZjRFwaLOaCE+IasY5jJh7pPGy80w21m/iKBffVQbalJO1W5pE6F++xYokjEqf5cPUgRJILofZmYsplrhGF0nQDGtQ1MXElXjX1Zc5uAUcucPP5qnWubQNOHNOmx4PuA5k8FkHPfz6QbqGmNPdbt4yIX6Em1Pbg6Zl3HYpc06xv9PMEMOdNtE6lviboqbu7GIkQxBsytDbwWkJKO/PyAM5chP3B9JecNYjxdeD3E030OHfSRFklYNMbar7u7rOhbUiGO/yR2WnQX2EBYFShBDZ4yGrzZR0fnObT6t0ZKBOVo7TYzSfP30EFVvgHvKNa9kpxRJXYVy4HtcwL+B0ulisl4IcQiMCNsBxFWMokQ1suno8dK2kqmKQ5jxo4j3kRmS8ioHKTdq9HQzautkYuCDiNpIWmXi/3RJQKX+veighA6aU+Y/MHnI01byB0mQbLHDa85dfE7a3mfIrEayUHhoL8VcsWAW8AUbK2w4ZNZim5W2DPEb10qVxLyzcHWmJlrb8BiIUzWl2RZo2k11TfOO/XFQ1zvC3dPoqhmZzyWaWSK74atyBQ/PuqLcCJe9xPhRPrnLSw4niBzqn2KsPH5YevOIypa1wGbW7AyZh9ZUBbYxSUYNJCLd8PPVcdA0IyyxYu+yfb1YaSEJR3p9tIunXmsZbuRKdUza2SJX/eF38y3xu8pCjy3gMSogXIB+zfyV+vwv/xFyuGu6jJgYrAjsNj7+Uyw= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5f3a1ff9-95f9-4115-0005-08d7ea845201 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Apr 2020 08:23:53.0515 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 70+polk/Ah2YIChvNjeyOUx2sofhzPx12xHFH3Oe6qDG3bGoUIltB4vTspn6QcvG5Ej360DRAcoPbOLTCliwISZgkey5LphEe2/5t19r6VI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5463 Received-SPF: pass client-ip=40.107.7.114; envelope-from=vsementsov@virtuozzo.com; helo=EUR04-HE1-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/27 04:23:52 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Received-From: 40.107.7.114 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, fam@euphon.net, integration@gluster.org, berto@igalia.com, pavel.dovgaluk@ispras.ru, dillaman@redhat.com, qemu-devel@nongnu.org, pl@kamp.de, ronniesahlberg@gmail.com, mreitz@redhat.com, den@openvz.org, sheepdog@lists.wpkg.org, vsementsov@virtuozzo.com, stefanha@redhat.com, namei.unix@gmail.com, pbonzini@redhat.com, sw@weilnetz.de, jsnow@redhat.com, ari@tuxera.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) Content-Type: text/plain; charset="utf-8" The function is called from 64bit io handlers, and bytes is just passed to throttle_account() which is 64bit too (unsigned though). So, let's convert intermediate argument to 64bit too. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake --- include/block/throttle-groups.h | 2 +- block/throttle-groups.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/block/throttle-groups.h b/include/block/throttle-group= s.h index 712a8e64b4..f921994b8a 100644 --- a/include/block/throttle-groups.h +++ b/include/block/throttle-groups.h @@ -76,7 +76,7 @@ void throttle_group_unregister_tgm(ThrottleGroupMember *t= gm); void throttle_group_restart_tgm(ThrottleGroupMember *tgm); =20 void coroutine_fn throttle_group_co_io_limits_intercept(ThrottleGroupMembe= r *tgm, - unsigned int bytes, + int64_t bytes, bool is_write); void throttle_group_attach_aio_context(ThrottleGroupMember *tgm, AioContext *new_context); diff --git a/block/throttle-groups.c b/block/throttle-groups.c index 37695b0cd7..37d1b7a8b8 100644 --- a/block/throttle-groups.c +++ b/block/throttle-groups.c @@ -358,7 +358,7 @@ static void schedule_next_request(ThrottleGroupMember *= tgm, bool is_write) * @is_write: the type of operation (read/write) */ void coroutine_fn throttle_group_co_io_limits_intercept(ThrottleGroupMembe= r *tgm, - unsigned int bytes, + int64_t bytes, bool is_write) { bool must_wait; --=20 2.21.0 From nobody Thu May 2 14:29:44 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=none dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1587976089; cv=pass; d=zohomail.com; s=zohoarc; b=MhCRa1u8D6xK3uG+xJNotNNRErjBhg6QDnmseGikQQs6st3247P8Q4QMbE83ypbnomuXnMy5jsiot2tU8A8NFCpgn7rf3XAUuCupLyjLTvAGHWADl89rlm7/fYGu7fJ5DlM36nQT6WIGkqiYLV1mK9Fpo2VYd+TEjV+Fim4BTmk= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587976089; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=15AMeICMjr+njwKyQlpiK6XXqLA5ajWrYYlGp74/ug8=; b=gq3E3Dw3KdU5kIs5XzftnUKVaMLkCHBLUgtmIiaoHgVxb4zWwzNjYCaNUpSHnFj6OmCKC1QCuQlTsUtbJ+ljfdUlIR6/53Bef2PLzwqcz5gA40nzmXfq7QZ0gkcr3WhNvROwlumKVLqgbfV/bWRXF0O1k3hu30rjrsTS25/8Lb0= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1587976089598858.704590614085; Mon, 27 Apr 2020 01:28:09 -0700 (PDT) Received: from localhost ([::1]:58498 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSz7Y-0002C7-0X for importer@patchew.org; Mon, 27 Apr 2020 04:28:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48800) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSz3X-0002Cc-EE for qemu-devel@nongnu.org; Mon, 27 Apr 2020 04:23:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jSz3W-0007ZP-Qm for qemu-devel@nongnu.org; Mon, 27 Apr 2020 04:23:59 -0400 Received: from mail-eopbgr70114.outbound.protection.outlook.com ([40.107.7.114]:29366 helo=EUR04-HE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jSz3V-0007Ta-Af; Mon, 27 Apr 2020 04:23:57 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM7PR08MB5463.eurprd08.prod.outlook.com (2603:10a6:20b:106::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.22; Mon, 27 Apr 2020 08:23:54 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::acfa:5:88c8:b7b9]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::acfa:5:88c8:b7b9%3]) with mapi id 15.20.2937.020; Mon, 27 Apr 2020 08:23:54 +0000 Received: from localhost.localdomain (185.215.60.182) by FR2P281CA0004.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Mon, 27 Apr 2020 08:23:53 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BDPhKog+8sL1GSSabYYG12jpefLdALvhomj5vIR7cgh4Xnal90B3yzPsbDqnXKZD/Z+x8TWSkaVpMVUxEUYbubHOHooZGZ0ZyxU9Gck8xMAFUtlI4FGW+mmZNvBNPiwUHeZU9DVFOgIFih0U8/j9yC9hirSssjd1YSkJtmDi1hORKJYIrIPaertPaaBo4nfeRn0pZvf+lNYvu6Y05M2IO1LdH3KvretKwaHDqdLNy3LiRi2ddr2+AmSifcn1/DJIfgiqItJbEiaOMCluW3fFsAf9ykJHxkKtZtJFSlnzuqTeR5tn6WNaOZMlxjNeTwZYdzmGLEKbZRA7dpk6eJQ40g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=15AMeICMjr+njwKyQlpiK6XXqLA5ajWrYYlGp74/ug8=; b=h0RV+9WwAzQBYqRoFbLbEEw0nFallyvk1u/qM6hqDantoUjAujEIwtiEcFQ6XNF9FXEjXwV2Wb2u2ZohHN1XvRphN87pf5jqyxUM4xJ1Bwpb5OK5yxYg2kAhkX1yCQYW4oBUshsLHIabE2peZ1gR7/uQZezDcsTQnj8Xhv+wkp0kYKbjFJpyyrj8hwfAogTXPHw/GTeACf9+tWfgIKh6/RL8oDth5Db9GtC+R+8lc4/QG72FrjxrQQKRz2jHDlIwMYqNNqsM2882o82gDTYlnUQ5ZwqJ1OP++6ssFNBzqXZ5pn+u9l/V/B4oFjQPoj9oYt39dXdT6oiTiZ7/EtqDww== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=15AMeICMjr+njwKyQlpiK6XXqLA5ajWrYYlGp74/ug8=; b=PmCsdLRfi3Z+dd1ilp9H61GljcPOK50ISz4Lkw1OM3sxWOWFF6SrmmR1DYRiYOiDUaBGGjF0nSiguCc3zLukv0rRfYFQXdOjvkg9eemGId5+PKgLr2vVhrdlNyfS7GLOOPRXpUtU/Sc6d7owIRqC6Hg72VVBpOXcOvE3GJsGXYg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=vsementsov@virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Subject: [PATCH v2 02/17] block: use int64_t as bytes type in tracked requests Date: Mon, 27 Apr 2020 11:23:10 +0300 Message-Id: <20200427082325.10414-3-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200427082325.10414-1-vsementsov@virtuozzo.com> References: <20200427082325.10414-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: FR2P281CA0004.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::14) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Mailer: git-send-email 2.21.0 X-Originating-IP: [185.215.60.182] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: abaec1d1-b7d2-4f15-c387-08d7ea8452db X-MS-TrafficTypeDiagnostic: AM7PR08MB5463: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:397; X-Forefront-PRVS: 0386B406AA X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(366004)(136003)(396003)(376002)(346002)(39840400004)(2906002)(81156014)(6486002)(26005)(8676002)(8936002)(4326008)(6916009)(478600001)(66556008)(7416002)(66946007)(66476007)(6666004)(16526019)(316002)(2616005)(1076003)(186003)(5660300002)(52116002)(6506007)(956004)(36756003)(107886003)(6512007)(69590400007)(86362001); DIR:OUT; SFP:1102; Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FMn1OfRDxtMt3ZSJG/IjlzIXGx/igJTlLb08pIP1y4hJ6iCd0CoybY0rBQahuNrh/1KDKbdvnmkRMpslsnBjGLGUVgP3ZKMGrFbw9vg+UYeacPJG+KBi52jfplnPSoh1BeA1uvsFML3brjRa/cl/bHufeKhFDaLQG1foUylCFSVQ5sjxVy2p8AXT8DzaSdsxbDtJRn5TFPAbRESqtbtAx84bfMb0k8wA6nYv5cNkItSWRHtr9YP2yJL7h5vByqXjwJcCyoQZnUQXSXDo3f283v8tUx/4yflOYbNN8GFNP4OnNcwaEcwK2GaLUWD8tqNkUr5oOZuGApLmKy7wxfnNb1AFMSwbeiYNPIe1DyZVVXvM2cpgeg2H8Uu+was6Jz3Y/WBpR+4uFRwQv82LSPbGWuf9p4oCAy8i0+coPCi4i4M3ayMm6M2WCVcFQfkNaf5VF2dIGEz92+g4a2uLxCwflSUD65OmXnOeSfdTcI2K2wxe2GtaR+SyjFu8LeJ+U9Z2 X-MS-Exchange-AntiSpam-MessageData: lzVANwIfJzwYEObddZx2OoZCbVXRN0H6PHAHkOv/a39/LF4LNsra87l0Nete7u5xHUcMPLsU7wDyyxFrJZIRr6/9tUa8lJb4xCmPbG2oqzCdVD3hFZ3H+K0fpAK1xa4HkoxibKAZINCoQ3jJu24lntNM5aE8UrenmZHwto+AQCPDlyp8bBZ5uOvytujIOswGGTmshoCy5mbX9xsHXWglICHIb0A0i6HOe8I68XvjSuSHwjmzOOEzgRODakNaDR/dh6JsVT9soyZVi+8AQqSeKB9eYgaN63N6GhKjDzrL/6ktow5IXmB4DMs8u/aiUWinW01yRb/viSqbXQSsP6e8ypaTDoBkpk64ti7aC04Rpc352JTxVqRMM22h817UC2RZfYm65eCitcZA5QBF7f/7A6eVNUx0EwWSw3uztd3G3TyYrAkJV0FmivDcNelGo9anWnNBxi495y8CWVwMdWeBA6cKnx4M2WTEPK5bdomnDKvnc9dKhYNbT1n82uILH+hezN5MRJeRm2UYpq2QMu9YrUstSiiP7pANrm0QUiyvv6s4s12aAFOyT6KRBC+1eoJ9oC8BWvzjyb/AF+g699RB0ZB7vEOecCDmyON0Jdm4koOTOUZJAvrjLDbrDI0m65XFXV7gwUBFCHXU1ZiWUCzm1e1sEzQHKXMmgYf/W6JX+zPcZNVxBZTfZ2V/Pd77/NJ8tqR9ehYNtvowl2Y7w7GyuTielFDu9BveA2hmyWgKio3zMD4fE6JNitVHYnAA6on0lSKqSqHGq67/aGxzLCl60kwa5L48+6LmkSdXVy1TBfc= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: abaec1d1-b7d2-4f15-c387-08d7ea8452db X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Apr 2020 08:23:54.5181 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Ju5gmqcV7IpyotAKkbbSb0MGknoviCC9hLqpXekmGnm2pYBUtsxQ3R4D7XWrUsH2hR6YKjYsRa/kkVyRe4gc8fXn1Leir1DKRH9Oi187C1Y= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5463 Received-SPF: pass client-ip=40.107.7.114; envelope-from=vsementsov@virtuozzo.com; helo=EUR04-HE1-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/27 04:23:52 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Received-From: 40.107.7.114 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, fam@euphon.net, integration@gluster.org, berto@igalia.com, pavel.dovgaluk@ispras.ru, dillaman@redhat.com, qemu-devel@nongnu.org, pl@kamp.de, ronniesahlberg@gmail.com, mreitz@redhat.com, den@openvz.org, sheepdog@lists.wpkg.org, vsementsov@virtuozzo.com, stefanha@redhat.com, namei.unix@gmail.com, pbonzini@redhat.com, sw@weilnetz.de, jsnow@redhat.com, ari@tuxera.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) Content-Type: text/plain; charset="utf-8" We are generally moving to int64_t for both offset and bytes parameters on all io paths. Convert tracked requests now. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Stefan Hajnoczi Reviewed-by: Eric Blake --- include/block/block_int.h | 4 ++-- block/io.c | 11 ++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/include/block/block_int.h b/include/block/block_int.h index 4c3587ea19..c8daba608b 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -70,12 +70,12 @@ enum BdrvTrackedRequestType { typedef struct BdrvTrackedRequest { BlockDriverState *bs; int64_t offset; - uint64_t bytes; + int64_t bytes; enum BdrvTrackedRequestType type; =20 bool serialising; int64_t overlap_offset; - uint64_t overlap_bytes; + int64_t overlap_bytes; =20 QLIST_ENTRY(BdrvTrackedRequest) list; Coroutine *co; /* owner, used for deadlock detection */ diff --git a/block/io.c b/block/io.c index aba67f66b9..7cbb80bd24 100644 --- a/block/io.c +++ b/block/io.c @@ -692,10 +692,11 @@ static void tracked_request_end(BdrvTrackedRequest *r= eq) static void tracked_request_begin(BdrvTrackedRequest *req, BlockDriverState *bs, int64_t offset, - uint64_t bytes, + int64_t bytes, enum BdrvTrackedRequestType type) { - assert(bytes <=3D INT64_MAX && offset <=3D INT64_MAX - bytes); + assert(offset >=3D 0 && bytes >=3D 0 && + bytes <=3D INT64_MAX && offset <=3D INT64_MAX - bytes); =20 *req =3D (BdrvTrackedRequest){ .bs =3D bs, @@ -716,7 +717,7 @@ static void tracked_request_begin(BdrvTrackedRequest *r= eq, } =20 static bool tracked_request_overlaps(BdrvTrackedRequest *req, - int64_t offset, uint64_t bytes) + int64_t offset, int64_t bytes) { /* aaaa bbbb */ if (offset >=3D req->overlap_offset + req->overlap_bytes) { @@ -773,8 +774,8 @@ bool bdrv_mark_request_serialising(BdrvTrackedRequest *= req, uint64_t align) { BlockDriverState *bs =3D req->bs; int64_t overlap_offset =3D req->offset & ~(align - 1); - uint64_t overlap_bytes =3D ROUND_UP(req->offset + req->bytes, align) - - overlap_offset; + int64_t overlap_bytes =3D + ROUND_UP(req->offset + req->bytes, align) - overlap_offset; bool waited; =20 qemu_co_mutex_lock(&bs->reqs_lock); --=20 2.21.0 From nobody Thu May 2 14:29:44 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=none dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1587976037; cv=pass; d=zohomail.com; s=zohoarc; b=fynF6QubQMYMCaDcBmWVkdrAt6Cnr/PFa/se1zZb1UnTwk1RfBdJAfhOw8eZEPnA2Xup9OyG3H0upmWy6eQYzSBckUWxbrCfY608uD42Iu7DY7ec/t2+w+2FK154AEB7oeOFfkRZY9t4dJRwlFNn1IvGXMfluu3VL286S4g75KE= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587976037; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=JyxwVFEjIJ8maOv80J+vFbwCLPp9tzvkpv96RwU/OkE=; b=ReM399TXi8eWUO5Vpsp9hWohJmcfURTc7CDp/tuAVGj6RrBMZ59jqLwR7n97eU8/pSoecOaC5WbyA0DwSEiGelUaPT00GShigvLlIfvfiETLlRs+mD4UCnBsCXxHqXjx/vGTDUGWGh9e/3wE511q66M5Fy5Y47Swg/Jkqd6UJnk= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1587976037745424.981711187212; Mon, 27 Apr 2020 01:27:17 -0700 (PDT) Received: from localhost ([::1]:58394 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSz6h-0000DN-Q8 for importer@patchew.org; Mon, 27 Apr 2020 04:27:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48850) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSz3b-0002Ny-2d for qemu-devel@nongnu.org; Mon, 27 Apr 2020 04:24:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jSz3X-0007Zw-TH for qemu-devel@nongnu.org; Mon, 27 Apr 2020 04:24:02 -0400 Received: from mail-eopbgr70114.outbound.protection.outlook.com ([40.107.7.114]:29366 helo=EUR04-HE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jSz3W-0007Ta-B1; Mon, 27 Apr 2020 04:23:58 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM7PR08MB5463.eurprd08.prod.outlook.com (2603:10a6:20b:106::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.22; Mon, 27 Apr 2020 08:23:56 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::acfa:5:88c8:b7b9]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::acfa:5:88c8:b7b9%3]) with mapi id 15.20.2937.020; Mon, 27 Apr 2020 08:23:56 +0000 Received: from localhost.localdomain (185.215.60.182) by FR2P281CA0004.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Mon, 27 Apr 2020 08:23:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QuVO5k54BPNf4UPGg/wUT/DbqJjbx+RDIQxgYIj2SMTLYwx402Eqau1wsrozuh0Tqshollr+M7JIkelpZJGYt4mtya6cypefwj7Ss4kQpJxN60GhQqizwmhrwQvroE98SalOAcG62aVMj5sViMi0ui8BXSFZXJ/1PdEjxwO/7VypMpCcs/74MIaYuInWcUwNEAYxukWcfhIrvM0nETjuy+8kmC3Hb7cRv8Z3fsb/frF5mDFN+2j9f2jmzH4GtxRZf9c+Zg9NUDbmrvExxKDXFYlPeS9xO6xReYobYDJ+Fl/goZudIWHm2SDWTC9ErJCA5Pjb4F6SRzs73jlcRMXiPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JyxwVFEjIJ8maOv80J+vFbwCLPp9tzvkpv96RwU/OkE=; b=ktfsCJbvoBw/eqXxt+0clCwScvD9v49ESej0vZhAmDgKmEar39QR7oC/9l6eGyXMsEDmFcGEo5W899PkmO5Pv5/yxx/at6/tzfIR9rHyEndpCjFMHnpv42pLBohNsKQr1iuq+lHKM9Q77UZCe2ucbmtvWGSYtuQesFTdDj8hu8tO1Ix9DwEuTTrXMosj3CiLschp7xc7OSCz3BwVF1Yg5UOfw+7byQaKujZUmqIoTXkdK7GLNvuWERb/faOGjsj9r7Ik6ib/wSwadNjB5Td1hprDMMbKhQUdr8blg3XRRhp8j3GC7PDGnZ77ubwH0eK8jrZyUEV230lTDhz7Cu3EXg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JyxwVFEjIJ8maOv80J+vFbwCLPp9tzvkpv96RwU/OkE=; b=hxUwrRI6+Bcyy8TvMdZniZTyDsWq9CORxe9e0XWfVD5LaWPdcHL2RB3ONJhIJ5VCXaYaPKDlJ6TKPecx0ENxgi8VR0dXaTW0SYMjNzg25Frc3bO7g1KQ6sRcytP0/R4G/yFJXvT1zphCu7EqIZ4Vt/kin1/nuHu1Jtx89uH4JtM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=vsementsov@virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Subject: [PATCH v2 03/17] block/io: use int64_t bytes parameter in bdrv_check_byte_request() Date: Mon, 27 Apr 2020 11:23:11 +0300 Message-Id: <20200427082325.10414-4-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200427082325.10414-1-vsementsov@virtuozzo.com> References: <20200427082325.10414-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: FR2P281CA0004.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::14) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Mailer: git-send-email 2.21.0 X-Originating-IP: [185.215.60.182] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 65dc8ad8-59d2-4bc0-a41a-08d7ea8453b3 X-MS-TrafficTypeDiagnostic: AM7PR08MB5463: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:962; X-Forefront-PRVS: 0386B406AA X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(366004)(136003)(396003)(376002)(346002)(39840400004)(2906002)(81156014)(6486002)(26005)(8676002)(8936002)(4326008)(6916009)(478600001)(66556008)(7416002)(66946007)(66476007)(6666004)(16526019)(316002)(2616005)(1076003)(186003)(5660300002)(4744005)(52116002)(6506007)(956004)(36756003)(107886003)(6512007)(69590400007)(86362001); DIR:OUT; SFP:1102; Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CYfoT/wEr18FsBnZRePooEgSiv6j3xtnaBniWNmVu4Wak5Oyae/kzj5rcbzkHeHj5dkiwOwaSMmGn1oqhUsmPRVbaDBGf/8e4bBWnmWj/Eu2OQ9Lr2gfWLTqdeGQOf0IW2SSCI+7lhOmYlx/iwN0oyeO2zGZj/WzrFZ3Lw79tuit/7X2/hYl1GM5XUyGM5nDY6EYhK3td6hdHze5901ycodH/W4RGzt5uzrjkGMrDqwiIZjMZ51p9pyL0VnKfMTCgLBR6QMBHg5DSCZ+SxaRMSc91JQLoeIxhBESJjVoukz7SETXTs8IKWvpkj0I6WTwz/QN9n82N/V0gxp2lHirPjnkhkaCrg9Z4H05m2n4SGNmFRQzensrnOwpMn3/gKPqI7PQhjmpcFNA0cfs4bkarBCy7oxS985g1LhLU1jWs/GIzya6oDMKQiR6wy5+sT/Nvznbz8xoTuK2MfehqR8d/bYLI/UP6XIv9+/h254zQkVNtKL4CZjCN+zLHuCM6W/D X-MS-Exchange-AntiSpam-MessageData: IpI7pYIdTxhMGzt0r3IU29QnGfprHtIFhVe32HrYFSfwlbVHVoksxoXtbRT5iCmEATLgwAhXVmdt9Jq8p+pMN/M1wLx9Guom89kpUtCpVsv95iS8to7SKUZaZbqjogLjmcqmPLc2qcdrgg9RxMzHYvxU5uSOeD9q7t6IXd1TEslJP0mtYprQjcaElKtRr1J4xFKPTDqC6bkM2K2/TSQPhc0jJl68jVKm7NakoC7fvtkSG1Bez5O9YXanFS9F/3D5VLhC3AuI8iRmW/DZZbWpFl3ZCh0xNae3JZ/Ll9hqVrJpxI2ZGNWE8/ufp8Z+KmAqewyw3VQX0cLdGoosC62D1j4uEP34nfq25/TB2Mz3HfjOy6lvSEHKktbZGESsoIxh8JNYMVzEAfjSpJ59T4gkD3Y2mIjpUWAFlxGpYSALoYQKyiO4WBviA5Iyy+9y6k13Tyylu3UMLTpwmsthn/OcNSXAJbH6gERffljyN5T1i6GPEtBizmeUEY9g5rDaM8b3hTFnaOlSK17VezFxgoH14dCuxm8TW0TZJs/+QCN7Cny/UVnwsrdHWWL1hjk72pGiThNVh+pSdvAgszW/bE3rE9Jd33YN24O/944pxv4rUnL1j1oMpErEq5If6lJc0gIwrbB+gb2TFIUtyBvUeRtzbDe1S/E29820kY1TYwIwZJdopt7Ggehf1Z6JJuzmjshSP9Q2uNODnNzRZzbGqAUOcbWCiXN14BK1niqzUuId2Xeh5K2PhLReyrerIIVQ8GTt4NS2EdU3biiwbQMdkipYBxMRSMeViM1sM5Nm5JFiMgk= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 65dc8ad8-59d2-4bc0-a41a-08d7ea8453b3 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Apr 2020 08:23:55.9130 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: apKEtLMBuuoBPSFUh3PHKFeIUKQ/ZE8jeAXTLWbTJ3IxAo+fhMOqesXPYbsLCC69sQWuJDf3W7lDbkZbbQMmIHt51yRG1TBT71cvk0c/ZRs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5463 Received-SPF: pass client-ip=40.107.7.114; envelope-from=vsementsov@virtuozzo.com; helo=EUR04-HE1-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/27 04:23:52 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Received-From: 40.107.7.114 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, fam@euphon.net, integration@gluster.org, berto@igalia.com, pavel.dovgaluk@ispras.ru, dillaman@redhat.com, qemu-devel@nongnu.org, pl@kamp.de, ronniesahlberg@gmail.com, mreitz@redhat.com, den@openvz.org, sheepdog@lists.wpkg.org, vsementsov@virtuozzo.com, stefanha@redhat.com, namei.unix@gmail.com, pbonzini@redhat.com, sw@weilnetz.de, jsnow@redhat.com, ari@tuxera.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) Content-Type: text/plain; charset="utf-8" We are generally moving to int64_t for both offset and bytes parameters on all io paths. Convert bdrv_check_byte_request() now. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake --- block/io.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/block/io.c b/block/io.c index 7cbb80bd24..1267918def 100644 --- a/block/io.c +++ b/block/io.c @@ -875,9 +875,9 @@ static bool coroutine_fn bdrv_wait_serialising_requests= (BdrvTrackedRequest *self } =20 static int bdrv_check_byte_request(BlockDriverState *bs, int64_t offset, - size_t size) + int64_t bytes) { - if (size > BDRV_REQUEST_MAX_BYTES) { + if (bytes > BDRV_REQUEST_MAX_BYTES) { return -EIO; } =20 @@ -885,7 +885,7 @@ static int bdrv_check_byte_request(BlockDriverState *bs= , int64_t offset, return -ENOMEDIUM; } =20 - if (offset < 0) { + if (offset < 0 || bytes < 0) { return -EIO; } =20 --=20 2.21.0 From nobody Thu May 2 14:29:44 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=none dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1587976370; cv=pass; d=zohomail.com; s=zohoarc; b=V/a3/0NoWae49f09FYxtXQIpniHqeHV1rMxkH37t3xER46WakQ1kwLk28UQPKQ77wHRkTdcj+hkBsVpuZ5WL9US7Qz5NgWYxJDz6CHMTIiQfyGfvfBY6kY5ixFGSzegNz5o9L4uhzmj9g2DfJjViJkuezOa/x0oZQcsB7Pc5XaY= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587976370; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=yy3xXl85nwGEzmT9kVH+IntKelWJt78/C09WVYkUlHA=; b=ZbKv2v0xhcdQDRL61BvGZ3gJIiOmCXqKb6kB7Jc6yhlKBR23fdVdUZHuzFjlA00f1CXtAIwfI+2FN7hwhr4e2WvWzRaQRecV6ui+ZavOKKCAdQ6pdwL2zrvt1BJ3xxO+5AVQtohT/cuP92b51kkWxQ67pKBcIIRYpRPVKifMWG0= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1587976370152519.6815052649486; Mon, 27 Apr 2020 01:32:50 -0700 (PDT) Received: from localhost ([::1]:59026 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSzC4-0003l9-H3 for importer@patchew.org; Mon, 27 Apr 2020 04:32:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48840) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSz3a-0002Ml-Ic for qemu-devel@nongnu.org; Mon, 27 Apr 2020 04:24:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jSz3Z-0007ap-2J for qemu-devel@nongnu.org; Mon, 27 Apr 2020 04:24:02 -0400 Received: from mail-eopbgr70114.outbound.protection.outlook.com ([40.107.7.114]:29366 helo=EUR04-HE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jSz3X-0007Ta-Aq; Mon, 27 Apr 2020 04:23:59 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM7PR08MB5463.eurprd08.prod.outlook.com (2603:10a6:20b:106::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.22; Mon, 27 Apr 2020 08:23:57 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::acfa:5:88c8:b7b9]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::acfa:5:88c8:b7b9%3]) with mapi id 15.20.2937.020; Mon, 27 Apr 2020 08:23:57 +0000 Received: from localhost.localdomain (185.215.60.182) by FR2P281CA0004.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Mon, 27 Apr 2020 08:23:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eOSFqYuKdThJwPW5ZeY6q40sdhu9P3R/KC89BsjbHkZ/gZiggT5yLrrdI1VByBa49Gx/2gOH3SCyIrzJyFZclD4UozHIsEsv5ZkcNcemKVzIJqGtaSdKrDtFE47U92jJStwi+efQ4zBvRtQW27pWwwR62t5ePZLr4IHXLuzRmC+MFAlYa0ghch1K4j6b5jl7dguQLZqEwTiZ+3Tz6SpRXSK50AJy2GIwhM0OlZm5DlkRQH5PgRZOG0MqVqx3qruES/HbFhDLiChEYnsVUDHpU4ygw2710vbUyTesU4vSsOUT+ORydZb2GAn9PJrtd/3ATk9HTvu6Mwu6KHeeH0Jw3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yy3xXl85nwGEzmT9kVH+IntKelWJt78/C09WVYkUlHA=; b=ejWaTpb+JWbiFpCZkqzUo2UKyWm65kY1/4hLeq3VoRd+iYpXJXVO7UMA1XOeAq7E18/zo62u6ijmej6OpHKi2qXC4xbcmTDWa9WB5ykEihdytnqA8R7IWEx8pWK678YYvCktHC0hIw491EUH+dLDWqTbVSgofsnH7lYGzDWQIzs+dZZmRltH/IfQscosr08WC3Ya/9uOZdthVqmtfDPmAcngKMI1k1WbkvGf8AiJFreCC3i4Vx1mg26JKDVO9hq6WX3b0/l0AtcI3m5/falEkJuUs5/DvtnJDCsFaqhOWT6m2s6ZQ4G+wxyPMxyKp2oByds3wiy+cVtBpCuAQX2dew== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yy3xXl85nwGEzmT9kVH+IntKelWJt78/C09WVYkUlHA=; b=OrFG1Z02xrQMl6a3Pbfky2WWSJ9+EsygzOU3NmvDkwVkh4qQyXkDDiq+3PUVTJh5/YXg6/yf5DCQdddECScetn+hldg+SfBgrZiXAYgUGSioWhtDrXPFzZGmBea0C8WR+vgXcKR/lxB/mRHhkjRO9rIx1FnE1U6OmhGQ1b9Ux+I= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=vsementsov@virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Subject: [PATCH v2 04/17] block/io: use int64_t bytes in driver wrappers Date: Mon, 27 Apr 2020 11:23:12 +0300 Message-Id: <20200427082325.10414-5-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200427082325.10414-1-vsementsov@virtuozzo.com> References: <20200427082325.10414-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: FR2P281CA0004.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::14) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Mailer: git-send-email 2.21.0 X-Originating-IP: [185.215.60.182] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c3599ac7-f9e4-44a9-a52a-08d7ea84548d X-MS-TrafficTypeDiagnostic: AM7PR08MB5463: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:923; X-Forefront-PRVS: 0386B406AA X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(366004)(136003)(396003)(376002)(346002)(39840400004)(2906002)(81156014)(6486002)(26005)(8676002)(8936002)(4326008)(6916009)(478600001)(66556008)(7416002)(66946007)(66476007)(6666004)(16526019)(316002)(2616005)(1076003)(186003)(5660300002)(52116002)(6506007)(956004)(36756003)(107886003)(6512007)(69590400007)(86362001); DIR:OUT; SFP:1102; Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3suxYrpxirDY9boeVuHXGv8LtfEsENxsE62J7uQNEM1kOEhDIwwiZbcBikUH+xX3sIxiZqouCNPQ3UbDegQfjABTbZwzGw95IH5AYZobLsaiW/A9qSWBTuXQjdvIt4aCaglHpDvbgCYKZbapi+y2x5ngCg8WdH3wG3fagW7bmSdE8aAhuuAJXiVG4REYRZMV69Ll8ZRM7zMy8imARogEA3Ev3aD6tIH1jA8+tE3KCtjwrasJBIwHmxnbwkXPZDh6+ZEuRAjLT+ImWi+Jm50Is7jSgApp/FOHXotJhneibUM87Pw1A2KquE/ibDdrpxAD1nzXW1OjzX7rmk5xPi6WKytLn00EQM6m6PjQlCVNq6POfwZOFBz8TcLBIaAjwubjXVHLNBN8Is2gGUjpG5xvGUJSOnrFpX7/FPdVEjlAoknKsTKVm3DYHlRAJyMcODSppHdgalhvlG1piRystglVim8wjJMH50l+ojZYRc2c2cyM9Lbnb3t740A3h0DEIPUG X-MS-Exchange-AntiSpam-MessageData: oeOi2QN7DdxV09FOTbqKuBdR161HC7rm5NYJEOmNmdrRtHO2pfY2SR+o3aoqxIVnxGxmg501OooSj740Bb+8veSP/1TTTa25MffXyHWcbNYT3Jr43McDWXs1b4Be/wo8Vxegj1Pm3BziCKTquHIMs0YOC/S8zACHPCC9eF/jKj5EwgJnjjd6hzFz4LUVnCD/i/Fjize9h2AU8tNL32G2eeTDcRqX4iXWIe/d9UtRvHff3P5GbkLxUIeHAV+hWrJ+RKBdYSYcxRjHxKLEXqgYqqqS9uxnKvtYKl5prp5icfNpaN0m2bxws7I2XL8A7zbPlV8EiLZ9oX+bkjhv16HGkxEPeSBD+EAVgVQxuw32vxZAXzakMBORpcjfHIchfuyk8jlIpmJpwCuhkqLDocTPz26Eon3WU4kafAhItuUUdA9TuuuK2aeiF6SzGrJUNA/6j7J3FRhsRAs4Ki9XnDdkPgs95tV7Rqz5Cwr0YFlSkHMOYRV2b4ktXcx9gkVFTHuBXYWAGnUvZKdI0KYLkzvtXLXiVtyH2fishfPSqVyI6RapH5lQC/+l0oxp/LsiIEORzHbvKCKU9nbRE26FgJq0cmm5MofiQG6O7rrubEnBmggt1+CfTLqDkfQ6UkuCWmX4LH7oR4xyXpEAKbRh++QTDSBEOzMB1PIczzRF15HMpWJBr2rHWxonCzInzG21K/UBiQVOf+DiKyc8V+TzUxNPjT4n3nKSYPPZpHoGcVgwNmsyVq6ou/7ERdd9R7CO1yW6lj+eDqI54FnbefE8Xx5JJFVKALhGXyGs+zuMYu4Dar8= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: c3599ac7-f9e4-44a9-a52a-08d7ea84548d X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Apr 2020 08:23:57.3208 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: LxDplzNqwvjjvHXouxIFwf7KAN9+rBhMOr/SZGRY1gP4EdCdTpo3QXGfpKfNv7D5M7pGija/GKahOOyvOPk91NVt97U74h8ircM4SzLqcAI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5463 Received-SPF: pass client-ip=40.107.7.114; envelope-from=vsementsov@virtuozzo.com; helo=EUR04-HE1-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/27 04:23:52 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Received-From: 40.107.7.114 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, fam@euphon.net, integration@gluster.org, berto@igalia.com, pavel.dovgaluk@ispras.ru, dillaman@redhat.com, qemu-devel@nongnu.org, pl@kamp.de, ronniesahlberg@gmail.com, mreitz@redhat.com, den@openvz.org, sheepdog@lists.wpkg.org, vsementsov@virtuozzo.com, stefanha@redhat.com, namei.unix@gmail.com, pbonzini@redhat.com, sw@weilnetz.de, jsnow@redhat.com, ari@tuxera.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) Content-Type: text/plain; charset="utf-8" We are generally moving to int64_t for both offset and bytes parameters on all io paths. Convert driver wrappers parameters which are already 64bit to signed type. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake --- block/io.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/block/io.c b/block/io.c index 1267918def..4796476835 100644 --- a/block/io.c +++ b/block/io.c @@ -1086,7 +1086,7 @@ static void bdrv_co_io_em_complete(void *opaque, int = ret) } =20 static int coroutine_fn bdrv_driver_preadv(BlockDriverState *bs, - uint64_t offset, uint64_t bytes, + int64_t offset, int64_t bytes, QEMUIOVector *qiov, size_t qiov_offset, int flags) { @@ -1155,7 +1155,7 @@ out: } =20 static int coroutine_fn bdrv_driver_pwritev(BlockDriverState *bs, - uint64_t offset, uint64_t byte= s, + int64_t offset, int64_t bytes, QEMUIOVector *qiov, size_t qiov_offset, int flags) { @@ -1235,8 +1235,8 @@ emulate_flags: } =20 static int coroutine_fn -bdrv_driver_pwritev_compressed(BlockDriverState *bs, uint64_t offset, - uint64_t bytes, QEMUIOVector *qiov, +bdrv_driver_pwritev_compressed(BlockDriverState *bs, int64_t offset, + int64_t bytes, QEMUIOVector *qiov, size_t qiov_offset) { BlockDriver *drv =3D bs->drv; --=20 2.21.0 From nobody Thu May 2 14:29:44 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=none dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1587976080; cv=pass; d=zohomail.com; s=zohoarc; b=CE0eH1aOC5b5kBYzjGX67uDNYZmwMJtJgCx0+PoDYjJfQ2DwS19ghIWWRbxq280KXOkmt8gYnwzUYTmBQBxwVcCZZgkTV1M/t6Gnf1swQU/NhovJms/bCOiDAbrDMRBJrdRgGYBZE7CsC8O8HJoZEJILmRH1eQhkc547/sUOSF4= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587976080; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=AHVe5q0aGJGJfuUaocbrIbtM4T0kS9ZgXQhC/F+MQMI=; b=UdDjLuYNXZwbhum8XzG7tCJZrm2N8RrptIVLpKCb5WKO5MhoI/3JAqeWxSreVZIQ8CaqScR9jVg0b3vuniady2ezKm6op9hke06XI0lLtFyqNqCcbNl9E+zVJJj/nj/EKSi5GhdNVCUccFtWuKeV3Y6iCCnv1oB/NtrdxIKb/uQ= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1587976080127233.90458490173228; Mon, 27 Apr 2020 01:28:00 -0700 (PDT) Received: from localhost ([::1]:58480 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSz7O-000204-Ld for importer@patchew.org; Mon, 27 Apr 2020 04:27:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48834) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSz3a-0002Lk-9h for qemu-devel@nongnu.org; Mon, 27 Apr 2020 04:24:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jSz3Z-0007c8-Sd for qemu-devel@nongnu.org; Mon, 27 Apr 2020 04:24:02 -0400 Received: from mail-eopbgr70114.outbound.protection.outlook.com ([40.107.7.114]:29366 helo=EUR04-HE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jSz3Y-0007Ta-AL; Mon, 27 Apr 2020 04:24:00 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM7PR08MB5463.eurprd08.prod.outlook.com (2603:10a6:20b:106::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.22; Mon, 27 Apr 2020 08:23:58 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::acfa:5:88c8:b7b9]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::acfa:5:88c8:b7b9%3]) with mapi id 15.20.2937.020; Mon, 27 Apr 2020 08:23:58 +0000 Received: from localhost.localdomain (185.215.60.182) by FR2P281CA0004.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Mon, 27 Apr 2020 08:23:57 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NulXxudmuznZ1PXaOA2nqVV8IEEDLO8qbK5fwXKsxv8x/QdiaUe+7+uQrFfYkAjwKbgdpg/JwYUofj5+oeTFIX+ouTNBLpWLpYxg57vK7UJZGeeS+PupmTYwyGPsKB3P3QvcKReaBeniG/BUUlglfdvKZo7TuKMo5mIFUvhqn+/Hlmw3dMoQx2lb8vcGxhYM83jlj6Op4mBCjvcANYREPDBvlk9QsDJec/T2Ze8KSwGHlk5VvW+IOZ/eKEY4zIXaZZfbtSChPp/mQMLgg90oYEtg//K7yb3mw7m/gfQK4l2VFnxb98e47l9TFUqkAnoZ/UiRkp6q9sEvNK5T9YLbdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AHVe5q0aGJGJfuUaocbrIbtM4T0kS9ZgXQhC/F+MQMI=; b=fxZV1bD1OLpusck5DC+CpI+uiNM9/pN7cS7uwZlKy1Alo3LVoA7pDHG81SkCKel1cvNXFX3N6QBEWsoBUEuys5wyM5dE5Hs8piiudJkGkao9VzbbEHKTfcpPNdRMZysbHBF7d98atD0FkoW6dkcjvdYEDYB12PfzMWZ8vQrw/e3DZjfIHvPd0Vnl1Laz2oeGCirtDymb+BHvDBwvCrJrPUZb9lPzx79nDlTVdFYs6rB9nuPtrYS4sGDnSHKNaz98EFyRdd5FoQlN3TTvsVmK21GPsSKXM7IUb8ndB5lSXafoV2lGrWrrAX3GvCWFqr16ANXWJ039q3JZI+IHJ3+uow== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AHVe5q0aGJGJfuUaocbrIbtM4T0kS9ZgXQhC/F+MQMI=; b=qf/dXi42x4dHUwAMA8Ex+obSk7c8SNPZ/im6gGz9UEimRDfCJ7uNR45AwGjX4c4U6+gXkI7svJySQ6+YAWekwDmWN8m7r/MFXXaChau/SX2EUg6L1QbAGc25v5YBJ/UWHfbpQwWFY2kZHjqUuBcWvLzaXlRMeDshJIyLJ7jw+p4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=vsementsov@virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Subject: [PATCH v2 05/17] block/io: support int64_t bytes in bdrv_co_do_pwrite_zeroes() Date: Mon, 27 Apr 2020 11:23:13 +0300 Message-Id: <20200427082325.10414-6-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200427082325.10414-1-vsementsov@virtuozzo.com> References: <20200427082325.10414-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: FR2P281CA0004.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::14) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Mailer: git-send-email 2.21.0 X-Originating-IP: [185.215.60.182] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 79763d41-7f40-4e60-1ae6-08d7ea845568 X-MS-TrafficTypeDiagnostic: AM7PR08MB5463: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3826; X-Forefront-PRVS: 0386B406AA X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(366004)(136003)(396003)(376002)(346002)(39840400004)(2906002)(81156014)(6486002)(26005)(8676002)(8936002)(4326008)(6916009)(478600001)(66556008)(7416002)(66946007)(66476007)(6666004)(16526019)(316002)(2616005)(1076003)(186003)(5660300002)(52116002)(6506007)(956004)(36756003)(107886003)(6512007)(69590400007)(86362001); DIR:OUT; SFP:1102; Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wWPN3bEWDGohtZn7lGwOJ7q8I886SkFe0t+yIWNQSKO7roVaqhKeP33DVTSd4mnOysvEIZV5fOXy6sFECwB+ZZurkxzo8dEUjMeFILyatz3DSHAWzqNoq5FzFa26blUScy4XmI7SOvFs/a6bz91ulZSZyO2D0NEar0BRKeNG0jOQ9XIMR+QnIpMvQkYCkhBa52CAyDJRRQ0HIwttmSwiyxOXFjiq9DlfM0Eu24/9ffXzUrsGA8e0wrKOmjPMJxj5U+9R8aTcYXpnOlhDagq9RsBszAqL+LUi22csJVi+Xj26gOTgtidEWN2JvWJB9Xiobc07uavdeae9jcmvAlXZwXpETAWQQx40JSX8EIPnv1k0tSvdo8fxswCpgmd8S4TKCb7rFuw8uVrGytfLFYCGyfu453me3/oNo5E605yQImETA7oGw7po88PsRNSbs9UrsxbUnvuVXGT7kygq2NBYJZ1LopQH0scXEEz1YWVg1s4ELpAd+IvJ2lm2eJnxgGUo X-MS-Exchange-AntiSpam-MessageData: WpiRm/8UoEzJhweIXb2EczVw94CdtrGVeVyg1UEjTkKM9kUHbfIS7cWLKWkChuCbrbCdMA9irQLbjSO3XunqvVftUQtY+6tGV6bAxo5ia1QGXl4CZjolgSQ6EZda/FgEyGjP7SVif+M+mAyLPFIWk2UMV5fOaqlYlKWVNTiFRv3Xo4IGyFn9vdN7eufZuuuy4fYL0iAUT9c925lpOsndKDFGjexnoUIEng5aED4K8+aqUZ8cKmRynkn6MypUvK/R0RyX6BKIHzXvjpbQc4e9HWEuvSnm0QPQppRWoLlTuqe/R5IUYz3yue8u4akFlWw4REz4T9KTxDnMeeRc5ZmMAkbL9c/I6+5vt2P3KMqmQLzGKmJ3vPNKuyAzmUGxHtbn9lDqds5ScDiDvAEEOB0ReoGiutx7MDWeujFOaobJuVBUgIQ/RzOcw7X3Bb4DGhIeOfQvOU8TROnNuZ6ohv+ZkWPRy6sCjv8TgWa5KBZ3mJYkmN9bP2AkBCY4QFC+NF1bQ9uic/YTuoKNT0CgkI4/vBZQkdJqc2vl3GEbTmB/G86idZ0ZLdwU/SBKhAhbkBe6ZY/PrgSaFukdjadt+loBXU9cSE7ApOucMM0ChD09coAQIWXe3Iu0DHrfXHuZz5oO1ZF3cgGlqbEpmdR2OcyeK6bjSMdMj4XGEnuEcwrMVNmI+XIpvbnRYdusn9PUVEiSg2c0LXHTiMvNst2RiokEF2y80GpSdhdPftXgqAOuuz8wT45HMQn0bdxaENQgwcQxlaSImrw/mF1PDotz1WKMCwXu+hTbNfRuUYtpw8T1CeU= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 79763d41-7f40-4e60-1ae6-08d7ea845568 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Apr 2020 08:23:58.7465 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: /+ab1dOd2VqxgOxM8xDMwlQModz7TxYunA4oQ+XShhvPyE2yBaCQ/qtitSxnz6VE5rc1jcNeRG9q7btS3l9fEy02pP2gJyDQivjGaYZxtIk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5463 Received-SPF: pass client-ip=40.107.7.114; envelope-from=vsementsov@virtuozzo.com; helo=EUR04-HE1-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/27 04:23:52 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Received-From: 40.107.7.114 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, fam@euphon.net, integration@gluster.org, berto@igalia.com, pavel.dovgaluk@ispras.ru, dillaman@redhat.com, qemu-devel@nongnu.org, pl@kamp.de, ronniesahlberg@gmail.com, mreitz@redhat.com, den@openvz.org, sheepdog@lists.wpkg.org, vsementsov@virtuozzo.com, stefanha@redhat.com, namei.unix@gmail.com, pbonzini@redhat.com, sw@weilnetz.de, jsnow@redhat.com, ari@tuxera.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) Content-Type: text/plain; charset="utf-8" We are generally moving to int64_t for both offset and bytes parameters on all io paths. Prepare bdrv_co_do_pwrite_zeroes() now. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake --- block/io.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/block/io.c b/block/io.c index 4796476835..c8c30e3699 100644 --- a/block/io.c +++ b/block/io.c @@ -42,7 +42,7 @@ =20 static void bdrv_parent_cb_resize(BlockDriverState *bs); static int coroutine_fn bdrv_co_do_pwrite_zeroes(BlockDriverState *bs, - int64_t offset, int bytes, BdrvRequestFlags flags); + int64_t offset, int64_t bytes, BdrvRequestFlags flags); =20 static void bdrv_parent_drained_begin(BlockDriverState *bs, BdrvChild *ign= ore, bool ignore_bds_parents) @@ -1743,7 +1743,7 @@ int coroutine_fn bdrv_co_preadv_part(BdrvChild *child, } =20 static int coroutine_fn bdrv_co_do_pwrite_zeroes(BlockDriverState *bs, - int64_t offset, int bytes, BdrvRequestFlags flags) + int64_t offset, int64_t bytes, BdrvRequestFlags flags) { BlockDriver *drv =3D bs->drv; QEMUIOVector qiov; @@ -1773,7 +1773,7 @@ static int coroutine_fn bdrv_co_do_pwrite_zeroes(Bloc= kDriverState *bs, assert(max_write_zeroes >=3D bs->bl.request_alignment); =20 while (bytes > 0 && !ret) { - int num =3D bytes; + int64_t num =3D bytes; =20 /* Align request. Block drivers can expect the "bulk" of the requ= est * to be aligned, and that unaligned requests do not cross cluster --=20 2.21.0 From nobody Thu May 2 14:29:44 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=none dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1587976014; cv=pass; d=zohomail.com; s=zohoarc; b=FMzytTP55Z2tqN3qYtsgMp6p2Xw29ECwNiE8ym9U84g6fs1Rh3znvp+2hSN6r1vRqOi1BOiPNxFB25tnC4LNTEqfLkf/0bUrwMHLtGqER4WKiPLNwmDxdH634qCb1c+kPdVMn8aYimUU39/2NLZaWrYDNqPJWEntZ5AGR4K9Zds= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587976014; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=RMEqiVwxRfBqFh+w1IAw8dH8l7dISyve6Of3WjcX83g=; b=B9AHsMGbguMQhVrE4W03W0txOQqgpqMU52b+InvMWQVsJBj+BnEsNm2G80wFU2k45ZDXxVMRYTjKgGCZ5Xk0zUvZn1oQ0RHKedUK1QGmakiTpb/E/iCcIFP4/yxrO6PAGDYHhwrGjxJHzX0d+UK8fvl780K1F9dHEQUvKIIVi/I= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1587976014496133.98647734718372; Mon, 27 Apr 2020 01:26:54 -0700 (PDT) Received: from localhost ([::1]:58380 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSz6L-00088X-5g for importer@patchew.org; Mon, 27 Apr 2020 04:26:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48882) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSz3d-0002Uj-6u for qemu-devel@nongnu.org; Mon, 27 Apr 2020 04:24:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jSz3c-0007iS-N2 for qemu-devel@nongnu.org; Mon, 27 Apr 2020 04:24:04 -0400 Received: from mail-eopbgr70127.outbound.protection.outlook.com ([40.107.7.127]:7750 helo=EUR04-HE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jSz3a-0007bA-VE; Mon, 27 Apr 2020 04:24:03 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM7PR08MB5463.eurprd08.prod.outlook.com (2603:10a6:20b:106::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.22; Mon, 27 Apr 2020 08:24:00 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::acfa:5:88c8:b7b9]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::acfa:5:88c8:b7b9%3]) with mapi id 15.20.2937.020; Mon, 27 Apr 2020 08:24:00 +0000 Received: from localhost.localdomain (185.215.60.182) by FR2P281CA0004.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Mon, 27 Apr 2020 08:23:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WsHfCyVAprPJRfu3J/GhA6V1HYVeq7c9K4wRVA4uaMVpzK0M8L2aQkqTJis57XqhDaSmvIBlUxC2eK4FOcdZdekf837gBRF+9+EJt+L7rZy+oPOUy0uMXuCs2bLWDGCPZLp2Nvdb60Dhx9hiQUIX3k+WmvTsYHqGk+Wo7wU5EeAZIT8h2EHDvXka1qq8UgTjmLZknHlz+t7fvFeWcOAlr3P2V6qKJjsh6Tg7Mz54IhKtQtV7lHcRE+LUSA2rJWru+LtDxMkpW6Oqj0w3MeelbA58VuMOeMYF3vKRTZLJ0v0C4dQExWMB/LOR3DWvIfXn8WTskLAGxNmg3VYNQJRnYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RMEqiVwxRfBqFh+w1IAw8dH8l7dISyve6Of3WjcX83g=; b=jyGofwNN6ok/luaZolDqWjAQW4xR0rrR3jwMunu1F3mx5kY1YPHCoGET04fDSlQZdgfc/vIuoY8WKn+ubkfZj10gC9glxVBSfyfc2S8sabCvpt+1eH2R3k7fjozs0mCbo/8jf2adkH1/XUSnBkFuUf4tfdGGL/YZ4NfddvGl4HZgK+9gGCwZH07xPKSjgBQgtUx2WAseHOLSX8S+b2FLOEGNAibw9Xen8DuXjGoEB+uT6294vR5o+gPaK3NoPSSx6/3HwHwIxgNaB1haExh88Q9YJk7ygTr72o+TDp2bgOhEbA43UiJjwLiuwXqI9mLkajXJDjDyuJUlI9xvrcF3mg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RMEqiVwxRfBqFh+w1IAw8dH8l7dISyve6Of3WjcX83g=; b=uD2RCjD+U7uUVGzbNPJVspg5iyGGVubUuBrxgecIV/kAdubnaEKyJttc2vcXmEyUAE2pi+Sjk1wHQUpSlAjFgn4UPLBrQuJwImpV1CdyXKEdSVuwiVKrxiOaFHRpB4rvi/QMlJ/qtnDltWVuWQ9HU/ocxM6CSfFijHGgZloyuoo= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=vsementsov@virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Subject: [PATCH v2 06/17] block/io: support int64_t bytes in bdrv_aligned_pwritev() Date: Mon, 27 Apr 2020 11:23:14 +0300 Message-Id: <20200427082325.10414-7-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200427082325.10414-1-vsementsov@virtuozzo.com> References: <20200427082325.10414-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: FR2P281CA0004.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::14) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Mailer: git-send-email 2.21.0 X-Originating-IP: [185.215.60.182] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 83c51d1d-88dc-46cf-4274-08d7ea845636 X-MS-TrafficTypeDiagnostic: AM7PR08MB5463: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:608; X-Forefront-PRVS: 0386B406AA X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(366004)(136003)(396003)(376002)(346002)(39840400004)(2906002)(81156014)(6486002)(26005)(8676002)(8936002)(4326008)(6916009)(478600001)(66556008)(7416002)(66946007)(66476007)(6666004)(16526019)(316002)(2616005)(1076003)(186003)(5660300002)(52116002)(6506007)(956004)(36756003)(107886003)(6512007)(69590400007)(86362001); DIR:OUT; SFP:1102; Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NMiB+fcGoSZPgybHXnqgchzHtVGJ80xK/Q4JWo2n1wa1EanqT166UqOFrplQfgBztTQ6xiR7vGMQoqGX4DJ7pkfza/XSjO1wL60xe1AA3H6lCbTut3Cf9xV7LKLCKSi4DLfBbtzRoXC81aDrZ7tU/VopItnatNXLz0eFCpvz25t2sk8I6PyhQzW/iZuzxXtk7Qb2vtcV89SBL9Fzs1rGVdybVHxpIcBaQlQjGiop2TKYmLOlupkrKdDjkycI6ZasmuZ0xYlTl40pk8ECMMxJgaMyj8CdPlfbbKTJQ7NJ1xrgJxPFScGlkNqsQwuJ6GP8ylzsug98KJNWMIFDSd5CoZylk3c5NNW3/ewbW3Lp6qBNhuyu/zQ7xhPznBstT5QphzClPpadabPHnFk0NGeIxOdUtEFSC7hu71qNzQpOICmR6xfQZ3uemXhSOJtPOzRTN0tu9zk+PWqbFp8CWJxsDMuW9c672FYFoN27kEyh/dTfNfzHClTfqbhnQxiBK0bc X-MS-Exchange-AntiSpam-MessageData: gmaXe2dr2p6QHxcI7sT16wBJhEBtcmoI4qYWT+2zKTyiW7ndWYdCgjjvBV/vsdqEDxHgP1BybLE/214s+pkQQZfdSYkS+lwJ0tyB6LCKIKXuZy2jB3YZ+budmwUuhP7Bnu5PWte9D3DzRDtrhWryKE3T23A6boXE55uG6iXef4BfWsL5UOeqhQLraQoC9cqnaBtIf2/ZSRCLpX1kFJ8Rxj7c4JoSdyPZkd/Iq+XgRl3/UUtElfjn6Imfnt9QGKj8VoMVD6uGgRavCthw6QpE07TqC6q6NtgqK/0AHihuUUCu/rRqOR6g4zhSLBx4qWMzfpGi+CtkAKZcO9aE4nbHPpzMtL4irEPAx/zvZbu333W9cpcOqdW3xyayLSOtGiPmyLhDWiqhuo8vKP3CvVo0YZXq5UbQBQOOyGqjL7UogTK23hOcJKcBguNw++PAiCwRyWdX3lRjwJPupwK2G/LaeGZhCv9hStmzQItBCexz5CcLOtOhUIxffY3UYnHUZQjZvM9m+V2pnBq9GeE+a5sZEaD0uqccpIBt/Uf4ntUyH1/mQn83HTqxh3i074L8VdB1crYmC5JSZhY0+Lj42fwfln3E3mHCskS0HT4b5QnWf6kS2qpcBqoJ3lIbzJV9GvdDSkGu4iffyYqECiXANq9WEBR4CHYHEU9YWX18vcMd16PDr3YIh2If0KY5RfksXoTR/Ktlai+7cVbAfXHSVnPpcSjVpfASacsqhnWVTeOADnAWfURCJXMLjwbJT7LeCCLmnIBzhRonvdt+iEwrL8tyB7hvdF8brn2jmqgSMQYuRX8= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 83c51d1d-88dc-46cf-4274-08d7ea845636 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Apr 2020 08:24:00.1075 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: dsHRB2IM0oLofYL7OWuTjp0Nd9/7MdnwlXLx5ZO821rufk9g6oJZdqhXBW+ueX6MPCSSS17HsDFSxxwXxNfFbncFXDIDpjDZF52gyYmP3fY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5463 Received-SPF: pass client-ip=40.107.7.127; envelope-from=vsementsov@virtuozzo.com; helo=EUR04-HE1-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/27 04:24:00 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Received-From: 40.107.7.127 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, fam@euphon.net, integration@gluster.org, berto@igalia.com, pavel.dovgaluk@ispras.ru, dillaman@redhat.com, qemu-devel@nongnu.org, pl@kamp.de, ronniesahlberg@gmail.com, mreitz@redhat.com, den@openvz.org, sheepdog@lists.wpkg.org, vsementsov@virtuozzo.com, stefanha@redhat.com, namei.unix@gmail.com, pbonzini@redhat.com, sw@weilnetz.de, jsnow@redhat.com, ari@tuxera.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) Content-Type: text/plain; charset="utf-8" We are generally moving to int64_t for both offset and bytes parameters on all io paths. Prepare bdrv_aligned_pwritev() now (and convert the dependencies: bdrv_co_write_req_prepare() and bdrv_co_write_req_finish() to signed type bytes) Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/io.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/block/io.c b/block/io.c index c8c30e3699..fe19e09034 100644 --- a/block/io.c +++ b/block/io.c @@ -1854,7 +1854,7 @@ fail: } =20 static inline int coroutine_fn -bdrv_co_write_req_prepare(BdrvChild *child, int64_t offset, uint64_t bytes, +bdrv_co_write_req_prepare(BdrvChild *child, int64_t offset, int64_t bytes, BdrvTrackedRequest *req, int flags) { BlockDriverState *bs =3D child->bs; @@ -1906,7 +1906,7 @@ bdrv_co_write_req_prepare(BdrvChild *child, int64_t o= ffset, uint64_t bytes, } =20 static inline void coroutine_fn -bdrv_co_write_req_finish(BdrvChild *child, int64_t offset, uint64_t bytes, +bdrv_co_write_req_finish(BdrvChild *child, int64_t offset, int64_t bytes, BdrvTrackedRequest *req, int ret) { int64_t end_sector =3D DIV_ROUND_UP(offset + bytes, BDRV_SECTOR_SIZE); @@ -1948,14 +1948,14 @@ bdrv_co_write_req_finish(BdrvChild *child, int64_t = offset, uint64_t bytes, * after possibly fragmenting it. */ static int coroutine_fn bdrv_aligned_pwritev(BdrvChild *child, - BdrvTrackedRequest *req, int64_t offset, unsigned int bytes, + BdrvTrackedRequest *req, int64_t offset, int64_t bytes, int64_t align, QEMUIOVector *qiov, size_t qiov_offset, int flags) { BlockDriverState *bs =3D child->bs; BlockDriver *drv =3D bs->drv; int ret; =20 - uint64_t bytes_remaining =3D bytes; + int64_t bytes_remaining =3D bytes; int max_transfer; =20 if (!drv) { @@ -1967,6 +1967,8 @@ static int coroutine_fn bdrv_aligned_pwritev(BdrvChil= d *child, } =20 assert(is_power_of_2(align)); + assert(offset >=3D 0); + assert(bytes >=3D 0); assert((offset & (align - 1)) =3D=3D 0); assert((bytes & (align - 1)) =3D=3D 0); assert(!qiov || qiov_offset + bytes <=3D qiov->size); @@ -2067,7 +2069,7 @@ static int coroutine_fn bdrv_co_do_zero_pwritev(BdrvC= hild *child, assert(!bytes || (offset & (align - 1)) =3D=3D 0); if (bytes >=3D align) { /* Write the aligned part in the middle. */ - uint64_t aligned_bytes =3D bytes & ~(align - 1); + int64_t aligned_bytes =3D bytes & ~(align - 1); ret =3D bdrv_aligned_pwritev(child, req, offset, aligned_bytes, al= ign, NULL, 0, flags); if (ret < 0) { --=20 2.21.0 From nobody Thu May 2 14:29:44 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=none dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1587976178; cv=pass; d=zohomail.com; s=zohoarc; b=TWR/nbKU2GnVHAzq4xs5rOsmNmiq+x+pf5Udc6VLB2w1+l5tuwcftNUs0XO2CUV02SRvEIXEB3nKEcW6/Su9JsDPDOmw1PZ518EcIkmoF6Sr99LSVVGGDZcoL286lzibG/+9n3jbxFmEmyVVDtO+r3LR7K/x4sGucm5LXCULZRY= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587976178; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=uHbf3Z3Zw+ddeV34dU1QJI9Zl/VP12Scp41HLEfvowg=; b=CWTETTuREjSgtKUyq7dqjl2eUI8/jAjxcgixC9qvoZKkoX96XMXE0MtH0ajniOxxtyjRFr63ybdYAEUsIa7vwC0Gd0LfFXBVe9mKg2NWZdeVHTUWRJmdmloylhgFiW0IrbgLY0jYHdFdbahnUzgqexHFlV65leSi9AWU9xWvX0o= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1587976178879766.9288327581395; Mon, 27 Apr 2020 01:29:38 -0700 (PDT) Received: from localhost ([::1]:58656 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSz8z-0005LX-5b for importer@patchew.org; Mon, 27 Apr 2020 04:29:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48896) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSz3e-0002ZC-EL for qemu-devel@nongnu.org; Mon, 27 Apr 2020 04:24:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jSz3d-0007kT-O1 for qemu-devel@nongnu.org; Mon, 27 Apr 2020 04:24:06 -0400 Received: from mail-eopbgr70127.outbound.protection.outlook.com ([40.107.7.127]:7750 helo=EUR04-HE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jSz3c-0007bA-0s; Mon, 27 Apr 2020 04:24:04 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM7PR08MB5463.eurprd08.prod.outlook.com (2603:10a6:20b:106::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.22; Mon, 27 Apr 2020 08:24:01 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::acfa:5:88c8:b7b9]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::acfa:5:88c8:b7b9%3]) with mapi id 15.20.2937.020; Mon, 27 Apr 2020 08:24:01 +0000 Received: from localhost.localdomain (185.215.60.182) by FR2P281CA0004.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Mon, 27 Apr 2020 08:24:00 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JdIe/23Wow+W+ScKAQZgDYWPO/wkFkcvZasRQ7tvv/h7cW/DthwXXVmKUTiFSazEX8RM6VlU5SrmrgrrhQzG/gOR0qwH3v18Cja8NS/OqJE+BDchXvMoNYLU5z00J2xVC8BeLAhueoL9sY4WEi3VIaZRybCH9kzUL7ir9WN/u3w4vF2FMhJquBwW69RViKWjwqtuvBqehnXfaCP9NQvH//W24aELrZiA7p8CLtl9IFDqie/zp885OI8cR2IaRCKS4hnDawf9hYAnYSYOfE5Y3k+DKwP7Juolr85mtNmbdenCbx6cn74z3h3P7WQ5WcM4RTJUeRW8yemRH69DR9UERg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uHbf3Z3Zw+ddeV34dU1QJI9Zl/VP12Scp41HLEfvowg=; b=K9BzOm56ASo8fF9tb5BMl3cdL68K9Lb03b/uKHCY18L3+6JjSFGqq95TXVJgMHwwV9GdLTZ5d6t8XTE6Nt1kOpj+3WcXHKaA2BOIfbAS/cYNFRz/2yYsUAmlia1cLckMYcuYLhY7JXqzEvbJvDmCOOeUVmHWqBpSymkAJEo+pC4Gd49dUgBL2xIyC42kwM+dTqvitDkmaaXIalavViUiS45jNxv0Ez/UfsptOxuRvnmpch0btjEKkoaICHwCjQ8EIlg2n0CajzZdgxBE5PSZucrwEOueVZMxciprH7RyVRlJqQo2p3DWwROhQwUy1ijTaZiMAfD2STWVFMpsVr57cg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uHbf3Z3Zw+ddeV34dU1QJI9Zl/VP12Scp41HLEfvowg=; b=ZSCClrZwQJccq2ypUc1DiEfDP8MGxjdwA9XnIn20GZM15GQUaGNN01/a788LfI/UMpGWg9OTUt8MiwM5qvSE8WPDJKsU1FQA8AcviVoBRaD5Ne1DIJIT6Ziwdxngx6ZwKbYyG1oZyxnGqfBg3DKFkJVPHnfCSl4NLL1ucx3GNnU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=vsementsov@virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Subject: [PATCH v2 07/17] block/io: support int64_t bytes in bdrv_co_do_copy_on_readv() Date: Mon, 27 Apr 2020 11:23:15 +0300 Message-Id: <20200427082325.10414-8-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200427082325.10414-1-vsementsov@virtuozzo.com> References: <20200427082325.10414-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: FR2P281CA0004.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::14) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Mailer: git-send-email 2.21.0 X-Originating-IP: [185.215.60.182] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b30d11eb-70d6-4fd5-f566-08d7ea845703 X-MS-TrafficTypeDiagnostic: AM7PR08MB5463: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:125; X-Forefront-PRVS: 0386B406AA X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(366004)(136003)(396003)(376002)(346002)(39840400004)(2906002)(81156014)(6486002)(26005)(8676002)(8936002)(4326008)(6916009)(478600001)(66556008)(7416002)(66946007)(66476007)(6666004)(16526019)(316002)(2616005)(1076003)(186003)(5660300002)(52116002)(6506007)(956004)(36756003)(107886003)(6512007)(69590400007)(86362001); DIR:OUT; SFP:1102; Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 69iTiq0Gau3QSD4jSkvE0P5L/mM02dSMJT3NvcHITyiOqb/ybxotCtU3I7dXLfre1zPJfdIorO3eLDW5Dbhs0esYSw3J4LTI/RqgWIkR6upvokvKUm2V8bTcp/ogQUZskuH1mjgE0pzpXVMCszDhGcIUxOwrFQvHNUdftxIgrzPPKPQqg2tsSwlb/O37oD/F19+/6/4ukvsbExubf6OBJdjWYsIn/opWXpUb7ca0ny/6DOrPbgU/l5dKplwsVNEvKm7i41gyLn9LXRpqTpDgJCRQ6KUt5DyZtv0br/RrQBURGPttzC8sxnH9W7+8FdcsrkkfrBMvulvmPmy8B4aFrilDvR1l3lgBLL3WaNtDzBWuY8qZqF1o/1L9orOAdpN+y0ZbvjAfWVlR2roHEqH5kYtSPqZyJakJj9/YhuYeCkFB/o1WQeYl0Ogf9GuA9f3UDfG+1+k211013munbGoTD4MgPR+CqNwEk+45vhAXqyeJY54td2U9kCjphu32B/xu X-MS-Exchange-AntiSpam-MessageData: WCcfszviwXw/E9fPMieUiXamO7Zu6GVbiQwu/lFLG60DLozatk9LKJXYDLC+YEqHF9Swp6bQ732BEeqFmo1mupbWcTPnl1Xqc2wVWPAOsQ0+7zlfhs/wlnMFc+6rcfjK1avuUdwJEB8BJ3ua31PQG7F2zoz+6tg34p05pgwmhUPYMFlu8GsKYnP7UO84vsMsppH2oeKpoeljXBpz5KfE2LBZcVulGWtJSJONRePOwFkWXP0dA177n8TOIZMaXXYtjeTj/EOioRNITeXL0YRwqeAZ/c18IHF/UkTfdW9yhv0X+QwcDA8Y3SuPWbw3J3MPQWIwDOFqsLvoQhSu9xVNxBLqrNN1R0howId+gpKLk5aVjIAtAnVkZG8nNElOJ1DbMtVyklvRkdUf6h3fVKwedyVeC4Nnp9eieNRsGOtgcnoQV+SadL8fPEidQk0Ni5w39ibJrnabIEuC8P1k7a9zfD+ZKECZOKp+3+7loEDfk8Y21wjGnPFamr07Pe//+lvpRpQOAXPBDrqFLI75ctYfup8mB3EeUfrHXhZBNSddnzw44utuwpJI4wT9VL7HpcVLYRrnLqixLQ2b4Hju6WHivfZfn2/WEsBlWCZkZ4Wj1FXYssAjSnitkQF6DSqPa7GwaP4zVN8AtVwPVn6Rt7MQtr2pYuAnI/WGWJzzGS0zs0DNwK+FzHeSlQ50YCty8uh76SpXa/w9fY2o+quL6FySH6PzmerLnIDGGAaIqRtB+tnJW7y/oDF3TZ7UMaxQmCFeZMoIoUnPd2Jh6zMWSzG8smNl0svG8Vb9K/GRWrMyOrU= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: b30d11eb-70d6-4fd5-f566-08d7ea845703 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Apr 2020 08:24:01.4556 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 4VwBWAPuXAnq+n9kYpaZ0slOGWOiaNR1eyjJtInwa99KJN1lgI+C9+4qAsYPHVPSFY7ImrtEhYLvwwa2Bj9enmo92lnPnYEGHc1WGiyuq60= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5463 Received-SPF: pass client-ip=40.107.7.127; envelope-from=vsementsov@virtuozzo.com; helo=EUR04-HE1-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/27 04:24:00 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Received-From: 40.107.7.127 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, fam@euphon.net, integration@gluster.org, berto@igalia.com, pavel.dovgaluk@ispras.ru, dillaman@redhat.com, qemu-devel@nongnu.org, pl@kamp.de, ronniesahlberg@gmail.com, mreitz@redhat.com, den@openvz.org, sheepdog@lists.wpkg.org, vsementsov@virtuozzo.com, stefanha@redhat.com, namei.unix@gmail.com, pbonzini@redhat.com, sw@weilnetz.de, jsnow@redhat.com, ari@tuxera.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) Content-Type: text/plain; charset="utf-8" We are generally moving to int64_t for both offset and bytes parameters on all io paths. Prepare bdrv_co_do_copy_on_readv() now. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/io.c | 6 +++--- block/trace-events | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/block/io.c b/block/io.c index fe19e09034..ee38c9afb4 100644 --- a/block/io.c +++ b/block/io.c @@ -1268,7 +1268,7 @@ bdrv_driver_pwritev_compressed(BlockDriverState *bs, = int64_t offset, } =20 static int coroutine_fn bdrv_co_do_copy_on_readv(BdrvChild *child, - int64_t offset, unsigned int bytes, QEMUIOVector *qiov, + int64_t offset, int64_t bytes, QEMUIOVector *qiov, size_t qiov_offset, int flags) { BlockDriverState *bs =3D child->bs; @@ -1283,11 +1283,11 @@ static int coroutine_fn bdrv_co_do_copy_on_readv(Bd= rvChild *child, BlockDriver *drv =3D bs->drv; int64_t cluster_offset; int64_t cluster_bytes; - size_t skip_bytes; + int64_t skip_bytes; int ret; int max_transfer =3D MIN_NON_ZERO(bs->bl.max_transfer, BDRV_REQUEST_MAX_BYTES); - unsigned int progress =3D 0; + int64_t progress =3D 0; bool skip_write; =20 if (!drv) { diff --git a/block/trace-events b/block/trace-events index 29dff8881c..179b47bf63 100644 --- a/block/trace-events +++ b/block/trace-events @@ -14,7 +14,7 @@ blk_root_detach(void *child, void *blk, void *bs) "child = %p blk %p bs %p" bdrv_co_preadv(void *bs, int64_t offset, int64_t nbytes, unsigned int flag= s) "bs %p offset %"PRId64" nbytes %"PRId64" flags 0x%x" bdrv_co_pwritev(void *bs, int64_t offset, int64_t nbytes, unsigned int fla= gs) "bs %p offset %"PRId64" nbytes %"PRId64" flags 0x%x" bdrv_co_pwrite_zeroes(void *bs, int64_t offset, int count, int flags) "bs = %p offset %"PRId64" count %d flags 0x%x" -bdrv_co_do_copy_on_readv(void *bs, int64_t offset, unsigned int bytes, int= 64_t cluster_offset, int64_t cluster_bytes) "bs %p offset %"PRId64" bytes %= u cluster_offset %"PRId64" cluster_bytes %"PRId64 +bdrv_co_do_copy_on_readv(void *bs, int64_t offset, int64_t bytes, int64_t = cluster_offset, int64_t cluster_bytes) "bs %p offset %" PRId64 " bytes %" P= RId64 " cluster_offset %" PRId64 " cluster_bytes %" PRId64 bdrv_co_copy_range_from(void *src, uint64_t src_offset, void *dst, uint64_= t dst_offset, uint64_t bytes, int read_flags, int write_flags) "src %p offs= et %"PRIu64" dst %p offset %"PRIu64" bytes %"PRIu64" rw flags 0x%x 0x%x" bdrv_co_copy_range_to(void *src, uint64_t src_offset, void *dst, uint64_t = dst_offset, uint64_t bytes, int read_flags, int write_flags) "src %p offset= %"PRIu64" dst %p offset %"PRIu64" bytes %"PRIu64" rw flags 0x%x 0x%x" =20 --=20 2.21.0 From nobody Thu May 2 14:29:44 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=none dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1587976231; cv=pass; d=zohomail.com; s=zohoarc; b=PktclfWTdE3GUsiTy8v3hDtlqOpmQN3bOW8IMOrCPuoR6m8R7dXAnJLQtbSXTDF5Y8YtUoVaIYq5EDaBI554yzqTVNt0F0OIaZkOeD64e6Lv1FXiOzqAJ2b9B4dKuI+06lcj/igHHvJ9cl01quQZw8ECuQ0VcbR1xpnBuBfqiCU= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587976231; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=DVKM/PxHKaTTlyg2sgwg4PfxbzmIqoHhlmzSAmmu4/I=; b=LzjQLJxfhqENrAeqoqno+6T972fZB4okoYAIYN3ZoSwbTD4/PbSx2NWHPfD5960BSKDas7jibhOmjNn3etXEKyv0cp1CRFTM/8emwoOZBOMx72M2K0jonkweqG0+PsFrFB+ZcbbE0VJHFlzxIy0KOrRm9qxHoZo4f33HIJsvJ9g= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1587976231130802.3577788111429; Mon, 27 Apr 2020 01:30:31 -0700 (PDT) Received: from localhost ([::1]:58746 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSz9o-0007A2-Hj for importer@patchew.org; Mon, 27 Apr 2020 04:30:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48912) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSz3f-0002dZ-L7 for qemu-devel@nongnu.org; Mon, 27 Apr 2020 04:24:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jSz3e-0007mW-W9 for qemu-devel@nongnu.org; Mon, 27 Apr 2020 04:24:07 -0400 Received: from mail-eopbgr70127.outbound.protection.outlook.com ([40.107.7.127]:7750 helo=EUR04-HE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jSz3d-0007bA-1m; Mon, 27 Apr 2020 04:24:05 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM7PR08MB5463.eurprd08.prod.outlook.com (2603:10a6:20b:106::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.22; Mon, 27 Apr 2020 08:24:03 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::acfa:5:88c8:b7b9]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::acfa:5:88c8:b7b9%3]) with mapi id 15.20.2937.020; Mon, 27 Apr 2020 08:24:03 +0000 Received: from localhost.localdomain (185.215.60.182) by FR2P281CA0004.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Mon, 27 Apr 2020 08:24:01 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R/2PCBSmm3Yg0nZbR8ubkCEYWRBeu0AT+zeWMjt95mtXML6C/d8QtPP0cdY78lEaZIsZFEKLcoRcqF2BfMd/tdIg10500vFnp/4hB3kJm4X4dh5orX5KJiS6yMElqipICE99o8y3clsjc7foTgSAfs9O2bpmH+YoaxufGg2XsZMbbU7bjb0VK42JKFAGgTJBtzmpPzv/pTzdN4ybdfDLSLd/6INa9wQPfd+vH5eLQIx+cEB5q+q95DQpdmaJ+IpaPVlo9O8AgGj3NjSdVaF2x+EyHOtjUh4cKh5HgtyI26XGPKu1lEl+NEbBm8mVI4pdIQzCQbaVnAJwYN4RcXh9tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DVKM/PxHKaTTlyg2sgwg4PfxbzmIqoHhlmzSAmmu4/I=; b=NspmM+F+Mcdhe7mHGkFvpbOUlYYl12ec+8yZpBKwQa/vJHMWxQbTyoa4tbOnLmM2Ew9pVjGz8ygU7AGAEfZDZw/AgMlePjaFF6oK1Zdn+eGfeaWDyQ6DmNt5X7s1VAQnv3ASlMSRqzruco+7UAs33c7VvsPUYnbUCTKY0/XZg8NTMJiRGlzo2bB3qOzgkPviLc/jfP+1koTnEMEiFZwBxOaHJ9R+v1QB7WNgBONxd0Qm78ysnBX5rjtJIY7Y5E0gAUMYwGxjgtUEZXztFV9ls0H166uM/PGt+PcSn9bNOhyloTbkQYnlOGmQ58j+2fxCthqesMrsT5hPTvwb4Mfiug== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DVKM/PxHKaTTlyg2sgwg4PfxbzmIqoHhlmzSAmmu4/I=; b=bmsmWjo74rHbrVUKIH8LwT9kh8ZETTdvsK8uy8kOBlC4jzZrn8xG8DoGXDM2UI9tlndRCjivOuBIfF2inhG3wHkQHKGMJAG3i8R2DoMDfvdEpVX21JtcQRHsbKNQn7vV2qkrl2/w6cO5G4yVKMDbXljYlKCIXaB2TUkrH0tdwiE= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=vsementsov@virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Subject: [PATCH v2 08/17] block/io: support int64_t bytes in bdrv_aligned_preadv() Date: Mon, 27 Apr 2020 11:23:16 +0300 Message-Id: <20200427082325.10414-9-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200427082325.10414-1-vsementsov@virtuozzo.com> References: <20200427082325.10414-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: FR2P281CA0004.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::14) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Mailer: git-send-email 2.21.0 X-Originating-IP: [185.215.60.182] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6043e689-7d87-45ab-98bc-08d7ea8457e8 X-MS-TrafficTypeDiagnostic: AM7PR08MB5463: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:785; X-Forefront-PRVS: 0386B406AA X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(366004)(136003)(396003)(376002)(346002)(39840400004)(2906002)(81156014)(6486002)(26005)(8676002)(8936002)(4326008)(6916009)(478600001)(66556008)(7416002)(66946007)(66476007)(6666004)(16526019)(316002)(2616005)(1076003)(186003)(5660300002)(52116002)(6506007)(956004)(36756003)(107886003)(6512007)(69590400007)(86362001); DIR:OUT; SFP:1102; Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8lI864AT5xUwM5RrE8KFiKzQee2F4hlP3hc67HnMFPL420cidYzwaJcEAUhvPPu3KL6dr1I6QWlj831/Zx1cULFm1drC8hykv0ijXs6Rke4U7c/0jdjsJwKPexPI1yzIHrvD6QlmI52KKup0FWhj7rJjr3MvmdtmMTQImHywKGfpF41c0BlDd15n2xWuQSWvudDLLUL6OVZI/H1nRm6QL2gszVDAcRpQCJnWLc76I80hXvpLFPTc8cbyBAwu+Q1VnhPlLEt9Ys+gQ4YBdaLsuwE370EfruhLVEJcq1O9BEIoN0VJOFwWF+DBcJvCFyLIWUcMeZVLNlVHyAov7CUsxpCzpOuAZsZRiIvY9dl4GTBQSD7+bev0Uw4kHqda/qKO2S1TUlnOB4VZk9jiCtHYy8/9WzzxTaKYrNET8rS94cp/gJPURuqWh8z4SRm0cSVlFH2fgpPHAQqZmvXpCRLtMZbt9S/yvafbwi1p1b4szPavI4ZxU8z06Q8sVq+h0mJ9 X-MS-Exchange-AntiSpam-MessageData: l4fcUBNJ1p2QH93n4Wyy3DfX/89n7OwdshnWgD3/osYZe4RvMwAd+nzT7rD4S6Y5YoLkgfJsNLRF7pjVYaeATI2JtgH2GVLlsb7zmXd98vga0SOQRKLx8X1M8dByi6b0vvyeXh5QGNfi8JvTtaoD3tQ34Exya98k2Da22EYm0uKkNuQfiFiH/DOFqSejZV8PXTxaIlM4WTj9Z5BvoiVe0NxFWLgfcRMVOuGnILERgFpexFHZOkXYqDMScbMcgkn+2eYw129UGt5Ohpx7fblB/AhrHT0EWwk9raPTdZKC2EWGnZNa789Ey27AL0AkAojGprMPRXOJR/gMW/kdGfPJ41kMH3GJejWCdjDIoDEwaVdf4ojJJkgsZaDJbzA8e2TR+pNVvWyNCTPizub2h0R90pEFoW5AM5tpk9mMlg7xdq+ED9Z4w+UtaMmHzRxhK3bUBbktQKwpHw7BAiUBQGAjjfWB73Z9m1VQIdERiMXgJ8tolbWL4X7c3M6RrWsmO1BmLgPOb3V6pDMrpiN+GrpA71+BEgeUw+22uuCAPTjSM8fOaHKh4jFKsB+AVAfwbrYx6fNLS1wd2aVqQ7lRTM0fwaWEKx1uX85WFSwDLook5GNXDlriUE5djf4jVXpsPBAKoCLowY+eIdqDzc6AHk2sYe/ownxbHiTM/8H9S6EnJB2knhcUVS3LNjjS+1XWJSj4deg5Sgz0tXuzS6tx3r0j8m7dxgAhJxUZYCZWYLrVF5qX1phSBfsVaA092luXck4kO3BnqexabC5adV+1hsobZCKSoYYHM+BtNLdNKEUXDfs= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6043e689-7d87-45ab-98bc-08d7ea8457e8 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Apr 2020 08:24:02.9579 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: cxvmlxWXaLwQ+uvzUJ98vvCOs2ifo8v1YR6pBRdCzxZcgUJMcePN5MSSeYxdKm505Z52mzHOJWgLCyYwLo9WJUOK6r3zbOp7p1zQaP0pdnw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5463 Received-SPF: pass client-ip=40.107.7.127; envelope-from=vsementsov@virtuozzo.com; helo=EUR04-HE1-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/27 04:24:00 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Received-From: 40.107.7.127 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, fam@euphon.net, integration@gluster.org, berto@igalia.com, pavel.dovgaluk@ispras.ru, dillaman@redhat.com, qemu-devel@nongnu.org, pl@kamp.de, ronniesahlberg@gmail.com, mreitz@redhat.com, den@openvz.org, sheepdog@lists.wpkg.org, vsementsov@virtuozzo.com, stefanha@redhat.com, namei.unix@gmail.com, pbonzini@redhat.com, sw@weilnetz.de, jsnow@redhat.com, ari@tuxera.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) Content-Type: text/plain; charset="utf-8" We are generally moving to int64_t for both offset and bytes parameters on all io paths. Prepare bdrv_aligned_preadv() now. Make byte variable in bdrv_padding_rmw_read() int64_t, as it defined only to be passed to bdrv_aligned_preadv(). Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/io.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/block/io.c b/block/io.c index ee38c9afb4..70b51dbd0f 100644 --- a/block/io.c +++ b/block/io.c @@ -1430,16 +1430,17 @@ err: * reads; any other features must be implemented by the caller. */ static int coroutine_fn bdrv_aligned_preadv(BdrvChild *child, - BdrvTrackedRequest *req, int64_t offset, unsigned int bytes, + BdrvTrackedRequest *req, int64_t offset, int64_t bytes, int64_t align, QEMUIOVector *qiov, size_t qiov_offset, int flags) { BlockDriverState *bs =3D child->bs; int64_t total_bytes, max_bytes; int ret =3D 0; - uint64_t bytes_remaining =3D bytes; + int64_t bytes_remaining =3D bytes; int max_transfer; =20 assert(is_power_of_2(align)); + assert(offset >=3D 0 && bytes >=3D 0); assert((offset & (align - 1)) =3D=3D 0); assert((bytes & (align - 1)) =3D=3D 0); assert((bs->open_flags & BDRV_O_NO_IO) =3D=3D 0); @@ -1495,7 +1496,7 @@ static int coroutine_fn bdrv_aligned_preadv(BdrvChild= *child, } =20 while (bytes_remaining) { - int num; + int64_t num; =20 if (max_bytes) { num =3D MIN(bytes_remaining, MIN(max_bytes, max_transfer)); @@ -1596,7 +1597,7 @@ static int bdrv_padding_rmw_read(BdrvChild *child, assert(req->serialising && pad->buf); =20 if (pad->head || pad->merge_reads) { - uint64_t bytes =3D pad->merge_reads ? pad->buf_len : align; + int64_t bytes =3D pad->merge_reads ? pad->buf_len : align; =20 qemu_iovec_init_buf(&local_qiov, pad->buf, bytes); =20 --=20 2.21.0 From nobody Thu May 2 14:29:44 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=fail (Bad Signature); dmarc=fail(p=none dis=none) header.from=virtuozzo.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1587976235668463.8536681708995; Mon, 27 Apr 2020 01:30:35 -0700 (PDT) Received: from localhost ([::1]:58756 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSz9u-0007Jk-2g for importer@patchew.org; Mon, 27 Apr 2020 04:30:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48924) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSz3g-0002gj-I1 for qemu-devel@nongnu.org; Mon, 27 Apr 2020 04:24:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jSz3f-0007mw-Vv for qemu-devel@nongnu.org; Mon, 27 Apr 2020 04:24:08 -0400 Received: from mail-eopbgr70127.outbound.protection.outlook.com ([40.107.7.127]:7750 helo=EUR04-HE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jSz3e-0007bA-4J; Mon, 27 Apr 2020 04:24:06 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM7PR08MB5463.eurprd08.prod.outlook.com (2603:10a6:20b:106::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.22; Mon, 27 Apr 2020 08:24:04 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::acfa:5:88c8:b7b9]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::acfa:5:88c8:b7b9%3]) with mapi id 15.20.2937.020; Mon, 27 Apr 2020 08:24:04 +0000 Received: from localhost.localdomain (185.215.60.182) by FR2P281CA0004.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Mon, 27 Apr 2020 08:24:03 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=frQUCe+Y1KyKNDcBB+SDkjzVKEpil4H1xvIZEdFqZeqmw4RujGk0HtQH3HupY9JJKxYqCG6ldJvKP3LcgEkMEmQaHcAidwRJ9zIpc6tMqUMbjJnNCDyViAK5aJzNvwI61WmKOVJpZw3+5xRvgJifCOqnZrgOxycTZSRsI2J+7uFpYphSBjUeOeJ2n0AqGHk6x8DsjPfm9XegekVdxuxRaCzz2xja4G+o47REWyulozOAr81y6d2oll4XzOeCcfeWupWZ00qXJXsJDtxunL1MMadxNDV2LVL3RQsnkEktV2oRnDMSgrZ3C8aoQeQ0woOfGVAD+lI5hxBdzQhiUpnQtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PSaFXlXVOS57WSXhpAw7+W1J4mxVR+36A1Js9dtRxQE=; b=eD3HZhIFxxHCtmHGLvOdZc5clmpvufcy4Ncpy+PM3IRteoH7EjMJHsV09vosvGpQVqSa8pMRabqvhM9Xj137momCjV1B+1U0DwP7xGlIgUiMHw/YZreRFFMfsZwQ1rXukavMmcJifvt1Ckr9ynZJW7pleZs/iUFlggiVwzXZMsDagzMgxA9IMewerg7IPN9GCsw5U1z8oOxyIzrLMhGxoakZowPOSKER4JaaTYB9ttF147vAg4b9BUWgQyYIPa5Ibz8E23XAGCvRdlo0XqHVI5u1uOy4etHeG+hqi4VCQP2tHEoNYKYPzHirEX+ja/iyFjzoRml0NZ8NybYOI1DdIw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PSaFXlXVOS57WSXhpAw7+W1J4mxVR+36A1Js9dtRxQE=; b=nsMs29Grh9zXp1Kq46z36A1vD7bu5UTNEKPrFIqyoBvaJziuGGgC+GfXiCEfubbTSBGHHrYzgNqW+q7RBmLeJmC80+xhO9GMopyx2nUfAmdcOU3+lymTCuR5Algf/ZsIeq3kYfL24lhSEDSDU3eHQkxHP2qxZZzdQDjfFbI5y8U= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=vsementsov@virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Subject: [PATCH v2 09/17] block/io: support int64_t bytes in bdrv_co_p{read, write}v_part() Date: Mon, 27 Apr 2020 11:23:17 +0300 Message-Id: <20200427082325.10414-10-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200427082325.10414-1-vsementsov@virtuozzo.com> References: <20200427082325.10414-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: FR2P281CA0004.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::14) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Mailer: git-send-email 2.21.0 X-Originating-IP: [185.215.60.182] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f54d2e11-eb71-4c6a-3ecb-08d7ea8458ba X-MS-TrafficTypeDiagnostic: AM7PR08MB5463: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:409; X-Forefront-PRVS: 0386B406AA X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(366004)(136003)(396003)(376002)(346002)(39840400004)(2906002)(81156014)(6486002)(26005)(8676002)(8936002)(4326008)(6916009)(478600001)(66556008)(7416002)(66946007)(66476007)(6666004)(16526019)(316002)(2616005)(1076003)(186003)(5660300002)(52116002)(6506007)(956004)(36756003)(107886003)(6512007)(69590400007)(86362001)(142933001); DIR:OUT; SFP:1102; Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: z5prQGRIIeCzR8kTrG5+FuPDh6YVUlZdusfb8VdvONLmEB1yJlMgt7PxZihisy0i5qYEdFdl/ETNh00yz/WN+Jmvg7omQNFOe9C7d3SETicpnSAy2hNLTOl10lUm/BGy27UtBt3Q95trZqc68vWeqDD+o/h/Wt1kHRAfLk9w2GNPdsTG+aHw71osLMKIygpCM8zHvd0FjYjJm9rmIFH7pTDbFx5AOJACFVTMnr5YX8YI1AnWBd9b0ZeSjyEoabI4Qk/YTNFLk+qbOB70dW8cOkveHqBgZ8HCWZs+M+BNfyKSKz9m1V7iZ0LIMmj54LL0ksp6T8/YTyVWhWwTZzDnNWYcc3VryT0qMwOfJmLC2RCiFTU3F0vRfhGSx84d2HQDOslb3lcQc6U2UxnTwt+j7i80/48c/ZMMapzMKa9CuljmuCpYh6QuUfY7tx62twoFQovsKA8LxM7PEpCIcK72bpmRV6BsP43DXV/e6NZmlhijZeWyvbF4ydHCeYFvn9umGwres6JbwbB1mEHTFRWfKQ== X-MS-Exchange-AntiSpam-MessageData: K8nhk/rwzmMQYsvrDDXs4nF+gyhNTJeWQOMo9jrDOrdMS6zn+bpEZsoEHF9c7tEIBrgc2vL2VQJ9hy1jZX0ywi6/32Bnf5XaPfaYkbDmZadnwpUOQpExI7PtUqcvPDb2rXVj0nDxrzEo9Ta8Z2l44TohKFLa2gD8OFdqGKaGPWVZxlPvvQxZhtenDAu3iCWgXVfyUJqPYKkzmbYMlJAxwYkhYWpB0d73ndw1WZOLFOVaJXzkpF/qGMTuKP0BKi3WIu45m7/l34/5ZgGwfbnDA8V5oFCV+0AystWU/hzJKlLzAShJtW0X/iZI2U7B1x8wliGiqemhL69fzIh89xohbnVUO4WLZnKLrULgoUeGOs5SQRgVQcyTuoAr1dahFOjXdr+Qv0WkOBYCt9T2NspVAdd0A7XO1ywRFClIomOHuH8NH5c6H8c/tYWqs6sI/KBJolSd+kh+gwH24lhk3iZN30JoMk/UAU5+Dj/aDrixdLHr+D/Y/5TdYmCTIb8QBiDXrazReiKXs/7no51zmpa3H0oFZdaT7OJqed9W+53cBDAeNiBhTybOW0cv/JGliRDxcc1TLwx4lWEF5SUYKozaz47CzopNnkij3stWtrAbx0FZEurVSU5zDgaNiM2X7gCU50AexZggMOx7VTAG9hyhtujOyqsco4Y1GFi/JzwyHv3ZsHAkOmeyQFVmL2Hefz3iepwYC/0//XBpdVy5UvVhz85AxbG4D/4YL0Gdx15HKbqq7PnHnLP7f41MF68c4YpocStQEq7xl53dcJy5dLVCuEYvD61rbqp6VY55bZZzjss= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: f54d2e11-eb71-4c6a-3ecb-08d7ea8458ba X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Apr 2020 08:24:04.3110 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: rdkxiQXv2ZAzSQaE78cEThkBmaAJllRkOJBUzAppHt5r7b2gPohteaKdqlokUUTH5rtrQjrI6vRUD9Kf0o4eUx5PrUUO/qrWYIJy6rwaQcw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5463 Received-SPF: pass client-ip=40.107.7.127; envelope-from=vsementsov@virtuozzo.com; helo=EUR04-HE1-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/27 04:24:00 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Received-From: 40.107.7.127 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, fam@euphon.net, integration@gluster.org, berto@igalia.com, pavel.dovgaluk@ispras.ru, dillaman@redhat.com, qemu-devel@nongnu.org, pl@kamp.de, ronniesahlberg@gmail.com, mreitz@redhat.com, den@openvz.org, sheepdog@lists.wpkg.org, vsementsov@virtuozzo.com, stefanha@redhat.com, namei.unix@gmail.com, pbonzini@redhat.com, sw@weilnetz.de, jsnow@redhat.com, ari@tuxera.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" We are generally moving to int64_t for both offset and bytes parameters on all io paths. Prepare bdrv_co_preadv_part() and bdrv_co_pwritev_part() and their remaining dependencies now. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/block_int.h | 4 ++-- block/io.c | 12 ++++++------ block/trace-events | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/block/block_int.h b/include/block/block_int.h index c8daba608b..3c2a1d741a 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -975,13 +975,13 @@ int coroutine_fn bdrv_co_preadv(BdrvChild *child, int64_t offset, unsigned int bytes, QEMUIOVector *qiov, BdrvRequestFlags flags); int coroutine_fn bdrv_co_preadv_part(BdrvChild *child, - int64_t offset, unsigned int bytes, + int64_t offset, int64_t bytes, QEMUIOVector *qiov, size_t qiov_offset, BdrvRequestFlags flags); int coroutine_fn bdrv_co_pwritev(BdrvChild *child, int64_t offset, unsigned int bytes, QEMUIOVector *qiov, BdrvRequestFlags flags); int coroutine_fn bdrv_co_pwritev_part(BdrvChild *child, - int64_t offset, unsigned int bytes, + int64_t offset, int64_t bytes, QEMUIOVector *qiov, size_t qiov_offset, BdrvRequestFlags flags); =20 static inline int coroutine_fn bdrv_co_pread(BdrvChild *child, diff --git a/block/io.c b/block/io.c index 70b51dbd0f..784eaf02f2 100644 --- a/block/io.c +++ b/block/io.c @@ -1668,7 +1668,7 @@ static void bdrv_padding_destroy(BdrvRequestPadding *= pad) */ static bool bdrv_pad_request(BlockDriverState *bs, QEMUIOVector **qiov, size_t *qiov_offset, - int64_t *offset, unsigned int *bytes, + int64_t *offset, int64_t *bytes, BdrvRequestPadding *pad) { if (!bdrv_init_padding(bs, *offset, *bytes, pad)) { @@ -1694,7 +1694,7 @@ int coroutine_fn bdrv_co_preadv(BdrvChild *child, } =20 int coroutine_fn bdrv_co_preadv_part(BdrvChild *child, - int64_t offset, unsigned int bytes, + int64_t offset, int64_t bytes, QEMUIOVector *qiov, size_t qiov_offset, BdrvRequestFlags flags) { @@ -1703,7 +1703,7 @@ int coroutine_fn bdrv_co_preadv_part(BdrvChild *child, BdrvRequestPadding pad; int ret; =20 - trace_bdrv_co_preadv(bs, offset, bytes, flags); + trace_bdrv_co_preadv_part(bs, offset, bytes, flags); =20 ret =3D bdrv_check_byte_request(bs, offset, bytes); if (ret < 0) { @@ -2033,7 +2033,7 @@ static int coroutine_fn bdrv_aligned_pwritev(BdrvChil= d *child, =20 static int coroutine_fn bdrv_co_do_zero_pwritev(BdrvChild *child, int64_t offset, - unsigned int bytes, + int64_t bytes, BdrvRequestFlags flags, BdrvTrackedRequest *req) { @@ -2107,7 +2107,7 @@ int coroutine_fn bdrv_co_pwritev(BdrvChild *child, } =20 int coroutine_fn bdrv_co_pwritev_part(BdrvChild *child, - int64_t offset, unsigned int bytes, QEMUIOVector *qiov, size_t qiov_of= fset, + int64_t offset, int64_t bytes, QEMUIOVector *qiov, size_t qiov_offset, BdrvRequestFlags flags) { BlockDriverState *bs =3D child->bs; @@ -2116,7 +2116,7 @@ int coroutine_fn bdrv_co_pwritev_part(BdrvChild *chil= d, BdrvRequestPadding pad; int ret; =20 - trace_bdrv_co_pwritev(child->bs, offset, bytes, flags); + trace_bdrv_co_pwritev_part(child->bs, offset, bytes, flags); =20 if (!bs->drv) { return -ENOMEDIUM; diff --git a/block/trace-events b/block/trace-events index 179b47bf63..dd367a9b19 100644 --- a/block/trace-events +++ b/block/trace-events @@ -11,8 +11,8 @@ blk_root_attach(void *child, void *blk, void *bs) "child = %p blk %p bs %p" blk_root_detach(void *child, void *blk, void *bs) "child %p blk %p bs %p" =20 # io.c -bdrv_co_preadv(void *bs, int64_t offset, int64_t nbytes, unsigned int flag= s) "bs %p offset %"PRId64" nbytes %"PRId64" flags 0x%x" -bdrv_co_pwritev(void *bs, int64_t offset, int64_t nbytes, unsigned int fla= gs) "bs %p offset %"PRId64" nbytes %"PRId64" flags 0x%x" +bdrv_co_preadv_part(void *bs, int64_t offset, int64_t bytes, int flags) "b= s %p offset %" PRId64 " bytes %" PRId64 " flags 0x%x" +bdrv_co_pwritev_part(void *bs, int64_t offset, int64_t bytes, int flags) "= bs %p offset %" PRId64 " bytes %" PRId64 " flags 0x%x" bdrv_co_pwrite_zeroes(void *bs, int64_t offset, int count, int flags) "bs = %p offset %"PRId64" count %d flags 0x%x" bdrv_co_do_copy_on_readv(void *bs, int64_t offset, int64_t bytes, int64_t = cluster_offset, int64_t cluster_bytes) "bs %p offset %" PRId64 " bytes %" P= RId64 " cluster_offset %" PRId64 " cluster_bytes %" PRId64 bdrv_co_copy_range_from(void *src, uint64_t src_offset, void *dst, uint64_= t dst_offset, uint64_t bytes, int read_flags, int write_flags) "src %p offs= et %"PRIu64" dst %p offset %"PRIu64" bytes %"PRIu64" rw flags 0x%x 0x%x" --=20 2.21.0 From nobody Thu May 2 14:29:44 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=none dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1587976339; cv=pass; d=zohomail.com; s=zohoarc; b=m5m1DcPoDA6dPeCxcIRN8urce9jN5y3BH2TgUYKs58IhCBCIqoivr4vUwsEe3Vu0dbVWrEMBYeDlfeW7N/4YT5VKVnFwCzT6druYqsXAg1L0sHkidaJn0ablzp/ng/FJl6ssrs4yeRhDWk0H6b/R8zyYtDG9C35iXEyD7tANyUA= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587976339; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=H6HNUBrgvYgkrNp2weZIznabRYz6CuqDJYQUZPlLN2w=; b=MKtiMD2X6Vs3xzHvdTfDVaQSYVhIjZjv8+78ar/7aWCFOvGT3bCpkd78CmsU7UX8nL8G6HDwyYpefSD+KTa36i9CYQcg4VsW3EL8+ZY6FHNPAOXUyQjPTuBg4rmUYruWjTerNsOCQljdVC05Om7qemW1uWUZdpModm6lCPOJTkw= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1587976339670513.4445683718842; Mon, 27 Apr 2020 01:32:19 -0700 (PDT) Received: from localhost ([::1]:58964 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSzBZ-0002VR-5X for importer@patchew.org; Mon, 27 Apr 2020 04:32:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48952) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSz3j-0002qB-IF for qemu-devel@nongnu.org; Mon, 27 Apr 2020 04:24:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jSz3i-0007qk-Rf for qemu-devel@nongnu.org; Mon, 27 Apr 2020 04:24:11 -0400 Received: from mail-eopbgr70099.outbound.protection.outlook.com ([40.107.7.99]:65188 helo=EUR04-HE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jSz3g-0007mE-Ht; Mon, 27 Apr 2020 04:24:08 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM7PR08MB5463.eurprd08.prod.outlook.com (2603:10a6:20b:106::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.22; Mon, 27 Apr 2020 08:24:05 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::acfa:5:88c8:b7b9]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::acfa:5:88c8:b7b9%3]) with mapi id 15.20.2937.020; Mon, 27 Apr 2020 08:24:05 +0000 Received: from localhost.localdomain (185.215.60.182) by FR2P281CA0004.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Mon, 27 Apr 2020 08:24:04 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cNmaGsw3iGIgl/FgTgeJlRgnhBcIgYL1qX8kRN4Ug8l3ySuCYdoetS4nfZl8WrJJs6Dbjf5FI4FHc2FIPTJgVtYbCmlx5iOQEXSoL9pNWGiW9nArjRemr93yNH16ISdaUwx0VWRxsEZytPl8wx08j9n6bZ1caORfUvc8diibMNxfvgptIjAqDHI6uz3v5LNdSmX46SI0t91jjTLTthKANqfZZ89YGS3hdtkrsNixjzPKNF174zv0meaCs16x0dTk47mtPd39OAfe3Ju6Cl5LgWOQkRRPlatTZbj646XmC84j9YWZFyc15MLHoi7sVriMJT33tRG6BvYL+FKICwM9gQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=H6HNUBrgvYgkrNp2weZIznabRYz6CuqDJYQUZPlLN2w=; b=V/i7cVR4hD7lohPpaTjK0JN16opXsiv8+5l3W08bCg5q/iVAEwSLh3JKiYXu1vGN6CPpcJfGuovpIYwcj8uM+o2d82Jlkv1sLu6KPlISR7wy9UA3Tc2bW/9sLW7ydMpWpdedtDx15nHDHfRDqXi8hfmrAbw1uGAecYK4Td1NyrvU3Lnya+G8LP5Wi3C4QU+MhGnrmgzrCLkgK1Z37a9TBwfGBH+RyanfYvoeBMALiPGVJxHZ5uDXDc5iLrl3QYNo3+XfYIep41zb4plheSpku2DhpO5odDTYhcALZjwtQBu6m8vjf54W32cD37l4tuIjibM4w0vAZK8HPgo83t5jSg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=H6HNUBrgvYgkrNp2weZIznabRYz6CuqDJYQUZPlLN2w=; b=G0syHiWSZyQudgBBEZpo2ERsKrfyvciaz62fN5iuRlN/f4LbT39RKWOjv1Zhy/ymvyA6ZjbbtQNj7LtU7mM3vGBbjSqhXSksu/TgSU7JG1jaQ4m+/hPFcHCVvnP+6afUqADAlSD8O1ex8w9VaSIWLvPApCMa6VCDgZX05Hw1Psk= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=vsementsov@virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Subject: [PATCH v2 10/17] block/io: support int64_t bytes in read/write wrappers Date: Mon, 27 Apr 2020 11:23:18 +0300 Message-Id: <20200427082325.10414-11-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200427082325.10414-1-vsementsov@virtuozzo.com> References: <20200427082325.10414-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: FR2P281CA0004.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::14) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Mailer: git-send-email 2.21.0 X-Originating-IP: [185.215.60.182] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2d683d0b-06ff-4b8c-5fed-08d7ea84598a X-MS-TrafficTypeDiagnostic: AM7PR08MB5463: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:800; X-Forefront-PRVS: 0386B406AA X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(366004)(136003)(396003)(376002)(346002)(39840400004)(2906002)(81156014)(6486002)(26005)(8676002)(8936002)(4326008)(6916009)(478600001)(66556008)(7416002)(66946007)(66476007)(6666004)(16526019)(316002)(2616005)(1076003)(186003)(5660300002)(52116002)(6506007)(956004)(36756003)(107886003)(6512007)(69590400007)(86362001); DIR:OUT; SFP:1102; Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: THnEhTeGtSBUVtyAOcVXlVZ66Crl3X3d5jnBVcFIeVUbDqZUdqzoYQmi7UdEJtHTLnpaFT5MsVhAEFSaXmWSIlvz6AxY4I5dnCfQvKQCTOk/XkvpTEK1oCQjIvAu98BLcIQlHdqjB2uC8qHUoYG5osGsqP1TwNJig1L1ErUhx6DJA2Ada6Lz5JmN/qxJZ4HzlMtZPeqLDhIujFtbIA53ZlzViOz8HVw3bW/V0ZkGR9xnPxcQ7yOSpol0uoG8gDFKRoryzjeQynVNIguICxVcAs+is/iEpBukpTSRFm2ypIkG6bUpGCtZGga2cU+pqxy6ZOvel/F9YSulOaeZcEdxaoRAvnHtPFIFiaiNPy2kjtcnqaKLWe4kg15xRcdNxiwMLES+ZnlsHt7rhmaRFTrGwNH94XKlrWFw2pBmPPtGtEHJ50YusiHqk0DPgoMZGDixkhNCMhKbs6I4b664kzF6xOwOzFoEydJ31QrACg86dbQST3xPwQeBOyJ0ZK0ONrM6 X-MS-Exchange-AntiSpam-MessageData: wyVQ87ufh269diAFFnguDq7vFr4jk5VR0dSjHVT0DjTnPD8prEP1kGtRI5Ud0DsufvQZEAVYZvxluCMazsxfE/Zu5O8ijR3L8W5RHEJ/wZJt/IAouL+xaO6/4pgtQElTH6zPflLONs2nfYYWyWJ83sIj5ufrwLHEw2bKzVYY57X3O5G6+98m59w9NiUv/x2h0IJY4GGdM0WRQzm6lB0HjOPXItYrzfFcmR51hcpcJ642tlzApvsRtNRfT+duaRigbBsgGY1LzdnYs0ZT/XUZHjhJduaK+FMEuMjteoLYtBOS5L3fmGzZl+HZQIfMH9YOFQj/Z3GenmJa86Pu4eHEyHie1yR/c4xbGf8Ownw0GYlQCTuMjYcqvtm1oEiGSSTnPX3TnrnwkPmhZujPQZobsW+WMmWd8vDqM5lfu0nRGnMwDX21gHaujrkeYuDJGg9kSBZXgrFQCUMPRJXE8zOvhhkPy9tIwMv4CTxuYwfztQHBugaCBfknENF905nnDthsp1SIBM3qJmCPStKl4v6zgwLMja1RmNCBeLHpHxzvlv1whQZgC2lWPTr1xVEichYB0PRPGtS2wR1ijcfT2o89RLU27uq5WBPbWvk5T9yON8VDGKeSWeC5oWykRD2akjW6dBeBUS6tPdMu14jm7Nf/9WUNV9kkBhEBZ/CwewZ4z1Jfhz3YDi486O0s9MMGf/rVBHn33QH290mKKktpRFhhmwh59g3bCdLobVua/0oAgIhvd4ON/JmlwkrSLu1b/x0Ez2FVeoy2xlL6cRHXQZjQ3FbDe3UlnKPjP8KrZEjsYaE= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2d683d0b-06ff-4b8c-5fed-08d7ea84598a X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Apr 2020 08:24:05.6710 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 0exf4BRlyFvATY8lO9iVavB50cLKPROZ3XTsLKulDZLzkMNJBOgxaZjYcUjNWdS1Rj2X87NVUWfBnZqNZ1axMbx1JmXNMZOfYUUc9jSiuJY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5463 Received-SPF: pass client-ip=40.107.7.99; envelope-from=vsementsov@virtuozzo.com; helo=EUR04-HE1-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/27 04:24:06 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Received-From: 40.107.7.99 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, fam@euphon.net, integration@gluster.org, berto@igalia.com, pavel.dovgaluk@ispras.ru, dillaman@redhat.com, qemu-devel@nongnu.org, pl@kamp.de, ronniesahlberg@gmail.com, mreitz@redhat.com, den@openvz.org, sheepdog@lists.wpkg.org, vsementsov@virtuozzo.com, stefanha@redhat.com, namei.unix@gmail.com, pbonzini@redhat.com, sw@weilnetz.de, jsnow@redhat.com, ari@tuxera.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) Content-Type: text/plain; charset="utf-8" Now, when bdrv_co_preadv_part() and bdrv_co_pwritev_part() updated, update all their wrappers. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/block.h | 10 +++++----- include/block/block_int.h | 4 ++-- block/blkverify.c | 2 +- block/io.c | 17 +++++++++-------- block/trace-events | 2 +- 5 files changed, 18 insertions(+), 17 deletions(-) diff --git a/include/block/block.h b/include/block/block.h index b05995fe9c..03abf30d1d 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -318,14 +318,14 @@ int bdrv_reopen_prepare(BDRVReopenState *reopen_state, void bdrv_reopen_commit(BDRVReopenState *reopen_state); void bdrv_reopen_abort(BDRVReopenState *reopen_state); int bdrv_pwrite_zeroes(BdrvChild *child, int64_t offset, - int bytes, BdrvRequestFlags flags); + int64_t bytes, BdrvRequestFlags flags); int bdrv_make_zero(BdrvChild *child, BdrvRequestFlags flags); -int bdrv_pread(BdrvChild *child, int64_t offset, void *buf, int bytes); +int bdrv_pread(BdrvChild *child, int64_t offset, void *buf, int64_t bytes); int bdrv_preadv(BdrvChild *child, int64_t offset, QEMUIOVector *qiov); -int bdrv_pwrite(BdrvChild *child, int64_t offset, const void *buf, int byt= es); +int bdrv_pwrite(BdrvChild *child, int64_t offset, const void *buf, int64_t= bytes); int bdrv_pwritev(BdrvChild *child, int64_t offset, QEMUIOVector *qiov); int bdrv_pwrite_sync(BdrvChild *child, int64_t offset, - const void *buf, int count); + const void *buf, int64_t bytes); /* * Efficiently zero a region of the disk image. Note that this is a regul= ar * I/O request like read or write and should have a reasonable size. This @@ -333,7 +333,7 @@ int bdrv_pwrite_sync(BdrvChild *child, int64_t offset, * because it may allocate memory for the entire region. */ int coroutine_fn bdrv_co_pwrite_zeroes(BdrvChild *child, int64_t offset, - int bytes, BdrvRequestFlags flags); + int64_t bytes, BdrvRequestFlags fla= gs); BlockDriverState *bdrv_find_backing_image(BlockDriverState *bs, const char *backing_file); void bdrv_refresh_filename(BlockDriverState *bs); diff --git a/include/block/block_int.h b/include/block/block_int.h index 3c2a1d741a..b4b42d0cd6 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -972,13 +972,13 @@ extern BlockDriver bdrv_raw; extern BlockDriver bdrv_qcow2; =20 int coroutine_fn bdrv_co_preadv(BdrvChild *child, - int64_t offset, unsigned int bytes, QEMUIOVector *qiov, + int64_t offset, int64_t bytes, QEMUIOVector *qiov, BdrvRequestFlags flags); int coroutine_fn bdrv_co_preadv_part(BdrvChild *child, int64_t offset, int64_t bytes, QEMUIOVector *qiov, size_t qiov_offset, BdrvRequestFlags flags); int coroutine_fn bdrv_co_pwritev(BdrvChild *child, - int64_t offset, unsigned int bytes, QEMUIOVector *qiov, + int64_t offset, int64_t bytes, QEMUIOVector *qiov, BdrvRequestFlags flags); int coroutine_fn bdrv_co_pwritev_part(BdrvChild *child, int64_t offset, int64_t bytes, diff --git a/block/blkverify.c b/block/blkverify.c index ba6b1853ae..667e60d832 100644 --- a/block/blkverify.c +++ b/block/blkverify.c @@ -31,7 +31,7 @@ typedef struct BlkverifyRequest { uint64_t bytes; int flags; =20 - int (*request_fn)(BdrvChild *, int64_t, unsigned int, QEMUIOVector *, + int (*request_fn)(BdrvChild *, int64_t, int64_t, QEMUIOVector *, BdrvRequestFlags); =20 int ret; /* test image result */ diff --git a/block/io.c b/block/io.c index 784eaf02f2..02632eaf59 100644 --- a/block/io.c +++ b/block/io.c @@ -946,7 +946,7 @@ static int bdrv_prwv_co(BdrvChild *child, int64_t offse= t, } =20 int bdrv_pwrite_zeroes(BdrvChild *child, int64_t offset, - int bytes, BdrvRequestFlags flags) + int64_t bytes, BdrvRequestFlags flags) { QEMUIOVector qiov =3D QEMU_IOVEC_INIT_BUF(qiov, NULL, bytes); =20 @@ -1008,7 +1008,7 @@ int bdrv_preadv(BdrvChild *child, int64_t offset, QEM= UIOVector *qiov) } =20 /* See bdrv_pwrite() for the return codes */ -int bdrv_pread(BdrvChild *child, int64_t offset, void *buf, int bytes) +int bdrv_pread(BdrvChild *child, int64_t offset, void *buf, int64_t bytes) { QEMUIOVector qiov =3D QEMU_IOVEC_INIT_BUF(qiov, buf, bytes); =20 @@ -1037,7 +1037,8 @@ int bdrv_pwritev(BdrvChild *child, int64_t offset, QE= MUIOVector *qiov) -EINVAL Invalid offset or number of bytes -EACCES Trying to write a read-only device */ -int bdrv_pwrite(BdrvChild *child, int64_t offset, const void *buf, int byt= es) +int bdrv_pwrite(BdrvChild *child, int64_t offset, const void *buf, + int64_t bytes) { QEMUIOVector qiov =3D QEMU_IOVEC_INIT_BUF(qiov, buf, bytes); =20 @@ -1055,11 +1056,11 @@ int bdrv_pwrite(BdrvChild *child, int64_t offset, c= onst void *buf, int bytes) * Returns 0 on success, -errno in error cases. */ int bdrv_pwrite_sync(BdrvChild *child, int64_t offset, - const void *buf, int count) + const void *buf, int64_t bytes) { int ret; =20 - ret =3D bdrv_pwrite(child, offset, buf, count); + ret =3D bdrv_pwrite(child, offset, buf, bytes); if (ret < 0) { return ret; } @@ -1687,7 +1688,7 @@ static bool bdrv_pad_request(BlockDriverState *bs, } =20 int coroutine_fn bdrv_co_preadv(BdrvChild *child, - int64_t offset, unsigned int bytes, QEMUIOVector *qiov, + int64_t offset, int64_t bytes, QEMUIOVector *qiov, BdrvRequestFlags flags) { return bdrv_co_preadv_part(child, offset, bytes, qiov, 0, flags); @@ -2100,7 +2101,7 @@ out: * Handle a write request in coroutine context */ int coroutine_fn bdrv_co_pwritev(BdrvChild *child, - int64_t offset, unsigned int bytes, QEMUIOVector *qiov, + int64_t offset, int64_t bytes, QEMUIOVector *qiov, BdrvRequestFlags flags) { return bdrv_co_pwritev_part(child, offset, bytes, qiov, 0, flags); @@ -2177,7 +2178,7 @@ out: } =20 int coroutine_fn bdrv_co_pwrite_zeroes(BdrvChild *child, int64_t offset, - int bytes, BdrvRequestFlags flags) + int64_t bytes, BdrvRequestFlags fla= gs) { trace_bdrv_co_pwrite_zeroes(child->bs, offset, bytes, flags); =20 diff --git a/block/trace-events b/block/trace-events index dd367a9b19..13ad9af0d8 100644 --- a/block/trace-events +++ b/block/trace-events @@ -13,7 +13,7 @@ blk_root_detach(void *child, void *blk, void *bs) "child = %p blk %p bs %p" # io.c bdrv_co_preadv_part(void *bs, int64_t offset, int64_t bytes, int flags) "b= s %p offset %" PRId64 " bytes %" PRId64 " flags 0x%x" bdrv_co_pwritev_part(void *bs, int64_t offset, int64_t bytes, int flags) "= bs %p offset %" PRId64 " bytes %" PRId64 " flags 0x%x" -bdrv_co_pwrite_zeroes(void *bs, int64_t offset, int count, int flags) "bs = %p offset %"PRId64" count %d flags 0x%x" +bdrv_co_pwrite_zeroes(void *bs, int64_t offset, int64_t bytes, int flags) = "bs %p offset %" PRId64 " bytes %" PRId64 " flags 0x%x" bdrv_co_do_copy_on_readv(void *bs, int64_t offset, int64_t bytes, int64_t = cluster_offset, int64_t cluster_bytes) "bs %p offset %" PRId64 " bytes %" P= RId64 " cluster_offset %" PRId64 " cluster_bytes %" PRId64 bdrv_co_copy_range_from(void *src, uint64_t src_offset, void *dst, uint64_= t dst_offset, uint64_t bytes, int read_flags, int write_flags) "src %p offs= et %"PRIu64" dst %p offset %"PRIu64" bytes %"PRIu64" rw flags 0x%x 0x%x" bdrv_co_copy_range_to(void *src, uint64_t src_offset, void *dst, uint64_t = dst_offset, uint64_t bytes, int read_flags, int write_flags) "src %p offset= %"PRIu64" dst %p offset %"PRIu64" bytes %"PRIu64" rw flags 0x%x 0x%x" --=20 2.21.0 From nobody Thu May 2 14:29:44 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=none dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1587976323; cv=pass; d=zohomail.com; s=zohoarc; b=CjBzzU/RdGfVTbof8SA2ePMrunH57gGYszZ/s2pjK2brDKX0GoD0RYIAgFmCawI+6I71zfI9JkzvJdfgm5zerem+V08z9BNfmJPX2hrtO4lRJjHexUUEbwHRul/n8pLJ0/zVOuxWpXbEjgZ4gUCv7MSdKR8ZqJQfDXI6nljYgG8= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587976323; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=5jmFQHF+mLcCi6WpqQgc+kmHUGsKoeQBvNVET0b6l+I=; b=Fvy2O58l7oMxKGpzVjnlgfbSx8SwsqVo7cAVirfYcEwjmoF/kg/o/KYtdjoGjeAx05Rd1pwVuMBAvkQTX4OqIs+OnViI82jLWa0RpsTKSrpfQ1GaVErhJiqVFBq9RoiMg1HN5j49yn9YvRuHptL0P9O0rE0gmxIvlS6Aqz1JFPw= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1587976323323444.14414105011224; Mon, 27 Apr 2020 01:32:03 -0700 (PDT) Received: from localhost ([::1]:58952 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSzBJ-00020R-Mf for importer@patchew.org; Mon, 27 Apr 2020 04:32:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49118) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSz41-0003X9-91 for qemu-devel@nongnu.org; Mon, 27 Apr 2020 04:24:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jSz3t-0000GA-Kr for qemu-devel@nongnu.org; Mon, 27 Apr 2020 04:24:29 -0400 Received: from mail-eopbgr70099.outbound.protection.outlook.com ([40.107.7.99]:65188 helo=EUR04-HE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jSz3h-0007mE-Iz; Mon, 27 Apr 2020 04:24:09 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM7PR08MB5463.eurprd08.prod.outlook.com (2603:10a6:20b:106::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.22; Mon, 27 Apr 2020 08:24:07 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::acfa:5:88c8:b7b9]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::acfa:5:88c8:b7b9%3]) with mapi id 15.20.2937.020; Mon, 27 Apr 2020 08:24:07 +0000 Received: from localhost.localdomain (185.215.60.182) by FR2P281CA0004.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Mon, 27 Apr 2020 08:24:05 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eaADaIIr9kUfGUkkrJNucJWzjC1TS5wLXdJYaYF61PruyXiP5TTPUlbN0Y7Z+4ZM9nAO7gQOgZYtM0Bc6THAQHxWY0rq5dQ8bB1+7VdFRG8haEjxlMyYMUPFCyBtdSrfm2RJupigLnSdazEQjRuPdDN/HtkIX42FItf1xBsLRWFflXAqVGPgLvltO6M3Wx+uKQLHyMttFoxjCne1rhufckOymKv+sVuX5Ppk2HOQnuch8Y77S6FYNqOiyNHCpJ576Vc4YqHrQhtMiEscQj6yno1Rpgj0X8ZYvRFwqkDNk02y9N0Lv80j1X9OwIcYm230wgt2+zz93VFE9t6iIZfM/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5jmFQHF+mLcCi6WpqQgc+kmHUGsKoeQBvNVET0b6l+I=; b=drZwlzr55pYxgI0dhf8N8zVKkrYyqeGf5RZ33cdrduGAyD+Jyjy2OHyf+Q1erZpt+q+j6xX8sMUGyglIR0rjs/T7ajFPrTmZVrVQjSGXoQjJb1pEUPWr4xFjzjA11zHkGM2OEqG97mrJ/nGFu6kLnYQYpLebstNcRHHEtIQlfa7HQY1u2k9/Sozav5c4Av3Kz+9N6RDfAmrhFoQv4O8YzXqJ9vOeJ3yCE1o1aERJf1Dgo/FW0XeHcpI+foy85hXoSa3xi1029KbM6YKzjP5NU3W3Wg31HJfmafuaj/N7d3KqBy6bmd9xVk6FYWDfta6ndtH6hXoA3iK0yqDk/jsWEQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5jmFQHF+mLcCi6WpqQgc+kmHUGsKoeQBvNVET0b6l+I=; b=PNtYeddkAZjXWzZgtgDrDj+5EoT0Ii1Sr2pvhT6QieQ/BOKkj5/XZNC0Rm+a4t+AHnVqGa0yI5kLTy37pKnmSfT3tgv+G2HvpPM7YV34Mq9qWDL56fvbrgC8ZmzBu4sqBPEQwY/tmwQ95tF4R9nFcYNds/+weVDR4Re675O28eo= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=vsementsov@virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Subject: [PATCH v2 11/17] block/io: use int64_t bytes in copy_range Date: Mon, 27 Apr 2020 11:23:19 +0300 Message-Id: <20200427082325.10414-12-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200427082325.10414-1-vsementsov@virtuozzo.com> References: <20200427082325.10414-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: FR2P281CA0004.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::14) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Mailer: git-send-email 2.21.0 X-Originating-IP: [185.215.60.182] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1bec70e4-fe60-4c11-05f1-08d7ea845a5c X-MS-TrafficTypeDiagnostic: AM7PR08MB5463: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:541; X-Forefront-PRVS: 0386B406AA X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(366004)(136003)(396003)(376002)(346002)(39840400004)(2906002)(81156014)(6486002)(26005)(8676002)(8936002)(4326008)(6916009)(478600001)(66556008)(7416002)(66946007)(66476007)(6666004)(16526019)(316002)(2616005)(1076003)(186003)(5660300002)(52116002)(6506007)(956004)(36756003)(107886003)(6512007)(69590400007)(86362001); DIR:OUT; SFP:1102; Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +VUUVn4BEePzfTqfyhVPCKGeM8YlDSXIItwO+CdKYF62L/oCwCPJiRj8GhndQVrMvUD1jiDCZmgMqY57MdCkXajV0M4QCiKIKT9MQwmG3kh0UEM0J+sfg+VoMjDN7pnVq6kurhVY/+qpUJLyGMMs2mgggaieXK1N/U6pT3I3uiNkt+p3O90BgH7R6WmL5s+PIq8FeulmxwZjYG7lAMuI9sSz8Mz18CwP5cg8VjKAYmFbxCGt62Ed1t1H1AlxniWZuOJXjn4tyYG3jpkiydMSGJyKIwQtWIMXW1E3UxIiWaHaW+if+KDnG/aZuf+M8lEBd1DMHpJFv5WY5QD2TaG6oIlDI/DG8px2+jshx5TDbgb9TFOCohqibSNX4hlge5JkbYMh/mOa9OBG791PrEkaOdxzRduzcqVWWT+TtqeSqmr+GhthWrloikJ/ADjOchv7mt94k8gHs1fgt90ehDW4hssKwTtq7zIzTNQyyIZCJDZ/o2e/wZxrZE3rptdXZ/lJ X-MS-Exchange-AntiSpam-MessageData: YXkcb4CAkV/NvP1dJAACF6YuXIA/XOpNw31DxqMDRJ8S9cWcBLKBjok2k8D2ZodgII1MLqolDGbCvQ+dhKbSVGQDsJ8vw06axnNRK375j0dQa0lw9OK30ov1lI5EWpg9SivqW89L3tF9YkQpqMSgIalyvThr/zwGr6EG4UaNY13RGjuyFrBCH3wPXg9hkfmrFE86c8eMQSZCwncAjOclDG7PEmtwj7ZvhvJTxa7mj4t/QSRxQ2tI3bpwbTd+6mFFCvKuL02CPrK8Us4IuIfWMxxVjeIvUS4w0C06nPkM5Q4hAN2ujmkTfQmRog5TzRiZtGMnNPgrDSQ8LHAhoMr0+7XsVzF1TFTtAatTZPpFcYFImG6wcGToN//vUF9qNb0y1temPFDmLvY7lJBO+KbqwjMTKvVe0qxZNv4AGustDeBvgSZheZxqzKTrJR87vLlsIeClYBeif0sYWv8l2xdXMHsTgmt0tYOC1Yf5ZACkENYN2GXkxg4xZDkP1yq0X6ejPzoCl1G60HbHm8mKdO4RYE8Zc6uXGso/3ZQtKlTfQgvHZ8dETVg5mLZ+Z1AIRCenVhLnOhj1d6LWg3pII+JnPfs8BumqVRnp8Tmu6OfEvFYsGm66yK80ftgKNOEdd3OeUN0UN0EadKiIc5iTuRD+KeRLhFEUsJDu8qctBtah5KiZd9XMDymIFy0cqSOyjnp0QHMzQFgaTkG9ZlygmNRUWdDYa8foFOwXZ/MbICpi7o1fHBXdv+RCnXWZTaxwvnqfxvhWmsETcr6tEnoRqofRAtQqHOFE0BvJLI8GRaQ8rFE= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1bec70e4-fe60-4c11-05f1-08d7ea845a5c X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Apr 2020 08:24:07.0300 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 8jksoZTmZyghj4kqUVsrDuNNirsHk3tIv8TW7d77/iSp0Rngv1rueXGk6RHaOjBIFvDSNr+61ZQ/y9+TjNJvcMZiTONC8/JWqY3fP6CNi0o= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5463 Received-SPF: pass client-ip=40.107.7.99; envelope-from=vsementsov@virtuozzo.com; helo=EUR04-HE1-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/27 04:24:06 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Received-From: 40.107.7.99 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, fam@euphon.net, integration@gluster.org, berto@igalia.com, pavel.dovgaluk@ispras.ru, dillaman@redhat.com, qemu-devel@nongnu.org, pl@kamp.de, ronniesahlberg@gmail.com, mreitz@redhat.com, den@openvz.org, sheepdog@lists.wpkg.org, vsementsov@virtuozzo.com, stefanha@redhat.com, namei.unix@gmail.com, pbonzini@redhat.com, sw@weilnetz.de, jsnow@redhat.com, ari@tuxera.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) Content-Type: text/plain; charset="utf-8" We are generally moving to int64_t for both offset and bytes parameters on all io paths. Convert copy_range parameters which are already 64bit to signed type. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/block.h | 6 +++--- include/block/block_int.h | 12 ++++++------ block/io.c | 22 +++++++++++----------- block/trace-events | 4 ++-- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/include/block/block.h b/include/block/block.h index 03abf30d1d..2eea27bc99 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -731,8 +731,8 @@ void bdrv_unregister_buf(BlockDriverState *bs, void *ho= st); * * Returns: 0 if succeeded; negative error code if failed. **/ -int coroutine_fn bdrv_co_copy_range(BdrvChild *src, uint64_t src_offset, - BdrvChild *dst, uint64_t dst_offset, - uint64_t bytes, BdrvRequestFlags read_= flags, +int coroutine_fn bdrv_co_copy_range(BdrvChild *src, int64_t src_offset, + BdrvChild *dst, int64_t dst_offset, + int64_t bytes, BdrvRequestFlags read_f= lags, BdrvRequestFlags write_flags); #endif diff --git a/include/block/block_int.h b/include/block/block_int.h index b4b42d0cd6..28aea2bcfd 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -1315,14 +1315,14 @@ void bdrv_dec_in_flight(BlockDriverState *bs); =20 void blockdev_close_all_bdrv_states(void); =20 -int coroutine_fn bdrv_co_copy_range_from(BdrvChild *src, uint64_t src_offs= et, - BdrvChild *dst, uint64_t dst_offs= et, - uint64_t bytes, +int coroutine_fn bdrv_co_copy_range_from(BdrvChild *src, int64_t src_offse= t, + BdrvChild *dst, int64_t dst_offse= t, + int64_t bytes, BdrvRequestFlags read_flags, BdrvRequestFlags write_flags); -int coroutine_fn bdrv_co_copy_range_to(BdrvChild *src, uint64_t src_offset, - BdrvChild *dst, uint64_t dst_offset, - uint64_t bytes, +int coroutine_fn bdrv_co_copy_range_to(BdrvChild *src, int64_t src_offset, + BdrvChild *dst, int64_t dst_offset, + int64_t bytes, BdrvRequestFlags read_flags, BdrvRequestFlags write_flags); =20 diff --git a/block/io.c b/block/io.c index 02632eaf59..7c979eacd8 100644 --- a/block/io.c +++ b/block/io.c @@ -3209,8 +3209,8 @@ void bdrv_unregister_buf(BlockDriverState *bs, void *= host) } =20 static int coroutine_fn bdrv_co_copy_range_internal( - BdrvChild *src, uint64_t src_offset, BdrvChild *dst, - uint64_t dst_offset, uint64_t bytes, + BdrvChild *src, int64_t src_offset, BdrvChild *dst, + int64_t dst_offset, int64_t bytes, BdrvRequestFlags read_flags, BdrvRequestFlags write_flags, bool recurse_src) { @@ -3288,9 +3288,9 @@ static int coroutine_fn bdrv_co_copy_range_internal( * * See the comment of bdrv_co_copy_range for the parameter and return value * semantics. */ -int coroutine_fn bdrv_co_copy_range_from(BdrvChild *src, uint64_t src_offs= et, - BdrvChild *dst, uint64_t dst_offs= et, - uint64_t bytes, +int coroutine_fn bdrv_co_copy_range_from(BdrvChild *src, int64_t src_offse= t, + BdrvChild *dst, int64_t dst_offse= t, + int64_t bytes, BdrvRequestFlags read_flags, BdrvRequestFlags write_flags) { @@ -3304,9 +3304,9 @@ int coroutine_fn bdrv_co_copy_range_from(BdrvChild *s= rc, uint64_t src_offset, * * See the comment of bdrv_co_copy_range for the parameter and return value * semantics. */ -int coroutine_fn bdrv_co_copy_range_to(BdrvChild *src, uint64_t src_offset, - BdrvChild *dst, uint64_t dst_offset, - uint64_t bytes, +int coroutine_fn bdrv_co_copy_range_to(BdrvChild *src, int64_t src_offset, + BdrvChild *dst, int64_t dst_offset, + int64_t bytes, BdrvRequestFlags read_flags, BdrvRequestFlags write_flags) { @@ -3316,9 +3316,9 @@ int coroutine_fn bdrv_co_copy_range_to(BdrvChild *src= , uint64_t src_offset, bytes, read_flags, write_flags, fal= se); } =20 -int coroutine_fn bdrv_co_copy_range(BdrvChild *src, uint64_t src_offset, - BdrvChild *dst, uint64_t dst_offset, - uint64_t bytes, BdrvRequestFlags read_= flags, +int coroutine_fn bdrv_co_copy_range(BdrvChild *src, int64_t src_offset, + BdrvChild *dst, int64_t dst_offset, + int64_t bytes, BdrvRequestFlags read_f= lags, BdrvRequestFlags write_flags) { return bdrv_co_copy_range_from(src, src_offset, diff --git a/block/trace-events b/block/trace-events index 13ad9af0d8..e4d68438af 100644 --- a/block/trace-events +++ b/block/trace-events @@ -15,8 +15,8 @@ bdrv_co_preadv_part(void *bs, int64_t offset, int64_t byt= es, int flags) "bs %p o bdrv_co_pwritev_part(void *bs, int64_t offset, int64_t bytes, int flags) "= bs %p offset %" PRId64 " bytes %" PRId64 " flags 0x%x" bdrv_co_pwrite_zeroes(void *bs, int64_t offset, int64_t bytes, int flags) = "bs %p offset %" PRId64 " bytes %" PRId64 " flags 0x%x" bdrv_co_do_copy_on_readv(void *bs, int64_t offset, int64_t bytes, int64_t = cluster_offset, int64_t cluster_bytes) "bs %p offset %" PRId64 " bytes %" P= RId64 " cluster_offset %" PRId64 " cluster_bytes %" PRId64 -bdrv_co_copy_range_from(void *src, uint64_t src_offset, void *dst, uint64_= t dst_offset, uint64_t bytes, int read_flags, int write_flags) "src %p offs= et %"PRIu64" dst %p offset %"PRIu64" bytes %"PRIu64" rw flags 0x%x 0x%x" -bdrv_co_copy_range_to(void *src, uint64_t src_offset, void *dst, uint64_t = dst_offset, uint64_t bytes, int read_flags, int write_flags) "src %p offset= %"PRIu64" dst %p offset %"PRIu64" bytes %"PRIu64" rw flags 0x%x 0x%x" +bdrv_co_copy_range_from(void *src, int64_t src_offset, void *dst, int64_t = dst_offset, int64_t bytes, int read_flags, int write_flags) "src %p offset = %" PRId64 " dst %p offset %" PRId64 " bytes %" PRId64 " rw flags 0x%x 0x%x" +bdrv_co_copy_range_to(void *src, int64_t src_offset, void *dst, int64_t ds= t_offset, int64_t bytes, int read_flags, int write_flags) "src %p offset %"= PRId64 " dst %p offset %" PRId64 " bytes %" PRId64 " rw flags 0x%x 0x%x" =20 # stream.c stream_one_iteration(void *s, int64_t offset, uint64_t bytes, int is_alloc= ated) "s %p offset %" PRId64 " bytes %" PRIu64 " is_allocated %d" --=20 2.21.0 From nobody Thu May 2 14:29:44 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=none dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1587976620; cv=pass; d=zohomail.com; s=zohoarc; b=c3MXokfT4MSYRlxmNI9d9R3zkHah+4LSOFEJ3Qdl9PXzbkPAZ2QsNqvkzNVn3LjmharRC5pMR0jd6g2bP0yc6lMU84Etd3fq04i7wJx38lVw1K8x2EKa/7Ngb8NzR4qdBX1pF7YZJgWTeu0bSCEJlXb34NM4Amt079KBPfrPBPo= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587976620; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=VgpYD7TDX090L83FzIYghOviQ6mC5mBUndWmQH2xXVg=; b=NTbgQ6JTx7uwnCOTx7ghwATnEwOuzoiKV4Ci4GzKbDWTlreK0sn+eINNKPoD9PWaPVGafO7S/7g58C0OlVvrMkFrfvE4x/+1QTtpJ4FmC74UvSN9USVzQgkTH/Gw4X0km1eum1th0JxNxiAdH8Vl753dltX9RmrOQOoI9EaKpgw= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 15879766200831014.860419248115; Mon, 27 Apr 2020 01:37:00 -0700 (PDT) Received: from localhost ([::1]:59336 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSzG6-0001VF-FX for importer@patchew.org; Mon, 27 Apr 2020 04:36:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49144) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSz44-0003fN-KG for qemu-devel@nongnu.org; Mon, 27 Apr 2020 04:24:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jSz3z-0000jP-FL for qemu-devel@nongnu.org; Mon, 27 Apr 2020 04:24:31 -0400 Received: from mail-eopbgr70099.outbound.protection.outlook.com ([40.107.7.99]:65188 helo=EUR04-HE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jSz3j-0007mE-BW; Mon, 27 Apr 2020 04:24:11 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM7PR08MB5463.eurprd08.prod.outlook.com (2603:10a6:20b:106::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.22; Mon, 27 Apr 2020 08:24:08 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::acfa:5:88c8:b7b9]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::acfa:5:88c8:b7b9%3]) with mapi id 15.20.2937.020; Mon, 27 Apr 2020 08:24:08 +0000 Received: from localhost.localdomain (185.215.60.182) by FR2P281CA0004.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Mon, 27 Apr 2020 08:24:07 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ju1bizHWOORv+Wb1udnUS9KIZ8aVXFb6R+uOtlKxJ0ZLCrZaKkLfzPmzhBrrG3BNHgjB+wkMfmD9omdmJCos6bpGWio0YgZoQtud5oqIk9FtgO7Wk+998HE2/I0Y2Lqf27f0tgxkutNWXWZuXKo7g4hDO35tWvC0C1X+SLg/s8ReS1vfcghDiU+aHyaGhXAWr2gavD3I7KAOOUafM9MEzDQrn6yKKxKmwyeOTIZOrjqjdES0iOr7KPMLq9ISpqFPhabFR/xRnP1t6OUMYNfAOWC0L9gW9JWmexkp4M5QodDnK60+enUsiFfWMAMS4FmSvJ7JpWSBLi6z5KPk63Mkmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VgpYD7TDX090L83FzIYghOviQ6mC5mBUndWmQH2xXVg=; b=BVCHcpEwmFRseOso7FPLTd7ncmg1ff1SKMVaZxPd+HXZyQfC3wfNribBKDinXE/Fxqw6ik3tij8xVUc3+BJW3xzXu/QfHCazlPWkqVCYSWBlloL0t42eiI+Dxl6/LiMF1hkyG0odFTnjOKZiA0WgTUuNoMidppxToHR+eO92RARyy2+haRqSK5SWuPozCXK122IE3C7ovQYlg+kdRMuaatxXOjM/YRAfp8Z2csVsuUV6sfYcXXTrKy5BWhjOf9AKz7x1WISDDs9xYZM5t0kFaIRJ/0N/nthTYPuWAIO4CVNozI0NPBhe0vrcDQs864LuMUCDb+faLBz/ae9xbX6ThQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VgpYD7TDX090L83FzIYghOviQ6mC5mBUndWmQH2xXVg=; b=mztsVVx0LkeJSOMxb+5ZeSxpN6293vzHsTTDNSqz0633AYeb0CeGzYpWgQyQFMapBNmxC6aeO3kR1cByrKH1YoKmwA2vtQriGrU27RED3vCGcEjPX6H0jWz1kqLUzbGwS1E6+hqwJEr25GCUANPSUsCAlEQlxBRdPhwa5HBQJ74= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=vsementsov@virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Subject: [PATCH v2 12/17] block/block-backend: convert blk io path to use int64_t parameters Date: Mon, 27 Apr 2020 11:23:20 +0300 Message-Id: <20200427082325.10414-13-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200427082325.10414-1-vsementsov@virtuozzo.com> References: <20200427082325.10414-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: FR2P281CA0004.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::14) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Mailer: git-send-email 2.21.0 X-Originating-IP: [185.215.60.182] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6f8e9be2-a63b-4d01-3a55-08d7ea845b26 X-MS-TrafficTypeDiagnostic: AM7PR08MB5463: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:205; X-Forefront-PRVS: 0386B406AA X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(366004)(136003)(396003)(376002)(346002)(39840400004)(2906002)(81156014)(6486002)(26005)(8676002)(8936002)(4326008)(6916009)(478600001)(66556008)(7416002)(66946007)(66476007)(6666004)(16526019)(316002)(2616005)(1076003)(186003)(5660300002)(52116002)(6506007)(30864003)(956004)(36756003)(107886003)(6512007)(69590400007)(86362001); DIR:OUT; SFP:1102; Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9Ys4TshWFtsIQEZL2dZFMHJShQxDDP8hKfo1ik0ajXmgZw2CBRg+KaNVu7zAgc9d32Kc/5jPtj9HUK6kTt9J/GRWpbq+PWBQSWWFiSwtrcM2eyGVC5KN9SCW83LW5bq2GsvPsYmOhybcH5ccgt7gnB0hgf64HeetJ2lB9TcquO/hP8Wr8wlv7JJQBejvXKo/pJyaIqaaEaN8YDkyYyxtl7vqgcXE/DpnLPB4mA8JfQKbEnE9lDjcjtN5FXtnKCjz1gIG3W+vfT9o4RiUeO0OJekXidO6S31eZ3vLLqd9KKylzgPI/iBKAujnLWRjDNrH2oEdbgCfHnvUGUhByPy81uvoeg3pifTSecFJK//V5WSNI21UhYD3iGo5CrQSSmvYmCBxwsZPfJj8CK01CeaJwG+Y/+FDbOTOxYVqLGXe5JA4KwKXBAEeZEJ4n2wea9TRUS0DA64jK6Jl/YQzpNlnYoD9yjVi4vFTDEgEVF3I2cKwB/5mabXH/2zRXPxmXZ6P X-MS-Exchange-AntiSpam-MessageData: uSPaWaGGg/ePvykvCo18c7pRLXniT7nwA9QD0zKR+YxgjHIO5Oom/Rbh5PMCFnt74BvAB95VH8fNQRetyrVlWSbUEqXrxUiyEFLgYpwELjViaeKGn8GHAHpcyWnqL+aAxvwpfEweX+xWcrRGyDhq5axLDBuKmGNGXrDYtA0OI+XnPzdqzkmM30GN947KL+PRwdzVKQlNPyFO/9irDSNRsVbaQDGHrKNWt7EyseCeXiBEdDT680KFX9M/+k6CxJQUqA6hgfS8WpDMNk0QmixiDJART0x3OTT1LquKmZXo2+TbHDikwo1E1Rh4T//6+rztMeG4daBigjGZ8usBt5qaA6b8872B1csXyTiSjrW2GiVEI+F46GkXyOeFJp02a+MJqmRZBtGaOjrkVo024ncSMg3nFADVvmmNba00kXBHuOq08lXCi1J9TmQTt67A/8ybl1EjT1Tb5xh6HFB7iNfULlPf3AkB1cl8ICFR/XDOvBkdjzO2qKvOZbDCHOjz5ZaARFY29hOs12h9jIoaQw0+6Wrg+ig8y5ff0oC9kb1LbS3BccpeTyWjc68SEuec6NiWhbPlcuDSfcG2z3lzEf9bclP5M5vRsGQ+UUg+eSMhzvKUpMMmiNMosYw6D0LTLlvYM5cKZUe3j53Amsq4qMv6AeiZSY9hjUW4OnL3KGfkwHG5t0yJGFoPXY8HiWD24vn7v6Dh2Qmvx9cmV4EZABRJxyGeb+qowR5vRmxCgFJSPfj5z7vqVR+yyY0+mnFbQHDurOxnnIN5yZBaytkOce34o/9DgdWW8biEd0QF1zMUP2I= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6f8e9be2-a63b-4d01-3a55-08d7ea845b26 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Apr 2020 08:24:08.4299 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: CZPh8h7LA69PzIlvhRfWA2lLAruhXCkcIO0fqrpqw4339t+666cisSW8qJ++PBJbY04bl4HDiw9AGY11NWAehPAQ8GDTLsrYEgk9IvMCqwI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5463 Received-SPF: pass client-ip=40.107.7.99; envelope-from=vsementsov@virtuozzo.com; helo=EUR04-HE1-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/27 04:24:06 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Received-From: 40.107.7.99 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, fam@euphon.net, integration@gluster.org, berto@igalia.com, pavel.dovgaluk@ispras.ru, dillaman@redhat.com, qemu-devel@nongnu.org, pl@kamp.de, ronniesahlberg@gmail.com, mreitz@redhat.com, den@openvz.org, sheepdog@lists.wpkg.org, vsementsov@virtuozzo.com, stefanha@redhat.com, namei.unix@gmail.com, pbonzini@redhat.com, sw@weilnetz.de, jsnow@redhat.com, ari@tuxera.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) Content-Type: text/plain; charset="utf-8" We are generally moving to int64_t for both offset and bytes parameters on all io paths. Now bdrv layer is converted, convert blk layer too. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/sysemu/block-backend.h | 26 +++++++-------- block/block-backend.c | 60 ++++++++++++++++++---------------- 2 files changed, 44 insertions(+), 42 deletions(-) diff --git a/include/sysemu/block-backend.h b/include/sysemu/block-backend.h index 9bbdbd63d7..0c1eee1778 100644 --- a/include/sysemu/block-backend.h +++ b/include/sysemu/block-backend.h @@ -119,14 +119,14 @@ BlockBackend *blk_by_dev(void *dev); BlockBackend *blk_by_qdev_id(const char *id, Error **errp); void blk_set_dev_ops(BlockBackend *blk, const BlockDevOps *ops, void *opaq= ue); int coroutine_fn blk_co_preadv(BlockBackend *blk, int64_t offset, - unsigned int bytes, QEMUIOVector *qiov, + int64_t bytes, QEMUIOVector *qiov, BdrvRequestFlags flags); int coroutine_fn blk_co_pwritev_part(BlockBackend *blk, int64_t offset, - unsigned int bytes, + int64_t bytes, QEMUIOVector *qiov, size_t qiov_offse= t, BdrvRequestFlags flags); int coroutine_fn blk_co_pwritev(BlockBackend *blk, int64_t offset, - unsigned int bytes, QEMUIOVector *qiov, + int64_t bytes, QEMUIOVector *qiov, BdrvRequestFlags flags); =20 static inline int coroutine_fn blk_co_pread(BlockBackend *blk, int64_t off= set, @@ -148,13 +148,13 @@ static inline int coroutine_fn blk_co_pwrite(BlockBac= kend *blk, int64_t offset, } =20 int blk_pwrite_zeroes(BlockBackend *blk, int64_t offset, - int bytes, BdrvRequestFlags flags); + int64_t bytes, BdrvRequestFlags flags); BlockAIOCB *blk_aio_pwrite_zeroes(BlockBackend *blk, int64_t offset, - int bytes, BdrvRequestFlags flags, + int64_t bytes, BdrvRequestFlags flags, BlockCompletionFunc *cb, void *opaque); int blk_make_zero(BlockBackend *blk, BdrvRequestFlags flags); -int blk_pread(BlockBackend *blk, int64_t offset, void *buf, int bytes); -int blk_pwrite(BlockBackend *blk, int64_t offset, const void *buf, int byt= es, +int blk_pread(BlockBackend *blk, int64_t offset, void *buf, int64_t bytes); +int blk_pwrite(BlockBackend *blk, int64_t offset, const void *buf, int64_t= bytes, BdrvRequestFlags flags); int64_t blk_getlength(BlockBackend *blk); void blk_get_geometry(BlockBackend *blk, uint64_t *nb_sectors_ptr); @@ -167,14 +167,14 @@ BlockAIOCB *blk_aio_pwritev(BlockBackend *blk, int64_= t offset, BlockCompletionFunc *cb, void *opaque); BlockAIOCB *blk_aio_flush(BlockBackend *blk, BlockCompletionFunc *cb, void *opaque); -BlockAIOCB *blk_aio_pdiscard(BlockBackend *blk, int64_t offset, int bytes, +BlockAIOCB *blk_aio_pdiscard(BlockBackend *blk, int64_t offset, int64_t by= tes, BlockCompletionFunc *cb, void *opaque); void blk_aio_cancel(BlockAIOCB *acb); void blk_aio_cancel_async(BlockAIOCB *acb); int blk_ioctl(BlockBackend *blk, unsigned long int req, void *buf); BlockAIOCB *blk_aio_ioctl(BlockBackend *blk, unsigned long int req, void *= buf, BlockCompletionFunc *cb, void *opaque); -int blk_co_pdiscard(BlockBackend *blk, int64_t offset, int bytes); +int blk_co_pdiscard(BlockBackend *blk, int64_t offset, int64_t bytes); int blk_co_flush(BlockBackend *blk); int blk_flush(BlockBackend *blk); int blk_commit_all(void); @@ -233,12 +233,12 @@ int blk_get_open_flags_from_root_state(BlockBackend *= blk); void *blk_aio_get(const AIOCBInfo *aiocb_info, BlockBackend *blk, BlockCompletionFunc *cb, void *opaque); int coroutine_fn blk_co_pwrite_zeroes(BlockBackend *blk, int64_t offset, - int bytes, BdrvRequestFlags flags); + int64_t bytes, BdrvRequestFlags flag= s); int blk_pwrite_compressed(BlockBackend *blk, int64_t offset, const void *b= uf, - int bytes); + int64_t bytes); int blk_truncate(BlockBackend *blk, int64_t offset, bool exact, PreallocMode prealloc, Error **errp); -int blk_pdiscard(BlockBackend *blk, int64_t offset, int bytes); +int blk_pdiscard(BlockBackend *blk, int64_t offset, int64_t bytes); int blk_save_vmstate(BlockBackend *blk, const uint8_t *buf, int64_t pos, int size); int blk_load_vmstate(BlockBackend *blk, uint8_t *buf, int64_t pos, int siz= e); @@ -259,7 +259,7 @@ void blk_unregister_buf(BlockBackend *blk, void *host); =20 int coroutine_fn blk_co_copy_range(BlockBackend *blk_in, int64_t off_in, BlockBackend *blk_out, int64_t off_out, - int bytes, BdrvRequestFlags read_flags, + int64_t bytes, BdrvRequestFlags read_fl= ags, BdrvRequestFlags write_flags); =20 const BdrvChild *blk_root(BlockBackend *blk); diff --git a/block/block-backend.c b/block/block-backend.c index 38ae413826..b3f6edfc70 100644 --- a/block/block-backend.c +++ b/block/block-backend.c @@ -1110,11 +1110,11 @@ void blk_set_disable_request_queuing(BlockBackend *= blk, bool disable) } =20 static int blk_check_byte_request(BlockBackend *blk, int64_t offset, - size_t size) + int64_t bytes) { int64_t len; =20 - if (size > INT_MAX) { + if (bytes > INT_MAX) { return -EIO; } =20 @@ -1122,7 +1122,7 @@ static int blk_check_byte_request(BlockBackend *blk, = int64_t offset, return -ENOMEDIUM; } =20 - if (offset < 0) { + if (offset < 0 || bytes < 0) { return -EIO; } =20 @@ -1132,7 +1132,7 @@ static int blk_check_byte_request(BlockBackend *blk, = int64_t offset, return len; } =20 - if (offset > len || len - offset < size) { + if (offset > len || len - offset < bytes) { return -EIO; } } @@ -1154,7 +1154,7 @@ static void coroutine_fn blk_wait_while_drained(Block= Backend *blk) =20 /* To be called between exactly one pair of blk_inc/dec_in_flight() */ static int coroutine_fn -blk_do_preadv(BlockBackend *blk, int64_t offset, unsigned int bytes, +blk_do_preadv(BlockBackend *blk, int64_t offset, int64_t bytes, QEMUIOVector *qiov, BdrvRequestFlags flags) { int ret; @@ -1185,7 +1185,7 @@ blk_do_preadv(BlockBackend *blk, int64_t offset, unsi= gned int bytes, } =20 int coroutine_fn blk_co_preadv(BlockBackend *blk, int64_t offset, - unsigned int bytes, QEMUIOVector *qiov, + int64_t bytes, QEMUIOVector *qiov, BdrvRequestFlags flags) { int ret; @@ -1199,7 +1199,7 @@ int coroutine_fn blk_co_preadv(BlockBackend *blk, int= 64_t offset, =20 /* To be called between exactly one pair of blk_inc/dec_in_flight() */ static int coroutine_fn -blk_do_pwritev_part(BlockBackend *blk, int64_t offset, unsigned int bytes, +blk_do_pwritev_part(BlockBackend *blk, int64_t offset, int64_t bytes, QEMUIOVector *qiov, size_t qiov_offset, BdrvRequestFlags flags) { @@ -1235,7 +1235,7 @@ blk_do_pwritev_part(BlockBackend *blk, int64_t offset= , unsigned int bytes, } =20 int coroutine_fn blk_co_pwritev_part(BlockBackend *blk, int64_t offset, - unsigned int bytes, + int64_t bytes, QEMUIOVector *qiov, size_t qiov_offse= t, BdrvRequestFlags flags) { @@ -1249,7 +1249,7 @@ int coroutine_fn blk_co_pwritev_part(BlockBackend *bl= k, int64_t offset, } =20 int coroutine_fn blk_co_pwritev(BlockBackend *blk, int64_t offset, - unsigned int bytes, QEMUIOVector *qiov, + int64_t bytes, QEMUIOVector *qiov, BdrvRequestFlags flags) { return blk_co_pwritev_part(blk, offset, bytes, qiov, 0, flags); @@ -1311,7 +1311,7 @@ static int blk_prw(BlockBackend *blk, int64_t offset,= uint8_t *buf, } =20 int blk_pwrite_zeroes(BlockBackend *blk, int64_t offset, - int bytes, BdrvRequestFlags flags) + int64_t bytes, BdrvRequestFlags flags) { return blk_prw(blk, offset, NULL, bytes, blk_write_entry, flags | BDRV_REQ_ZERO_WRITE); @@ -1361,7 +1361,7 @@ BlockAIOCB *blk_abort_aio_request(BlockBackend *blk, typedef struct BlkAioEmAIOCB { BlockAIOCB common; BlkRwCo rwco; - int bytes; + int64_t bytes; bool has_returned; } BlkAioEmAIOCB; =20 @@ -1385,7 +1385,8 @@ static void blk_aio_complete_bh(void *opaque) blk_aio_complete(acb); } =20 -static BlockAIOCB *blk_aio_prwv(BlockBackend *blk, int64_t offset, int byt= es, +static BlockAIOCB *blk_aio_prwv(BlockBackend *blk, + int64_t offset, int64_t bytes, void *iobuf, CoroutineEntry co_entry, BdrvRequestFlags flags, BlockCompletionFunc *cb, void *opaque) @@ -1442,31 +1443,31 @@ static void blk_aio_write_entry(void *opaque) } =20 BlockAIOCB *blk_aio_pwrite_zeroes(BlockBackend *blk, int64_t offset, - int count, BdrvRequestFlags flags, + int64_t bytes, BdrvRequestFlags flags, BlockCompletionFunc *cb, void *opaque) { - return blk_aio_prwv(blk, offset, count, NULL, blk_aio_write_entry, + return blk_aio_prwv(blk, offset, bytes, NULL, blk_aio_write_entry, flags | BDRV_REQ_ZERO_WRITE, cb, opaque); } =20 -int blk_pread(BlockBackend *blk, int64_t offset, void *buf, int count) +int blk_pread(BlockBackend *blk, int64_t offset, void *buf, int64_t bytes) { - int ret =3D blk_prw(blk, offset, buf, count, blk_read_entry, 0); + int ret =3D blk_prw(blk, offset, buf, bytes, blk_read_entry, 0); if (ret < 0) { return ret; } - return count; + return bytes; } =20 -int blk_pwrite(BlockBackend *blk, int64_t offset, const void *buf, int cou= nt, - BdrvRequestFlags flags) +int blk_pwrite(BlockBackend *blk, int64_t offset, const void *buf, + int64_t bytes, BdrvRequestFlags flags) { - int ret =3D blk_prw(blk, offset, (void *) buf, count, blk_write_entry, + int ret =3D blk_prw(blk, offset, (void *) buf, bytes, blk_write_entry, flags); if (ret < 0) { return ret; } - return count; + return bytes; } =20 int64_t blk_getlength(BlockBackend *blk) @@ -1567,7 +1568,7 @@ BlockAIOCB *blk_aio_ioctl(BlockBackend *blk, unsigned= long int req, void *buf, =20 /* To be called between exactly one pair of blk_inc/dec_in_flight() */ static int coroutine_fn -blk_do_pdiscard(BlockBackend *blk, int64_t offset, int bytes) +blk_do_pdiscard(BlockBackend *blk, int64_t offset, int64_t bytes) { int ret; =20 @@ -1591,14 +1592,15 @@ static void blk_aio_pdiscard_entry(void *opaque) } =20 BlockAIOCB *blk_aio_pdiscard(BlockBackend *blk, - int64_t offset, int bytes, + int64_t offset, int64_t bytes, BlockCompletionFunc *cb, void *opaque) { return blk_aio_prwv(blk, offset, bytes, NULL, blk_aio_pdiscard_entry, = 0, cb, opaque); } =20 -int coroutine_fn blk_co_pdiscard(BlockBackend *blk, int64_t offset, int by= tes) +int coroutine_fn blk_co_pdiscard(BlockBackend *blk, int64_t offset, + int64_t bytes) { int ret; =20 @@ -1618,7 +1620,7 @@ static void blk_pdiscard_entry(void *opaque) aio_wait_kick(); } =20 -int blk_pdiscard(BlockBackend *blk, int64_t offset, int bytes) +int blk_pdiscard(BlockBackend *blk, int64_t offset, int64_t bytes) { return blk_prw(blk, offset, NULL, bytes, blk_pdiscard_entry, 0); } @@ -2123,16 +2125,16 @@ void *blk_aio_get(const AIOCBInfo *aiocb_info, Bloc= kBackend *blk, } =20 int coroutine_fn blk_co_pwrite_zeroes(BlockBackend *blk, int64_t offset, - int bytes, BdrvRequestFlags flags) + int64_t bytes, BdrvRequestFlags flag= s) { return blk_co_pwritev(blk, offset, bytes, NULL, flags | BDRV_REQ_ZERO_WRITE); } =20 int blk_pwrite_compressed(BlockBackend *blk, int64_t offset, const void *b= uf, - int count) + int64_t bytes) { - return blk_prw(blk, offset, (void *) buf, count, blk_write_entry, + return blk_prw(blk, offset, (void *) buf, bytes, blk_write_entry, BDRV_REQ_WRITE_COMPRESSED); } =20 @@ -2358,7 +2360,7 @@ void blk_unregister_buf(BlockBackend *blk, void *host) =20 int coroutine_fn blk_co_copy_range(BlockBackend *blk_in, int64_t off_in, BlockBackend *blk_out, int64_t off_out, - int bytes, BdrvRequestFlags read_flags, + int64_t bytes, BdrvRequestFlags read_fl= ags, BdrvRequestFlags write_flags) { int r; --=20 2.21.0 From nobody Thu May 2 14:29:44 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=none dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1587976169; cv=pass; d=zohomail.com; s=zohoarc; b=ULauUoaUQqoIDA75sjFLzF3F8n5HilPWnJNy/3MEJ9tTpKjWi4vWygXdoS4MOjRnRwUn3lHP5ERIVU6pNFdyw1FHSJFYvTVN//gL4aVYEJQhnncbQcIbV9ZQf+HTD/QZxNR8LZssoyi81XFkTDAPg7CsXvRdK8iKBUyxb10/ckE= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587976169; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=FZ+BFuGbzp9YXYnPzYlMFcVEE9PKdjmeX6MpHPdk5Qg=; b=ncOSelZkYn4d1c7nM0xmX2ODp6mS6/GyyabaOnTLZXKtnxGXNCvBq0ntr654q+4fdMWBQJbtHYd30FagX4DOVyNzvNHAVQO1/4l4uo9va4NtbBWjLwxCChjn8eVFcPzI22ZAr6FTLhuX7XbpQMpOLI7u0WFDQ+ZQ8kXI4w8UP48= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1587976169189865.993188017975; Mon, 27 Apr 2020 01:29:29 -0700 (PDT) Received: from localhost ([::1]:58632 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSz8p-0004vN-Gf for importer@patchew.org; Mon, 27 Apr 2020 04:29:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49022) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSz3p-000375-NS for qemu-devel@nongnu.org; Mon, 27 Apr 2020 04:24:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jSz3o-0008GE-9p for qemu-devel@nongnu.org; Mon, 27 Apr 2020 04:24:17 -0400 Received: from mail-eopbgr70099.outbound.protection.outlook.com ([40.107.7.99]:65188 helo=EUR04-HE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jSz3k-0007mE-EN; Mon, 27 Apr 2020 04:24:12 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM7PR08MB5463.eurprd08.prod.outlook.com (2603:10a6:20b:106::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.22; Mon, 27 Apr 2020 08:24:10 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::acfa:5:88c8:b7b9]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::acfa:5:88c8:b7b9%3]) with mapi id 15.20.2937.020; Mon, 27 Apr 2020 08:24:09 +0000 Received: from localhost.localdomain (185.215.60.182) by FR2P281CA0004.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Mon, 27 Apr 2020 08:24:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=boSBxMAEulyx1WT0tm/IQZSzO6f52BzSc3XAQQovBF2Pufln8LUARboh8g5AyGBsYAhrtN++BI2QHCDa0UjRnKR7MAs9IVCvZCft3jRuRfka9DX0ecwwsKhIuOnFRmwSQWVzXGgIc5xwpywsHc+MtGxg8qtPfNlLG68WtGCUIiw6O62LXj5XercUJVrvO6rYyAp9g8H0M3CVzLQM2cS24HOqr5DPsNHmX/HVSUCW2nz/1wmXLHiPruNhBZt8CEyfF9oikM5pKRbnrPkWgV6FbLrOhzRtQryzoyeDzsgTwjvUfpy3DxonxQRxSj2ogSWNgjl2hKxDWPWSflPs4eZ7YQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FZ+BFuGbzp9YXYnPzYlMFcVEE9PKdjmeX6MpHPdk5Qg=; b=hCAF/K8fjx3jgXptzH5FAuSjTKh8X/dccrqRCT0EY0mMk4U2QvLl40TuaT4YaiNeLFGtoyEBL7rlXpcbS8QNG+Qht4isiGt1FDQT6/iAOHNE4W3WfpOLxaGBOS6OBhqFOYFNiCNBfaNczdqTc97rxYyThCu8xas6KCvXy/VeXc+jv74eGZpIz8rbatbrD+bVdTlt/k0stcefIyXYnYiFD/iB5Umaoo9sK4hCXwg6ULNY0fvzcaRnf1M5VnAsk8AkYf0fgupZB7mHUNjhSy/r9qy7o0+wL+/+jkGDleEyDa85ie5972BB3PG5GRZNaQOmgvkc403QdiidM8kHZl9cSw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FZ+BFuGbzp9YXYnPzYlMFcVEE9PKdjmeX6MpHPdk5Qg=; b=pksr0N9SPoXWDYUt+uYI+NYz7hEBMiLa6OzWP0u/R6c9vPvUKaIAndRy/VpiReUfnfFZA+AUPqb+oACrIKquj4nzHaUSuzjFadLgun4coHWZsSRxDwcTXJH19b+XMTh9Zw8Kfbmkedt44qiU0ryBq+2pYzXwN6W5aDjceRkTUDg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=vsementsov@virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Subject: [PATCH v2 13/17] block: use int64_t instead of uint64_t in driver read handlers Date: Mon, 27 Apr 2020 11:23:21 +0300 Message-Id: <20200427082325.10414-14-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200427082325.10414-1-vsementsov@virtuozzo.com> References: <20200427082325.10414-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: FR2P281CA0004.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::14) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Mailer: git-send-email 2.21.0 X-Originating-IP: [185.215.60.182] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3ed33209-0ea7-4515-3b5c-08d7ea845c00 X-MS-TrafficTypeDiagnostic: AM7PR08MB5463: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:37; X-Forefront-PRVS: 0386B406AA X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(366004)(136003)(396003)(376002)(346002)(39840400004)(2906002)(81156014)(6486002)(26005)(8676002)(8936002)(4326008)(6916009)(478600001)(66556008)(7416002)(66946007)(66476007)(6666004)(16526019)(316002)(2616005)(1076003)(186003)(5660300002)(52116002)(6506007)(30864003)(956004)(36756003)(107886003)(6512007)(69590400007)(86362001); DIR:OUT; SFP:1102; Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BmM0/qUkqCbaFLf6uZwvdfh9TaD5TY1NWrYNvfvv6OSoEtCQfWv8kcPNU5kJmR4HknrIE8FL0he4z4dePc/ZmWpDdutVL2ejRvDt60nzaFr8MVFd8xM5+tEY4I4oqls8/UU78QID+56dnkQDjYQ6EqIK8mA7NTOpnWi9K7vXxDkfog0rqfwABJFrLfi/qEI8vqrq/76j0HYeVo4KyNKMziuS2klM9Mb3GGwkl53vOlPvyIhUGD+2xM2yWwuwufZwNN2gbOoiuX8ihKJfVUyqSIRErtPVBw16XFyMMlfQWrVrvESAaL4LOgvtODs+CkUXFecniwym+He1UK31ESQVJdedQAxcmAd+NTe1yaInzQm31PokJe6YFV2py6GJDMkdMYRzQcEbTl2N5utN9VsRn/dAFo27DJi9NtUSgYvzaTt4MGsuNEKVWO52dS/3mlrpaRA0WJzZ4Qjan9Yvujlj6K56yl3UvOBRMLJwvObiwHas9mgrQDFiz/6ZPAttoQlb X-MS-Exchange-AntiSpam-MessageData: hdXK2y0ybrB52rqrJYWWTiG9IPkXM90jAuOGfTqsR3qdEUeX+h6AUv4XOr01e6Alcg0Z+3F37JA/1JjXy/xlR5sEL6dQXIsspQOCeJ2EOegV6tRKw7vCmic2I5xTV8SFcBdfJd0QVODT1iwKwY6J+HkWVipLFWPP+qWOAkpMYVl3oZP9PdBkYlZHZ7Lf2RJyDOngrMhjRV6N0g0fbzi420FVUp4hDTsOuRscfMrgHF7LkSNl2XAFV+s1fHoxwrmQQWAJe34Az1T18X0/3gtWSjlafy8e+6c+WC7bPJb8eZ8xKDvU9Lisnmt9tLQvkl+uVhqFK4bDOEGGjie26e47tODogmEh/FjAZHD1w7LOFKXY1oTqCpOrLgp7G5A0OYEmvB54EHpC3zlWJvlHJXn7cDh0ANegW+Ff0fGc670gEKg2L5XjmsQCoJtIVql9ZNr/Em0V6zykY5YvETgZGqug9GzxMKA/dIdMD16d6rp5r3YqEUXBGXQ68ujKqz16uc32OEpn4b7AcOPLBgtb+3TxrtxusXPV+V1q3l4KXoq5KOS8Ubc1qU1i5nWmmr9i8kOHQBFg1KcTcdU9P8XLJ7kN3WhVx4Z6BdZjLT5mwcFY9mOJnYGWiaSMiBjsnBTli07MrkyHNWG1Um66zMvMwRfQu1tQ6yEC7U+hE8PAIIC9yPoSjfh8aPA2B6eddwNiQrmqyTQ7u6ZjOnwPBV3evp9EggDI8OqBBh/Q+NHac6uETkgCE1n6RIrk11k2ufO/MyjUQiLlu35lsYL8rcq29AtoOolOuCA3lWagmqrTHwmxwKY= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3ed33209-0ea7-4515-3b5c-08d7ea845c00 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Apr 2020 08:24:09.8397 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: uZT9MWGSU9Lqg9q6uHb6dRMDU7Bc5IUdvGvPmmO/P9cqnkV42Q+EPZujI0mZTYXV5myNuFOdB6kmpe7ok72bQXD4zkIFC1KHNtRXZ0dE/F4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5463 Received-SPF: pass client-ip=40.107.7.99; envelope-from=vsementsov@virtuozzo.com; helo=EUR04-HE1-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/27 04:24:06 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Received-From: 40.107.7.99 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, fam@euphon.net, integration@gluster.org, berto@igalia.com, pavel.dovgaluk@ispras.ru, dillaman@redhat.com, qemu-devel@nongnu.org, pl@kamp.de, ronniesahlberg@gmail.com, mreitz@redhat.com, den@openvz.org, sheepdog@lists.wpkg.org, vsementsov@virtuozzo.com, stefanha@redhat.com, namei.unix@gmail.com, pbonzini@redhat.com, sw@weilnetz.de, jsnow@redhat.com, ari@tuxera.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) Content-Type: text/plain; charset="utf-8" We are generally moving to int64_t for both offset and bytes parameters on all io paths. Convert driver read handlers parameters which are already 64bit to signed type. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/block_int.h | 6 +++--- block/backup-top.c | 2 +- block/blkdebug.c | 2 +- block/blklogwrites.c | 2 +- block/blkreplay.c | 2 +- block/blkverify.c | 2 +- block/bochs.c | 2 +- block/cloop.c | 2 +- block/commit.c | 2 +- block/copy-on-read.c | 2 +- block/crypto.c | 2 +- block/curl.c | 2 +- block/dmg.c | 2 +- block/file-posix.c | 4 ++-- block/filter-compress.c | 2 +- block/mirror.c | 2 +- block/nbd.c | 4 ++-- block/nfs.c | 4 ++-- block/null.c | 4 ++-- block/nvme.c | 2 +- block/qcow.c | 4 ++-- block/qcow2.c | 2 +- block/quorum.c | 4 ++-- block/raw-format.c | 18 +++++++++--------- block/rbd.c | 2 +- block/throttle.c | 2 +- block/vdi.c | 2 +- block/vmdk.c | 2 +- block/vpc.c | 2 +- block/vvfat.c | 2 +- tests/test-bdrv-drain.c | 8 ++++---- 31 files changed, 50 insertions(+), 50 deletions(-) diff --git a/include/block/block_int.h b/include/block/block_int.h index 28aea2bcfd..1588df02c2 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -180,7 +180,7 @@ struct BlockDriver { =20 /* aio */ BlockAIOCB *(*bdrv_aio_preadv)(BlockDriverState *bs, - uint64_t offset, uint64_t bytes, QEMUIOVector *qiov, int flags, + int64_t offset, int64_t bytes, QEMUIOVector *qiov, int flags, BlockCompletionFunc *cb, void *opaque); BlockAIOCB *(*bdrv_aio_pwritev)(BlockDriverState *bs, uint64_t offset, uint64_t bytes, QEMUIOVector *qiov, int flags, @@ -210,9 +210,9 @@ struct BlockDriver { * The buffer in @qiov may point directly to guest memory. */ int coroutine_fn (*bdrv_co_preadv)(BlockDriverState *bs, - uint64_t offset, uint64_t bytes, QEMUIOVector *qiov, int flags); + int64_t offset, int64_t bytes, QEMUIOVector *qiov, int flags); int coroutine_fn (*bdrv_co_preadv_part)(BlockDriverState *bs, - uint64_t offset, uint64_t bytes, + int64_t offset, int64_t bytes, QEMUIOVector *qiov, size_t qiov_offset, int flags); int coroutine_fn (*bdrv_co_writev)(BlockDriverState *bs, int64_t sector_num, int nb_sectors, QEMUIOVector *qiov, int flags); diff --git a/block/backup-top.c b/block/backup-top.c index 3b50c06e2c..49fd8763cc 100644 --- a/block/backup-top.c +++ b/block/backup-top.c @@ -42,7 +42,7 @@ typedef struct BDRVBackupTopState { } BDRVBackupTopState; =20 static coroutine_fn int backup_top_co_preadv( - BlockDriverState *bs, uint64_t offset, uint64_t bytes, + BlockDriverState *bs, int64_t offset, int64_t bytes, QEMUIOVector *qiov, int flags) { return bdrv_co_preadv(bs->backing, offset, bytes, qiov, flags); diff --git a/block/blkdebug.c b/block/blkdebug.c index af44aa973f..b61275f229 100644 --- a/block/blkdebug.c +++ b/block/blkdebug.c @@ -619,7 +619,7 @@ static int rule_check(BlockDriverState *bs, uint64_t of= fset, uint64_t bytes, } =20 static int coroutine_fn -blkdebug_co_preadv(BlockDriverState *bs, uint64_t offset, uint64_t bytes, +blkdebug_co_preadv(BlockDriverState *bs, int64_t offset, int64_t bytes, QEMUIOVector *qiov, int flags) { int err; diff --git a/block/blklogwrites.c b/block/blklogwrites.c index 04d8b33607..6e5bd09993 100644 --- a/block/blklogwrites.c +++ b/block/blklogwrites.c @@ -307,7 +307,7 @@ static void blk_log_writes_refresh_limits(BlockDriverSt= ate *bs, Error **errp) } =20 static int coroutine_fn -blk_log_writes_co_preadv(BlockDriverState *bs, uint64_t offset, uint64_t b= ytes, +blk_log_writes_co_preadv(BlockDriverState *bs, int64_t offset, int64_t byt= es, QEMUIOVector *qiov, int flags) { return bdrv_co_preadv(bs->file, offset, bytes, qiov, flags); diff --git a/block/blkreplay.c b/block/blkreplay.c index c96ac8f4bc..70bc1158e1 100644 --- a/block/blkreplay.c +++ b/block/blkreplay.c @@ -73,7 +73,7 @@ static void block_request_create(uint64_t reqid, BlockDri= verState *bs, } =20 static int coroutine_fn blkreplay_co_preadv(BlockDriverState *bs, - uint64_t offset, uint64_t bytes, QEMUIOVector *qiov, int flags) + int64_t offset, int64_t bytes, QEMUIOVector *qiov, int flags) { uint64_t reqid =3D blkreplay_next_id(); int ret =3D bdrv_co_preadv(bs->file, offset, bytes, qiov, flags); diff --git a/block/blkverify.c b/block/blkverify.c index 667e60d832..f456c99814 100644 --- a/block/blkverify.c +++ b/block/blkverify.c @@ -224,7 +224,7 @@ blkverify_co_prwv(BlockDriverState *bs, BlkverifyReques= t *r, uint64_t offset, } =20 static int coroutine_fn -blkverify_co_preadv(BlockDriverState *bs, uint64_t offset, uint64_t bytes, +blkverify_co_preadv(BlockDriverState *bs, int64_t offset, int64_t bytes, QEMUIOVector *qiov, int flags) { BlkverifyRequest r; diff --git a/block/bochs.c b/block/bochs.c index 32bb83b268..08ae3793e4 100644 --- a/block/bochs.c +++ b/block/bochs.c @@ -238,7 +238,7 @@ static int64_t seek_to_sector(BlockDriverState *bs, int= 64_t sector_num) } =20 static int coroutine_fn -bochs_co_preadv(BlockDriverState *bs, uint64_t offset, uint64_t bytes, +bochs_co_preadv(BlockDriverState *bs, int64_t offset, int64_t bytes, QEMUIOVector *qiov, int flags) { BDRVBochsState *s =3D bs->opaque; diff --git a/block/cloop.c b/block/cloop.c index 4de94876d4..a5db202678 100644 --- a/block/cloop.c +++ b/block/cloop.c @@ -245,7 +245,7 @@ static inline int cloop_read_block(BlockDriverState *bs= , int block_num) } =20 static int coroutine_fn -cloop_co_preadv(BlockDriverState *bs, uint64_t offset, uint64_t bytes, +cloop_co_preadv(BlockDriverState *bs, int64_t offset, int64_t bytes, QEMUIOVector *qiov, int flags) { BDRVCloopState *s =3D bs->opaque; diff --git a/block/commit.c b/block/commit.c index 8e672799af..951e4f623a 100644 --- a/block/commit.c +++ b/block/commit.c @@ -211,7 +211,7 @@ static const BlockJobDriver commit_job_driver =3D { }; =20 static int coroutine_fn bdrv_commit_top_preadv(BlockDriverState *bs, - uint64_t offset, uint64_t bytes, QEMUIOVector *qiov, int flags) + int64_t offset, int64_t bytes, QEMUIOVector *qiov, int flags) { return bdrv_co_preadv(bs->backing, offset, bytes, qiov, flags); } diff --git a/block/copy-on-read.c b/block/copy-on-read.c index 242d3ff055..0f6b5398b1 100644 --- a/block/copy-on-read.c +++ b/block/copy-on-read.c @@ -74,7 +74,7 @@ static int64_t cor_getlength(BlockDriverState *bs) =20 =20 static int coroutine_fn cor_co_preadv(BlockDriverState *bs, - uint64_t offset, uint64_t bytes, + int64_t offset, int64_t bytes, QEMUIOVector *qiov, int flags) { return bdrv_co_preadv(bs->file, offset, bytes, qiov, diff --git a/block/crypto.c b/block/crypto.c index d577f89659..1117b1fafe 100644 --- a/block/crypto.c +++ b/block/crypto.c @@ -335,7 +335,7 @@ static int block_crypto_reopen_prepare(BDRVReopenState = *state, #define BLOCK_CRYPTO_MAX_IO_SIZE (1024 * 1024) =20 static coroutine_fn int -block_crypto_co_preadv(BlockDriverState *bs, uint64_t offset, uint64_t byt= es, +block_crypto_co_preadv(BlockDriverState *bs, int64_t offset, int64_t bytes, QEMUIOVector *qiov, int flags) { BlockCrypto *crypto =3D bs->opaque; diff --git a/block/curl.c b/block/curl.c index 6e325901dc..305a7a5e95 100644 --- a/block/curl.c +++ b/block/curl.c @@ -922,7 +922,7 @@ out: } =20 static int coroutine_fn curl_co_preadv(BlockDriverState *bs, - uint64_t offset, uint64_t bytes, QEMUIOVector *qiov, int flags) + int64_t offset, int64_t bytes, QEMUIOVector *qiov, int flags) { CURLAIOCB acb =3D { .co =3D qemu_coroutine_self(), diff --git a/block/dmg.c b/block/dmg.c index 4a045f2b3e..c378b4f555 100644 --- a/block/dmg.c +++ b/block/dmg.c @@ -689,7 +689,7 @@ static inline int dmg_read_chunk(BlockDriverState *bs, = uint64_t sector_num) } =20 static int coroutine_fn -dmg_co_preadv(BlockDriverState *bs, uint64_t offset, uint64_t bytes, +dmg_co_preadv(BlockDriverState *bs, int64_t offset, int64_t bytes, QEMUIOVector *qiov, int flags) { BDRVDMGState *s =3D bs->opaque; diff --git a/block/file-posix.c b/block/file-posix.c index 7e19bbff5f..87415a0a3c 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -1941,8 +1941,8 @@ static int coroutine_fn raw_co_prw(BlockDriverState *= bs, uint64_t offset, return raw_thread_pool_submit(bs, handle_aiocb_rw, &acb); } =20 -static int coroutine_fn raw_co_preadv(BlockDriverState *bs, uint64_t offse= t, - uint64_t bytes, QEMUIOVector *qiov, +static int coroutine_fn raw_co_preadv(BlockDriverState *bs, int64_t offset, + int64_t bytes, QEMUIOVector *qiov, int flags) { return raw_co_prw(bs, offset, bytes, qiov, QEMU_AIO_READ); diff --git a/block/filter-compress.c b/block/filter-compress.c index 82c315b298..496bbd9e4b 100644 --- a/block/filter-compress.c +++ b/block/filter-compress.c @@ -62,7 +62,7 @@ static int64_t compress_getlength(BlockDriverState *bs) =20 =20 static int coroutine_fn compress_co_preadv_part(BlockDriverState *bs, - uint64_t offset, uint64_t = bytes, + int64_t offset, int64_t by= tes, QEMUIOVector *qiov, size_t qiov_offset, int flags) diff --git a/block/mirror.c b/block/mirror.c index c26fd9260d..51ff4ffd43 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -1365,7 +1365,7 @@ static void coroutine_fn active_write_settle(MirrorOp= *op) } =20 static int coroutine_fn bdrv_mirror_top_preadv(BlockDriverState *bs, - uint64_t offset, uint64_t bytes, QEMUIOVector *qiov, int flags) + int64_t offset, int64_t bytes, QEMUIOVector *qiov, int flags) { return bdrv_co_preadv(bs->backing, offset, bytes, qiov, flags); } diff --git a/block/nbd.c b/block/nbd.c index 2160859f64..d878caa7ad 100644 --- a/block/nbd.c +++ b/block/nbd.c @@ -1160,8 +1160,8 @@ static int nbd_co_request(BlockDriverState *bs, NBDRe= quest *request, return ret ? ret : request_ret; } =20 -static int nbd_client_co_preadv(BlockDriverState *bs, uint64_t offset, - uint64_t bytes, QEMUIOVector *qiov, int fl= ags) +static int nbd_client_co_preadv(BlockDriverState *bs, int64_t offset, + int64_t bytes, QEMUIOVector *qiov, int fla= gs) { int ret, request_ret; Error *local_err =3D NULL; diff --git a/block/nfs.c b/block/nfs.c index cc2413d5ab..7bcb068715 100644 --- a/block/nfs.c +++ b/block/nfs.c @@ -263,8 +263,8 @@ nfs_co_generic_cb(int ret, struct nfs_context *nfs, voi= d *data, nfs_co_generic_bh_cb, task); } =20 -static int coroutine_fn nfs_co_preadv(BlockDriverState *bs, uint64_t offse= t, - uint64_t bytes, QEMUIOVector *iov, +static int coroutine_fn nfs_co_preadv(BlockDriverState *bs, int64_t offset, + int64_t bytes, QEMUIOVector *iov, int flags) { NFSClient *client =3D bs->opaque; diff --git a/block/null.c b/block/null.c index 15e1d56746..483e1eebb2 100644 --- a/block/null.c +++ b/block/null.c @@ -116,7 +116,7 @@ static coroutine_fn int null_co_common(BlockDriverState= *bs) } =20 static coroutine_fn int null_co_preadv(BlockDriverState *bs, - uint64_t offset, uint64_t bytes, + int64_t offset, int64_t bytes, QEMUIOVector *qiov, int flags) { BDRVNullState *s =3D bs->opaque; @@ -187,7 +187,7 @@ static inline BlockAIOCB *null_aio_common(BlockDriverSt= ate *bs, } =20 static BlockAIOCB *null_aio_preadv(BlockDriverState *bs, - uint64_t offset, uint64_t bytes, + int64_t offset, int64_t bytes, QEMUIOVector *qiov, int flags, BlockCompletionFunc *cb, void *opaque) diff --git a/block/nvme.c b/block/nvme.c index 7b7c0cc5d6..254943672a 100644 --- a/block/nvme.c +++ b/block/nvme.c @@ -1062,7 +1062,7 @@ static int nvme_co_prw(BlockDriverState *bs, uint64_t= offset, uint64_t bytes, } =20 static coroutine_fn int nvme_co_preadv(BlockDriverState *bs, - uint64_t offset, uint64_t bytes, + int64_t offset, int64_t bytes, QEMUIOVector *qiov, int flags) { return nvme_co_prw(bs, offset, bytes, qiov, false, flags); diff --git a/block/qcow.c b/block/qcow.c index 8973e4e565..b3376465f4 100644 --- a/block/qcow.c +++ b/block/qcow.c @@ -628,8 +628,8 @@ static void qcow_refresh_limits(BlockDriverState *bs, E= rror **errp) bs->bl.request_alignment =3D BDRV_SECTOR_SIZE; } =20 -static coroutine_fn int qcow_co_preadv(BlockDriverState *bs, uint64_t offs= et, - uint64_t bytes, QEMUIOVector *qiov, +static coroutine_fn int qcow_co_preadv(BlockDriverState *bs, int64_t offse= t, + int64_t bytes, QEMUIOVector *qiov, int flags) { BDRVQcowState *s =3D bs->opaque; diff --git a/block/qcow2.c b/block/qcow2.c index b524b0c53f..45ed81304a 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -2202,7 +2202,7 @@ static coroutine_fn int qcow2_co_preadv_task_entry(Ai= oTask *task) } =20 static coroutine_fn int qcow2_co_preadv_part(BlockDriverState *bs, - uint64_t offset, uint64_t byt= es, + int64_t offset, int64_t bytes, QEMUIOVector *qiov, size_t qiov_offset, int flags) { diff --git a/block/quorum.c b/block/quorum.c index 6d7a56bd93..b51d6bdc41 100644 --- a/block/quorum.c +++ b/block/quorum.c @@ -660,8 +660,8 @@ static int read_fifo_child(QuorumAIOCB *acb) return ret; } =20 -static int quorum_co_preadv(BlockDriverState *bs, uint64_t offset, - uint64_t bytes, QEMUIOVector *qiov, int flags) +static int quorum_co_preadv(BlockDriverState *bs, int64_t offset, int64_t = bytes, + QEMUIOVector *qiov, int flags) { BDRVQuorumState *s =3D bs->opaque; QuorumAIOCB *acb =3D quorum_aio_get(bs, qiov, offset, bytes, flags); diff --git a/block/raw-format.c b/block/raw-format.c index 93b25e1b6b..edce5f66c5 100644 --- a/block/raw-format.c +++ b/block/raw-format.c @@ -171,8 +171,8 @@ static void raw_reopen_abort(BDRVReopenState *state) } =20 /* Check and adjust the offset, against 'offset' and 'size' options. */ -static inline int raw_adjust_offset(BlockDriverState *bs, uint64_t *offset, - uint64_t bytes, bool is_write) +static inline int raw_adjust_offset(BlockDriverState *bs, int64_t *offset, + int64_t bytes, bool is_write) { BDRVRawState *s =3D bs->opaque; =20 @@ -191,8 +191,8 @@ static inline int raw_adjust_offset(BlockDriverState *b= s, uint64_t *offset, return 0; } =20 -static int coroutine_fn raw_co_preadv(BlockDriverState *bs, uint64_t offse= t, - uint64_t bytes, QEMUIOVector *qiov, +static int coroutine_fn raw_co_preadv(BlockDriverState *bs, int64_t offset, + int64_t bytes, QEMUIOVector *qiov, int flags) { int ret; @@ -249,7 +249,7 @@ static int coroutine_fn raw_co_pwritev(BlockDriverState= *bs, uint64_t offset, qiov =3D &local_qiov; } =20 - ret =3D raw_adjust_offset(bs, &offset, bytes, true); + ret =3D raw_adjust_offset(bs, (int64_t *)&offset, bytes, true); if (ret) { goto fail; } @@ -284,7 +284,7 @@ static int coroutine_fn raw_co_pwrite_zeroes(BlockDrive= rState *bs, { int ret; =20 - ret =3D raw_adjust_offset(bs, (uint64_t *)&offset, bytes, true); + ret =3D raw_adjust_offset(bs, (int64_t *)&offset, bytes, true); if (ret) { return ret; } @@ -296,7 +296,7 @@ static int coroutine_fn raw_co_pdiscard(BlockDriverStat= e *bs, { int ret; =20 - ret =3D raw_adjust_offset(bs, (uint64_t *)&offset, bytes, true); + ret =3D raw_adjust_offset(bs, &offset, bytes, true); if (ret) { return ret; } @@ -516,7 +516,7 @@ static int coroutine_fn raw_co_copy_range_from(BlockDri= verState *bs, { int ret; =20 - ret =3D raw_adjust_offset(bs, &src_offset, bytes, false); + ret =3D raw_adjust_offset(bs, (int64_t *)&src_offset, bytes, false); if (ret) { return ret; } @@ -535,7 +535,7 @@ static int coroutine_fn raw_co_copy_range_to(BlockDrive= rState *bs, { int ret; =20 - ret =3D raw_adjust_offset(bs, &dst_offset, bytes, true); + ret =3D raw_adjust_offset(bs, (int64_t *)&dst_offset, bytes, true); if (ret) { return ret; } diff --git a/block/rbd.c b/block/rbd.c index e637639a07..bc96e69fe9 100644 --- a/block/rbd.c +++ b/block/rbd.c @@ -1034,7 +1034,7 @@ failed: } =20 static BlockAIOCB *qemu_rbd_aio_preadv(BlockDriverState *bs, - uint64_t offset, uint64_t bytes, + int64_t offset, int64_t bytes, QEMUIOVector *qiov, int flags, BlockCompletionFunc *cb, void *opaque) diff --git a/block/throttle.c b/block/throttle.c index 71f4bb0ad1..81ff98ac30 100644 --- a/block/throttle.c +++ b/block/throttle.c @@ -114,7 +114,7 @@ static int64_t throttle_getlength(BlockDriverState *bs) } =20 static int coroutine_fn throttle_co_preadv(BlockDriverState *bs, - uint64_t offset, uint64_t bytes, + int64_t offset, int64_t bytes, QEMUIOVector *qiov, int flags) { =20 diff --git a/block/vdi.c b/block/vdi.c index e1a11f2aa0..0b395dc3cc 100644 --- a/block/vdi.c +++ b/block/vdi.c @@ -547,7 +547,7 @@ static int coroutine_fn vdi_co_block_status(BlockDriver= State *bs, } =20 static int coroutine_fn -vdi_co_preadv(BlockDriverState *bs, uint64_t offset, uint64_t bytes, +vdi_co_preadv(BlockDriverState *bs, int64_t offset, int64_t bytes, QEMUIOVector *qiov, int flags) { BDRVVdiState *s =3D bs->opaque; diff --git a/block/vmdk.c b/block/vmdk.c index 218d9c9800..acad4118e4 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -1868,7 +1868,7 @@ static int vmdk_read_extent(VmdkExtent *extent, int64= _t cluster_offset, } =20 static int coroutine_fn -vmdk_co_preadv(BlockDriverState *bs, uint64_t offset, uint64_t bytes, +vmdk_co_preadv(BlockDriverState *bs, int64_t offset, int64_t bytes, QEMUIOVector *qiov, int flags) { BDRVVmdkState *s =3D bs->opaque; diff --git a/block/vpc.c b/block/vpc.c index d8141b52da..cc9c9b2297 100644 --- a/block/vpc.c +++ b/block/vpc.c @@ -611,7 +611,7 @@ static int vpc_get_info(BlockDriverState *bs, BlockDriv= erInfo *bdi) } =20 static int coroutine_fn -vpc_co_preadv(BlockDriverState *bs, uint64_t offset, uint64_t bytes, +vpc_co_preadv(BlockDriverState *bs, int64_t offset, int64_t bytes, QEMUIOVector *qiov, int flags) { BDRVVPCState *s =3D bs->opaque; diff --git a/block/vvfat.c b/block/vvfat.c index ab800c4887..b177ee7672 100644 --- a/block/vvfat.c +++ b/block/vvfat.c @@ -1538,7 +1538,7 @@ static int vvfat_read(BlockDriverState *bs, int64_t s= ector_num, } =20 static int coroutine_fn -vvfat_co_preadv(BlockDriverState *bs, uint64_t offset, uint64_t bytes, +vvfat_co_preadv(BlockDriverState *bs, int64_t offset, int64_t bytes, QEMUIOVector *qiov, int flags) { int ret; diff --git a/tests/test-bdrv-drain.c b/tests/test-bdrv-drain.c index fa0e6a648b..c03b021777 100644 --- a/tests/test-bdrv-drain.c +++ b/tests/test-bdrv-drain.c @@ -65,7 +65,7 @@ static void co_reenter_bh(void *opaque) } =20 static int coroutine_fn bdrv_test_co_preadv(BlockDriverState *bs, - uint64_t offset, uint64_t byte= s, + int64_t offset, int64_t bytes, QEMUIOVector *qiov, int flags) { BDRVTestState *s =3D bs->opaque; @@ -1120,7 +1120,7 @@ static void bdrv_test_top_close(BlockDriverState *bs) } =20 static int coroutine_fn bdrv_test_top_co_preadv(BlockDriverState *bs, - uint64_t offset, uint64_t = bytes, + int64_t offset, int64_t by= tes, QEMUIOVector *qiov, int fl= ags) { BDRVTestTopState *tts =3D bs->opaque; @@ -1862,8 +1862,8 @@ static void bdrv_replace_test_close(BlockDriverState = *bs) * Set .has_read to true and return success. */ static int coroutine_fn bdrv_replace_test_co_preadv(BlockDriverState *bs, - uint64_t offset, - uint64_t bytes, + int64_t offset, + int64_t bytes, QEMUIOVector *qiov, int flags) { --=20 2.21.0 From nobody Thu May 2 14:29:44 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=none dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1587976725; cv=pass; d=zohomail.com; s=zohoarc; b=BTWowswDtztONHTBmCDOj3NwZ2/QbM8XGqOsdAlTGzFfHxpU8TZWzFcDlG+uadHa4sQ9ERKIT6+LzZSNgl0gG9nnfBygxtLgmU6vLyqJ9dm3v3OdSlEJopJSakhu1KoUzQDAsixGTsOqJPgcoTcEODzAsw5Gn8TTk0X2HLuKheo= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587976725; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=kKJybAKx5fGg1Vrj9MKOjYm63lm8uHJBypGDTLWOa38=; b=Lr0KscRRma/YBVS7aJ+MciNJsVKq2FIFgQejtaATCmvdGr5Vh3M8S5GRebPTiTIzGDY/Ac2ztplAupHI4Gvi979i50H3crJqaDBCYcmc4j/A5mT63a89akyIMxG0TmheToIJrHDEYDV5iap5pRbVt6Bte0pjM6GM3oFSeLFib0Q= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1587976725582758.1597461103607; Mon, 27 Apr 2020 01:38:45 -0700 (PDT) Received: from localhost ([::1]:59642 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSzHo-0004ip-1x for importer@patchew.org; Mon, 27 Apr 2020 04:38:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49100) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSz3y-0003Rb-LO for qemu-devel@nongnu.org; Mon, 27 Apr 2020 04:24:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jSz3s-00009e-LE for qemu-devel@nongnu.org; Mon, 27 Apr 2020 04:24:26 -0400 Received: from mail-eopbgr130137.outbound.protection.outlook.com ([40.107.13.137]:50950 helo=EUR01-HE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jSz3n-0007sD-3J; Mon, 27 Apr 2020 04:24:15 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM7PR08MB5495.eurprd08.prod.outlook.com (2603:10a6:20b:104::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13; Mon, 27 Apr 2020 08:24:11 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::acfa:5:88c8:b7b9]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::acfa:5:88c8:b7b9%3]) with mapi id 15.20.2937.020; Mon, 27 Apr 2020 08:24:11 +0000 Received: from localhost.localdomain (185.215.60.182) by FR2P281CA0004.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Mon, 27 Apr 2020 08:24:09 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JFkJpT8ib+PXcDb80b8FAPa4Rlw/4FFA1xxB3vM2/CdOT1RfqQVg7Tc5LrfRq7XycP+ouz/GIms+eRFrcCVjND1si54kP8om8LmrQePFzuPynDC2+Kh2GPQpCNCovlVoZ6oqGAgRgGTpDPlD5+hQfzcem1jEurMMPRs6rTWuwHuKYHtFFqAp5X2qMop+2OsvREeoalBcwDxRXOBINp2S4VmdAl+AqYzCqppY7q1gzk98RO5q7OYq9bIjQqddPAUrTf42XZaiOcf1QJXDF9SXZDT4FDFHmomg/d4Ua1Tt6BOjXYbaxZxoTi5j/ti8s8/I+QrOTxIFdi5cP9c3jfewmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kKJybAKx5fGg1Vrj9MKOjYm63lm8uHJBypGDTLWOa38=; b=L1STYVvlbYeOUi76Jv+NOh0cDpJL+6nUSX+a4gyVjeewG4BSJpdspZ8ZAfViAEopaPFvbm/59b4xVHljwBEZSv2r3CkqMDsFBRd1yAy5NjX9LRoii4axrAamfPr3EkuwAhN3Z2gsQWr5inVSWzkMyKj60vjfqA/aPS6hycaNpZSffB0QpkRvPxqEqNgP82tG9X5jXDsh+/SOSIEveCx7qRp0r5W1qPD5jGKiLIdXZ487rAU12Ameo0TgsxwtAv9on6LVt5lCDHNhQb3gBP824/xwjrrfvPnQhXz0xejVUdedCkx+W11llPcAzNFVSg3ntYv8BSWNPUpBbT3h5WiHhg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kKJybAKx5fGg1Vrj9MKOjYm63lm8uHJBypGDTLWOa38=; b=eJXHiNW27p3sOEdlMveGQK4IaMjDxTJVuNT8arFDG04EXPRewJdxQ1Hk8WIn7ujVwydYLcCyzH0fZIBxXVUc8awHLCcevwyAeFK9kO6RzMucV0fo8PfH2icTSZUedG1qgHjBnUji9y7gPEmlZkoAcg3zelmXRk/j+kRsIRQLOI0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=vsementsov@virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Subject: [PATCH v2 14/17] block: use int64_t instead of uint64_t in driver write handlers Date: Mon, 27 Apr 2020 11:23:22 +0300 Message-Id: <20200427082325.10414-15-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200427082325.10414-1-vsementsov@virtuozzo.com> References: <20200427082325.10414-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: FR2P281CA0004.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::14) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Mailer: git-send-email 2.21.0 X-Originating-IP: [185.215.60.182] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bb085316-d9cd-4f47-cacb-08d7ea845cd2 X-MS-TrafficTypeDiagnostic: AM7PR08MB5495: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:75; X-Forefront-PRVS: 0386B406AA X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(396003)(346002)(136003)(376002)(366004)(39840400004)(1076003)(6666004)(66556008)(66476007)(2616005)(16526019)(6506007)(956004)(66946007)(26005)(2906002)(52116002)(5660300002)(186003)(30864003)(6512007)(7416002)(107886003)(86362001)(36756003)(316002)(4326008)(6916009)(6486002)(69590400007)(8676002)(81156014)(8936002)(478600001)(21314003); DIR:OUT; SFP:1102; Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: iTizcy6F2LFxukXFQDTtDcwA7mYN6Xh3zL1FUPfBQ+a4CxlrAb4iCKVj6sCfyTpMOXybZ7t+oqkJYfw6oIM8pITOQQK2nCAY38p2Gr5mS3M0vDmAFanG0hG89+j7qOBZZLIgSenZ9LoYv3j7UIXXdi2faqWu/suOTmtWdIYE0PBS6F/DVBv0tNhm/J7ikaygZnbWICFKWvjAedpUIjLNre7Yz7rA9cUYdAqMVyySfbS9hjwqaqb/GgBZp8IiV5rBDmNaQE7W55VEtrgLmMUrBXBx0YbeHMNpDaNxpc18VYN7wPperRnQ33Nzs2BalNqEE/zUlrzSn7GXhWbq8BWaVUCTUxws0Kch01Z5tZggL3IG/JY58QvNe8wFbIUbDj4mxqvZukeTXHcTQBPeUHy1eyBHYkDVibOpD1yGguPLVs+9eto7xB8VVv09CkSFjAtr+2M6NNkHwv5TGKS5J3zCC2WFan8G+2ymuit+NiZNl0i5WYh8mH9PqFjp3F7dQrtFpJqlWPXAPDGOYruAPGvj5A== X-MS-Exchange-AntiSpam-MessageData: cIDUeArlOAjj7swvGr/pSATY9RChWPwyd4H2BrlrbB+P1VoaL237GLdaocf0YUau+dFUNS8u2qXoAv0dt0RwgYgG/2ImBtTlSMRLeU+/y6+K3TNucHNZ0WJ3l0IKLur+OQnsHmpp4It8mGzFRxbr3qrEwA4lhr+vsjgpTE6GxSShjGt/oopX4zVHgC030FJVDYJwemNXyRs4+MBO03ea7uS86DZhM3dj86xxqTbzPUboI9SASa/Kdxc0MgLp/PaGCeJhJzOafM/jXEbapF92uTrt4IQpI+P9zZsu9zSw6SFGa9BnRTu0isPSRdYQ8suapjkfmDkuLNGZ/OpiogszKZe2IFuSRoHzNUZUMXatTrj1/2PDH18KtQfBUHu7EfyluOPT66liA+joBWMV69cR91WUKztKq51yoj3SEoVFL8CkEYjAYGvQDt0w2MgTd2g8JA4iZUdKA98GUGXsRYJYrDj24gwTM9OcU7AAodO5JRAS73eEU9/aVl4Lt472UrQrQfZ61nxrSO5q8ZDjoxxNNUyZ6q25043W2I3D7XB46mGdAitjo/U6CQtyay+snLWqz77lIwCaZx/KeSOvVkpnibDN0x7+uSzFVYkAQfMNZt3sNG3Co2iU2rEktPPhOAq6UfgU7WdlWkqZlKGalvseoZI9AGpN0994Pjd83JhKvBz3fRZUGln+NePXN6MQg3+ocriuHHpHpe3kLIYQRtRIr11imxjbSgBZB0QoxVcDf/NpUJyBi5ZGP/TbUiRFsLHElkljJR+Kdf2z/ul8ndnLQlS5WO908ssX1yYr8z5v1YA= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: bb085316-d9cd-4f47-cacb-08d7ea845cd2 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Apr 2020 08:24:11.2365 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: lph/w/5VlZGDNv5/Tyzo8zMZBDn7a8ZucHGgKifun0FQlLbVYPVgoWQgXp7I2Nfp4bnQ++7sA3jzRXP+dkC68az/gBlPLjRBhXWL3ABm/VQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5495 Received-SPF: pass client-ip=40.107.13.137; envelope-from=vsementsov@virtuozzo.com; helo=EUR01-HE1-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/27 04:24:12 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Received-From: 40.107.13.137 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, fam@euphon.net, integration@gluster.org, berto@igalia.com, pavel.dovgaluk@ispras.ru, dillaman@redhat.com, qemu-devel@nongnu.org, pl@kamp.de, ronniesahlberg@gmail.com, mreitz@redhat.com, den@openvz.org, sheepdog@lists.wpkg.org, vsementsov@virtuozzo.com, stefanha@redhat.com, namei.unix@gmail.com, pbonzini@redhat.com, sw@weilnetz.de, jsnow@redhat.com, ari@tuxera.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) Content-Type: text/plain; charset="utf-8" We are generally moving to int64_t for both offset and bytes parameters on all io paths. Convert driver write handlers parameters which are already 64bit to signed type. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/block_int.h | 10 +++++----- block/backup-top.c | 3 +-- block/blkdebug.c | 2 +- block/blklogwrites.c | 2 +- block/blkreplay.c | 2 +- block/blkverify.c | 2 +- block/copy-on-read.c | 2 +- block/crypto.c | 2 +- block/file-posix.c | 4 ++-- block/filter-compress.c | 4 ++-- block/mirror.c | 2 +- block/nbd.c | 4 ++-- block/nfs.c | 4 ++-- block/null.c | 4 ++-- block/nvme.c | 2 +- block/qcow.c | 8 ++++---- block/qcow2.c | 4 ++-- block/quorum.c | 4 ++-- block/raw-format.c | 8 ++++---- block/rbd.c | 2 +- block/throttle.c | 2 +- block/vdi.c | 2 +- block/vmdk.c | 6 +++--- block/vpc.c | 2 +- block/vvfat.c | 4 ++-- block/trace-events | 2 +- 26 files changed, 46 insertions(+), 47 deletions(-) diff --git a/include/block/block_int.h b/include/block/block_int.h index 1588df02c2..0da54cdf48 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -183,7 +183,7 @@ struct BlockDriver { int64_t offset, int64_t bytes, QEMUIOVector *qiov, int flags, BlockCompletionFunc *cb, void *opaque); BlockAIOCB *(*bdrv_aio_pwritev)(BlockDriverState *bs, - uint64_t offset, uint64_t bytes, QEMUIOVector *qiov, int flags, + int64_t offset, int64_t bytes, QEMUIOVector *qiov, int flags, BlockCompletionFunc *cb, void *opaque); BlockAIOCB *(*bdrv_aio_flush)(BlockDriverState *bs, BlockCompletionFunc *cb, void *opaque); @@ -232,9 +232,9 @@ struct BlockDriver { * The buffer in @qiov may point directly to guest memory. */ int coroutine_fn (*bdrv_co_pwritev)(BlockDriverState *bs, - uint64_t offset, uint64_t bytes, QEMUIOVector *qiov, int flags); + int64_t offset, int64_t bytes, QEMUIOVector *qiov, int flags); int coroutine_fn (*bdrv_co_pwritev_part)(BlockDriverState *bs, - uint64_t offset, uint64_t bytes, + int64_t offset, int64_t bytes, QEMUIOVector *qiov, size_t qiov_offset, int flags); =20 /* @@ -364,9 +364,9 @@ struct BlockDriver { Error **errp); =20 int coroutine_fn (*bdrv_co_pwritev_compressed)(BlockDriverState *bs, - uint64_t offset, uint64_t bytes, QEMUIOVector *qiov); + int64_t offset, int64_t bytes, QEMUIOVector *qiov); int coroutine_fn (*bdrv_co_pwritev_compressed_part)(BlockDriverState *= bs, - uint64_t offset, uint64_t bytes, QEMUIOVector *qiov, + int64_t offset, int64_t bytes, QEMUIOVector *qiov, size_t qiov_offset); =20 int (*bdrv_snapshot_create)(BlockDriverState *bs, diff --git a/block/backup-top.c b/block/backup-top.c index 49fd8763cc..4190d465d6 100644 --- a/block/backup-top.c +++ b/block/backup-top.c @@ -87,8 +87,7 @@ static int coroutine_fn backup_top_co_pwrite_zeroes(Block= DriverState *bs, } =20 static coroutine_fn int backup_top_co_pwritev(BlockDriverState *bs, - uint64_t offset, - uint64_t bytes, + int64_t offset, int64_t byte= s, QEMUIOVector *qiov, int flag= s) { int ret =3D backup_top_cbw(bs, offset, bytes, flags); diff --git a/block/blkdebug.c b/block/blkdebug.c index b61275f229..b4d0966982 100644 --- a/block/blkdebug.c +++ b/block/blkdebug.c @@ -640,7 +640,7 @@ blkdebug_co_preadv(BlockDriverState *bs, int64_t offset= , int64_t bytes, } =20 static int coroutine_fn -blkdebug_co_pwritev(BlockDriverState *bs, uint64_t offset, uint64_t bytes, +blkdebug_co_pwritev(BlockDriverState *bs, int64_t offset, int64_t bytes, QEMUIOVector *qiov, int flags) { int err; diff --git a/block/blklogwrites.c b/block/blklogwrites.c index 6e5bd09993..890a61dfba 100644 --- a/block/blklogwrites.c +++ b/block/blklogwrites.c @@ -466,7 +466,7 @@ blk_log_writes_co_do_file_pdiscard(BlkLogWritesFileReq = *fr) } =20 static int coroutine_fn -blk_log_writes_co_pwritev(BlockDriverState *bs, uint64_t offset, uint64_t = bytes, +blk_log_writes_co_pwritev(BlockDriverState *bs, int64_t offset, int64_t by= tes, QEMUIOVector *qiov, int flags) { return blk_log_writes_co_log(bs, offset, bytes, qiov, flags, diff --git a/block/blkreplay.c b/block/blkreplay.c index 70bc1158e1..d93383a88f 100644 --- a/block/blkreplay.c +++ b/block/blkreplay.c @@ -84,7 +84,7 @@ static int coroutine_fn blkreplay_co_preadv(BlockDriverSt= ate *bs, } =20 static int coroutine_fn blkreplay_co_pwritev(BlockDriverState *bs, - uint64_t offset, uint64_t bytes, QEMUIOVector *qiov, int flags) + int64_t offset, int64_t bytes, QEMUIOVector *qiov, int flags) { uint64_t reqid =3D blkreplay_next_id(); int ret =3D bdrv_co_pwritev(bs->file, offset, bytes, qiov, flags); diff --git a/block/blkverify.c b/block/blkverify.c index f456c99814..a3c447fc68 100644 --- a/block/blkverify.c +++ b/block/blkverify.c @@ -253,7 +253,7 @@ blkverify_co_preadv(BlockDriverState *bs, int64_t offse= t, int64_t bytes, } =20 static int coroutine_fn -blkverify_co_pwritev(BlockDriverState *bs, uint64_t offset, uint64_t bytes, +blkverify_co_pwritev(BlockDriverState *bs, int64_t offset, int64_t bytes, QEMUIOVector *qiov, int flags) { BlkverifyRequest r; diff --git a/block/copy-on-read.c b/block/copy-on-read.c index 0f6b5398b1..fc3186bacb 100644 --- a/block/copy-on-read.c +++ b/block/copy-on-read.c @@ -83,7 +83,7 @@ static int coroutine_fn cor_co_preadv(BlockDriverState *b= s, =20 =20 static int coroutine_fn cor_co_pwritev(BlockDriverState *bs, - uint64_t offset, uint64_t bytes, + int64_t offset, int64_t bytes, QEMUIOVector *qiov, int flags) { =20 diff --git a/block/crypto.c b/block/crypto.c index 1117b1fafe..ecb5697a4b 100644 --- a/block/crypto.c +++ b/block/crypto.c @@ -398,7 +398,7 @@ block_crypto_co_preadv(BlockDriverState *bs, int64_t of= fset, int64_t bytes, =20 =20 static coroutine_fn int -block_crypto_co_pwritev(BlockDriverState *bs, uint64_t offset, uint64_t by= tes, +block_crypto_co_pwritev(BlockDriverState *bs, int64_t offset, int64_t byte= s, QEMUIOVector *qiov, int flags) { BlockCrypto *crypto =3D bs->opaque; diff --git a/block/file-posix.c b/block/file-posix.c index 87415a0a3c..688f2fa54c 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -1948,8 +1948,8 @@ static int coroutine_fn raw_co_preadv(BlockDriverStat= e *bs, int64_t offset, return raw_co_prw(bs, offset, bytes, qiov, QEMU_AIO_READ); } =20 -static int coroutine_fn raw_co_pwritev(BlockDriverState *bs, uint64_t offs= et, - uint64_t bytes, QEMUIOVector *qiov, +static int coroutine_fn raw_co_pwritev(BlockDriverState *bs, int64_t offse= t, + int64_t bytes, QEMUIOVector *qiov, int flags) { assert(flags =3D=3D 0); diff --git a/block/filter-compress.c b/block/filter-compress.c index 496bbd9e4b..f2400fea37 100644 --- a/block/filter-compress.c +++ b/block/filter-compress.c @@ -73,8 +73,8 @@ static int coroutine_fn compress_co_preadv_part(BlockDriv= erState *bs, =20 =20 static int coroutine_fn compress_co_pwritev_part(BlockDriverState *bs, - uint64_t offset, - uint64_t bytes, + int64_t offset, + int64_t bytes, QEMUIOVector *qiov, size_t qiov_offset, int f= lags) { diff --git a/block/mirror.c b/block/mirror.c index 51ff4ffd43..687a91e654 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -1419,7 +1419,7 @@ out: } =20 static int coroutine_fn bdrv_mirror_top_pwritev(BlockDriverState *bs, - uint64_t offset, uint64_t bytes, QEMUIOVector *qiov, int flags) + int64_t offset, int64_t bytes, QEMUIOVector *qiov, int flags) { MirrorBDSOpaque *s =3D bs->opaque; QEMUIOVector bounce_qiov; diff --git a/block/nbd.c b/block/nbd.c index d878caa7ad..54bce3911e 100644 --- a/block/nbd.c +++ b/block/nbd.c @@ -1218,8 +1218,8 @@ static int nbd_client_co_preadv(BlockDriverState *bs,= int64_t offset, return ret ? ret : request_ret; } =20 -static int nbd_client_co_pwritev(BlockDriverState *bs, uint64_t offset, - uint64_t bytes, QEMUIOVector *qiov, int f= lags) +static int nbd_client_co_pwritev(BlockDriverState *bs, int64_t offset, + int64_t bytes, QEMUIOVector *qiov, int fl= ags) { BDRVNBDState *s =3D (BDRVNBDState *)bs->opaque; NBDRequest request =3D { diff --git a/block/nfs.c b/block/nfs.c index 7bcb068715..d59d8e7d32 100644 --- a/block/nfs.c +++ b/block/nfs.c @@ -298,8 +298,8 @@ static int coroutine_fn nfs_co_preadv(BlockDriverState = *bs, int64_t offset, return 0; } =20 -static int coroutine_fn nfs_co_pwritev(BlockDriverState *bs, uint64_t offs= et, - uint64_t bytes, QEMUIOVector *iov, +static int coroutine_fn nfs_co_pwritev(BlockDriverState *bs, int64_t offse= t, + int64_t bytes, QEMUIOVector *iov, int flags) { NFSClient *client =3D bs->opaque; diff --git a/block/null.c b/block/null.c index 483e1eebb2..cac37e7ba6 100644 --- a/block/null.c +++ b/block/null.c @@ -129,7 +129,7 @@ static coroutine_fn int null_co_preadv(BlockDriverState= *bs, } =20 static coroutine_fn int null_co_pwritev(BlockDriverState *bs, - uint64_t offset, uint64_t bytes, + int64_t offset, int64_t bytes, QEMUIOVector *qiov, int flags) { return null_co_common(bs); @@ -202,7 +202,7 @@ static BlockAIOCB *null_aio_preadv(BlockDriverState *bs, } =20 static BlockAIOCB *null_aio_pwritev(BlockDriverState *bs, - uint64_t offset, uint64_t bytes, + int64_t offset, int64_t bytes, QEMUIOVector *qiov, int flags, BlockCompletionFunc *cb, void *opaque) diff --git a/block/nvme.c b/block/nvme.c index 254943672a..db7fffe94f 100644 --- a/block/nvme.c +++ b/block/nvme.c @@ -1069,7 +1069,7 @@ static coroutine_fn int nvme_co_preadv(BlockDriverSta= te *bs, } =20 static coroutine_fn int nvme_co_pwritev(BlockDriverState *bs, - uint64_t offset, uint64_t bytes, + int64_t offset, int64_t bytes, QEMUIOVector *qiov, int flags) { return nvme_co_prw(bs, offset, bytes, qiov, true, flags); diff --git a/block/qcow.c b/block/qcow.c index b3376465f4..9583e8e8b2 100644 --- a/block/qcow.c +++ b/block/qcow.c @@ -725,8 +725,8 @@ static coroutine_fn int qcow_co_preadv(BlockDriverState= *bs, int64_t offset, return ret; } =20 -static coroutine_fn int qcow_co_pwritev(BlockDriverState *bs, uint64_t off= set, - uint64_t bytes, QEMUIOVector *qiov, +static coroutine_fn int qcow_co_pwritev(BlockDriverState *bs, int64_t offs= et, + int64_t bytes, QEMUIOVector *qiov, int flags) { BDRVQcowState *s =3D bs->opaque; @@ -1049,8 +1049,8 @@ static int qcow_make_empty(BlockDriverState *bs) /* XXX: put compressed sectors first, then all the cluster aligned tables to avoid losing bytes in alignment */ static coroutine_fn int -qcow_co_pwritev_compressed(BlockDriverState *bs, uint64_t offset, - uint64_t bytes, QEMUIOVector *qiov) +qcow_co_pwritev_compressed(BlockDriverState *bs, int64_t offset, int64_t b= ytes, + QEMUIOVector *qiov) { BDRVQcowState *s =3D bs->opaque; z_stream strm; diff --git a/block/qcow2.c b/block/qcow2.c index 45ed81304a..ed5e456b09 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -2475,7 +2475,7 @@ static coroutine_fn int qcow2_co_pwritev_task_entry(A= ioTask *task) } =20 static coroutine_fn int qcow2_co_pwritev_part( - BlockDriverState *bs, uint64_t offset, uint64_t bytes, + BlockDriverState *bs, int64_t offset, int64_t bytes, QEMUIOVector *qiov, size_t qiov_offset, int flags) { BDRVQcow2State *s =3D bs->opaque; @@ -4328,7 +4328,7 @@ static coroutine_fn int qcow2_co_pwritev_compressed_t= ask_entry(AioTask *task) */ static coroutine_fn int qcow2_co_pwritev_compressed_part(BlockDriverState *bs, - uint64_t offset, uint64_t bytes, + int64_t offset, int64_t bytes, QEMUIOVector *qiov, size_t qiov_offset) { BDRVQcow2State *s =3D bs->opaque; diff --git a/block/quorum.c b/block/quorum.c index b51d6bdc41..4164c3fbf8 100644 --- a/block/quorum.c +++ b/block/quorum.c @@ -706,8 +706,8 @@ static void write_quorum_entry(void *opaque) } } =20 -static int quorum_co_pwritev(BlockDriverState *bs, uint64_t offset, - uint64_t bytes, QEMUIOVector *qiov, int flags) +static int quorum_co_pwritev(BlockDriverState *bs, int64_t offset, + int64_t bytes, QEMUIOVector *qiov, int flags) { BDRVQuorumState *s =3D bs->opaque; QuorumAIOCB *acb =3D quorum_aio_get(bs, qiov, offset, bytes, flags); diff --git a/block/raw-format.c b/block/raw-format.c index edce5f66c5..d5ff7012b7 100644 --- a/block/raw-format.c +++ b/block/raw-format.c @@ -206,8 +206,8 @@ static int coroutine_fn raw_co_preadv(BlockDriverState = *bs, int64_t offset, return bdrv_co_preadv(bs->file, offset, bytes, qiov, flags); } =20 -static int coroutine_fn raw_co_pwritev(BlockDriverState *bs, uint64_t offs= et, - uint64_t bytes, QEMUIOVector *qiov, +static int coroutine_fn raw_co_pwritev(BlockDriverState *bs, int64_t offse= t, + int64_t bytes, QEMUIOVector *qiov, int flags) { void *buf =3D NULL; @@ -249,7 +249,7 @@ static int coroutine_fn raw_co_pwritev(BlockDriverState= *bs, uint64_t offset, qiov =3D &local_qiov; } =20 - ret =3D raw_adjust_offset(bs, (int64_t *)&offset, bytes, true); + ret =3D raw_adjust_offset(bs, &offset, bytes, true); if (ret) { goto fail; } @@ -284,7 +284,7 @@ static int coroutine_fn raw_co_pwrite_zeroes(BlockDrive= rState *bs, { int ret; =20 - ret =3D raw_adjust_offset(bs, (int64_t *)&offset, bytes, true); + ret =3D raw_adjust_offset(bs, &offset, bytes, true); if (ret) { return ret; } diff --git a/block/rbd.c b/block/rbd.c index bc96e69fe9..412df8cdb7 100644 --- a/block/rbd.c +++ b/block/rbd.c @@ -1044,7 +1044,7 @@ static BlockAIOCB *qemu_rbd_aio_preadv(BlockDriverSta= te *bs, } =20 static BlockAIOCB *qemu_rbd_aio_pwritev(BlockDriverState *bs, - uint64_t offset, uint64_t bytes, + int64_t offset, int64_t bytes, QEMUIOVector *qiov, int flags, BlockCompletionFunc *cb, void *opaque) diff --git a/block/throttle.c b/block/throttle.c index 81ff98ac30..28e73073e7 100644 --- a/block/throttle.c +++ b/block/throttle.c @@ -125,7 +125,7 @@ static int coroutine_fn throttle_co_preadv(BlockDriverS= tate *bs, } =20 static int coroutine_fn throttle_co_pwritev(BlockDriverState *bs, - uint64_t offset, uint64_t byte= s, + int64_t offset, int64_t bytes, QEMUIOVector *qiov, int flags) { ThrottleGroupMember *tgm =3D bs->opaque; diff --git a/block/vdi.c b/block/vdi.c index 0b395dc3cc..07ad195239 100644 --- a/block/vdi.c +++ b/block/vdi.c @@ -603,7 +603,7 @@ vdi_co_preadv(BlockDriverState *bs, int64_t offset, int= 64_t bytes, } =20 static int coroutine_fn -vdi_co_pwritev(BlockDriverState *bs, uint64_t offset, uint64_t bytes, +vdi_co_pwritev(BlockDriverState *bs, int64_t offset, int64_t bytes, QEMUIOVector *qiov, int flags) { BDRVVdiState *s =3D bs->opaque; diff --git a/block/vmdk.c b/block/vmdk.c index acad4118e4..a88e9c9ba4 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -2048,7 +2048,7 @@ static int vmdk_pwritev(BlockDriverState *bs, uint64_= t offset, } =20 static int coroutine_fn -vmdk_co_pwritev(BlockDriverState *bs, uint64_t offset, uint64_t bytes, +vmdk_co_pwritev(BlockDriverState *bs, int64_t offset, int64_t bytes, QEMUIOVector *qiov, int flags) { int ret; @@ -2060,8 +2060,8 @@ vmdk_co_pwritev(BlockDriverState *bs, uint64_t offset= , uint64_t bytes, } =20 static int coroutine_fn -vmdk_co_pwritev_compressed(BlockDriverState *bs, uint64_t offset, - uint64_t bytes, QEMUIOVector *qiov) +vmdk_co_pwritev_compressed(BlockDriverState *bs, int64_t offset, int64_t b= ytes, + QEMUIOVector *qiov) { if (bytes =3D=3D 0) { /* The caller will write bytes 0 to signal EOF. diff --git a/block/vpc.c b/block/vpc.c index cc9c9b2297..90a402eb41 100644 --- a/block/vpc.c +++ b/block/vpc.c @@ -662,7 +662,7 @@ fail: } =20 static int coroutine_fn -vpc_co_pwritev(BlockDriverState *bs, uint64_t offset, uint64_t bytes, +vpc_co_pwritev(BlockDriverState *bs, int64_t offset, int64_t bytes, QEMUIOVector *qiov, int flags) { BDRVVPCState *s =3D bs->opaque; diff --git a/block/vvfat.c b/block/vvfat.c index b177ee7672..97e6b0e2a5 100644 --- a/block/vvfat.c +++ b/block/vvfat.c @@ -3073,7 +3073,7 @@ DLOG(checkpoint()); } =20 static int coroutine_fn -vvfat_co_pwritev(BlockDriverState *bs, uint64_t offset, uint64_t bytes, +vvfat_co_pwritev(BlockDriverState *bs, int64_t offset, int64_t bytes, QEMUIOVector *qiov, int flags) { int ret; @@ -3111,7 +3111,7 @@ static int coroutine_fn vvfat_co_block_status(BlockDr= iverState *bs, } =20 static int coroutine_fn -write_target_commit(BlockDriverState *bs, uint64_t offset, uint64_t bytes, +write_target_commit(BlockDriverState *bs, int64_t offset, int64_t bytes, QEMUIOVector *qiov, int flags) { int ret; diff --git a/block/trace-events b/block/trace-events index e4d68438af..b7fc837015 100644 --- a/block/trace-events +++ b/block/trace-events @@ -78,7 +78,7 @@ luring_resubmit_short_read(void *s, void *luringcb, int n= read) "LuringState %p l =20 # qcow2.c qcow2_add_task(void *co, void *bs, void *pool, const char *action, int clu= ster_type, uint64_t file_cluster_offset, uint64_t offset, uint64_t bytes, v= oid *qiov, size_t qiov_offset) "co %p bs %p pool %p: %s: cluster_type %d fi= le_cluster_offset %" PRIu64 " offset %" PRIu64 " bytes %" PRIu64 " qiov %p = qiov_offset %zu" -qcow2_writev_start_req(void *co, int64_t offset, int bytes) "co %p offset = 0x%" PRIx64 " bytes %d" +qcow2_writev_start_req(void *co, int64_t offset, int64_t bytes) "co %p off= set 0x%" PRIx64 " bytes %" PRId64 qcow2_writev_done_req(void *co, int ret) "co %p ret %d" qcow2_writev_start_part(void *co) "co %p" qcow2_writev_done_part(void *co, int cur_bytes) "co %p cur_bytes %d" --=20 2.21.0 From nobody Thu May 2 14:29:44 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=none dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1587976450; cv=pass; d=zohomail.com; s=zohoarc; b=TDNOBLBFJX4WF4Nb+RSNH82R02Ap9Wy5JHWOKY5SHk+Qo1iK3e9ST5D4xN5LLL6YWIokd5AEM9afL5XjLZJ0VkdDz9WR76zv+EHmyotdGaOlnrau8ZQ3QPA/WiYU5v0MHuBFq2iTUBagIvp59M48i4Jcj8EVqOvyUnL8jhoM9Ss= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587976450; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=G3dczDesqXlnvmLcNLNFaJcqNFnn15hJlFlTBgnchYM=; b=WmmYbuyEIcXFUBjc4EXBmCcNVca0a6V7u32j88jKsglWiwT9KlzMY0jigUQ/usweO9Ee1jVX1p0XOtNNBWXHHAcFDBYQptaWYagugP2NgpFRf48n30z9HRH9Kg5m0q+jsCA9I+AHwv+3jk3u0tGXqw5JV7K9qNSEHeJDYqBgeqA= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1587976450974706.9355156419848; Mon, 27 Apr 2020 01:34:10 -0700 (PDT) Received: from localhost ([::1]:59110 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSzDN-0005t0-Ed for importer@patchew.org; Mon, 27 Apr 2020 04:34:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49168) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSz4F-0004Em-Sp for qemu-devel@nongnu.org; Mon, 27 Apr 2020 04:24:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jSz4F-00025v-9u for qemu-devel@nongnu.org; Mon, 27 Apr 2020 04:24:43 -0400 Received: from mail-eopbgr00096.outbound.protection.outlook.com ([40.107.0.96]:55939 helo=EUR02-AM5-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jSz3n-00081B-Ul; Mon, 27 Apr 2020 04:24:16 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM7PR08MB5400.eurprd08.prod.outlook.com (2603:10a6:20b:109::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13; Mon, 27 Apr 2020 08:24:12 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::acfa:5:88c8:b7b9]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::acfa:5:88c8:b7b9%3]) with mapi id 15.20.2937.020; Mon, 27 Apr 2020 08:24:12 +0000 Received: from localhost.localdomain (185.215.60.182) by FR2P281CA0004.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Mon, 27 Apr 2020 08:24:11 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KWboXQTSYNvT3rTOJKg4g34XSysUjn+ppVDo8fZGmBZXOFfuRP3EdkQzkfSFBzWGH+ykdUNG9Q5AL6pTPOMTMyaAUN5p2OTP5BA4Veb4ckmx81W8L7ShNRN6rfDwWFZsA8PTngux03SlOebIyiKJqBVr71z1uFOnLMloHwhp6SjU1/kW1B+O03uTRC7k5RdU2xtV79d/+ejhwIbCGcZKgCXUPDj6T8Z87WBbHYSNJbMEI8rM72pU6tkuypjqqXtSBk4hYZgLdzrimXxsRIcNl2YtNjJYyuLyVhPdhTT2ALOGAPjwRCEubEASy7mBm8dMqxz7WW2htfRLkvOuoJI7ZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=G3dczDesqXlnvmLcNLNFaJcqNFnn15hJlFlTBgnchYM=; b=kmCHw0CijZAXdYZ+OhtzkEw92uHYYTKDsHi+FHU4Yyg75NSUAMjUroxyNH4VZ0uKmDOH5yUpTlqUCKY7UXT9FdKlS+ntHXUM88BLvyTzFe0p/wSXVcFQ6KIRjAIvz26mliL11A6GL2qwU6nEuqlmjuCzuwPrLxBQM68+HCM/1rUTuS1IZ4uGRWca96xwDoxtExOU24ed2t57SFT5A1ChbB0uzjPnx7T9X/civhVdi3StS01LJBYDzuvlgecF3zktVyefMe91s9wS3ux3/ljDHDOvxg7SNAXRkhoZ+I9B3OVdai5qkQsTHf736eIk8Grp/+cCc1YENEI3MUcflk8tSw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=G3dczDesqXlnvmLcNLNFaJcqNFnn15hJlFlTBgnchYM=; b=aFM3M643v3CitmTCcvH361NFbsFu2truL2By4YqEy0ceBRTzvIGuybIPdDB1EPgnVxb4aTrxi6rtRk7is+NemEnQVcGKU/vd+l1HDhaCfRxkqAHi6C552D/Gl5olfKjJcxI4BMetZqiiEj16U+eCnTnywYmIdRFuTfKnwOkBG/Y= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=vsementsov@virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Subject: [PATCH v2 15/17] block: use int64_t instead of uint64_t in copy_range driver handlers Date: Mon, 27 Apr 2020 11:23:23 +0300 Message-Id: <20200427082325.10414-16-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200427082325.10414-1-vsementsov@virtuozzo.com> References: <20200427082325.10414-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: FR2P281CA0004.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::14) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Mailer: git-send-email 2.21.0 X-Originating-IP: [185.215.60.182] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e4ddc97d-e2b5-45b7-fa66-08d7ea845dce X-MS-TrafficTypeDiagnostic: AM7PR08MB5400: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:186; X-Forefront-PRVS: 0386B406AA X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(366004)(107886003)(36756003)(956004)(2616005)(2906002)(4326008)(26005)(6512007)(6916009)(6486002)(5660300002)(6506007)(186003)(69590400007)(1076003)(8676002)(66946007)(498600001)(81156014)(52116002)(86362001)(7416002)(66556008)(6666004)(8936002)(66476007)(16526019); DIR:OUT; SFP:1102; Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OB9xwaMG4WRxqpLJGfZ1qtm5EZ4DuULkm+zsMSP3F2s6g/w81L8lGUTMBGFPqB1O0Vj5g0fo8ZEeEwCVJUOu5LSiaUdbLIy8jFuVdR++gxWt0msrgv/6RLyVLUfAdv7WDpA3Q3D+NL/Nitv/Bd4HHK92QsixhDEstGE+Qwi7s57bJGLZMYBuC6yZ9HeuMUoWbKix20zcMrq75mhVEPZH9WZa2qKMWr8grXlsdPuhedyMJ1pHcMIje+qWnmnnNSvODIJ5UiNFdmUYurIFqKUfm7x2UTeflYPkH0Fzw9E5xeyX7UvsDpu3EI/8MLYRdpPKjxepX8nNshXOG4dSjqPNf3LxAdcla5l44USGL6Pf50Dx08sw5/CiPCvqOrswRtqQgYaJ1HycCXHPKmzmLMd7wR5yQnJ9HzCxKt7Y3dVBWMm8XKCRa2lLAc7Z2IE5fQ578+7NXIDT9q0Sh1lpSBpYZ/ZION90E3gpLpLao0CwaXrAPrC7GfkSPtKqeTsZFT8p X-MS-Exchange-AntiSpam-MessageData: eGLccI4yHPXty+eIkQOBDxYkVG+PbEtiW3+jcd4cR8RmgGCVdGDHLM1Z6pdZd9KHo4om5W59Sk0dByf4chgb9eWVPfmoUd2LJYsP/2ZXba8vPPn3htQRzzB5qEWzbRpwUtwE96AuU1LuXwTj7EwMMYfVxZGvoFOWHZDfyNhSi2uSFeqgk2gDCGRMnHVTw1hOnFKbjivPoQEOw0J1Opep5vC+l4hV9EEkWDYoBYg7+OxOpZvO3M3+Q4yRjUxI4VTmyzzK9/n9PVFJ/H7rZndMVCTy2iCJJcGgBIhmgof7M3MJCWf0TiGwMGuoUUnwzjZmGl3lUaK+wVIF16T1Kl2dTP1yGLTkpEBYeDOHWcOyyksXHFQ6aOd4Gm9f57gPeBhgCYe7AIkVnokZSnAKY+SRodEOrimwlVEjW2qUdIhxsY/kEbk/vcNbrDrWiE74EuXXPutlTacEAWTvzxAtFxOC3YTSdS/yFHH48l/noYFxycCxuW6aBHgeJudgk2rt7KDaGUM6XeQf+QFQsk3Cv4G8NWBwhEmoAz4qH1EZJ7OQU57+CMn8fg4rymTWOiC/rQtCsfA/pz+lb6jRWQz5ewJPCMRKVbRb+GmyfJkaiU/1ho/jv6EwtVymLrhyvNE7bOC+v9V6AUEm8i29uDAARFUqSf32jAQzzwe0QNJU65dUUYQMxucNNU3ErFOuMtUqsdwQKspvTKKT643WrtiXqQAdu5W9asZWMMmGwnMorM7yxosTZ/NdMpXBk0ggHCu3aW3ywyUqbBHq2+TrHshu7PyaguAodBTAItf0HBYTaFL7EWM= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: e4ddc97d-e2b5-45b7-fa66-08d7ea845dce X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Apr 2020 08:24:12.8385 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Dry1AWmb+nQeIR/hK6rNRS2nmtlYZckNdmNokgYnAlUPC47rH6dTAzxT77ymhjw2RP4tjJ1UR/UzFnYe7RapzV7vJcrmYFCyPgtUlNRsPgQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5400 Received-SPF: pass client-ip=40.107.0.96; envelope-from=vsementsov@virtuozzo.com; helo=EUR02-AM5-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/27 04:24:14 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Received-From: 40.107.0.96 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, fam@euphon.net, integration@gluster.org, berto@igalia.com, pavel.dovgaluk@ispras.ru, dillaman@redhat.com, qemu-devel@nongnu.org, pl@kamp.de, ronniesahlberg@gmail.com, mreitz@redhat.com, den@openvz.org, sheepdog@lists.wpkg.org, vsementsov@virtuozzo.com, stefanha@redhat.com, namei.unix@gmail.com, pbonzini@redhat.com, sw@weilnetz.de, jsnow@redhat.com, ari@tuxera.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) Content-Type: text/plain; charset="utf-8" We are generally moving to int64_t for both offset and bytes parameters on all io paths. Convert driver copy_range handlers parameters which are already 64bit to signed type. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/block_int.h | 12 ++++++------ block/file-posix.c | 10 +++++----- block/iscsi.c | 12 ++++++------ block/qcow2.c | 12 ++++++------ block/raw-format.c | 16 ++++++++-------- 5 files changed, 31 insertions(+), 31 deletions(-) diff --git a/include/block/block_int.h b/include/block/block_int.h index 0da54cdf48..ea8fca5e28 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -257,10 +257,10 @@ struct BlockDriver { */ int coroutine_fn (*bdrv_co_copy_range_from)(BlockDriverState *bs, BdrvChild *src, - uint64_t offset, + int64_t offset, BdrvChild *dst, - uint64_t dst_offset, - uint64_t bytes, + int64_t dst_offset, + int64_t bytes, BdrvRequestFlags read_flag= s, BdrvRequestFlags write_fla= gs); =20 @@ -274,10 +274,10 @@ struct BlockDriver { */ int coroutine_fn (*bdrv_co_copy_range_to)(BlockDriverState *bs, BdrvChild *src, - uint64_t src_offset, + int64_t src_offset, BdrvChild *dst, - uint64_t dst_offset, - uint64_t bytes, + int64_t dst_offset, + int64_t bytes, BdrvRequestFlags read_flags, BdrvRequestFlags write_flags= ); =20 diff --git a/block/file-posix.c b/block/file-posix.c index 688f2fa54c..76da620135 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -3034,8 +3034,8 @@ static void raw_abort_perm_update(BlockDriverState *b= s) } =20 static int coroutine_fn raw_co_copy_range_from( - BlockDriverState *bs, BdrvChild *src, uint64_t src_offset, - BdrvChild *dst, uint64_t dst_offset, uint64_t bytes, + BlockDriverState *bs, BdrvChild *src, int64_t src_offset, + BdrvChild *dst, int64_t dst_offset, int64_t bytes, BdrvRequestFlags read_flags, BdrvRequestFlags write_flags) { return bdrv_co_copy_range_to(src, src_offset, dst, dst_offset, bytes, @@ -3044,10 +3044,10 @@ static int coroutine_fn raw_co_copy_range_from( =20 static int coroutine_fn raw_co_copy_range_to(BlockDriverState *bs, BdrvChild *src, - uint64_t src_offset, + int64_t src_offset, BdrvChild *dst, - uint64_t dst_offset, - uint64_t bytes, + int64_t dst_offset, + int64_t bytes, BdrvRequestFlags read_flags, BdrvRequestFlags write_flags) { diff --git a/block/iscsi.c b/block/iscsi.c index 0b4b7210df..861a70c823 100644 --- a/block/iscsi.c +++ b/block/iscsi.c @@ -2180,10 +2180,10 @@ static void coroutine_fn iscsi_co_invalidate_cache(= BlockDriverState *bs, =20 static int coroutine_fn iscsi_co_copy_range_from(BlockDriverState *bs, BdrvChild *src, - uint64_t src_offset, + int64_t src_offset, BdrvChild *dst, - uint64_t dst_offset, - uint64_t bytes, + int64_t dst_offset, + int64_t bytes, BdrvRequestFlags read_fla= gs, BdrvRequestFlags write_fl= ags) { @@ -2321,10 +2321,10 @@ static void iscsi_xcopy_data(struct iscsi_data *dat= a, =20 static int coroutine_fn iscsi_co_copy_range_to(BlockDriverState *bs, BdrvChild *src, - uint64_t src_offset, + int64_t src_offset, BdrvChild *dst, - uint64_t dst_offset, - uint64_t bytes, + int64_t dst_offset, + int64_t bytes, BdrvRequestFlags read_flags, BdrvRequestFlags write_flag= s) { diff --git a/block/qcow2.c b/block/qcow2.c index ed5e456b09..945554b25c 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -3809,9 +3809,9 @@ static coroutine_fn int qcow2_co_pdiscard(BlockDriver= State *bs, =20 static int coroutine_fn qcow2_co_copy_range_from(BlockDriverState *bs, - BdrvChild *src, uint64_t src_offset, - BdrvChild *dst, uint64_t dst_offset, - uint64_t bytes, BdrvRequestFlags read_flags, + BdrvChild *src, int64_t src_offset, + BdrvChild *dst, int64_t dst_offset, + int64_t bytes, BdrvRequestFlags read_flags, BdrvRequestFlags write_flags) { BDRVQcow2State *s =3D bs->opaque; @@ -3890,9 +3890,9 @@ out: =20 static int coroutine_fn qcow2_co_copy_range_to(BlockDriverState *bs, - BdrvChild *src, uint64_t src_offset, - BdrvChild *dst, uint64_t dst_offset, - uint64_t bytes, BdrvRequestFlags read_flags, + BdrvChild *src, int64_t src_offset, + BdrvChild *dst, int64_t dst_offset, + int64_t bytes, BdrvRequestFlags read_flags, BdrvRequestFlags write_flags) { BDRVQcow2State *s =3D bs->opaque; diff --git a/block/raw-format.c b/block/raw-format.c index d5ff7012b7..2537755f84 100644 --- a/block/raw-format.c +++ b/block/raw-format.c @@ -507,16 +507,16 @@ static int raw_probe_geometry(BlockDriverState *bs, H= DGeometry *geo) =20 static int coroutine_fn raw_co_copy_range_from(BlockDriverState *bs, BdrvChild *src, - uint64_t src_offset, + int64_t src_offset, BdrvChild *dst, - uint64_t dst_offset, - uint64_t bytes, + int64_t dst_offset, + int64_t bytes, BdrvRequestFlags read_flags, BdrvRequestFlags write_flag= s) { int ret; =20 - ret =3D raw_adjust_offset(bs, (int64_t *)&src_offset, bytes, false); + ret =3D raw_adjust_offset(bs, &src_offset, bytes, false); if (ret) { return ret; } @@ -526,16 +526,16 @@ static int coroutine_fn raw_co_copy_range_from(BlockD= riverState *bs, =20 static int coroutine_fn raw_co_copy_range_to(BlockDriverState *bs, BdrvChild *src, - uint64_t src_offset, + int64_t src_offset, BdrvChild *dst, - uint64_t dst_offset, - uint64_t bytes, + int64_t dst_offset, + int64_t bytes, BdrvRequestFlags read_flags, BdrvRequestFlags write_flags) { int ret; =20 - ret =3D raw_adjust_offset(bs, (int64_t *)&dst_offset, bytes, true); + ret =3D raw_adjust_offset(bs, &dst_offset, bytes, true); if (ret) { return ret; } --=20 2.21.0 From nobody Thu May 2 14:29:44 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=none dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1587976562; cv=pass; d=zohomail.com; s=zohoarc; b=IXXZyJMZA1YCUcvvxIzLMGXuMb24w1qP/xHsz/5PFZ5LZMmR31rxO9M8bV/q6yeXKVRYGJeXrBQ5Ln6cXMRfBUazbwhfawDa4IKrFCx3Zzi+Hs2rPjMydyWdnJKJzS2IaIZJ7JyGH7r7ZW/IAipC0fhZkrflxzjYpTUhkVAMNBg= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587976562; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=fSZy6lMpx7dhfLgg1s1Ig9Xl/S/zmXJuQMmJEzzr+PY=; b=hJ3FzoYpa5Ao4PM1h472eMymo2Q7GufHUu0cMuNWodj/MJnWGxQlfFms1VXCrgRJ+7wVdRFBSJS3d0U7W7EGmdSQOc474r6Xfl0Ab+HzLvJsJ23JEfz1mehPwp8kRcwwNM1K2PpHu9otPWYIZfqMhF6zk3GabsJ7/lcuw22w7Tg= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1587976562379981.5546352585113; Mon, 27 Apr 2020 01:36:02 -0700 (PDT) Received: from localhost ([::1]:59262 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSzF9-0000NF-KE for importer@patchew.org; Mon, 27 Apr 2020 04:35:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49094) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSz3y-0003Ra-EZ for qemu-devel@nongnu.org; Mon, 27 Apr 2020 04:24:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jSz3u-0000Ne-JG for qemu-devel@nongnu.org; Mon, 27 Apr 2020 04:24:26 -0400 Received: from mail-eopbgr00096.outbound.protection.outlook.com ([40.107.0.96]:55939 helo=EUR02-AM5-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jSz3p-00081B-7w; Mon, 27 Apr 2020 04:24:17 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM7PR08MB5400.eurprd08.prod.outlook.com (2603:10a6:20b:109::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13; Mon, 27 Apr 2020 08:24:14 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::acfa:5:88c8:b7b9]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::acfa:5:88c8:b7b9%3]) with mapi id 15.20.2937.020; Mon, 27 Apr 2020 08:24:14 +0000 Received: from localhost.localdomain (185.215.60.182) by FR2P281CA0004.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Mon, 27 Apr 2020 08:24:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YXuOYknfBnOG4HcTNRZSPMGHKZgRHbd0yuvRDcRDC1m+xVfdSV+/Ra45fQNwuhOFBnmejOEFWqIKSmP+pf2ICZ0ynhYgMSAQr5EMjTCO60DOqI3+2nENrQQVXXNO2XPR0md0uW9fMXwfGrYNW1XuMDcsuOqErnhNQBXAhCcYRLP3OnULOVztdl8I9zWV9VJjGnG0ZT9brkJClTDnBRFn3N+3wNJoZmdiZ5VhGvsSIuMlkd6HGX13oqJ4zYH4CqyiCmFJqLOr+Q1IzM55AvOg+ctUuVPhsZU4MNU33djvm6gwmcBOdrQ48wkxYdeqeW2XOSE8YAsnruFyzYjcaTCfxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fSZy6lMpx7dhfLgg1s1Ig9Xl/S/zmXJuQMmJEzzr+PY=; b=meCEnmWdjlfN2eXgnj7bPOULe+YpxLQUns3eSDRm4vBXjK7PDSgODV8JZqKrkuxlN/LN2S/upTw6uP3MKaOAaoNXZ24pf+qZxypiqzAFWwY+8sQj5w85Ld0FHboyBrOuFqcx4oTCdS4/Vh0O2HER4su/FtzfHs80AqUWT1bPYL+UpI+LM4L9GMtwZI1bYCd/dlqg0EGrQlVqv0Y89+335VHDpZg7ZPYyDWN4G+n+9kNFjVi+NR19/RfYGfGL4EkZr3FwrkrO5yxdOFZzAjliJGa8qnXvTBD1rgBut/a0oTEHZkoKbPNcfeMb02eHm79gwaH/g4zKhxHQX5C7Yag9vg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fSZy6lMpx7dhfLgg1s1Ig9Xl/S/zmXJuQMmJEzzr+PY=; b=JrOq8SCshYjkluadbXpu+kFpaJ2H4G192AeE7bUgkRVZgNrHBBXtT3isLV80Fd1pVF/oJn2icwywpoZ5A+So6NpwV+dTa8V7XCe1NoflBR9fYSRYUJt6RVgoDI0gkLlDQFCNNxMal3cce9u6Q9UDmrntfcJYVAgIIW2eiH677Uw= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=vsementsov@virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Subject: [PATCH v2 16/17] block: use int64_t instead of int in driver write_zeroes handlers Date: Mon, 27 Apr 2020 11:23:24 +0300 Message-Id: <20200427082325.10414-17-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200427082325.10414-1-vsementsov@virtuozzo.com> References: <20200427082325.10414-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: FR2P281CA0004.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::14) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Mailer: git-send-email 2.21.0 X-Originating-IP: [185.215.60.182] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6f83b831-0bc8-4413-7687-08d7ea845ea7 X-MS-TrafficTypeDiagnostic: AM7PR08MB5400: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:483; X-Forefront-PRVS: 0386B406AA X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(39840400004)(396003)(136003)(376002)(366004)(346002)(107886003)(36756003)(956004)(2616005)(2906002)(4326008)(26005)(6512007)(6916009)(6486002)(5660300002)(6506007)(186003)(69590400007)(1076003)(316002)(8676002)(66946007)(81156014)(52116002)(478600001)(30864003)(86362001)(7416002)(66556008)(6666004)(8936002)(66476007)(16526019); DIR:OUT; SFP:1102; Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fY53l4mv4icL9t/fiJdE4QbYqe818MMz1LcHsNMD5hK7Ts+zLgTsBy9CFujgyd9N64yhf0Be9AyIM+IP7qMhKFGzQA/OaQjqSqTtQbFLfRcF6+NijO2JyF+X3SwRibMQTVqaKT/wrFFcIYVYDxxOhKWH5uFYY/0x56tMVjOQP1v6oTZEekeJQqYeGAMrNLhZoWHKmYLmSS6tXi4GjXzI1/A+Ywa7L1a2q1flBtkc9a1XejzLY3C+VDiEubnrQW0HhHlh1JTeValaEKyk1j6XTZt2FGj3WGvABixNvwJXIsSJxo7vvjyLMZGfIVfiRYUOKXmYgIy28h1GRT+fPcfXsetuUL+9b5qO2WalnIFqDlDGtHvGy3bMEofFX8pHiNtp0NBo6V1Ey/CMbp5Rcx9Lo6CUDnF/w/Du2img/7VZINLFtYZAtT1rqIsc1cV0Mr4+rPX6fEXuRnS+MEOWb5eNsmvlE/C7D/JnX1th0KBlwx/MozpyqrRuzd8nQxryOXAr X-MS-Exchange-AntiSpam-MessageData: +uqfiCw79EGF5pURTegnAmDDptyJeRyDilO7Ux4vvaRkBgLTJxXMvTsZD9FYHIkxr1EPNqCbK/+m3YTHQdXHDYn+aRB/T5V4zhzDVVAE2HJ+tqD4MrxmLYXKJHhphckoTS2rrT+0mRNQmo5mzPLCf7eHeSLdkzPRsapSeTwLw64Xzx10YaGUh4F/DP463ht2krSIJX9rv1VpYBWsN+UIqdX3G+yrrNbW8sUnHie9amNp6ftUyicy5sPeJ8VJhYAc6cL9Zuh/kBr0TeY5Z0Gw+K86k6oxvKvX7aNG/2/eJGKOX7OvfROLQIrh1aSeSI+QttulmzKqQPallJfpkBw6IIgHvrHkYBeyAa6Gh6S6Ia5jXy6LgkwxkQ1AjRNLLkkgYNl8fQzwrIK9p6OCEG0VD4KtAGNuSBDYls/ipICUZ5gnzVn/3qqFcREsfag4OTAthteoO+bo5EwJoIkb/VFUdGANXPd2jvQWcQnCFUlnJ2nP5ta+u9CSbjlMmBqb53O160sWrqum79pl8qh32CcnvzDYkC4c/hNwwlAXhzMyhe8DcJsnsXrFhuydFb1UbGN+bz3ArP60frwx95fcF4rGPq6+nnApYmEkmfgobXpHISnbPo0Y5886LY5U1mUSy9yHD1t1CHrt6ZpX79v4BU+KYHOmfAwt+UMVUoTXpuC1bU7ggc6KVMTj4L9SLkJlX0BnROoVQhQdHqpYBohVdjUensY9AMgn7j7VVR0/tXzdHhmrtgfFl/bqqwa8R70Yk1V8Ub9/RB+9CKQi2HcAQYHRYYOHzeKvnI4mPyZ7cma4sAA= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6f83b831-0bc8-4413-7687-08d7ea845ea7 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Apr 2020 08:24:14.2552 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: w9KlhGqdctlU7TJcT2/ogWDqiTIDmLv2piX9pRgVZq6EVMgsWGwvq9jXvUl7KdkoobDYJGj8rt/6s+z0ZnDoaBqWA03tkQLajfZ79wNeW6Y= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5400 Received-SPF: pass client-ip=40.107.0.96; envelope-from=vsementsov@virtuozzo.com; helo=EUR02-AM5-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/27 04:24:14 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Received-From: 40.107.0.96 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, fam@euphon.net, integration@gluster.org, berto@igalia.com, pavel.dovgaluk@ispras.ru, dillaman@redhat.com, qemu-devel@nongnu.org, pl@kamp.de, ronniesahlberg@gmail.com, mreitz@redhat.com, den@openvz.org, sheepdog@lists.wpkg.org, vsementsov@virtuozzo.com, stefanha@redhat.com, namei.unix@gmail.com, pbonzini@redhat.com, sw@weilnetz.de, jsnow@redhat.com, ari@tuxera.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) Content-Type: text/plain; charset="utf-8" We are generally moving to int64_t for both offset and bytes parameters on all io paths. Convert driver write_zeroes handlers bytes parameter to int64_t. This patch just converts handlers where it is obvious that bytes parameter is passed further to 64bit interfaces, and add simple wrappers where it is not obvious. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/block_int.h | 2 +- block/backup-top.c | 2 +- block/blkdebug.c | 2 +- block/blklogwrites.c | 4 ++-- block/blkreplay.c | 2 +- block/copy-on-read.c | 2 +- block/file-posix.c | 6 +++--- block/filter-compress.c | 2 +- block/gluster.c | 8 +++++--- block/iscsi.c | 12 ++++++++++-- block/mirror.c | 2 +- block/nbd.c | 4 +++- block/nvme.c | 16 ++++++++++++---- block/qcow2.c | 9 ++++++++- block/qed.c | 17 +++++++++++++---- block/raw-format.c | 2 +- block/throttle.c | 2 +- block/vmdk.c | 2 +- 18 files changed, 66 insertions(+), 30 deletions(-) diff --git a/include/block/block_int.h b/include/block/block_int.h index ea8fca5e28..fe446f11eb 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -244,7 +244,7 @@ struct BlockDriver { * will be called instead. */ int coroutine_fn (*bdrv_co_pwrite_zeroes)(BlockDriverState *bs, - int64_t offset, int bytes, BdrvRequestFlags flags); + int64_t offset, int64_t bytes, BdrvRequestFlags flags); int coroutine_fn (*bdrv_co_pdiscard)(BlockDriverState *bs, int64_t offset, int bytes); =20 diff --git a/block/backup-top.c b/block/backup-top.c index 4190d465d6..20c943280f 100644 --- a/block/backup-top.c +++ b/block/backup-top.c @@ -76,7 +76,7 @@ static int coroutine_fn backup_top_co_pdiscard(BlockDrive= rState *bs, } =20 static int coroutine_fn backup_top_co_pwrite_zeroes(BlockDriverState *bs, - int64_t offset, int bytes, BdrvRequestFlags flags) + int64_t offset, int64_t bytes, BdrvRequestFlags flags) { int ret =3D backup_top_cbw(bs, offset, bytes, flags); if (ret < 0) { diff --git a/block/blkdebug.c b/block/blkdebug.c index b4d0966982..521b7b1fe2 100644 --- a/block/blkdebug.c +++ b/block/blkdebug.c @@ -672,7 +672,7 @@ static int blkdebug_co_flush(BlockDriverState *bs) } =20 static int coroutine_fn blkdebug_co_pwrite_zeroes(BlockDriverState *bs, - int64_t offset, int byte= s, + int64_t offset, int64_t = bytes, BdrvRequestFlags flags) { uint32_t align =3D MAX(bs->bl.request_alignment, diff --git a/block/blklogwrites.c b/block/blklogwrites.c index 890a61dfba..ccfb1100e4 100644 --- a/block/blklogwrites.c +++ b/block/blklogwrites.c @@ -474,8 +474,8 @@ blk_log_writes_co_pwritev(BlockDriverState *bs, int64_t= offset, int64_t bytes, } =20 static int coroutine_fn -blk_log_writes_co_pwrite_zeroes(BlockDriverState *bs, int64_t offset, int = bytes, - BdrvRequestFlags flags) +blk_log_writes_co_pwrite_zeroes(BlockDriverState *bs, int64_t offset, + int64_t bytes, BdrvRequestFlags flags) { return blk_log_writes_co_log(bs, offset, bytes, NULL, flags, blk_log_writes_co_do_file_pwrite_zeroes, = 0, diff --git a/block/blkreplay.c b/block/blkreplay.c index d93383a88f..74ea935593 100644 --- a/block/blkreplay.c +++ b/block/blkreplay.c @@ -95,7 +95,7 @@ static int coroutine_fn blkreplay_co_pwritev(BlockDriverS= tate *bs, } =20 static int coroutine_fn blkreplay_co_pwrite_zeroes(BlockDriverState *bs, - int64_t offset, int bytes, BdrvRequestFlags flags) + int64_t offset, int64_t bytes, BdrvRequestFlags flags) { uint64_t reqid =3D blkreplay_next_id(); int ret =3D bdrv_co_pwrite_zeroes(bs->file, offset, bytes, flags); diff --git a/block/copy-on-read.c b/block/copy-on-read.c index fc3186bacb..59272b5faa 100644 --- a/block/copy-on-read.c +++ b/block/copy-on-read.c @@ -92,7 +92,7 @@ static int coroutine_fn cor_co_pwritev(BlockDriverState *= bs, =20 =20 static int coroutine_fn cor_co_pwrite_zeroes(BlockDriverState *bs, - int64_t offset, int bytes, + int64_t offset, int64_t bytes, BdrvRequestFlags flags) { return bdrv_co_pwrite_zeroes(bs->file, offset, bytes, flags); diff --git a/block/file-posix.c b/block/file-posix.c index 76da620135..bfddfbb9b3 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -2797,7 +2797,7 @@ raw_co_pdiscard(BlockDriverState *bs, int64_t offset,= int bytes) } =20 static int coroutine_fn -raw_do_pwrite_zeroes(BlockDriverState *bs, int64_t offset, int bytes, +raw_do_pwrite_zeroes(BlockDriverState *bs, int64_t offset, int64_t bytes, BdrvRequestFlags flags, bool blkdev) { BDRVRawState *s =3D bs->opaque; @@ -2866,7 +2866,7 @@ raw_do_pwrite_zeroes(BlockDriverState *bs, int64_t of= fset, int bytes, =20 static int coroutine_fn raw_co_pwrite_zeroes( BlockDriverState *bs, int64_t offset, - int bytes, BdrvRequestFlags flags) + int64_t bytes, BdrvRequestFlags flags) { return raw_do_pwrite_zeroes(bs, offset, bytes, flags, false); } @@ -3489,7 +3489,7 @@ hdev_co_pdiscard(BlockDriverState *bs, int64_t offset= , int bytes) } =20 static coroutine_fn int hdev_co_pwrite_zeroes(BlockDriverState *bs, - int64_t offset, int bytes, BdrvRequestFlags flags) + int64_t offset, int64_t bytes, BdrvRequestFlags flags) { int rc; =20 diff --git a/block/filter-compress.c b/block/filter-compress.c index f2400fea37..b22e57c5f2 100644 --- a/block/filter-compress.c +++ b/block/filter-compress.c @@ -84,7 +84,7 @@ static int coroutine_fn compress_co_pwritev_part(BlockDri= verState *bs, =20 =20 static int coroutine_fn compress_co_pwrite_zeroes(BlockDriverState *bs, - int64_t offset, int byte= s, + int64_t offset, int64_t = bytes, BdrvRequestFlags flags) { return bdrv_co_pwrite_zeroes(bs->file, offset, bytes, flags); diff --git a/block/gluster.c b/block/gluster.c index 0aa1f2cda4..88130c3d2d 100644 --- a/block/gluster.c +++ b/block/gluster.c @@ -1017,19 +1017,21 @@ static void qemu_gluster_reopen_abort(BDRVReopenSta= te *state) #ifdef CONFIG_GLUSTERFS_ZEROFILL static coroutine_fn int qemu_gluster_co_pwrite_zeroes(BlockDriverState *bs, int64_t offset, - int size, + int64_t bytes, BdrvRequestFlags fla= gs) { int ret; GlusterAIOCB acb; BDRVGlusterState *s =3D bs->opaque; =20 - acb.size =3D size; + assert(bytes < INT_MAX); + + acb.size =3D bytes; acb.ret =3D 0; acb.coroutine =3D qemu_coroutine_self(); acb.aio_context =3D bdrv_get_aio_context(bs); =20 - ret =3D glfs_zerofill_async(s->fd, offset, size, gluster_finish_aiocb,= &acb); + ret =3D glfs_zerofill_async(s->fd, offset, bytes, gluster_finish_aiocb= , &acb); if (ret < 0) { return -errno; } diff --git a/block/iscsi.c b/block/iscsi.c index 861a70c823..c4183ef12f 100644 --- a/block/iscsi.c +++ b/block/iscsi.c @@ -1204,8 +1204,8 @@ out_unlock: } =20 static int -coroutine_fn iscsi_co_pwrite_zeroes(BlockDriverState *bs, int64_t offset, - int bytes, BdrvRequestFlags flags) +coroutine_fn iscsi_co_pwrite_zeroes_old(BlockDriverState *bs, int64_t offs= et, + int bytes, BdrvRequestFlags flags) { IscsiLun *iscsilun =3D bs->opaque; struct IscsiTask iTask; @@ -1308,6 +1308,14 @@ out_unlock: return r; } =20 +static int +coroutine_fn iscsi_co_pwrite_zeroes(BlockDriverState *bs, int64_t offset, + int64_t bytes, BdrvRequestFlags flags) +{ + assert(bytes < INT_MAX); + return iscsi_co_pwrite_zeroes_old(bs, offset, bytes, flags); +} + static void apply_chap(struct iscsi_context *iscsi, QemuOpts *opts, Error **errp) { diff --git a/block/mirror.c b/block/mirror.c index 687a91e654..2d8fe6008a 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -1464,7 +1464,7 @@ static int coroutine_fn bdrv_mirror_top_flush(BlockDr= iverState *bs) } =20 static int coroutine_fn bdrv_mirror_top_pwrite_zeroes(BlockDriverState *bs, - int64_t offset, int bytes, BdrvRequestFlags flags) + int64_t offset, int64_t bytes, BdrvRequestFlags flags) { return bdrv_mirror_top_do_write(bs, MIRROR_METHOD_ZERO, offset, bytes,= NULL, flags); diff --git a/block/nbd.c b/block/nbd.c index 54bce3911e..fc30514e10 100644 --- a/block/nbd.c +++ b/block/nbd.c @@ -1243,7 +1243,7 @@ static int nbd_client_co_pwritev(BlockDriverState *bs= , int64_t offset, } =20 static int nbd_client_co_pwrite_zeroes(BlockDriverState *bs, int64_t offse= t, - int bytes, BdrvRequestFlags flags) + int64_t bytes, BdrvRequestFlags fla= gs) { BDRVNBDState *s =3D (BDRVNBDState *)bs->opaque; NBDRequest request =3D { @@ -1252,6 +1252,8 @@ static int nbd_client_co_pwrite_zeroes(BlockDriverSta= te *bs, int64_t offset, .len =3D bytes, }; =20 + assert(bytes < INT_MAX); + assert(!(s->info.flags & NBD_FLAG_READ_ONLY)); if (!(s->info.flags & NBD_FLAG_SEND_WRITE_ZEROES)) { return -ENOTSUP; diff --git a/block/nvme.c b/block/nvme.c index db7fffe94f..ef27c7eb3c 100644 --- a/block/nvme.c +++ b/block/nvme.c @@ -1103,10 +1103,10 @@ static coroutine_fn int nvme_co_flush(BlockDriverSt= ate *bs) } =20 =20 -static coroutine_fn int nvme_co_pwrite_zeroes(BlockDriverState *bs, - int64_t offset, - int bytes, - BdrvRequestFlags flags) +static coroutine_fn int nvme_co_pwrite_zeroes_old(BlockDriverState *bs, + int64_t offset, + int bytes, + BdrvRequestFlags flags) { BDRVNVMeState *s =3D bs->opaque; NVMeQueuePair *ioq =3D s->queues[1]; @@ -1156,6 +1156,14 @@ static coroutine_fn int nvme_co_pwrite_zeroes(BlockD= riverState *bs, return data.ret; } =20 +static coroutine_fn int nvme_co_pwrite_zeroes(BlockDriverState *bs, + int64_t offset, + int64_t bytes, + BdrvRequestFlags flags) +{ + assert(bytes <=3D INT_MAX); + return nvme_co_pwrite_zeroes_old(bs, offset, bytes, flags); +} =20 static int coroutine_fn nvme_co_pdiscard(BlockDriverState *bs, int64_t offset, diff --git a/block/qcow2.c b/block/qcow2.c index 945554b25c..905d22e2c8 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -3726,7 +3726,7 @@ static bool is_zero(BlockDriverState *bs, int64_t off= set, int64_t bytes) return res >=3D 0 && (res & BDRV_BLOCK_ZERO) && nr =3D=3D bytes; } =20 -static coroutine_fn int qcow2_co_pwrite_zeroes(BlockDriverState *bs, +static coroutine_fn int qcow2_co_pwrite_zeroes_old(BlockDriverState *bs, int64_t offset, int bytes, BdrvRequestFlags flags) { int ret; @@ -3778,6 +3778,13 @@ static coroutine_fn int qcow2_co_pwrite_zeroes(Block= DriverState *bs, return ret; } =20 +static coroutine_fn int qcow2_co_pwrite_zeroes(BlockDriverState *bs, + int64_t offset, int64_t bytes, BdrvRequestFlags flags) +{ + assert(bytes < INT_MAX); + return qcow2_co_pwrite_zeroes_old(bs, offset, bytes, flags); +} + static coroutine_fn int qcow2_co_pdiscard(BlockDriverState *bs, int64_t offset, int bytes) { diff --git a/block/qed.c b/block/qed.c index 1af9b3cb1d..fe00dbbff5 100644 --- a/block/qed.c +++ b/block/qed.c @@ -1439,10 +1439,10 @@ static int coroutine_fn bdrv_qed_co_writev(BlockDri= verState *bs, return qed_co_request(bs, sector_num, qiov, nb_sectors, QED_AIOCB_WRIT= E); } =20 -static int coroutine_fn bdrv_qed_co_pwrite_zeroes(BlockDriverState *bs, - int64_t offset, - int bytes, - BdrvRequestFlags flags) +static int coroutine_fn bdrv_qed_co_pwrite_zeroes_old(BlockDriverState *bs, + int64_t offset, + int bytes, + BdrvRequestFlags fla= gs) { BDRVQEDState *s =3D bs->opaque; =20 @@ -1463,6 +1463,15 @@ static int coroutine_fn bdrv_qed_co_pwrite_zeroes(Bl= ockDriverState *bs, QED_AIOCB_WRITE | QED_AIOCB_ZERO); } =20 +static int coroutine_fn bdrv_qed_co_pwrite_zeroes(BlockDriverState *bs, + int64_t offset, + int64_t bytes, + BdrvRequestFlags flags) +{ + assert(bytes <=3D INT_MAX); + return bdrv_qed_co_pwrite_zeroes_old(bs, offset, bytes, flags); +} + static int coroutine_fn bdrv_qed_co_truncate(BlockDriverState *bs, int64_t offset, bool exact, diff --git a/block/raw-format.c b/block/raw-format.c index 2537755f84..de2fef9edc 100644 --- a/block/raw-format.c +++ b/block/raw-format.c @@ -279,7 +279,7 @@ static int coroutine_fn raw_co_block_status(BlockDriver= State *bs, } =20 static int coroutine_fn raw_co_pwrite_zeroes(BlockDriverState *bs, - int64_t offset, int bytes, + int64_t offset, int64_t bytes, BdrvRequestFlags flags) { int ret; diff --git a/block/throttle.c b/block/throttle.c index 28e73073e7..c1503f133f 100644 --- a/block/throttle.c +++ b/block/throttle.c @@ -135,7 +135,7 @@ static int coroutine_fn throttle_co_pwritev(BlockDriver= State *bs, } =20 static int coroutine_fn throttle_co_pwrite_zeroes(BlockDriverState *bs, - int64_t offset, int byte= s, + int64_t offset, int64_t = bytes, BdrvRequestFlags flags) { ThrottleGroupMember *tgm =3D bs->opaque; diff --git a/block/vmdk.c b/block/vmdk.c index a88e9c9ba4..2898c10fa8 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -2089,7 +2089,7 @@ vmdk_co_pwritev_compressed(BlockDriverState *bs, int6= 4_t offset, int64_t bytes, =20 static int coroutine_fn vmdk_co_pwrite_zeroes(BlockDriverState *bs, int64_t offset, - int bytes, + int64_t bytes, BdrvRequestFlags flags) { int ret; --=20 2.21.0 From nobody Thu May 2 14:29:44 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=none dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1587976498; cv=pass; d=zohomail.com; s=zohoarc; b=Y5vFqN0OB50LGhA+YevvIxj8p4iXVsdtCI168WCtalCPz/mVtRBlgLrkLOGowQ+XF0mc1bF2rAVMleAW6oO1einLNO7NY6aS5qjgl1/GvraKfJhGEieiHaZc1uIPO5F04x4yd3WgbZddctIIGhrBKIScuottUFPMVqq8NlFY+iI= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587976498; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=xDetedrS9YdvUfmugU6bhlm8Pm95V+7h+jOtqe4bjlw=; b=aSD4m0rXSRRXYNebBuBazNo8EpoVwoVjawCgq0Z3dj7v+4be1DyP18A3iDmlLuNoatgHvgTwSP6CkoCxVdY32Z2EQ35BCcechRJZiOCtwiEEJWnG62ftMciCeounQ9DYLlKcOAec14kCUDZNE2x1EtBmeg7sPGAFVhONGLMEGrA= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 158797649840423.947483441028908; Mon, 27 Apr 2020 01:34:58 -0700 (PDT) Received: from localhost ([::1]:59166 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSzE5-00071m-R8 for importer@patchew.org; Mon, 27 Apr 2020 04:34:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49122) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSz42-0003XP-Ai for qemu-devel@nongnu.org; Mon, 27 Apr 2020 04:24:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jSz3z-0000io-9r for qemu-devel@nongnu.org; Mon, 27 Apr 2020 04:24:29 -0400 Received: from mail-eopbgr00096.outbound.protection.outlook.com ([40.107.0.96]:55939 helo=EUR02-AM5-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jSz3q-00081B-6h; Mon, 27 Apr 2020 04:24:18 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM7PR08MB5400.eurprd08.prod.outlook.com (2603:10a6:20b:109::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13; Mon, 27 Apr 2020 08:24:15 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::acfa:5:88c8:b7b9]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::acfa:5:88c8:b7b9%3]) with mapi id 15.20.2937.020; Mon, 27 Apr 2020 08:24:15 +0000 Received: from localhost.localdomain (185.215.60.182) by FR2P281CA0004.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Mon, 27 Apr 2020 08:24:14 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nM4+v6wZTGvhXw2uP0BKXGUX9jbjCCVDNasNAEpTje2n+Mnwa4UTmXGX0ipm3hnWeHWVK5d/lxxx3qDb0p3fzypHJ/z2fRkLp05hictszuMHi/1AFCxM75eOnMdOGvs0OJpdcDwWM10bdLjhlLj1L534v7jnurdDdf6w0vaPhJvjnwRJLMlFGlRhPGX+jbMM0AmKsBVAA/gBeTw0wf5CIriBDK37dMYyH0PmkXaMi75E1j6Up3nI8GffHT1/LF5HxAwblfyLCvojVny4wE/2yqALo4WYRhxUOYMXz4jz0kxFywsE0maA+Fog/z1Ru/NBlKYS/asti5eQqPTnFFUCwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xDetedrS9YdvUfmugU6bhlm8Pm95V+7h+jOtqe4bjlw=; b=I+sQd7OV3E3Eeilpylh30CSJa+GxEwEV1iBRqy8XT/TLxxUjhGr9HuQ9d4WSBWzZuS515O72+b6lx3ofPKvCOM1ea0DjVR7gJgJDrIWxu6ld+6J5GpJ99gbZwVG4dVpwjLs1pHpTk0FeOTfBNs2UljRx1lQ2b+sneCIwLim+mJKexEo+DZdMAChyojDMy4S6f1+nXGxM9wzTVHlMI9+JMfHGTk+30rSusns1apUCwYyXkuDfbk11ZOEqZ1GkzEA+GkazQipHjqMs7Oeqq9ZeI/zBJtiFIufROWMqW7wZ0xxaIHBECHi+DFbBkkn6z+5SIR4W8kLiZRksEGN3d8EQPQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xDetedrS9YdvUfmugU6bhlm8Pm95V+7h+jOtqe4bjlw=; b=ElcJo5tMBUFSHuZfseSL0mHG9v4kz1n/jhwGRoeXtaRBVbN9saMzLirMLE3ly/+6K7q4qANmbNTLCL6cpYXjxJlM2cIuFIkXwBSKWDJwNh5ITm4gyhF9/p268N3prvtp7LH0UsQ/dVHOSJKF4h3kB8O/0tsUKf0rOopO2e5Vy80= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=vsementsov@virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Subject: [PATCH v2 17/17] block: use int64_t instead of int in driver discard handlers Date: Mon, 27 Apr 2020 11:23:25 +0300 Message-Id: <20200427082325.10414-18-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200427082325.10414-1-vsementsov@virtuozzo.com> References: <20200427082325.10414-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: FR2P281CA0004.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::14) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Mailer: git-send-email 2.21.0 X-Originating-IP: [185.215.60.182] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e4bc4286-bd1d-458d-266b-08d7ea845f7c X-MS-TrafficTypeDiagnostic: AM7PR08MB5400: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:224; X-Forefront-PRVS: 0386B406AA X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(39840400004)(396003)(136003)(376002)(366004)(346002)(107886003)(36756003)(956004)(2616005)(2906002)(4326008)(26005)(6512007)(6916009)(6486002)(5660300002)(6506007)(186003)(69590400007)(1076003)(316002)(8676002)(66946007)(81156014)(52116002)(478600001)(30864003)(86362001)(7416002)(66556008)(6666004)(8936002)(66476007)(16526019); DIR:OUT; SFP:1102; Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ydtd20h1R+uXFzpHuMS8aKCLXt93sbwgbfzhJiyaSeg6F2brbQ+IXl+/xHDDHNlRrRRcMqdonZG9VmYIeNwm8c4w1HP7GbK6NTXUNT/PzWIxr/yPATIwmmN89CH3RQgYiOFaa8GTlWy4TI46TsZ/B1MO5lxSybMjS28m+aK4bS64+AEfDExNEsImhU8n0Le5R6wkQWw2XcVazCV4CkxYPvpjWw8sp7uF9IfgRLTpsE4fJi3eUg6Slgw90dAi432PNlnRoE89PU6DXpY4A2GHKktKAPCs3XaQmKa7gs1W3j+pvnUg4MJAqZF2ikbrChmpkk+udS3RgFN3/uCe5FJB0jUcJMDLQaF2TwtJdIO98CQvEuvOifmtsgbGX73/PnDiGR3jrdP/Uvf5rI7Y1BpOsG5r7qpEVAB9JZuzYbfQIkGhkV8yN4dpOJ0uu3YHgxmcvIXu0rDhy8dfCY7ZCZEb0n/6L7ids9zKApN8Cxj9f/j+daFVfNPI2rGBuxAJdxQb X-MS-Exchange-AntiSpam-MessageData: EeI/oFg6M4K4vZBVJxFdals25waB2UPsjbfbJhIzExE09I6kprn7GrPdSmQNIbEzGN/cUqvwdkrhA5Ykt8tS9sQ2c/uSK/3Plured32AoamLwhZMu09zNgmHBOsIoW7pRKSq7D6b/sSTPm493wbs3ItfLHh3TbiNz2HUjWhz682AHqs6GLn7WjvXJmCDp8bzwpvUNKgO9AOszoO1ocToUWwuXfGTnEtkL3eaGzE7HL/jMzPU8/LTXh9QIptOkYtD0hgazNs243bfkwq1ws1KEwWQ874o6InjHw7yx4sqeeks1rJMvPpNcHnJ7OVvrIlwvE0GcQeMqyOqu8XzfnKJ7oPJOn6qjb1W1enYODs/jqQNP5wTuyF6zhDjK+Y5p2uTie29vVBT52Lps/B/AghekHOaLCZVHtiHxnB9Jqcwzm8JptbheVEmH3c6SDE1H02rpYieZxxgMxpiYqiPz1EZd8fg7f1/1WnlTyXDe/h4mpvD15FfyH9/xfnx01n6hzkwgMhuQhht4nxHaMarXawqjJ/Morn/mDFHwZfWPKSJx63dsB+ndN52RN3/1Bo8CIa59q6JnvZzdMVd+p18D8+XZ5CJIJlJtEw0w1CN7wRMLhlTYVvwR4haDCuIA3tEBB95DOEWeTGETZ+c8Iam9ABWYGGNxSwFDFPQCZqmPXWjhcBD0+H23mzRG4lbyCjRUHp4CX2a2rzXwUrvTaMNZStBPYRSx01OHwL1rxdsXFY/XnEBfaM+EJKEsYlKSRODHNEgfhgLNuMexy9y/f02pzJJh8x4IEchjzPngSFQo6e/6mM= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: e4bc4286-bd1d-458d-266b-08d7ea845f7c X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Apr 2020 08:24:15.6292 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: L5jNJ2leIdKH2vDPk5zn8DwkdFTvE/ajLgoML9ls08wspflLIXZr2xEMgQlgPuD7/Z/cTAzMRZp7YVsSo8QW4PwIW0oXvtNL/jQxwY2uf2I= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5400 Received-SPF: pass client-ip=40.107.0.96; envelope-from=vsementsov@virtuozzo.com; helo=EUR02-AM5-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/27 04:24:14 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Received-From: 40.107.0.96 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, fam@euphon.net, integration@gluster.org, berto@igalia.com, pavel.dovgaluk@ispras.ru, dillaman@redhat.com, qemu-devel@nongnu.org, pl@kamp.de, ronniesahlberg@gmail.com, mreitz@redhat.com, den@openvz.org, sheepdog@lists.wpkg.org, vsementsov@virtuozzo.com, stefanha@redhat.com, namei.unix@gmail.com, pbonzini@redhat.com, sw@weilnetz.de, jsnow@redhat.com, ari@tuxera.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) Content-Type: text/plain; charset="utf-8" We are generally moving to int64_t for both offset and bytes parameters on all io paths. Convert driver discard handlers bytes parameter to int64_t. This patch just converts handlers where it is obvious that bytes parameter is passed further to 64bit interfaces, and add simple wrappers where it is not obvious. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/block_int.h | 2 +- block/backup-top.c | 2 +- block/blkdebug.c | 2 +- block/blklogwrites.c | 4 ++-- block/blkreplay.c | 2 +- block/copy-on-read.c | 2 +- block/file-posix.c | 18 ++++++++++++++++-- block/filter-compress.c | 2 +- block/gluster.c | 6 ++++-- block/iscsi.c | 10 +++++++++- block/mirror.c | 2 +- block/nbd.c | 4 +++- block/nvme.c | 13 ++++++++++--- block/qcow2.c | 2 +- block/raw-format.c | 2 +- block/sheepdog.c | 11 +++++++++-- block/throttle.c | 2 +- 17 files changed, 63 insertions(+), 23 deletions(-) diff --git a/include/block/block_int.h b/include/block/block_int.h index fe446f11eb..814837603d 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -246,7 +246,7 @@ struct BlockDriver { int coroutine_fn (*bdrv_co_pwrite_zeroes)(BlockDriverState *bs, int64_t offset, int64_t bytes, BdrvRequestFlags flags); int coroutine_fn (*bdrv_co_pdiscard)(BlockDriverState *bs, - int64_t offset, int bytes); + int64_t offset, int64_t bytes); =20 /* Map [offset, offset + nbytes) range onto a child of @bs to copy fro= m, * and invoke bdrv_co_copy_range_from(child, ...), or invoke diff --git a/block/backup-top.c b/block/backup-top.c index 20c943280f..7ff0b0aa7e 100644 --- a/block/backup-top.c +++ b/block/backup-top.c @@ -65,7 +65,7 @@ static coroutine_fn int backup_top_cbw(BlockDriverState *= bs, uint64_t offset, } =20 static int coroutine_fn backup_top_co_pdiscard(BlockDriverState *bs, - int64_t offset, int bytes) + int64_t offset, int64_t byt= es) { int ret =3D backup_top_cbw(bs, offset, bytes, 0); if (ret < 0) { diff --git a/block/blkdebug.c b/block/blkdebug.c index 521b7b1fe2..3c84cc3f84 100644 --- a/block/blkdebug.c +++ b/block/blkdebug.c @@ -705,7 +705,7 @@ static int coroutine_fn blkdebug_co_pwrite_zeroes(Block= DriverState *bs, } =20 static int coroutine_fn blkdebug_co_pdiscard(BlockDriverState *bs, - int64_t offset, int bytes) + int64_t offset, int64_t bytes) { uint32_t align =3D bs->bl.pdiscard_alignment; int err; diff --git a/block/blklogwrites.c b/block/blklogwrites.c index ccfb1100e4..172afbf199 100644 --- a/block/blklogwrites.c +++ b/block/blklogwrites.c @@ -490,9 +490,9 @@ static int coroutine_fn blk_log_writes_co_flush_to_disk= (BlockDriverState *bs) } =20 static int coroutine_fn -blk_log_writes_co_pdiscard(BlockDriverState *bs, int64_t offset, int count) +blk_log_writes_co_pdiscard(BlockDriverState *bs, int64_t offset, int64_t b= ytes) { - return blk_log_writes_co_log(bs, offset, count, NULL, 0, + return blk_log_writes_co_log(bs, offset, bytes, NULL, 0, blk_log_writes_co_do_file_pdiscard, LOG_DISCARD_FLAG, false); } diff --git a/block/blkreplay.c b/block/blkreplay.c index 74ea935593..f34ea6b249 100644 --- a/block/blkreplay.c +++ b/block/blkreplay.c @@ -106,7 +106,7 @@ static int coroutine_fn blkreplay_co_pwrite_zeroes(Bloc= kDriverState *bs, } =20 static int coroutine_fn blkreplay_co_pdiscard(BlockDriverState *bs, - int64_t offset, int bytes) + int64_t offset, int64_t byte= s) { uint64_t reqid =3D blkreplay_next_id(); int ret =3D bdrv_co_pdiscard(bs->file, offset, bytes); diff --git a/block/copy-on-read.c b/block/copy-on-read.c index 59272b5faa..c05553eba7 100644 --- a/block/copy-on-read.c +++ b/block/copy-on-read.c @@ -100,7 +100,7 @@ static int coroutine_fn cor_co_pwrite_zeroes(BlockDrive= rState *bs, =20 =20 static int coroutine_fn cor_co_pdiscard(BlockDriverState *bs, - int64_t offset, int bytes) + int64_t offset, int64_t bytes) { return bdrv_co_pdiscard(bs->file, offset, bytes); } diff --git a/block/file-posix.c b/block/file-posix.c index bfddfbb9b3..b938e1ee83 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -2791,11 +2791,18 @@ raw_do_pdiscard(BlockDriverState *bs, int64_t offse= t, int bytes, bool blkdev) } =20 static coroutine_fn int -raw_co_pdiscard(BlockDriverState *bs, int64_t offset, int bytes) +raw_co_pdiscard_old(BlockDriverState *bs, int64_t offset, int bytes) { return raw_do_pdiscard(bs, offset, bytes, false); } =20 +static coroutine_fn int +raw_co_pdiscard(BlockDriverState *bs, int64_t offset, int64_t bytes) +{ + assert(bytes <=3D INT_MAX); + return raw_co_pdiscard_old(bs, offset, bytes); +} + static int coroutine_fn raw_do_pwrite_zeroes(BlockDriverState *bs, int64_t offset, int64_t bytes, BdrvRequestFlags flags, bool blkdev) @@ -3475,7 +3482,7 @@ static int fd_open(BlockDriverState *bs) } =20 static coroutine_fn int -hdev_co_pdiscard(BlockDriverState *bs, int64_t offset, int bytes) +hdev_co_pdiscard_old(BlockDriverState *bs, int64_t offset, int bytes) { BDRVRawState *s =3D bs->opaque; int ret; @@ -3488,6 +3495,13 @@ hdev_co_pdiscard(BlockDriverState *bs, int64_t offse= t, int bytes) return raw_do_pdiscard(bs, offset, bytes, true); } =20 +static coroutine_fn int +hdev_co_pdiscard(BlockDriverState *bs, int64_t offset, int64_t bytes) +{ + assert(bytes <=3D INT_MAX); + return hdev_co_pdiscard_old(bs, offset, bytes); +} + static coroutine_fn int hdev_co_pwrite_zeroes(BlockDriverState *bs, int64_t offset, int64_t bytes, BdrvRequestFlags flags) { diff --git a/block/filter-compress.c b/block/filter-compress.c index b22e57c5f2..646abad5b0 100644 --- a/block/filter-compress.c +++ b/block/filter-compress.c @@ -92,7 +92,7 @@ static int coroutine_fn compress_co_pwrite_zeroes(BlockDr= iverState *bs, =20 =20 static int coroutine_fn compress_co_pdiscard(BlockDriverState *bs, - int64_t offset, int bytes) + int64_t offset, int64_t bytes) { return bdrv_co_pdiscard(bs->file, offset, bytes); } diff --git a/block/gluster.c b/block/gluster.c index 88130c3d2d..87cf69199d 100644 --- a/block/gluster.c +++ b/block/gluster.c @@ -1312,18 +1312,20 @@ error: =20 #ifdef CONFIG_GLUSTERFS_DISCARD static coroutine_fn int qemu_gluster_co_pdiscard(BlockDriverState *bs, - int64_t offset, int size) + int64_t offset, int64_t b= ytes) { int ret; GlusterAIOCB acb; BDRVGlusterState *s =3D bs->opaque; =20 + assert(bytes <=3D INT_MAX); + acb.size =3D 0; acb.ret =3D 0; acb.coroutine =3D qemu_coroutine_self(); acb.aio_context =3D bdrv_get_aio_context(bs); =20 - ret =3D glfs_discard_async(s->fd, offset, size, gluster_finish_aiocb, = &acb); + ret =3D glfs_discard_async(s->fd, offset, bytes, gluster_finish_aiocb,= &acb); if (ret < 0) { return -errno; } diff --git a/block/iscsi.c b/block/iscsi.c index c4183ef12f..c06521b74f 100644 --- a/block/iscsi.c +++ b/block/iscsi.c @@ -1141,7 +1141,8 @@ iscsi_getlength(BlockDriverState *bs) } =20 static int -coroutine_fn iscsi_co_pdiscard(BlockDriverState *bs, int64_t offset, int b= ytes) +coroutine_fn iscsi_co_pdiscard_old(BlockDriverState *bs, int64_t offset, + int bytes) { IscsiLun *iscsilun =3D bs->opaque; struct IscsiTask iTask; @@ -1203,6 +1204,13 @@ out_unlock: return r; } =20 +static int +coroutine_fn iscsi_co_pdiscard(BlockDriverState *bs, int64_t offset, int64= _t bytes) +{ + assert(bytes <=3D INT_MAX); + return iscsi_co_pdiscard_old(bs, offset, bytes); +} + static int coroutine_fn iscsi_co_pwrite_zeroes_old(BlockDriverState *bs, int64_t offs= et, int bytes, BdrvRequestFlags flags) diff --git a/block/mirror.c b/block/mirror.c index 2d8fe6008a..d284b5296e 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -1471,7 +1471,7 @@ static int coroutine_fn bdrv_mirror_top_pwrite_zeroes= (BlockDriverState *bs, } =20 static int coroutine_fn bdrv_mirror_top_pdiscard(BlockDriverState *bs, - int64_t offset, int bytes) + int64_t offset, int64_t bytes) { return bdrv_mirror_top_do_write(bs, MIRROR_METHOD_DISCARD, offset, byt= es, NULL, 0); diff --git a/block/nbd.c b/block/nbd.c index fc30514e10..50874351de 100644 --- a/block/nbd.c +++ b/block/nbd.c @@ -1293,7 +1293,7 @@ static int nbd_client_co_flush(BlockDriverState *bs) } =20 static int nbd_client_co_pdiscard(BlockDriverState *bs, int64_t offset, - int bytes) + int64_t bytes) { BDRVNBDState *s =3D (BDRVNBDState *)bs->opaque; NBDRequest request =3D { @@ -1302,6 +1302,8 @@ static int nbd_client_co_pdiscard(BlockDriverState *b= s, int64_t offset, .len =3D bytes, }; =20 + assert(bytes < INT_MAX); + assert(!(s->info.flags & NBD_FLAG_READ_ONLY)); if (!(s->info.flags & NBD_FLAG_SEND_TRIM) || !bytes) { return 0; diff --git a/block/nvme.c b/block/nvme.c index ef27c7eb3c..939d5d36dd 100644 --- a/block/nvme.c +++ b/block/nvme.c @@ -1165,9 +1165,9 @@ static coroutine_fn int nvme_co_pwrite_zeroes(BlockDr= iverState *bs, return nvme_co_pwrite_zeroes_old(bs, offset, bytes, flags); } =20 -static int coroutine_fn nvme_co_pdiscard(BlockDriverState *bs, - int64_t offset, - int bytes) +static int coroutine_fn nvme_co_pdiscard_old(BlockDriverState *bs, + int64_t offset, + int bytes) { BDRVNVMeState *s =3D bs->opaque; NVMeQueuePair *ioq =3D s->queues[1]; @@ -1244,6 +1244,13 @@ out: =20 } =20 +static int coroutine_fn nvme_co_pdiscard(BlockDriverState *bs, + int64_t offset, + int64_t bytes) +{ + assert(bytes <=3D INT_MAX); + return nvme_co_pdiscard_old(bs, offset, bytes); +} =20 static int nvme_reopen_prepare(BDRVReopenState *reopen_state, BlockReopenQueue *queue, Error **errp) diff --git a/block/qcow2.c b/block/qcow2.c index 905d22e2c8..0f6458c1cf 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -3786,7 +3786,7 @@ static coroutine_fn int qcow2_co_pwrite_zeroes(BlockD= riverState *bs, } =20 static coroutine_fn int qcow2_co_pdiscard(BlockDriverState *bs, - int64_t offset, int bytes) + int64_t offset, int64_t bytes) { int ret; BDRVQcow2State *s =3D bs->opaque; diff --git a/block/raw-format.c b/block/raw-format.c index de2fef9edc..2f25bed301 100644 --- a/block/raw-format.c +++ b/block/raw-format.c @@ -292,7 +292,7 @@ static int coroutine_fn raw_co_pwrite_zeroes(BlockDrive= rState *bs, } =20 static int coroutine_fn raw_co_pdiscard(BlockDriverState *bs, - int64_t offset, int bytes) + int64_t offset, int64_t bytes) { int ret; =20 diff --git a/block/sheepdog.c b/block/sheepdog.c index 59f7ebb171..750bfae016 100644 --- a/block/sheepdog.c +++ b/block/sheepdog.c @@ -3091,8 +3091,8 @@ static int sd_load_vmstate(BlockDriverState *bs, QEMU= IOVector *qiov, } =20 =20 -static coroutine_fn int sd_co_pdiscard(BlockDriverState *bs, int64_t offse= t, - int bytes) +static coroutine_fn int sd_co_pdiscard_old(BlockDriverState *bs, int64_t o= ffset, + int bytes) { SheepdogAIOCB acb; BDRVSheepdogState *s =3D bs->opaque; @@ -3121,6 +3121,13 @@ static coroutine_fn int sd_co_pdiscard(BlockDriverSt= ate *bs, int64_t offset, return acb.ret; } =20 +static coroutine_fn int sd_co_pdiscard(BlockDriverState *bs, int64_t offse= t, + int64_t bytes) +{ + assert(bytes <=3D INT_MAX); + return sd_co_pdiscard_old(bs, offset, bytes); +} + static coroutine_fn int sd_co_block_status(BlockDriverState *bs, bool want_zero, int64_t offset, int64_t bytes, int64_t *pnum, int64_t *map, diff --git a/block/throttle.c b/block/throttle.c index c1503f133f..c0a8521dca 100644 --- a/block/throttle.c +++ b/block/throttle.c @@ -145,7 +145,7 @@ static int coroutine_fn throttle_co_pwrite_zeroes(Block= DriverState *bs, } =20 static int coroutine_fn throttle_co_pdiscard(BlockDriverState *bs, - int64_t offset, int bytes) + int64_t offset, int64_t bytes) { ThrottleGroupMember *tgm =3D bs->opaque; throttle_group_co_io_limits_intercept(tgm, bytes, true); --=20 2.21.0