qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
To: qemu-devel@nongnu.org
Cc: Fabrice Fontaine <fontaine.fabrice@gmail.com>,
	Max Reitz <mreitz@redhat.com>
Subject: [PATCH] block/export/fuse.c: fix musl build
Date: Mon,  9 Aug 2021 10:50:21 +0200	[thread overview]
Message-ID: <20210809085021.783125-1-fontaine.fabrice@gmail.com> (raw)

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



             reply	other threads:[~2021-08-09  8:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-09  8:50 Fabrice Fontaine [this message]
2021-08-09  9:37 ` [PATCH] block/export/fuse.c: fix musl build Philippe Mathieu-Daudé
  -- strict thread matches above, loose matches on Subject: below --
2021-10-22  9:52 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210809085021.783125-1-fontaine.fabrice@gmail.com \
    --to=fontaine.fabrice@gmail.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).