xref: /OK3568_Linux_fs/buildroot/package/qemu/0004-block-export-fuse.c-fix-musl-build.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1From 304332039014679b809f606e2f227ee0fc43a451 Mon Sep 17 00:00:00 2001
2From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
3Date: Fri, 22 Oct 2021 11:52:09 +0200
4Subject: [PATCH] block/export/fuse.c: fix musl build
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9Include linux/falloc.h if CONFIG_FALLOCATE_ZERO_RANGE is defined to fix
10https://gitlab.com/qemu-project/qemu/-/commit/50482fda98bd62e072c30b7ea73c985c4e9d9bbb
11and avoid the following build failure on musl:
12
13../block/export/fuse.c: In function 'fuse_fallocate':
14../block/export/fuse.c:643:21: error: 'FALLOC_FL_ZERO_RANGE' undeclared (first use in this function)
15  643 |     else if (mode & FALLOC_FL_ZERO_RANGE) {
16      |                     ^~~~~~~~~~~~~~~~~~~~
17
18Fixes:
19 - http://autobuild.buildroot.org/results/be24433a429fda681fb66698160132c1c99bc53b
20
21Fixes: 50482fda98b ("block/export/fuse.c: fix musl build")
22Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
23Message-Id: <20211022095209.1319671-1-fontaine.fabrice@gmail.com>
24Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
25Signed-off-by: Kevin Wolf <kwolf@redhat.com>
26[Retrieved from:
27https://gitlab.com/qemu-project/qemu/-/commit/304332039014679b809f606e2f227ee0fc43a451]
28---
29 block/export/fuse.c | 4 ++++
30 1 file changed, 4 insertions(+)
31
32diff --git a/block/export/fuse.c b/block/export/fuse.c
33index 2e3bf8270b..823c126d23 100644
34--- a/block/export/fuse.c
35+++ b/block/export/fuse.c
36@@ -31,6 +31,10 @@
37 #include <fuse.h>
38 #include <fuse_lowlevel.h>
39
40+#if defined(CONFIG_FALLOCATE_ZERO_RANGE)
41+#include <linux/falloc.h>
42+#endif
43+
44 #ifdef __linux__
45 #include <linux/fs.h>
46 #endif
47--
48GitLab
49
50