From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 2/2] tst_device: Move tst_dev_sync() into from header to source file
Date: Mon, 20 Jan 2020 14:36:46 +0100 [thread overview]
Message-ID: <20200120133646.8629-2-pvorel@suse.cz> (raw)
In-Reply-To: <20200120133646.8629-1-pvorel@suse.cz>
While socketcall01.c was already fixed by previous commit and we expect
nothing else was broken by 9e83513eb, it's still better not include
lapi/syscalls.h to everything which uses new C API.
Fixes: 9e83513eb "tst_device.h: Use lapi/syscalls.h instead of <sys/syscall.h>"
Suggested-by: Martin Doucha <mdoucha@suse.cz>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
Feel free to reject this one.
Kind regards,
Petr
include/tst_device.h | 6 +-----
lib/tst_device.c | 6 ++++++
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/include/tst_device.h b/include/tst_device.h
index 13d92ee54..64ea77768 100644
--- a/include/tst_device.h
+++ b/include/tst_device.h
@@ -19,7 +19,6 @@
#define TST_DEVICE_H__
#include <unistd.h>
-#include "lapi/syscalls.h"
struct tst_device {
const char *dev;
@@ -76,10 +75,7 @@ int tst_detach_device(const char *dev_path);
* simply before the tst_dev_bytes_written invocation. For easy to use,
* we create this inline function tst_dev_sync.
*/
-static inline int tst_dev_sync(int fd)
-{
- return syscall(__NR_syncfs, fd);
-}
+static int tst_dev_sync(int fd);
/*
* Reads test block device stat file and returns the bytes written since the
diff --git a/lib/tst_device.c b/lib/tst_device.c
index e78549c94..ade6fdd52 100644
--- a/lib/tst_device.c
+++ b/lib/tst_device.c
@@ -31,6 +31,7 @@
#include <linux/loop.h>
#include <stdint.h>
#include <inttypes.h>
+#include "lapi/syscalls.h"
#include "test.h"
#include "safe_macros.h"
@@ -222,6 +223,11 @@ int tst_detach_device(const char *dev)
return 1;
}
+static int tst_dev_sync(int fd)
+{
+ return syscall(__NR_syncfs, fd);
+}
+
const char *tst_acquire_device__(unsigned int size)
{
int fd;
--
2.24.1
next prev parent reply other threads:[~2020-01-20 13:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-20 13:36 [LTP] [PATCH 1/2] socketcall01: Use tst_syscall() instead of custom syscall support detection Petr Vorel
2020-01-20 13:36 ` Petr Vorel [this message]
2020-01-20 13:52 ` [LTP] [PATCH 2/2] tst_device: Move tst_dev_sync() into from header to source file Petr Vorel
2020-01-20 13:55 ` Cyril Hrubis
2020-01-20 14:05 ` Petr Vorel
2020-01-20 19:10 ` [LTP] [PATCH 1/2] socketcall01: Use tst_syscall() instead of custom syscall support detection Petr Vorel
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=20200120133646.8629-2-pvorel@suse.cz \
--to=pvorel@suse.cz \
--cc=ltp@lists.linux.it \
/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