* [lttng-dev] [PATCH] Make sync_file_range() usage optional
@ 2013-01-12 8:23 Samuel Martin
2013-01-13 16:48 ` Mathieu Desnoyers
2013-01-16 16:02 ` David Goulet
0 siblings, 2 replies; 3+ messages in thread
From: Samuel Martin @ 2013-01-12 8:23 UTC (permalink / raw)
Under uClibc, sync_file_range() is not available under all
architectures, so we fall back to fdatasync() in this case.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>
Signed-off-by: Samuel Martin <s.martin49 at gmail.com>
---
configure.ac | 2 +-
src/common/compat/compat-fcntl.c | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 425941b..80940c0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -150,7 +150,7 @@ AS_IF([test "x$lttng_ust_support" = "xyes"], [
)
])
AM_CONDITIONAL([HAVE_LIBLTTNG_UST_CTL], [test "x$lttng_ust_ctl_found" = xyes])
-AC_CHECK_FUNCS([sched_getcpu sysconf])
+AC_CHECK_FUNCS([sched_getcpu sysconf sync_file_range])
# check for dlopen
AC_CHECK_LIB([dl], [dlopen],
diff --git a/src/common/compat/compat-fcntl.c b/src/common/compat/compat-fcntl.c
index 5a1c757..7ff63a3 100644
--- a/src/common/compat/compat-fcntl.c
+++ b/src/common/compat/compat-fcntl.c
@@ -23,7 +23,11 @@
int compat_sync_file_range(int fd, off64_t offset, off64_t nbytes,
unsigned int flags)
{
+#ifdef HAVE_SYNC_FILE_RANGE
return sync_file_range(fd, offset, nbytes, flags);
+#else
+ return fdatasync(fd);
+#endif
}
#endif /* __linux__ */
--
1.8.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* [lttng-dev] [PATCH] Make sync_file_range() usage optional
2013-01-12 8:23 [lttng-dev] [PATCH] Make sync_file_range() usage optional Samuel Martin
@ 2013-01-13 16:48 ` Mathieu Desnoyers
2013-01-16 16:02 ` David Goulet
1 sibling, 0 replies; 3+ messages in thread
From: Mathieu Desnoyers @ 2013-01-13 16:48 UTC (permalink / raw)
* Samuel Martin (s.martin49 at gmail.com) wrote:
> Under uClibc, sync_file_range() is not available under all
> architectures, so we fall back to fdatasync() in this case.
Hi Samuel,
For future, please specify either of:
[PATCH urcu]
[PATCH lttng-tools]
[PATCH lttng-ust]
[PATCH lttng-modules]
in the subject.
This patch belongs to lttng-tools, so I CC David who maintains it.
Acked-by: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>
Thanks!
Mathieu
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>
> Signed-off-by: Samuel Martin <s.martin49 at gmail.com>
> ---
> configure.ac | 2 +-
> src/common/compat/compat-fcntl.c | 4 ++++
> 2 files changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/configure.ac b/configure.ac
> index 425941b..80940c0 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -150,7 +150,7 @@ AS_IF([test "x$lttng_ust_support" = "xyes"], [
> )
> ])
> AM_CONDITIONAL([HAVE_LIBLTTNG_UST_CTL], [test "x$lttng_ust_ctl_found" = xyes])
> -AC_CHECK_FUNCS([sched_getcpu sysconf])
> +AC_CHECK_FUNCS([sched_getcpu sysconf sync_file_range])
>
> # check for dlopen
> AC_CHECK_LIB([dl], [dlopen],
> diff --git a/src/common/compat/compat-fcntl.c b/src/common/compat/compat-fcntl.c
> index 5a1c757..7ff63a3 100644
> --- a/src/common/compat/compat-fcntl.c
> +++ b/src/common/compat/compat-fcntl.c
> @@ -23,7 +23,11 @@
> int compat_sync_file_range(int fd, off64_t offset, off64_t nbytes,
> unsigned int flags)
> {
> +#ifdef HAVE_SYNC_FILE_RANGE
> return sync_file_range(fd, offset, nbytes, flags);
> +#else
> + return fdatasync(fd);
> +#endif
> }
>
> #endif /* __linux__ */
> --
> 1.8.1
>
>
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
--
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* [lttng-dev] [PATCH] Make sync_file_range() usage optional
2013-01-12 8:23 [lttng-dev] [PATCH] Make sync_file_range() usage optional Samuel Martin
2013-01-13 16:48 ` Mathieu Desnoyers
@ 2013-01-16 16:02 ` David Goulet
1 sibling, 0 replies; 3+ messages in thread
From: David Goulet @ 2013-01-16 16:02 UTC (permalink / raw)
Merged!
Thanks!
David
Samuel Martin:
> Under uClibc, sync_file_range() is not available under all
> architectures, so we fall back to fdatasync() in this case.
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>
> Signed-off-by: Samuel Martin <s.martin49 at gmail.com>
> ---
> configure.ac | 2 +-
> src/common/compat/compat-fcntl.c | 4 ++++
> 2 files changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/configure.ac b/configure.ac
> index 425941b..80940c0 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -150,7 +150,7 @@ AS_IF([test "x$lttng_ust_support" = "xyes"], [
> )
> ])
> AM_CONDITIONAL([HAVE_LIBLTTNG_UST_CTL], [test "x$lttng_ust_ctl_found" = xyes])
> -AC_CHECK_FUNCS([sched_getcpu sysconf])
> +AC_CHECK_FUNCS([sched_getcpu sysconf sync_file_range])
>
> # check for dlopen
> AC_CHECK_LIB([dl], [dlopen],
> diff --git a/src/common/compat/compat-fcntl.c b/src/common/compat/compat-fcntl.c
> index 5a1c757..7ff63a3 100644
> --- a/src/common/compat/compat-fcntl.c
> +++ b/src/common/compat/compat-fcntl.c
> @@ -23,7 +23,11 @@
> int compat_sync_file_range(int fd, off64_t offset, off64_t nbytes,
> unsigned int flags)
> {
> +#ifdef HAVE_SYNC_FILE_RANGE
> return sync_file_range(fd, offset, nbytes, flags);
> +#else
> + return fdatasync(fd);
> +#endif
> }
>
> #endif /* __linux__ */
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-01-16 16:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-12 8:23 [lttng-dev] [PATCH] Make sync_file_range() usage optional Samuel Martin
2013-01-13 16:48 ` Mathieu Desnoyers
2013-01-16 16:02 ` David Goulet
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox