public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Andrea Cervesato <andrea.cervesato@suse.de>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v5 04/16] Add listmount/statmount fallback declarations
Date: Tue, 08 Oct 2024 11:41:57 +0200	[thread overview]
Message-ID: <20241008-listmount_statmount-v5-4-66f4e1a9e7db@suse.com> (raw)
In-Reply-To: <20241008-listmount_statmount-v5-0-66f4e1a9e7db@suse.com>

From: Andrea Cervesato <andrea.cervesato@suse.com>

Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
---
 configure.ac         |  2 ++
 include/lapi/mount.h | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 72 insertions(+)

diff --git a/configure.ac b/configure.ac
index ebbf49e28..b4ab81e26 100644
--- a/configure.ac
+++ b/configure.ac
@@ -246,6 +246,8 @@ AC_CHECK_TYPES([struct mount_attr],,,[
 
 AC_CHECK_TYPES([struct cachestat_range],,,[#include <sys/mman.h>])
 AC_CHECK_TYPES([struct cachestat],,,[#include <sys/mman.h>])
+AC_CHECK_TYPES([struct mnt_id_req],,,[#include <linux/mount.h>])
+AC_CHECK_TYPES([struct statmount],,,[#include <linux/mount.h>])
 
 # Tools knobs
 
diff --git a/include/lapi/mount.h b/include/lapi/mount.h
index c1af944fe..01a0fd2d6 100644
--- a/include/lapi/mount.h
+++ b/include/lapi/mount.h
@@ -2,12 +2,15 @@
 /*
  * Copyright (c) Linux Test Project, 2015-2022
  * Copyright (c) 2015 Cui Bixuan <cuibixuan@huawei.com>
+ * Copyright (C) 2024 SUSE LLC Andrea Cervesato <andrea.cervesato@suse.com>
  */
 
 #ifndef LAPI_MOUNT_H__
 #define LAPI_MOUNT_H__
 
+#include <stdint.h>
 #include <sys/mount.h>
+#include "config.h"
 
 #ifndef MS_REC
 # define MS_REC 16384
@@ -37,4 +40,71 @@
 # define MS_NOSYMFOLLOW 256
 #endif
 
+#ifndef HAVE_STRUCT_MNT_ID_REQ
+struct mnt_id_req {
+	uint32_t size;
+	uint32_t spare;
+	uint64_t mnt_id;
+	uint64_t param;
+};
+#endif
+
+#ifndef HAVE_STRUCT_STATMOUNT
+struct statmount {
+	uint32_t size;
+	uint32_t __spare1;
+	uint64_t mask;
+	uint32_t sb_dev_major;
+	uint32_t sb_dev_minor;
+	uint64_t sb_magic;
+	uint32_t sb_flags;
+	uint32_t fs_type;
+	uint64_t mnt_id;
+	uint64_t mnt_parent_id;
+	uint32_t mnt_id_old;
+	uint32_t mnt_parent_id_old;
+	uint64_t mnt_attr;
+	uint64_t mnt_propagation;
+	uint64_t mnt_peer_group;
+	uint64_t mnt_master;
+	uint64_t propagate_from;
+	uint32_t mnt_root;
+	uint32_t mnt_point;
+	uint64_t __spare2[50];
+	char str[];
+};
+#endif
+
+#ifndef MNT_ID_REQ_SIZE_VER0
+# define MNT_ID_REQ_SIZE_VER0 24
+#endif
+
+#ifndef STATMOUNT_SB_BASIC
+# define STATMOUNT_SB_BASIC 0x00000001U
+#endif
+
+#ifndef STATMOUNT_MNT_BASIC
+# define STATMOUNT_MNT_BASIC 0x00000002U
+#endif
+
+#ifndef STATMOUNT_PROPAGATE_FROM
+# define STATMOUNT_PROPAGATE_FROM 0x00000004U
+#endif
+
+#ifndef STATMOUNT_MNT_ROOT
+# define STATMOUNT_MNT_ROOT 0x00000008U
+#endif
+
+#ifndef STATMOUNT_MNT_POINT
+# define STATMOUNT_MNT_POINT 0x00000010U
+#endif
+
+#ifndef STATMOUNT_FS_TYPE
+# define STATMOUNT_FS_TYPE 0x00000020U
+#endif
+
+#ifndef LSMT_ROOT
+# define LSMT_ROOT 0xffffffffffffffff
+#endif
+
 #endif /* LAPI_MOUNT_H__ */

-- 
2.43.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  parent reply	other threads:[~2024-10-08  9:43 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-08  9:41 [LTP] [PATCH v5 00/16] statmount/listmount testing suites Andrea Cervesato
2024-10-08  9:41 ` [LTP] [PATCH v5 01/16] Add SAFE_STATX macro Andrea Cervesato
2024-10-08  9:41 ` [LTP] [PATCH v5 02/16] Add TST_EXP_EQ_STR macro Andrea Cervesato
2024-10-08  9:41 ` [LTP] [PATCH v5 03/16] Add listmount/statmount syscalls Andrea Cervesato
2024-10-08  9:41 ` Andrea Cervesato [this message]
2024-10-08  9:41 ` [LTP] [PATCH v5 05/16] Add listmount01 test Andrea Cervesato
2024-10-08  9:41 ` [LTP] [PATCH v5 06/16] Add listmount02 test Andrea Cervesato
2024-10-08  9:42 ` [LTP] [PATCH v5 07/16] Add statmount01 test Andrea Cervesato
2024-10-08 11:54   ` Cyril Hrubis
2024-10-08  9:42 ` [LTP] [PATCH v5 08/16] Add statmount02 test Andrea Cervesato
2024-10-08  9:42 ` [LTP] [PATCH v5 09/16] Add statmount03 test Andrea Cervesato
2024-10-08  9:42 ` [LTP] [PATCH v5 10/16] Add statmount04 test Andrea Cervesato
2024-10-08  9:42 ` [LTP] [PATCH v5 11/16] Add statmount05 test Andrea Cervesato
2024-10-08 12:03   ` Cyril Hrubis
2024-10-08 13:57     ` Andrea Cervesato via ltp
2024-10-08 14:11       ` Andrea Cervesato via ltp
2024-10-08  9:42 ` [LTP] [PATCH v5 12/16] Add statmount06 test Andrea Cervesato
2024-10-08  9:42 ` [LTP] [PATCH v5 13/16] Add statmount07 test Andrea Cervesato
2024-10-08 12:27   ` Cyril Hrubis
2024-10-08  9:42 ` [LTP] [PATCH v5 14/16] Add statmount08 test Andrea Cervesato
2024-10-08 12:05   ` Cyril Hrubis
2024-10-08  9:42 ` [LTP] [PATCH v5 15/16] Add listmount03 test Andrea Cervesato
2024-10-08 12:08   ` Cyril Hrubis
2024-10-08  9:42 ` [LTP] [PATCH v5 16/16] Add listmount04 test Andrea Cervesato
2024-10-08 15:00   ` Cyril Hrubis
2024-10-08 15:33     ` Andrea Cervesato via ltp
2024-10-08 15:39       ` Cyril Hrubis

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=20241008-listmount_statmount-v5-4-66f4e1a9e7db@suse.com \
    --to=andrea.cervesato@suse.de \
    --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