-
Notifications
You must be signed in to change notification settings - Fork 37.7k
util: use HAVE_FDATASYNC to determine fdatasync() use #19614
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Rather than just using it on Linux and NetBSD, use `fdatasync()` based on whether it's available. i.e it is available in newer versions of FreeBSD (11.1 and later). This also aligns our code more closely with what is being done in leveldb. Was pointed out by Luke in bitcoin#19430.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 1d8338d
HAVE_FDATASYNC
is defined here:
Lines 1014 to 1020 in 2f71a1e
dnl LevelDB platform checks | |
AC_MSG_CHECKING(for fdatasync) | |
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>]], | |
[[ fdatasync(0); ]])], | |
[ AC_MSG_RESULT(yes); HAVE_FDATASYNC=1 ], | |
[ AC_MSG_RESULT(no); HAVE_FDATASYNC=0 ] | |
) |
and dnl LevelDB platform checks
comment seems outdated now.
Guix builds
|
ACK 1d8338d -- patch looks correct |
Wait, we already probe for |
…) use 1d8338d util: use HAVE_FDATASYNC to determine fdatasync() use (fanquake) Pull request description: Rather than just using on Linux and NetBSD, use `fdatasync()` based on whether it's available. i.e `fdatasync` is available in newer versions of FreeBSD. This also aligns more closely with what is being done in leveldb. Was pointed out by Luke in bitcoin#19430. ACKs for top commit: practicalswift: ACK 1d8338d -- patch looks correct laanwj: ACK 1d8338d hebasto: ACK 1d8338d Tree-SHA512: 7dd6d87f5dc0c0ba21ae42f96b63fc12b34806cd536457fc4284f14bb8c235765344be228b000c6adf4cd1e8c4e6a03a18ca18ab22599c42cc3b706e0bcd1a17
|
… LevelDB c4b85ba Bugfix: Define and use HAVE_FDATASYNC correctly outside LevelDB (Luke Dashjr) Pull request description: Fixes a bug introduced in #19614 The LevelDB-specific fdatasync check was only using `AC_SUBST`, which works for Makefiles, but doesn't define anything for C++. Furthermore, the #define is typically 0 or 1, never undefined. This fixes both issues by defining it and checking its value instead of whether it is merely defined. Pulled out of #14501 by fanquake's request ACKs for top commit: fanquake: ACK c4b85ba - thanks for catching and fixing my mistake. laanwj: Code review ACK c4b85ba Tree-SHA512: 91d5d426ba000b4f3ee7e2315635e24bbb23ceff16269ddf4f65a63d25fc9e9cf94a3b236eed2f8031cc36ddcf78aeb5916efcb244f415943a8a12f907ede8f9
…outside LevelDB c4b85ba Bugfix: Define and use HAVE_FDATASYNC correctly outside LevelDB (Luke Dashjr) Pull request description: Fixes a bug introduced in bitcoin#19614 The LevelDB-specific fdatasync check was only using `AC_SUBST`, which works for Makefiles, but doesn't define anything for C++. Furthermore, the #define is typically 0 or 1, never undefined. This fixes both issues by defining it and checking its value instead of whether it is merely defined. Pulled out of bitcoin#14501 by fanquake's request ACKs for top commit: fanquake: ACK c4b85ba - thanks for catching and fixing my mistake. laanwj: Code review ACK c4b85ba Tree-SHA512: 91d5d426ba000b4f3ee7e2315635e24bbb23ceff16269ddf4f65a63d25fc9e9cf94a3b236eed2f8031cc36ddcf78aeb5916efcb244f415943a8a12f907ede8f9
Summary: > Rather than just using it on Linux and NetBSD, use `fdatasync()` based > on whether it's available. i.e it is available in newer versions > of FreeBSD (11.1 and later). > > This also aligns our code more closely with what is being done in leveldb. > > Was pointed out by Luke in #19430. This is a backport of [[bitcoin/bitcoin#19614 | core#19614]] Test Plan: `ninja all check-all` Reviewers: #bitcoin_abc, majcosta Reviewed By: #bitcoin_abc, majcosta Differential Revision: https://reviews.bitcoinabc.org/D10060
…) use 1d8338d util: use HAVE_FDATASYNC to determine fdatasync() use (fanquake) Pull request description: Rather than just using on Linux and NetBSD, use `fdatasync()` based on whether it's available. i.e `fdatasync` is available in newer versions of FreeBSD. This also aligns more closely with what is being done in leveldb. Was pointed out by Luke in bitcoin#19430. ACKs for top commit: practicalswift: ACK 1d8338d -- patch looks correct laanwj: ACK 1d8338d hebasto: ACK 1d8338d Tree-SHA512: 7dd6d87f5dc0c0ba21ae42f96b63fc12b34806cd536457fc4284f14bb8c235765344be228b000c6adf4cd1e8c4e6a03a18ca18ab22599c42cc3b706e0bcd1a17
…) use 1d8338d util: use HAVE_FDATASYNC to determine fdatasync() use (fanquake) Pull request description: Rather than just using on Linux and NetBSD, use `fdatasync()` based on whether it's available. i.e `fdatasync` is available in newer versions of FreeBSD. This also aligns more closely with what is being done in leveldb. Was pointed out by Luke in bitcoin#19430. ACKs for top commit: practicalswift: ACK 1d8338d -- patch looks correct laanwj: ACK 1d8338d hebasto: ACK 1d8338d Tree-SHA512: 7dd6d87f5dc0c0ba21ae42f96b63fc12b34806cd536457fc4284f14bb8c235765344be228b000c6adf4cd1e8c4e6a03a18ca18ab22599c42cc3b706e0bcd1a17
…) use 1d8338d util: use HAVE_FDATASYNC to determine fdatasync() use (fanquake) Pull request description: Rather than just using on Linux and NetBSD, use `fdatasync()` based on whether it's available. i.e `fdatasync` is available in newer versions of FreeBSD. This also aligns more closely with what is being done in leveldb. Was pointed out by Luke in bitcoin#19430. ACKs for top commit: practicalswift: ACK 1d8338d -- patch looks correct laanwj: ACK 1d8338d hebasto: ACK 1d8338d Tree-SHA512: 7dd6d87f5dc0c0ba21ae42f96b63fc12b34806cd536457fc4284f14bb8c235765344be228b000c6adf4cd1e8c4e6a03a18ca18ab22599c42cc3b706e0bcd1a17
Rather than just using on Linux and NetBSD, use
fdatasync()
basedon whether it's available. i.e
fdatasync
is available in newer versions of FreeBSD.This also aligns more closely with what is being done in leveldb.
Was pointed out by Luke in #19430.