Commit Graph

8 Commits

Author SHA1 Message Date
Joe Thornber
a512b8754b Revert "fix compile failed with libc musl (#103)"
This reverts commit 9311aa6483.
2018-08-02 07:12:22 +01:00
hongxu-jia
9311aa6483 fix compile failed with libc musl (#103)
There is a failure while compiling with libc musl:
[snip]
|./block-cache/io_engine.h:18:17: error: expected
unqualified-id before numeric constant
|  unsigned const PAGE_SIZE = 4096;
[snip]

The musl defeines macro PAGE_SIZE, undef it conditionally
could fix the issue.

http://musl.openwall.narkive.com/tO8vrHdP/why-musl-define-page-size

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
2018-08-01 07:10:26 +01:00
Jörg Thalheim
6a7351da0d Fix musl build (#96)
a) Fix build if limits.h provides definition for PAGE_SIZE, as musl does w/musl per XSI[1] although it's apparently optional [2].
   This value is only provided when it's known to be a constant, to avoid the need to discover the value dynamically.
b) If not using system-provided (kernel headers, or libc headers, or something) use the POSIX approach of querying the value
   dynamically using sysconf(_SC_PAGE_SIZE) instead of hardcoded value that hopefully is correct.
[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/limits.h.html
[2] http://www.openwall.com/lists/musl/2015/09/11/8

This patch originate from:

  https://raw.githubusercontent.com/voidlinux/void-packages/a0ece13ad7ab2aae760e09e41e0459bd999a3695/srcpkgs/thin-provisioning-tools/patches/musl.patch

and was also applied in NixOS:

  https://github.com/NixOS/nixpkgs/pull/40559/

cc @dtzWill
2018-05-22 14:02:49 +01:00
Joe Thornber
5fd0b02e40 [io-engine] Add missing include 2017-03-13 13:20:27 +00:00
Joe Thornber
0f778a0a38 [block-cache] FIx some bugs in the io engine 2016-06-14 16:26:37 +01:00
Joe Thornber
07f44e9c77 [io_engine] Add exclusive flag to io_engine 2016-06-07 13:45:27 +01:00
Joe Thornber
a94bfea798 [block-cache] unit tests + debug io_engine and copier 2016-06-07 11:12:27 +01:00
Joe Thornber
c8fec7ec40 [cache_writeback] Coded, needs testing 2016-04-14 08:54:32 +01:00