All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] block/export/fuse.c: fix musl build
@ 2021-10-22  9:52 Fabrice Fontaine
  2021-10-25  6:31 ` Michael Tokarev
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Fabrice Fontaine @ 2021-10-22  9:52 UTC (permalink / raw)
  To: qemu-devel; +Cc: Kevin Wolf, Hanna Reitz, Fabrice Fontaine, qemu-block

Include linux/falloc.h if CONFIG_FALLOCATE_ZERO_RANGE is defined to fix
https://gitlab.com/qemu-project/qemu/-/commit/50482fda98bd62e072c30b7ea73c985c4e9d9bbb
and avoid the following build failure on musl:

../block/export/fuse.c: In function 'fuse_fallocate':
../block/export/fuse.c:643:21: error: 'FALLOC_FL_ZERO_RANGE' undeclared (first use in this function)
  643 |     else if (mode & FALLOC_FL_ZERO_RANGE) {
      |                     ^~~~~~~~~~~~~~~~~~~~

Fixes:
 - http://autobuild.buildroot.org/results/be24433a429fda681fb66698160132c1c99bc53b

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

diff --git a/block/export/fuse.c b/block/export/fuse.c
index 2e3bf8270b..823c126d23 100644
--- a/block/export/fuse.c
+++ b/block/export/fuse.c
@@ -31,6 +31,10 @@
 #include <fuse.h>
 #include <fuse_lowlevel.h>
 
+#if defined(CONFIG_FALLOCATE_ZERO_RANGE)
+#include <linux/falloc.h>
+#endif
+
 #ifdef __linux__
 #include <linux/fs.h>
 #endif
-- 
2.33.0



^ permalink raw reply related	[flat|nested] 10+ messages in thread
* [PATCH] block/export/fuse.c: fix musl build
@ 2021-08-09  8:50 Fabrice Fontaine
  2021-08-09  9:37 ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 10+ messages in thread
From: Fabrice Fontaine @ 2021-08-09  8:50 UTC (permalink / raw)
  To: qemu-devel; +Cc: Fabrice Fontaine, Max Reitz

Fix the following build failure on musl raised since version 6.0.0 and
https://gitlab.com/qemu-project/qemu/-/commit/4ca37a96a75aafe7a37ba51ab1912b09b7190a6b
because musl does not define FALLOC_FL_ZERO_RANGE:

../block/export/fuse.c: In function 'fuse_fallocate':
../block/export/fuse.c:563:23: error: 'FALLOC_FL_ZERO_RANGE' undeclared (first use in this function)
  563 |     } else if (mode & FALLOC_FL_ZERO_RANGE) {
      |                       ^~~~~~~~~~~~~~~~~~~~

Fixes:
 - http://autobuild.buildroot.org/results/b96e3d364fd1f8bbfb18904a742e73327d308f64

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

diff --git a/block/export/fuse.c b/block/export/fuse.c
index ada9e263eb..07e31129a6 100644
--- a/block/export/fuse.c
+++ b/block/export/fuse.c
@@ -635,6 +635,7 @@ static void fuse_fallocate(fuse_req_t req, fuse_ino_t inode, int mode,
             offset += size;
             length -= size;
         } while (ret == 0 && length > 0);
+#ifdef FALLOC_FL_ZERO_RANGE
     } else if (mode & FALLOC_FL_ZERO_RANGE) {
         if (!(mode & FALLOC_FL_KEEP_SIZE) && offset + length > blk_len) {
             /* No need for zeroes, we are going to write them ourselves */
@@ -654,6 +655,7 @@ static void fuse_fallocate(fuse_req_t req, fuse_ino_t inode, int mode,
             offset += size;
             length -= size;
         } while (ret == 0 && length > 0);
+#endif
     } else if (!mode) {
         /* We can only fallocate at the EOF with a truncate */
         if (offset < blk_len) {
-- 
2.30.2



^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-10-25 13:43 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-22  9:52 [PATCH] block/export/fuse.c: fix musl build Fabrice Fontaine
2021-10-25  6:31 ` Michael Tokarev
2021-10-25  7:08   ` Fabrice Fontaine
2021-10-25  9:32 ` Kevin Wolf
2021-10-25  9:50   ` Fabrice Fontaine
2021-10-25 11:01 ` Philippe Mathieu-Daudé
2021-10-25 11:05   ` Philippe Mathieu-Daudé
2021-10-25 13:42 ` Kevin Wolf
  -- strict thread matches above, loose matches on Subject: below --
2021-08-09  8:50 Fabrice Fontaine
2021-08-09  9:37 ` Philippe Mathieu-Daudé

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.