[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL for-2.8 09/13] block/curl: Use BDRV_SECTOR_SIZE
From: |
Jeff Cody |
Subject: |
[Qemu-devel] [PULL for-2.8 09/13] block/curl: Use BDRV_SECTOR_SIZE |
Date: |
Mon, 14 Nov 2016 23:14:47 -0500 |
From: Max Reitz <address@hidden>
Currently, curl defines its own constant SECTOR_SIZE. There is no
advantage over using the global BDRV_SECTOR_SIZE, so drop it.
Cc: address@hidden
Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-id: address@hidden
Signed-off-by: Jeff Cody <address@hidden>
---
block/curl.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/block/curl.c b/block/curl.c
index ba8adae..1d19e64 100644
--- a/block/curl.c
+++ b/block/curl.c
@@ -72,7 +72,6 @@ static CURLMcode __curl_multi_socket_action(CURLM
*multi_handle,
#define CURL_NUM_STATES 8
#define CURL_NUM_ACB 8
-#define SECTOR_SIZE 512
#define READ_AHEAD_DEFAULT (256 * 1024)
#define CURL_TIMEOUT_DEFAULT 5
#define CURL_TIMEOUT_MAX 10000
@@ -737,12 +736,12 @@ static void curl_readv_bh_cb(void *p)
CURLAIOCB *acb = p;
BDRVCURLState *s = acb->common.bs->opaque;
- size_t start = acb->sector_num * SECTOR_SIZE;
+ size_t start = acb->sector_num * BDRV_SECTOR_SIZE;
size_t end;
// In case we have the requested data already (e.g. read-ahead),
// we can just call the callback and be done.
- switch (curl_find_buf(s, start, acb->nb_sectors * SECTOR_SIZE, acb)) {
+ switch (curl_find_buf(s, start, acb->nb_sectors * BDRV_SECTOR_SIZE, acb)) {
case FIND_RET_OK:
qemu_aio_unref(acb);
// fall through
@@ -761,7 +760,7 @@ static void curl_readv_bh_cb(void *p)
}
acb->start = 0;
- acb->end = (acb->nb_sectors * SECTOR_SIZE);
+ acb->end = (acb->nb_sectors * BDRV_SECTOR_SIZE);
state->buf_off = 0;
g_free(state->orig_buf);
@@ -778,8 +777,8 @@ static void curl_readv_bh_cb(void *p)
state->acb[0] = acb;
snprintf(state->range, 127, "%zd-%zd", start, end);
- DPRINTF("CURL (AIO): Reading %d at %zd (%s)\n",
- (acb->nb_sectors * SECTOR_SIZE), start, state->range);
+ DPRINTF("CURL (AIO): Reading %llu at %zd (%s)\n",
+ (acb->nb_sectors * BDRV_SECTOR_SIZE), start, state->range);
curl_easy_setopt(state->curl, CURLOPT_RANGE, state->range);
curl_multi_add_handle(s->multi, state->curl);
--
2.7.4
- [Qemu-devel] [PULL for-2.8 00/13] Block patches for 2.8, Jeff Cody, 2016/11/14
- [Qemu-devel] [PULL for-2.8 01/13] blockjob: fix dead pointer in txn list, Jeff Cody, 2016/11/14
- [Qemu-devel] [PULL for-2.8 02/13] blockjob: add .clean property, Jeff Cody, 2016/11/14
- [Qemu-devel] [PULL for-2.8 03/13] blockjob: add .start field, Jeff Cody, 2016/11/14
- [Qemu-devel] [PULL for-2.8 04/13] blockjob: add block_job_start, Jeff Cody, 2016/11/14
- [Qemu-devel] [PULL for-2.8 07/13] qemu-iotests: avoid spurious failure on test 109, Jeff Cody, 2016/11/14
- [Qemu-devel] [PULL for-2.8 05/13] blockjob: refactor backup_start as backup_job_create, Jeff Cody, 2016/11/14
- [Qemu-devel] [PULL for-2.8 06/13] iotests: add transactional failure race test, Jeff Cody, 2016/11/14
- [Qemu-devel] [PULL for-2.8 09/13] block/curl: Use BDRV_SECTOR_SIZE,
Jeff Cody <=
- [Qemu-devel] [PULL for-2.8 10/13] block/curl: Fix return value from curl_read_cb, Jeff Cody, 2016/11/14
- [Qemu-devel] [PULL for-2.8 08/13] block/curl: Drop TFTP "support", Jeff Cody, 2016/11/14
- [Qemu-devel] [PULL for-2.8 11/13] block/curl: Remember all sockets, Jeff Cody, 2016/11/14
- [Qemu-devel] [PULL for-2.8 12/13] block/curl: Do not wait for data beyond EOF, Jeff Cody, 2016/11/14
- [Qemu-devel] [PULL for-2.8 13/13] mirror: do not flush every time the disks are synced, Jeff Cody, 2016/11/14
- Re: [Qemu-devel] [Qemu-block] [PULL for-2.8 00/13] Block patches for 2.8, Stefan Hajnoczi, 2016/11/15