Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame^] | 1 | From 38f5c88bf296dbbc04dcd57f36d64695055a2d3f Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Fri, 16 Dec 2022 20:19:49 -0800 |
| 4 | Subject: [PATCH 1/2] contrib/vhost-user-blk: Replace lseek64 with lseek |
| 5 | |
| 6 | 64bit off_t is already in use since build uses _FILE_OFFSET_BITS=64 |
| 7 | already. Using lseek/off_t also makes it work with latest must without |
| 8 | using _LARGEFILE64_SOURCE macro. This macro is implied with _GNU_SOURCE |
| 9 | when using glibc but not with musl. |
| 10 | |
| 11 | Upstream-Status: Submitted [https://lists.gnu.org/archive/html/qemu-devel/2022-12/msg02840.html] |
| 12 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 13 | Cc: Michael S. Tsirkin <mst@redhat.com> |
| 14 | CC: Raphael Norwitz <raphael.norwitz@nutanix.com> |
| 15 | --- |
| 16 | contrib/vhost-user-blk/vhost-user-blk.c | 4 ++-- |
| 17 | 1 file changed, 2 insertions(+), 2 deletions(-) |
| 18 | |
| 19 | diff --git a/contrib/vhost-user-blk/vhost-user-blk.c b/contrib/vhost-user-blk/vhost-user-blk.c |
| 20 | index aa99877fcd..7941694e53 100644 |
| 21 | --- a/contrib/vhost-user-blk/vhost-user-blk.c |
| 22 | +++ b/contrib/vhost-user-blk/vhost-user-blk.c |
| 23 | @@ -532,9 +532,9 @@ vub_get_blocksize(int fd) |
| 24 | static void |
| 25 | vub_initialize_config(int fd, struct virtio_blk_config *config) |
| 26 | { |
| 27 | - off64_t capacity; |
| 28 | + off_t capacity; |
| 29 | |
| 30 | - capacity = lseek64(fd, 0, SEEK_END); |
| 31 | + capacity = lseek(fd, 0, SEEK_END); |
| 32 | config->capacity = capacity >> 9; |
| 33 | config->blk_size = vub_get_blocksize(fd); |
| 34 | config->size_max = 65536; |
| 35 | -- |
| 36 | 2.39.0 |
| 37 | |