All of lore.kernel.org
 help / color / mirror / Atom feed
From: Xiao Yang <yangx.jy@cn.fujitsu.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v2 1/4] lib/tst_path_has_mnt_flags.c: Factor out tst_path_has_mnt_flags() for new API
Date: Thu, 16 Aug 2018 16:45:44 +0800	[thread overview]
Message-ID: <1534409147-29519-1-git-send-email-yangx.jy@cn.fujitsu.com> (raw)
In-Reply-To: <20180815114220.GA26923@rei>

We can use existed tst_path_has_mnt_flags() to check whether a path is
on a filesystem that is mounted with specified flags, so ensure that the
function can also be used by new API.

Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
---
 include/old/test.h               | 13 +------------
 include/tst_path_has_mnt_flags.h | 22 ++++++++++++++++++++++
 include/tst_test.h               |  1 +
 3 files changed, 24 insertions(+), 12 deletions(-)
 create mode 100644 include/tst_path_has_mnt_flags.h

diff --git a/include/old/test.h b/include/old/test.h
index 5eef304..25d7152 100644
--- a/include/old/test.h
+++ b/include/old/test.h
@@ -64,6 +64,7 @@
 #include "old_tmpdir.h"
 #include "tst_minmax.h"
 #include "tst_get_bad_addr.h"
+#include "tst_path_has_mnt_flags.h"
 
 /*
  * Ensure that NUMSIGS is defined.
@@ -236,18 +237,6 @@ unsigned short tst_get_unused_port(void (cleanup_fn)(void),
 const char *tst_strsig(int sig);
 const char *tst_strerrno(int err);
 
-/* lib/tst_path_has_mnt_flags.c
- *
- * Check whether a path is on a filesystem that is mounted with
- * specified flags
- * @path: path to file, if path is NULL tst_tmpdir is used.
- * @flags: NULL or NULL terminated array of mount flags
- *
- * Return: 0..n - number of flags matched
- */
-int tst_path_has_mnt_flags(void (cleanup_fn)(void),
-		const char *path, const char *flags[]);
-
 #ifdef TST_USE_COMPAT16_SYSCALL
 #define TCID_BIT_SUFFIX "_16"
 #elif  TST_USE_NEWER64_SYSCALL
diff --git a/include/tst_path_has_mnt_flags.h b/include/tst_path_has_mnt_flags.h
new file mode 100644
index 0000000..1b16f1b
--- /dev/null
+++ b/include/tst_path_has_mnt_flags.h
@@ -0,0 +1,22 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
+ * Author: Xiao Yang <yangx.jy@cn.fujitsu.com>
+ */
+
+#ifndef TST_PATH_HAS_MNT_FLAGS_H__
+#define TST_PATH_HAS_MNT_FLAGS_H__
+
+/* lib/tst_path_has_mnt_flags.c
+ *
+ * Check whether a path is on a filesystem that is mounted with
+ * specified flags
+ * @path: path to file, if path is NULL tst_tmpdir is used.
+ * @flags: NULL or NULL terminated array of mount flags
+ *
+ * Return: 0..n - number of flags matched
+ */
+int tst_path_has_mnt_flags(void (*cleanup_fn)(void),
+		const char *path, const char *flags[]);
+
+#endif	/* TST_PATH_HAS_MNT_FLAGS_H__ */
diff --git a/include/tst_test.h b/include/tst_test.h
index 98dacf3..f7d109a 100644
--- a/include/tst_test.h
+++ b/include/tst_test.h
@@ -41,6 +41,7 @@
 #include "tst_kernel.h"
 #include "tst_minmax.h"
 #include "tst_get_bad_addr.h"
+#include "tst_path_has_mnt_flags.h"
 
 /*
  * Reports testcase result.
-- 
1.8.3.1




  reply	other threads:[~2018-08-16  8:45 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-04  8:00 [LTP] [PATCH] syscalls/open11.c: Fix the failure of opening device special file Xiao Yang
2018-07-23  1:42 ` Xiao Yang
2018-08-15 11:42 ` Cyril Hrubis
2018-08-16  8:45   ` Xiao Yang [this message]
2018-08-16  8:45     ` [LTP] [PATCH v2 2/4] lib/tst_test.c: add .needs_devfs flag Xiao Yang
2018-08-16 13:28       ` Cyril Hrubis
2018-08-17  4:26         ` Xiao Yang
2018-08-17  4:33         ` [LTP] [PATCH v3 2/2] lib/tst_test.c: Add " Xiao Yang
2018-08-30 14:49           ` Cyril Hrubis
2018-08-31  2:58             ` Xiao Yang
2018-09-01  4:07             ` [LTP] [PATCH v4 " Xiao Yang
2018-08-31 12:31               ` Cyril Hrubis
2018-09-03  2:14                 ` Xiao Yang
2018-09-03 13:01                   ` Cyril Hrubis
2018-08-16  8:45     ` [LTP] [PATCH v2 3/4] syscalls/open11.c: Fix the failure of opening device special files Xiao Yang
2018-08-16  8:45     ` [LTP] [PATCH v2 4/4] syscalls/fsetxattr02.c: Fix the failure of opening device files Xiao Yang

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=1534409147-29519-1-git-send-email-yangx.jy@cn.fujitsu.com \
    --to=yangx.jy@cn.fujitsu.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.