diff mbox series

block/export/fuse.c: fix fuse-lseek on uclibc or musl

Message ID 20210827220301.272887-1-fontaine.fabrice@gmail.com (mailing list archive)
State New, archived
Headers show
Series block/export/fuse.c: fix fuse-lseek on uclibc or musl | expand

Commit Message

Fabrice Fontaine Aug. 27, 2021, 10:03 p.m. UTC
Include linux/fs.h to avoid the following build failure on uclibc or
musl raised since version 6.0.0:

../block/export/fuse.c: In function 'fuse_lseek':
../block/export/fuse.c:641:19: error: 'SEEK_HOLE' undeclared (first use in this function)
  641 |     if (whence != SEEK_HOLE && whence != SEEK_DATA) {
      |                   ^~~~~~~~~
../block/export/fuse.c:641:19: note: each undeclared identifier is reported only once for each function it appears in
../block/export/fuse.c:641:42: error: 'SEEK_DATA' undeclared (first use in this function); did you mean 'SEEK_SET'?
  641 |     if (whence != SEEK_HOLE && whence != SEEK_DATA) {
      |                                          ^~~~~~~~~
      |                                          SEEK_SET

Fixes:
 - http://autobuild.buildroot.org/results/33c90ebf04997f4d3557cfa66abc9cf9a3076137

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 block/export/fuse.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Hanna Czenczek Sept. 1, 2021, 11:08 a.m. UTC | #1
On 28.08.21 00:03, Fabrice Fontaine wrote:
> Include linux/fs.h to avoid the following build failure on uclibc or
> musl raised since version 6.0.0:
>
> ../block/export/fuse.c: In function 'fuse_lseek':
> ../block/export/fuse.c:641:19: error: 'SEEK_HOLE' undeclared (first use in this function)
>    641 |     if (whence != SEEK_HOLE && whence != SEEK_DATA) {
>        |                   ^~~~~~~~~
> ../block/export/fuse.c:641:19: note: each undeclared identifier is reported only once for each function it appears in
> ../block/export/fuse.c:641:42: error: 'SEEK_DATA' undeclared (first use in this function); did you mean 'SEEK_SET'?
>    641 |     if (whence != SEEK_HOLE && whence != SEEK_DATA) {
>        |                                          ^~~~~~~~~
>        |                                          SEEK_SET
>
> Fixes:
>   - http://autobuild.buildroot.org/results/33c90ebf04997f4d3557cfa66abc9cf9a3076137
>
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
>   block/export/fuse.c | 3 +++
>   1 file changed, 3 insertions(+)

Thanks, applied to my block branch:

https://github.com/XanClic/qemu/commits/block

Hanna
diff mbox series

Patch

diff --git a/block/export/fuse.c b/block/export/fuse.c
index fc7b07d2b5..2e3bf8270b 100644
--- a/block/export/fuse.c
+++ b/block/export/fuse.c
@@ -31,6 +31,9 @@ 
 #include <fuse.h>
 #include <fuse_lowlevel.h>
 
+#ifdef __linux__
+#include <linux/fs.h>
+#endif
 
 /* Prevent overly long bounce buffer allocations */
 #define FUSE_MAX_BOUNCE_BYTES (MIN(BDRV_REQUEST_MAX_BYTES, 64 * 1024 * 1024))