block: implement BDRV_REQ_PREFETCH

Do effective copy-on-read request when we don't need data actually. It
will be used for block-stream and NBD_CMD_CACHE.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20190725100550.33801-2-vsementsov@virtuozzo.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
[eblake: comment grammar fix]
Signed-off-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
Vladimir Sementsov-Ogievskiy 2019-07-25 13:05:48 +03:00 committed by Eric Blake
parent aec21d3175
commit 3299e5ecf7
2 changed files with 19 additions and 7 deletions

View file

@ -88,8 +88,14 @@ typedef enum {
* fallback. */
BDRV_REQ_NO_FALLBACK = 0x100,
/*
* BDRV_REQ_PREFETCH may be used only together with BDRV_REQ_COPY_ON_READ
* on read request and means that caller doesn't really need data to be
* written to qiov parameter which may be NULL.
*/
BDRV_REQ_PREFETCH = 0x200,
/* Mask of valid flags */
BDRV_REQ_MASK = 0x1ff,
BDRV_REQ_MASK = 0x3ff,
} BdrvRequestFlags;
typedef struct BlockSizes {