1From 8c3fcbf23fe31cf56f21ce1737bf22fe65fc553b Mon Sep 17 00:00:00 2001
2From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
3Date: Fri, 27 Aug 2021 23:40:01 +0200
4Subject: [PATCH] block/export/fuse.c: fix fuse-lseek on uclibc or musl
5
6Include linux/fs.h to avoid the following build failure on uclibc or
7musl raised since version 6.0.0:
8
9../block/export/fuse.c: In function 'fuse_lseek':
10../block/export/fuse.c:641:19: error: 'SEEK_HOLE' undeclared (first use in this function)
11  641 |     if (whence != SEEK_HOLE && whence != SEEK_DATA) {
12      |                   ^~~~~~~~~
13../block/export/fuse.c:641:19: note: each undeclared identifier is reported only once for each function it appears in
14../block/export/fuse.c:641:42: error: 'SEEK_DATA' undeclared (first use in this function); did you mean 'SEEK_SET'?
15  641 |     if (whence != SEEK_HOLE && whence != SEEK_DATA) {
16      |                                          ^~~~~~~~~
17      |                                          SEEK_SET
18
19Fixes:
20 - http://autobuild.buildroot.org/results/33c90ebf04997f4d3557cfa66abc9cf9a3076137
21
22Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
23[Upstream status: https://patchwork.ozlabs.org/project/qemu-devel/patch/20210827220301.272887-1-fontaine.fabrice@gmail.com/]
24---
25 block/export/fuse.c | 3 +++
26 1 file changed, 3 insertions(+)
27
28diff --git a/block/export/fuse.c b/block/export/fuse.c
29index fc7b07d2b5..2e3bf8270b 100644
30--- a/block/export/fuse.c
31+++ b/block/export/fuse.c
32@@ -31,6 +31,9 @@
33 #include <fuse.h>
34 #include <fuse_lowlevel.h>
35
36+#ifdef __linux__
37+#include <linux/fs.h>
38+#endif
39
40 /* Prevent overly long bounce buffer allocations */
41 #define FUSE_MAX_BOUNCE_BYTES (MIN(BDRV_REQUEST_MAX_BYTES, 64 * 1024 * 1024))
42--
432.32.0
44
45