We read and write in sectors by default. It makes little sense to add
the extra _sector string for read and write ops/function name.
Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
It is supposed to have no write ops in ro_ops_nowrite disk operation.
However, there is one. Let's remove it.
Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
ro_ops is never used after the assignment, so no need to do the
assignment.
Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
For some reason some of the defines were set to HAS_VIRTIO instead of HAS_AIO.
This broke raw blk device.
Reported-and-tested-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
This patch hooks AIO support into virtio-blk, allowing for faster IO.
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
[ penberg@kernel.org: wrap libaio include with CONFIG_HAS_AIO ]
Signed-off-by: Pekka Enberg <penberg@kernel.org>
This patch adds an optional callback to be called when a disk op completes.
Currently theres not much use for it, but it is the infrastructure for adding
aio support.
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
This patch modifies the definition and usage of ops for read only, mmap and
regular IO.
There is no longer a mix between iov and mmap, and read only no longer implies
mmap (although it will try to use it first).
This allows for more flexibility defining different ops for different
scenarios.
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
This patch renames:
raw_image__read_sector_ro_mmap to raw_image__read_sector
raw_image__write_sector_ro_mmap to raw_image__write_sector
raw_image__close_ro_mmap to raw_image__close
Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Make read/write ops in 'struct disk_image_operations'
always return the number of bytes read/written and close/flush
ops return int.
Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
This patch moves raw image and blk device code into disk/raw.c
Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>