From patchwork Mon Apr 27 08:23:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 283917 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2297CC54FD0 for ; Mon, 27 Apr 2020 08:28:04 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E299920661 for ; Mon, 27 Apr 2020 08:28:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="PmCsdLRf" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E299920661 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=virtuozzo.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:58498 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSz7S-0002C7-Sn for qemu-devel@archiver.kernel.org; Mon, 27 Apr 2020 04:28:02 -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 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; 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 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> 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 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 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: 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" 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 --- 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; bool serialising; int64_t overlap_offset; - uint64_t overlap_bytes; + int64_t overlap_bytes; 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 *req) static void tracked_request_begin(BdrvTrackedRequest *req, BlockDriverState *bs, int64_t offset, - uint64_t bytes, + int64_t bytes, enum BdrvTrackedRequestType type) { - assert(bytes <= INT64_MAX && offset <= INT64_MAX - bytes); + assert(offset >= 0 && bytes >= 0 && + bytes <= INT64_MAX && offset <= INT64_MAX - bytes); *req = (BdrvTrackedRequest){ .bs = bs, @@ -716,7 +717,7 @@ static void tracked_request_begin(BdrvTrackedRequest *req, } static bool tracked_request_overlaps(BdrvTrackedRequest *req, - int64_t offset, uint64_t bytes) + int64_t offset, int64_t bytes) { /* aaaa bbbb */ if (offset >= req->overlap_offset + req->overlap_bytes) { @@ -773,8 +774,8 @@ bool bdrv_mark_request_serialising(BdrvTrackedRequest *req, uint64_t align) { BlockDriverState *bs = req->bs; int64_t overlap_offset = req->offset & ~(align - 1); - uint64_t overlap_bytes = ROUND_UP(req->offset + req->bytes, align) - - overlap_offset; + int64_t overlap_bytes = + ROUND_UP(req->offset + req->bytes, align) - overlap_offset; bool waited; qemu_co_mutex_lock(&bs->reqs_lock); From patchwork Mon Apr 27 08:23:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 283918 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EF05CC54FD0 for ; Mon, 27 Apr 2020 08:27:05 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B68DD206D4 for ; Mon, 27 Apr 2020 08:27:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="hxUwrRI6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B68DD206D4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=virtuozzo.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:58394 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSz6W-0000DN-RM for qemu-devel@archiver.kernel.org; Mon, 27 Apr 2020 04:27:04 -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 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; 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 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> 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 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 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: 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" 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 --- 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 } 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; } @@ -885,7 +885,7 @@ static int bdrv_check_byte_request(BlockDriverState *bs, int64_t offset, return -ENOMEDIUM; } - if (offset < 0) { + if (offset < 0 || bytes < 0) { return -EIO; } From patchwork Mon Apr 27 08:23:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 283916 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F22FAC55199 for ; Mon, 27 Apr 2020 08:29:33 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BE83020728 for ; Mon, 27 Apr 2020 08:29:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="ZSCClrZw" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BE83020728 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=virtuozzo.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:58656 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSz8u-0005LX-QS for qemu-devel@archiver.kernel.org; Mon, 27 Apr 2020 04:29:32 -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 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; 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 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> 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 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 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: 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" 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, } 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 = child->bs; @@ -1283,11 +1283,11 @@ static int coroutine_fn bdrv_co_do_copy_on_readv(BdrvChild *child, BlockDriver *drv = bs->drv; int64_t cluster_offset; int64_t cluster_bytes; - size_t skip_bytes; + int64_t skip_bytes; int ret; int max_transfer = MIN_NON_ZERO(bs->bl.max_transfer, BDRV_REQUEST_MAX_BYTES); - unsigned int progress = 0; + int64_t progress = 0; bool skip_write; 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 flags) "bs %p offset %"PRId64" nbytes %"PRId64" flags 0x%x" bdrv_co_pwritev(void *bs, int64_t offset, int64_t nbytes, unsigned int flags) "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, int64_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 %" PRId64 " 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 offset %"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" From patchwork Mon Apr 27 08:23:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 283915 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0B5A5C5519A for ; Mon, 27 Apr 2020 08:30:27 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BC3C720728 for ; Mon, 27 Apr 2020 08:30:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="nsMs29Gr" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BC3C720728 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=virtuozzo.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:58756 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSz9l-0007Jk-Ga for qemu-devel@archiver.kernel.org; Mon, 27 Apr 2020 04:30:25 -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 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; 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 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> 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 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 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: 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" 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); 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, } 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; - trace_bdrv_co_preadv(bs, offset, bytes, flags); + trace_bdrv_co_preadv_part(bs, offset, bytes, flags); ret = bdrv_check_byte_request(bs, offset, bytes); if (ret < 0) { @@ -2033,7 +2033,7 @@ static int coroutine_fn bdrv_aligned_pwritev(BdrvChild *child, 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, } int coroutine_fn bdrv_co_pwritev_part(BdrvChild *child, - int64_t offset, unsigned int bytes, QEMUIOVector *qiov, size_t qiov_offset, + int64_t offset, int64_t bytes, QEMUIOVector *qiov, size_t qiov_offset, BdrvRequestFlags flags) { BlockDriverState *bs = child->bs; @@ -2116,7 +2116,7 @@ int coroutine_fn bdrv_co_pwritev_part(BdrvChild *child, BdrvRequestPadding pad; int ret; - trace_bdrv_co_pwritev(child->bs, offset, bytes, flags); + trace_bdrv_co_pwritev_part(child->bs, offset, bytes, flags); 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" # io.c -bdrv_co_preadv(void *bs, int64_t offset, int64_t nbytes, unsigned int flags) "bs %p offset %"PRId64" nbytes %"PRId64" flags 0x%x" -bdrv_co_pwritev(void *bs, int64_t offset, int64_t nbytes, unsigned int flags) "bs %p offset %"PRId64" nbytes %"PRId64" flags 0x%x" +bdrv_co_preadv_part(void *bs, int64_t offset, int64_t bytes, int flags) "bs %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 %" PRId64 " 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 offset %"PRIu64" dst %p offset %"PRIu64" bytes %"PRIu64" rw flags 0x%x 0x%x" From patchwork Mon Apr 27 08:23:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 283914 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7287DC55199 for ; Mon, 27 Apr 2020 08:32:12 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 28A7320728 for ; Mon, 27 Apr 2020 08:32:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="G0syHiWS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 28A7320728 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=virtuozzo.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:58964 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSzBT-0002VR-5n for qemu-devel@archiver.kernel.org; Mon, 27 Apr 2020 04:32:11 -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 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; 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 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> 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 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 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: 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" 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 bytes); +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 regular * 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 flags); 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; 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; - int (*request_fn)(BdrvChild *, int64_t, unsigned int, QEMUIOVector *, + int (*request_fn)(BdrvChild *, int64_t, int64_t, QEMUIOVector *, BdrvRequestFlags); 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 offset, } int bdrv_pwrite_zeroes(BdrvChild *child, int64_t offset, - int bytes, BdrvRequestFlags flags) + int64_t bytes, BdrvRequestFlags flags) { QEMUIOVector qiov = QEMU_IOVEC_INIT_BUF(qiov, NULL, bytes); @@ -1008,7 +1008,7 @@ int bdrv_preadv(BdrvChild *child, int64_t offset, QEMUIOVector *qiov) } /* 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 = QEMU_IOVEC_INIT_BUF(qiov, buf, bytes); @@ -1037,7 +1037,8 @@ int bdrv_pwritev(BdrvChild *child, int64_t offset, QEMUIOVector *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 bytes) +int bdrv_pwrite(BdrvChild *child, int64_t offset, const void *buf, + int64_t bytes) { QEMUIOVector qiov = QEMU_IOVEC_INIT_BUF(qiov, buf, bytes); @@ -1055,11 +1056,11 @@ int bdrv_pwrite(BdrvChild *child, int64_t offset, const 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; - ret = bdrv_pwrite(child, offset, buf, count); + ret = bdrv_pwrite(child, offset, buf, bytes); if (ret < 0) { return ret; } @@ -1687,7 +1688,7 @@ static bool bdrv_pad_request(BlockDriverState *bs, } 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: } int coroutine_fn bdrv_co_pwrite_zeroes(BdrvChild *child, int64_t offset, - int bytes, BdrvRequestFlags flags) + int64_t bytes, BdrvRequestFlags flags) { trace_bdrv_co_pwrite_zeroes(child->bs, offset, bytes, flags); 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) "bs %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 %" PRId64 " 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 offset %"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" From patchwork Mon Apr 27 08:23:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 283911 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 40AE2C54FD0 for ; Mon, 27 Apr 2020 08:38:41 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EDEB220656 for ; Mon, 27 Apr 2020 08:38:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="eJXHiNW2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EDEB220656 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=virtuozzo.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:59642 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSzHj-0004ip-UB for qemu-devel@archiver.kernel.org; Mon, 27 Apr 2020 04:38:40 -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 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; 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 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> 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 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 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: 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" 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); /* @@ -364,9 +364,9 @@ struct BlockDriver { Error **errp); 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); 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(BlockDriverState *bs, } static coroutine_fn int backup_top_co_pwritev(BlockDriverState *bs, - uint64_t offset, - uint64_t bytes, + int64_t offset, int64_t bytes, QEMUIOVector *qiov, int flags) { int ret = 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, } 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) } 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 bytes, 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(BlockDriverState *bs, } 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 = blkreplay_next_id(); int ret = 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 offset, int64_t bytes, } 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 *bs, 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) { 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 offset, int64_t bytes, static coroutine_fn int -block_crypto_co_pwritev(BlockDriverState *bs, uint64_t offset, uint64_t bytes, +block_crypto_co_pwritev(BlockDriverState *bs, int64_t offset, int64_t bytes, QEMUIOVector *qiov, int flags) { BlockCrypto *crypto = 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(BlockDriverState *bs, int64_t offset, return raw_co_prw(bs, offset, bytes, qiov, QEMU_AIO_READ); } -static int coroutine_fn raw_co_pwritev(BlockDriverState *bs, uint64_t offset, - uint64_t bytes, QEMUIOVector *qiov, +static int coroutine_fn raw_co_pwritev(BlockDriverState *bs, int64_t offset, + int64_t bytes, QEMUIOVector *qiov, int flags) { assert(flags == 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(BlockDriverState *bs, 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 flags) { 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: } 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 = 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; } -static int nbd_client_co_pwritev(BlockDriverState *bs, uint64_t offset, - uint64_t bytes, QEMUIOVector *qiov, int flags) +static int nbd_client_co_pwritev(BlockDriverState *bs, int64_t offset, + int64_t bytes, QEMUIOVector *qiov, int flags) { BDRVNBDState *s = (BDRVNBDState *)bs->opaque; NBDRequest request = { 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; } -static int coroutine_fn nfs_co_pwritev(BlockDriverState *bs, uint64_t offset, - uint64_t bytes, QEMUIOVector *iov, +static int coroutine_fn nfs_co_pwritev(BlockDriverState *bs, int64_t offset, + int64_t bytes, QEMUIOVector *iov, int flags) { NFSClient *client = 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, } 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, } 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(BlockDriverState *bs, } 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; } -static coroutine_fn int qcow_co_pwritev(BlockDriverState *bs, uint64_t offset, - uint64_t bytes, QEMUIOVector *qiov, +static coroutine_fn int qcow_co_pwritev(BlockDriverState *bs, int64_t offset, + int64_t bytes, QEMUIOVector *qiov, int flags) { BDRVQcowState *s = 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 bytes, + QEMUIOVector *qiov) { BDRVQcowState *s = 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(AioTask *task) } 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 = bs->opaque; @@ -4328,7 +4328,7 @@ static coroutine_fn int qcow2_co_pwritev_compressed_task_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 = 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) } } -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 = bs->opaque; QuorumAIOCB *acb = 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); } -static int coroutine_fn raw_co_pwritev(BlockDriverState *bs, uint64_t offset, - uint64_t bytes, QEMUIOVector *qiov, +static int coroutine_fn raw_co_pwritev(BlockDriverState *bs, int64_t offset, + int64_t bytes, QEMUIOVector *qiov, int flags) { void *buf = NULL; @@ -249,7 +249,7 @@ static int coroutine_fn raw_co_pwritev(BlockDriverState *bs, uint64_t offset, qiov = &local_qiov; } - ret = raw_adjust_offset(bs, (int64_t *)&offset, bytes, true); + ret = raw_adjust_offset(bs, &offset, bytes, true); if (ret) { goto fail; } @@ -284,7 +284,7 @@ static int coroutine_fn raw_co_pwrite_zeroes(BlockDriverState *bs, { int ret; - ret = raw_adjust_offset(bs, (int64_t *)&offset, bytes, true); + ret = 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(BlockDriverState *bs, } 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(BlockDriverState *bs, } static int coroutine_fn throttle_co_pwritev(BlockDriverState *bs, - uint64_t offset, uint64_t bytes, + int64_t offset, int64_t bytes, QEMUIOVector *qiov, int flags) { ThrottleGroupMember *tgm = 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, int64_t bytes, } 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 = 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, } 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, } 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 bytes, + QEMUIOVector *qiov) { if (bytes == 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: } 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 = 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()); } 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(BlockDriverState *bs, } 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 nread) "LuringState %p l # qcow2.c qcow2_add_task(void *co, void *bs, void *pool, const char *action, int cluster_type, uint64_t file_cluster_offset, uint64_t offset, uint64_t bytes, void *qiov, size_t qiov_offset) "co %p bs %p pool %p: %s: cluster_type %d file_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 offset 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" From patchwork Mon Apr 27 08:23:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 283913 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A8307C54FD0 for ; Mon, 27 Apr 2020 08:34:00 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 611012080C for ; Mon, 27 Apr 2020 08:34:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="aFM3M643" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 611012080C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=virtuozzo.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:59110 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSzDD-0005t0-E6 for qemu-devel@archiver.kernel.org; Mon, 27 Apr 2020 04:33:59 -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 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; 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 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> 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 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 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: 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" 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_flags, BdrvRequestFlags write_flags); @@ -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); 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 *bs) } 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( 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, 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_flags, BdrvRequestFlags write_flags) { @@ -2321,10 +2321,10 @@ static void iscsi_xcopy_data(struct iscsi_data *data, 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_flags) { 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(BlockDriverState *bs, 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 = bs->opaque; @@ -3890,9 +3890,9 @@ out: 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 = 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, HDGeometry *geo) 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_flags) { int ret; - ret = raw_adjust_offset(bs, (int64_t *)&src_offset, bytes, false); + ret = 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(BlockDriverState *bs, 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; - ret = raw_adjust_offset(bs, (int64_t *)&dst_offset, bytes, true); + ret = raw_adjust_offset(bs, &dst_offset, bytes, true); if (ret) { return ret; } From patchwork Mon Apr 27 08:23:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 283912 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 16110C54FD0 for ; Mon, 27 Apr 2020 08:35:44 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C083820728 for ; Mon, 27 Apr 2020 08:35:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="JrOq8SCs" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C083820728 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=virtuozzo.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:59262 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jSzEs-0000NF-R8 for qemu-devel@archiver.kernel.org; Mon, 27 Apr 2020 04:35:42 -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 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; 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 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> 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 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 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: 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" 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); 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(BlockDriverState *bs, } 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 = 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) } static int coroutine_fn blkdebug_co_pwrite_zeroes(BlockDriverState *bs, - int64_t offset, int bytes, + int64_t offset, int64_t bytes, BdrvRequestFlags flags) { uint32_t align = 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, } 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(BlockDriverState *bs, } 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 = blkreplay_next_id(); int ret = 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, 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) } 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 = bs->opaque; @@ -2866,7 +2866,7 @@ raw_do_pwrite_zeroes(BlockDriverState *bs, int64_t offset, int bytes, 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) } 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; 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(BlockDriverState *bs, static int coroutine_fn compress_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/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(BDRVReopenState *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 flags) { int ret; GlusterAIOCB acb; BDRVGlusterState *s = bs->opaque; - acb.size = size; + assert(bytes < INT_MAX); + + acb.size = bytes; acb.ret = 0; acb.coroutine = qemu_coroutine_self(); acb.aio_context = bdrv_get_aio_context(bs); - ret = glfs_zerofill_async(s->fd, offset, size, gluster_finish_aiocb, &acb); + ret = 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: } 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 offset, + int bytes, BdrvRequestFlags flags) { IscsiLun *iscsilun = bs->opaque; struct IscsiTask iTask; @@ -1308,6 +1308,14 @@ out_unlock: return r; } +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(BlockDriverState *bs) } 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, } static int nbd_client_co_pwrite_zeroes(BlockDriverState *bs, int64_t offset, - int bytes, BdrvRequestFlags flags) + int64_t bytes, BdrvRequestFlags flags) { BDRVNBDState *s = (BDRVNBDState *)bs->opaque; NBDRequest request = { @@ -1252,6 +1252,8 @@ static int nbd_client_co_pwrite_zeroes(BlockDriverState *bs, int64_t offset, .len = bytes, }; + 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(BlockDriverState *bs) } -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 = bs->opaque; NVMeQueuePair *ioq = s->queues[1]; @@ -1156,6 +1156,14 @@ static coroutine_fn int nvme_co_pwrite_zeroes(BlockDriverState *bs, return data.ret; } +static coroutine_fn int nvme_co_pwrite_zeroes(BlockDriverState *bs, + int64_t offset, + int64_t bytes, + BdrvRequestFlags flags) +{ + assert(bytes <= INT_MAX); + return nvme_co_pwrite_zeroes_old(bs, offset, bytes, flags); +} 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 offset, int64_t bytes) return res >= 0 && (res & BDRV_BLOCK_ZERO) && nr == bytes; } -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(BlockDriverState *bs, return ret; } +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(BlockDriverState *bs, return qed_co_request(bs, sector_num, qiov, nb_sectors, QED_AIOCB_WRITE); } -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 flags) { BDRVQEDState *s = bs->opaque; @@ -1463,6 +1463,15 @@ static int coroutine_fn bdrv_qed_co_pwrite_zeroes(BlockDriverState *bs, QED_AIOCB_WRITE | QED_AIOCB_ZERO); } +static int coroutine_fn bdrv_qed_co_pwrite_zeroes(BlockDriverState *bs, + int64_t offset, + int64_t bytes, + BdrvRequestFlags flags) +{ + assert(bytes <= 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(BlockDriverState *bs, } 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(BlockDriverState *bs, } static int coroutine_fn throttle_co_pwrite_zeroes(BlockDriverState *bs, - int64_t offset, int bytes, + int64_t offset, int64_t bytes, BdrvRequestFlags flags) { ThrottleGroupMember *tgm = 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, int64_t offset, int64_t bytes, static int coroutine_fn vmdk_co_pwrite_zeroes(BlockDriverState *bs, int64_t offset, - int bytes, + int64_t bytes, BdrvRequestFlags flags) { int ret;