blob: 1838c88f0e7fb3e03e9b832b28082f7116f26bff [file] [log] [blame]
Andrew Geissler517393d2023-01-13 08:55:19 -06001From 38f5c88bf296dbbc04dcd57f36d64695055a2d3f Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 16 Dec 2022 20:19:49 -0800
4Subject: [PATCH 1/2] contrib/vhost-user-blk: Replace lseek64 with lseek
5
664bit off_t is already in use since build uses _FILE_OFFSET_BITS=64
7already. Using lseek/off_t also makes it work with latest must without
8using _LARGEFILE64_SOURCE macro. This macro is implied with _GNU_SOURCE
9when using glibc but not with musl.
10
11Upstream-Status: Submitted [https://lists.gnu.org/archive/html/qemu-devel/2022-12/msg02840.html]
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13Cc: Michael S. Tsirkin <mst@redhat.com>
14CC: 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
19diff --git a/contrib/vhost-user-blk/vhost-user-blk.c b/contrib/vhost-user-blk/vhost-user-blk.c
20index 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--
362.39.0
37