From nobody Mon Feb 9 11:28:49 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=none dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1588245562; cv=pass; d=zohomail.com; s=zohoarc; b=EKnmzumWEgJGmoYw4KOB42WfQPtxZH+meH5v5QD4bOFB9xcrPAnNcfZSDwFZtqDWurtoLcP1/hWR1mH5lJgEScOkPdNyhj77/mDcgQg0pUbxRVd8J+opLbJy3E8OII9VyY3D/q67o8F5eB0XiDyYimpbZvzo7k7h23RDUix4/y8= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588245562; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=p96Q8f6SVdBp4AN38/xYSuB/77eP/QtXR1B0Z8I3bD0=; b=SLUZPFjREestEpXh5eDHIzy7Lh36/6+D4Gxh236hb0ZSL55B9nm8VJSh0XcyVL1iuhdC4WbBys1rrEsymgn90SyOU3SMJsGCYD7p3R3Xc+gL7Uz7z9JxIV6bfQvbAJmIuTqwxOMe49DS5yCb+zDHmIvZgeGX+hbbORrGiBCKEx4= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 158824556232232.18129524149754; Thu, 30 Apr 2020 04:19:22 -0700 (PDT) Received: from localhost ([::1]:58988 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jU7Ds-0005JN-Uo for importer@patchew.org; Thu, 30 Apr 2020 07:19:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57780) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jU78Y-00077X-9J for qemu-devel@nongnu.org; Thu, 30 Apr 2020 07:14:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jU772-0005HB-MF for qemu-devel@nongnu.org; Thu, 30 Apr 2020 07:13:50 -0400 Received: from mail-eopbgr80117.outbound.protection.outlook.com ([40.107.8.117]:39403 helo=EUR04-VI1-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 1jU75x-0003Yq-AS; Thu, 30 Apr 2020 07:11:09 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM7PR08MB5447.eurprd08.prod.outlook.com (2603:10a6:20b:10b::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.22; Thu, 30 Apr 2020 11:11:06 +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.2958.020; Thu, 30 Apr 2020 11:11:06 +0000 Received: from kvm.sw.ru (185.215.60.138) by AM0P190CA0021.EURP190.PROD.OUTLOOK.COM (2603:10a6:208:190::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.19 via Frontend Transport; Thu, 30 Apr 2020 11:11:04 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=T01TacMPMMQWLlZRLfeA21Y0fHa3qJGOemLzOtXOYm65LI3rkiEJKxiS/5nSZN0kZbataJiXw7UBB3oY0xPbo8cuXaPNBjg6BdA5m6OaJ/G5koRBxiwvPb/oO3szMFTGTnPuP+FbP6CcOGoOGTBLdLH4cJgVZeMiKmPmyjyLDWBtJl6qY96fVeYcDOtzxT/8xJLbXuJxYQ2vKhqFEe4r9roW42joVMPLKNgn9gvEwiAAQiAgAGGFaE958ukR2a6sak+QkB33244S/U0IZ0OTlMzIOZUuM0ZvkUFteGM10C5gmAs73vScKxLZ+YpNMNiVrSr1ahUuGUPn3GvSxMuNKw== 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=p96Q8f6SVdBp4AN38/xYSuB/77eP/QtXR1B0Z8I3bD0=; b=PnbaKBnMtsTO8RL23j3506V1eEGhq6Uywl9cFnc1yYhoAJ3h3lPD0yQYtGwCD/5QFi/g1A4lMDE4isfDGmRVsl8gxQZq6uX5h8rhCnnYv0/Z0LPJIFrIQqlH1XkGBwevVSUGaPOnANHFujtkhs2V/eIDnARZwaCJLW+OT7DHTn88JOQXnMm9ttIRV60+WK90o1g7W037SlczDKbBP5SoA/tqRVfa6ohH1hxamS/xtvsMyk50t9Lk8cwR7GXGw7OoQP3rup3hzcOj1F0QZxT1cMWoHXUcnWnmZKA/JMy5xTENCHkU27fCwJTgZPxAJat57t8FE49ByGP48VRGfahjrQ== 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=p96Q8f6SVdBp4AN38/xYSuB/77eP/QtXR1B0Z8I3bD0=; b=ugbMWO6sNOLBEdeGo89ZkwEEO/ldvMYwjPV/sLVheya17cHJlciVhZGnUwOQXyS1XtFWscvT7oOiK8mK0bukkC9L5am+pYnYB20W2Q6yLlUE9yr3Qs/V/2Y5cWYllxzhFf8MGsUWqfFJ0Kmg50Uhmm6N9O+PFiZsRvRTJ10pRQU= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Subject: [PATCH v3 12/17] block/block-backend: convert blk io path to use int64_t parameters Date: Thu, 30 Apr 2020 14:10:28 +0300 Message-Id: <20200430111033.29980-13-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200430111033.29980-1-vsementsov@virtuozzo.com> References: <20200430111033.29980-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: AM0P190CA0021.EURP190.PROD.OUTLOOK.COM (2603:10a6:208:190::31) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Mailer: git-send-email 2.21.0 X-Originating-IP: [185.215.60.138] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0c2773d0-d9d3-46ce-37f6-08d7ecf72d4c X-MS-TrafficTypeDiagnostic: AM7PR08MB5447: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:390; X-Forefront-PRVS: 0389EDA07F 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)(136003)(346002)(376002)(396003)(366004)(66556008)(6512007)(107886003)(316002)(6506007)(26005)(52116002)(186003)(478600001)(956004)(2616005)(16526019)(66476007)(2906002)(30864003)(86362001)(5660300002)(66946007)(6486002)(6916009)(7416002)(36756003)(8936002)(1076003)(6666004)(8676002)(4326008); DIR:OUT; SFP:1102; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kN+LSLZnZM07AKs4sOCVx+o8JFJQ6+WApPRcAAPHfvnUQeuAxCKi9KoHL71mrJJ3G3VKKH0LMfNoeUOejQ0PkoV4lj+gnigTab3oodaBWqAe4n0CKlenn5SHacpUhclvvJ+TGYdMGIwR6hT1iQ56ZvCJeyF6ztsXVdnt3jZZiGpjsp98bmFI4OjW6LB+P0e5/MEdrpL5qtsEq0b+H6MC3hCjWrfsef/AD6UpunHF8Zvgoev4tX2g5Hi/+VWh0B/t9wpuIrWv4rr/TeJsSI/Tf4YtP3VlA8TspAIIZKCEJaRAYuuKgkA/2Vi4einhK7qWjKbU9cGaYdPtRvLYSByHatLBuPQUL5rQ/Sr34icVJNDIZXJdhA8mhti+r6DcscNjhqheE+UxMNgWDCAU++5dJGkBXpQnM2JhokB/jsoYPhGj6wmQl1IrHd5di6nIjbfa X-MS-Exchange-AntiSpam-MessageData: 9/zR1fMrB9hUDFXJwbmjwSU3KoA83beId+lvhrbfQ31It2eMvGhfiS7l1oERsRe8YVy97Hcyx7CCxVN8hwdJrpxWsktgRCnDrlOWUXiZpoPXf6VdgG2yy65P5S+VIjdb20YBd09QIpuDZHiiQ84uOvm+exQkny8kCbaTJA3Tvd3WOVSuNTkLzLGYp6O+5waTpE6tiAGfJgJS25MrLdOS2YaKbxhnIOBKCzvMMLsbJKUur7eawBAXXuf3d/S/I8FJf79P0paKAy9uSJK4z1rZQ3A8+xUbQnVvjglTba1jFSh1PvnmSygGKFPEt4ySo2XlliajYug/1Ior0aypvIQ6D+/1MQgyFoLNucW7N1TEECaIHrk5ySpozpgudpdNH+39fY7KnJ3LnwWMTWTFf5dTwIJkoa8GxR/IDfr0gnQXyE1ylLJjqFXrGQbk+PzCOH8oe5umxiE1eF3iXIShoI4vo+4U6lcreIZ4Dy57CXYFXvVahOo28ZphBUdF0cAfhJ0ya9We9o7+9OCloJBOk6PzR+y6Ru3/cPN8au1D476aA8gNCS8QjXzfu5q+1odXm3jme6A6ADUzWx85HtXAOqfDo9Zsd7U+E5a2Zvwgbn84KM0jm+qSz+klmhV8NY6NLCKIgqX6yG4f6Q4NrU11gOe3e5OaxORVk4RGqd0fSeXgnEqvmuJseIZvDsqd9FYarE4DgR2cVj2UqaOrL29NvjOv7IZm7AG73JWbRyvleMMLzNfCK0/+3zcOJAVqsNB1yw9OH0R4xQk89ed7Tm7AV+5m/PHjoKfaDcfsoFDhDlbfyGM= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0c2773d0-d9d3-46ce-37f6-08d7ecf72d4c X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Apr 2020 11:11:06.2010 (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: wn93SmIyBeMoZxN7ya30FiHzGx/jSM9NJJqnIxQiQgEzycO7JyS9vvNi1g7NJyM+xkYKPs74dlSof4rMLZK1782v8AkqyLs/tbXBmn0zZpI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5447 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=40.107.8.117; envelope-from=vsementsov@virtuozzo.com; helo=EUR04-VI1-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/30 07:11:07 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Received-From: 40.107.8.117 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, sw@weilnetz.de, 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, jsnow@redhat.com, ari@tuxera.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) Content-Type: text/plain; charset="utf-8" We are generally moving to int64_t for both offset and bytes parameters on all io paths. Main motivation is realization of 64-bit write_zeroes operation for fast zeroing large disk chunks, up to the whole disk. We chose signed type, to be consistent with off_t (which is signed) and with possibility for signed return type (where negative value means error). Now bdrv layer is converted, convert blk layer too. Series: 64bit-block-status Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/sysemu/block-backend.h | 26 +++++++-------- block/block-backend.c | 60 ++++++++++++++++++---------------- 2 files changed, 44 insertions(+), 42 deletions(-) diff --git a/include/sysemu/block-backend.h b/include/sysemu/block-backend.h index 9bbdbd63d7..0c1eee1778 100644 --- a/include/sysemu/block-backend.h +++ b/include/sysemu/block-backend.h @@ -119,14 +119,14 @@ BlockBackend *blk_by_dev(void *dev); BlockBackend *blk_by_qdev_id(const char *id, Error **errp); void blk_set_dev_ops(BlockBackend *blk, const BlockDevOps *ops, void *opaq= ue); int coroutine_fn blk_co_preadv(BlockBackend *blk, int64_t offset, - unsigned int bytes, QEMUIOVector *qiov, + int64_t bytes, QEMUIOVector *qiov, BdrvRequestFlags flags); int coroutine_fn blk_co_pwritev_part(BlockBackend *blk, int64_t offset, - unsigned int bytes, + int64_t bytes, QEMUIOVector *qiov, size_t qiov_offse= t, BdrvRequestFlags flags); int coroutine_fn blk_co_pwritev(BlockBackend *blk, int64_t offset, - unsigned int bytes, QEMUIOVector *qiov, + int64_t bytes, QEMUIOVector *qiov, BdrvRequestFlags flags); =20 static inline int coroutine_fn blk_co_pread(BlockBackend *blk, int64_t off= set, @@ -148,13 +148,13 @@ static inline int coroutine_fn blk_co_pwrite(BlockBac= kend *blk, int64_t offset, } =20 int blk_pwrite_zeroes(BlockBackend *blk, int64_t offset, - int bytes, BdrvRequestFlags flags); + int64_t bytes, BdrvRequestFlags flags); BlockAIOCB *blk_aio_pwrite_zeroes(BlockBackend *blk, int64_t offset, - int bytes, BdrvRequestFlags flags, + int64_t bytes, BdrvRequestFlags flags, BlockCompletionFunc *cb, void *opaque); int blk_make_zero(BlockBackend *blk, BdrvRequestFlags flags); -int blk_pread(BlockBackend *blk, int64_t offset, void *buf, int bytes); -int blk_pwrite(BlockBackend *blk, int64_t offset, const void *buf, int byt= es, +int blk_pread(BlockBackend *blk, int64_t offset, void *buf, int64_t bytes); +int blk_pwrite(BlockBackend *blk, int64_t offset, const void *buf, int64_t= bytes, BdrvRequestFlags flags); int64_t blk_getlength(BlockBackend *blk); void blk_get_geometry(BlockBackend *blk, uint64_t *nb_sectors_ptr); @@ -167,14 +167,14 @@ BlockAIOCB *blk_aio_pwritev(BlockBackend *blk, int64_= t offset, BlockCompletionFunc *cb, void *opaque); BlockAIOCB *blk_aio_flush(BlockBackend *blk, BlockCompletionFunc *cb, void *opaque); -BlockAIOCB *blk_aio_pdiscard(BlockBackend *blk, int64_t offset, int bytes, +BlockAIOCB *blk_aio_pdiscard(BlockBackend *blk, int64_t offset, int64_t by= tes, BlockCompletionFunc *cb, void *opaque); void blk_aio_cancel(BlockAIOCB *acb); void blk_aio_cancel_async(BlockAIOCB *acb); int blk_ioctl(BlockBackend *blk, unsigned long int req, void *buf); BlockAIOCB *blk_aio_ioctl(BlockBackend *blk, unsigned long int req, void *= buf, BlockCompletionFunc *cb, void *opaque); -int blk_co_pdiscard(BlockBackend *blk, int64_t offset, int bytes); +int blk_co_pdiscard(BlockBackend *blk, int64_t offset, int64_t bytes); int blk_co_flush(BlockBackend *blk); int blk_flush(BlockBackend *blk); int blk_commit_all(void); @@ -233,12 +233,12 @@ int blk_get_open_flags_from_root_state(BlockBackend *= blk); void *blk_aio_get(const AIOCBInfo *aiocb_info, BlockBackend *blk, BlockCompletionFunc *cb, void *opaque); int coroutine_fn blk_co_pwrite_zeroes(BlockBackend *blk, int64_t offset, - int bytes, BdrvRequestFlags flags); + int64_t bytes, BdrvRequestFlags flag= s); int blk_pwrite_compressed(BlockBackend *blk, int64_t offset, const void *b= uf, - int bytes); + int64_t bytes); int blk_truncate(BlockBackend *blk, int64_t offset, bool exact, PreallocMode prealloc, Error **errp); -int blk_pdiscard(BlockBackend *blk, int64_t offset, int bytes); +int blk_pdiscard(BlockBackend *blk, int64_t offset, int64_t bytes); int blk_save_vmstate(BlockBackend *blk, const uint8_t *buf, int64_t pos, int size); int blk_load_vmstate(BlockBackend *blk, uint8_t *buf, int64_t pos, int siz= e); @@ -259,7 +259,7 @@ void blk_unregister_buf(BlockBackend *blk, void *host); =20 int coroutine_fn blk_co_copy_range(BlockBackend *blk_in, int64_t off_in, BlockBackend *blk_out, int64_t off_out, - int bytes, BdrvRequestFlags read_flags, + int64_t bytes, BdrvRequestFlags read_fl= ags, BdrvRequestFlags write_flags); =20 const BdrvChild *blk_root(BlockBackend *blk); diff --git a/block/block-backend.c b/block/block-backend.c index 38ae413826..b3f6edfc70 100644 --- a/block/block-backend.c +++ b/block/block-backend.c @@ -1110,11 +1110,11 @@ void blk_set_disable_request_queuing(BlockBackend *= blk, bool disable) } =20 static int blk_check_byte_request(BlockBackend *blk, int64_t offset, - size_t size) + int64_t bytes) { int64_t len; =20 - if (size > INT_MAX) { + if (bytes > INT_MAX) { return -EIO; } =20 @@ -1122,7 +1122,7 @@ static int blk_check_byte_request(BlockBackend *blk, = int64_t offset, return -ENOMEDIUM; } =20 - if (offset < 0) { + if (offset < 0 || bytes < 0) { return -EIO; } =20 @@ -1132,7 +1132,7 @@ static int blk_check_byte_request(BlockBackend *blk, = int64_t offset, return len; } =20 - if (offset > len || len - offset < size) { + if (offset > len || len - offset < bytes) { return -EIO; } } @@ -1154,7 +1154,7 @@ static void coroutine_fn blk_wait_while_drained(Block= Backend *blk) =20 /* To be called between exactly one pair of blk_inc/dec_in_flight() */ static int coroutine_fn -blk_do_preadv(BlockBackend *blk, int64_t offset, unsigned int bytes, +blk_do_preadv(BlockBackend *blk, int64_t offset, int64_t bytes, QEMUIOVector *qiov, BdrvRequestFlags flags) { int ret; @@ -1185,7 +1185,7 @@ blk_do_preadv(BlockBackend *blk, int64_t offset, unsi= gned int bytes, } =20 int coroutine_fn blk_co_preadv(BlockBackend *blk, int64_t offset, - unsigned int bytes, QEMUIOVector *qiov, + int64_t bytes, QEMUIOVector *qiov, BdrvRequestFlags flags) { int ret; @@ -1199,7 +1199,7 @@ int coroutine_fn blk_co_preadv(BlockBackend *blk, int= 64_t offset, =20 /* To be called between exactly one pair of blk_inc/dec_in_flight() */ static int coroutine_fn -blk_do_pwritev_part(BlockBackend *blk, int64_t offset, unsigned int bytes, +blk_do_pwritev_part(BlockBackend *blk, int64_t offset, int64_t bytes, QEMUIOVector *qiov, size_t qiov_offset, BdrvRequestFlags flags) { @@ -1235,7 +1235,7 @@ blk_do_pwritev_part(BlockBackend *blk, int64_t offset= , unsigned int bytes, } =20 int coroutine_fn blk_co_pwritev_part(BlockBackend *blk, int64_t offset, - unsigned int bytes, + int64_t bytes, QEMUIOVector *qiov, size_t qiov_offse= t, BdrvRequestFlags flags) { @@ -1249,7 +1249,7 @@ int coroutine_fn blk_co_pwritev_part(BlockBackend *bl= k, int64_t offset, } =20 int coroutine_fn blk_co_pwritev(BlockBackend *blk, int64_t offset, - unsigned int bytes, QEMUIOVector *qiov, + int64_t bytes, QEMUIOVector *qiov, BdrvRequestFlags flags) { return blk_co_pwritev_part(blk, offset, bytes, qiov, 0, flags); @@ -1311,7 +1311,7 @@ static int blk_prw(BlockBackend *blk, int64_t offset,= uint8_t *buf, } =20 int blk_pwrite_zeroes(BlockBackend *blk, int64_t offset, - int bytes, BdrvRequestFlags flags) + int64_t bytes, BdrvRequestFlags flags) { return blk_prw(blk, offset, NULL, bytes, blk_write_entry, flags | BDRV_REQ_ZERO_WRITE); @@ -1361,7 +1361,7 @@ BlockAIOCB *blk_abort_aio_request(BlockBackend *blk, typedef struct BlkAioEmAIOCB { BlockAIOCB common; BlkRwCo rwco; - int bytes; + int64_t bytes; bool has_returned; } BlkAioEmAIOCB; =20 @@ -1385,7 +1385,8 @@ static void blk_aio_complete_bh(void *opaque) blk_aio_complete(acb); } =20 -static BlockAIOCB *blk_aio_prwv(BlockBackend *blk, int64_t offset, int byt= es, +static BlockAIOCB *blk_aio_prwv(BlockBackend *blk, + int64_t offset, int64_t bytes, void *iobuf, CoroutineEntry co_entry, BdrvRequestFlags flags, BlockCompletionFunc *cb, void *opaque) @@ -1442,31 +1443,31 @@ static void blk_aio_write_entry(void *opaque) } =20 BlockAIOCB *blk_aio_pwrite_zeroes(BlockBackend *blk, int64_t offset, - int count, BdrvRequestFlags flags, + int64_t bytes, BdrvRequestFlags flags, BlockCompletionFunc *cb, void *opaque) { - return blk_aio_prwv(blk, offset, count, NULL, blk_aio_write_entry, + return blk_aio_prwv(blk, offset, bytes, NULL, blk_aio_write_entry, flags | BDRV_REQ_ZERO_WRITE, cb, opaque); } =20 -int blk_pread(BlockBackend *blk, int64_t offset, void *buf, int count) +int blk_pread(BlockBackend *blk, int64_t offset, void *buf, int64_t bytes) { - int ret =3D blk_prw(blk, offset, buf, count, blk_read_entry, 0); + int ret =3D blk_prw(blk, offset, buf, bytes, blk_read_entry, 0); if (ret < 0) { return ret; } - return count; + return bytes; } =20 -int blk_pwrite(BlockBackend *blk, int64_t offset, const void *buf, int cou= nt, - BdrvRequestFlags flags) +int blk_pwrite(BlockBackend *blk, int64_t offset, const void *buf, + int64_t bytes, BdrvRequestFlags flags) { - int ret =3D blk_prw(blk, offset, (void *) buf, count, blk_write_entry, + int ret =3D blk_prw(blk, offset, (void *) buf, bytes, blk_write_entry, flags); if (ret < 0) { return ret; } - return count; + return bytes; } =20 int64_t blk_getlength(BlockBackend *blk) @@ -1567,7 +1568,7 @@ BlockAIOCB *blk_aio_ioctl(BlockBackend *blk, unsigned= long int req, void *buf, =20 /* To be called between exactly one pair of blk_inc/dec_in_flight() */ static int coroutine_fn -blk_do_pdiscard(BlockBackend *blk, int64_t offset, int bytes) +blk_do_pdiscard(BlockBackend *blk, int64_t offset, int64_t bytes) { int ret; =20 @@ -1591,14 +1592,15 @@ static void blk_aio_pdiscard_entry(void *opaque) } =20 BlockAIOCB *blk_aio_pdiscard(BlockBackend *blk, - int64_t offset, int bytes, + int64_t offset, int64_t bytes, BlockCompletionFunc *cb, void *opaque) { return blk_aio_prwv(blk, offset, bytes, NULL, blk_aio_pdiscard_entry, = 0, cb, opaque); } =20 -int coroutine_fn blk_co_pdiscard(BlockBackend *blk, int64_t offset, int by= tes) +int coroutine_fn blk_co_pdiscard(BlockBackend *blk, int64_t offset, + int64_t bytes) { int ret; =20 @@ -1618,7 +1620,7 @@ static void blk_pdiscard_entry(void *opaque) aio_wait_kick(); } =20 -int blk_pdiscard(BlockBackend *blk, int64_t offset, int bytes) +int blk_pdiscard(BlockBackend *blk, int64_t offset, int64_t bytes) { return blk_prw(blk, offset, NULL, bytes, blk_pdiscard_entry, 0); } @@ -2123,16 +2125,16 @@ void *blk_aio_get(const AIOCBInfo *aiocb_info, Bloc= kBackend *blk, } =20 int coroutine_fn blk_co_pwrite_zeroes(BlockBackend *blk, int64_t offset, - int bytes, BdrvRequestFlags flags) + int64_t bytes, BdrvRequestFlags flag= s) { return blk_co_pwritev(blk, offset, bytes, NULL, flags | BDRV_REQ_ZERO_WRITE); } =20 int blk_pwrite_compressed(BlockBackend *blk, int64_t offset, const void *b= uf, - int count) + int64_t bytes) { - return blk_prw(blk, offset, (void *) buf, count, blk_write_entry, + return blk_prw(blk, offset, (void *) buf, bytes, blk_write_entry, BDRV_REQ_WRITE_COMPRESSED); } =20 @@ -2358,7 +2360,7 @@ void blk_unregister_buf(BlockBackend *blk, void *host) =20 int coroutine_fn blk_co_copy_range(BlockBackend *blk_in, int64_t off_in, BlockBackend *blk_out, int64_t off_out, - int bytes, BdrvRequestFlags read_flags, + int64_t bytes, BdrvRequestFlags read_fl= ags, BdrvRequestFlags write_flags) { int r; --=20 2.21.0