OSDN Git Service

block: Implement bdrv_{pread,pwrite,pwrite_zeroes}() using generated_co_wrapper
authorAlberto Faria <afaria@redhat.com>
Thu, 9 Jun 2022 15:27:41 +0000 (16:27 +0100)
committerHanna Reitz <hreitz@redhat.com>
Tue, 12 Jul 2022 10:14:56 +0000 (12:14 +0200)
commit1d39c7098bbfa6862cb96066c4f8f6735ea397c5
tree35affba54813edbb2151a09fd31c1ec404d5ab22
parentc1458c66b2a56a86d4e453b52dfd2c06040fe006
block: Implement bdrv_{pread,pwrite,pwrite_zeroes}() using generated_co_wrapper

bdrv_{pread,pwrite}() now return -EIO instead of -EINVAL when 'bytes' is
negative, making them consistent with bdrv_{preadv,pwritev}() and
bdrv_co_{pread,pwrite,preadv,pwritev}().

bdrv_pwrite_zeroes() now also calls trace_bdrv_co_pwrite_zeroes() and
clears the BDRV_REQ_MAY_UNMAP flag when appropriate, which it didn't
previously.

Signed-off-by: Alberto Faria <afaria@redhat.com>
Message-Id: <20220609152744.3891847-8-afaria@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
block/io.c
include/block/block-io.h