[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 41/41] contrib/vhost-user-blk: Replace lseek64 with lseek
From: |
Michael S. Tsirkin |
Subject: |
[PULL 41/41] contrib/vhost-user-blk: Replace lseek64 with lseek |
Date: |
Wed, 21 Dec 2022 08:06:36 -0500 |
From: Khem Raj <raj.khem@gmail.com>
64bit off_t is already in use since build uses _FILE_OFFSET_BITS=64
already. Using lseek/off_t also makes it work with latest musl without
using _LARGEFILE64_SOURCE macro. This macro is implied with _GNU_SOURCE
when using glibc but not with musl.
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
CC: Raphael Norwitz <raphael.norwitz@nutanix.com>
Message-Id: <20221218220740.315839-1-raj.khem@gmail.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Raphael Norwitz <raphael.norwitz@nutanix.com>
---
contrib/vhost-user-blk/vhost-user-blk.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/contrib/vhost-user-blk/vhost-user-blk.c
b/contrib/vhost-user-blk/vhost-user-blk.c
index aa99877fcd..7941694e53 100644
--- a/contrib/vhost-user-blk/vhost-user-blk.c
+++ b/contrib/vhost-user-blk/vhost-user-blk.c
@@ -532,9 +532,9 @@ vub_get_blocksize(int fd)
static void
vub_initialize_config(int fd, struct virtio_blk_config *config)
{
- off64_t capacity;
+ off_t capacity;
- capacity = lseek64(fd, 0, SEEK_END);
+ capacity = lseek(fd, 0, SEEK_END);
config->capacity = capacity >> 9;
config->blk_size = vub_get_blocksize(fd);
config->size_max = 65536;
--
MST
- [PULL 29/41] pci: drop redundant PCIDeviceClass::is_bridge field, (continued)
- [PULL 29/41] pci: drop redundant PCIDeviceClass::is_bridge field, Michael S. Tsirkin, 2022/12/21
- [PULL 30/41] docs/acpi/bits: document BITS_DEBUG environment variable, Michael S. Tsirkin, 2022/12/21
- [PULL 34/41] hw/virtio: Add missing "hw/core/cpu.h" include, Michael S. Tsirkin, 2022/12/21
- [PULL 28/41] remove DEC 21154 PCI bridge, Michael S. Tsirkin, 2022/12/21
- [PULL 33/41] hw/cxl/device: Add Flex Bus Port DVSEC, Michael S. Tsirkin, 2022/12/21
- [PULL 31/41] acpi/tests/avocado/bits: add mformat as one of the dependencies, Michael S. Tsirkin, 2022/12/21
- [PULL 32/41] hw/acpi: Rename tco.c -> ich9_tco.c, Michael S. Tsirkin, 2022/12/21
- [PULL 35/41] hw/virtio: Rename virtio_ss[] -> specific_virtio_ss[], Michael S. Tsirkin, 2022/12/21
- [PULL 38/41] hw/virtio: Extract config read/write accessors to virtio-config-io.c, Michael S. Tsirkin, 2022/12/21
- [PULL 40/41] libvhost-user: Switch to unsigned int for inuse field in struct VuVirtq, Michael S. Tsirkin, 2022/12/21
- [PULL 41/41] contrib/vhost-user-blk: Replace lseek64 with lseek,
Michael S. Tsirkin <=
- [PULL 36/41] hw/virtio: Guard and restrict scope of qmp_virtio_feature_map_t[], Michael S. Tsirkin, 2022/12/21
- [PULL 37/41] hw/virtio: Constify qmp_virtio_feature_map_t[], Michael S. Tsirkin, 2022/12/21
- [PULL 39/41] hw/virtio: Extract QMP related code virtio-qmp.c, Michael S. Tsirkin, 2022/12/21
- Re: [PULL 00/41] virtio,pc,pci: features, cleanups, fixes, Peter Maydell, 2022/12/21