diff mbox series

[v2,15/25] block: fix FreeBSD build failure with fallocate

Message ID 20220201182050.15087-16-alex.bennee@linaro.org
State New
Headers show
Series testing and plugin updates | expand

Commit Message

Alex Bennée Feb. 1, 2022, 6:20 p.m. UTC
We already use the CONFIG_FALLOCATE_PUNCH_HOLE symbol elsewhere in the
code so use it here.

Fixes: 4ca37a96a7 ("fuse: (Partially) implement fallocate()")
Cc: Hanna Reitz <hreitz@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 block/export/fuse.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Kevin Wolf Feb. 1, 2022, 7:52 p.m. UTC | #1
Am 01.02.2022 um 19:20 hat Alex Bennée geschrieben:
> We already use the CONFIG_FALLOCATE_PUNCH_HOLE symbol elsewhere in the
> code so use it here.
> 
> Fixes: 4ca37a96a7 ("fuse: (Partially) implement fallocate()")
> Cc: Hanna Reitz <hreitz@redhat.com>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

I think this addresses the same issue as Phil's series?

https://lists.gnu.org/archive/html/qemu-block/2022-02/msg00016.html

It's in the pull request I sent earlier today.

Kevin
diff mbox series

Patch

diff --git a/block/export/fuse.c b/block/export/fuse.c
index 6710d8aed8..7ed69c4a05 100644
--- a/block/export/fuse.c
+++ b/block/export/fuse.c
@@ -625,6 +625,7 @@  static void fuse_fallocate(fuse_req_t req, fuse_ino_t inode, int mode,
         return;
     }
 
+#ifdef CONFIG_FALLOCATE_PUNCH_HOLE
     if (mode & FALLOC_FL_KEEP_SIZE) {
         length = MIN(length, blk_len - offset);
     }
@@ -643,6 +644,7 @@  static void fuse_fallocate(fuse_req_t req, fuse_ino_t inode, int mode,
             length -= size;
         } while (ret == 0 && length > 0);
     }
+#endif
 #ifdef CONFIG_FALLOCATE_ZERO_RANGE
     else if (mode & FALLOC_FL_ZERO_RANGE) {
         if (!(mode & FALLOC_FL_KEEP_SIZE) && offset + length > blk_len) {