public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH v1 06/11] lapi/quotactl.h: Add fallback for quotactl_fd
@ 2021-10-18 13:14 Yang Xu
  2021-10-18 13:14 ` [LTP] [PATCH v1 07/11] syscalls/quotactl08: Test quoatctl01 but quota info hidden in filesystem Yang Xu
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Yang Xu @ 2021-10-18 13:14 UTC (permalink / raw)
  To: ltp

Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
---
 configure.ac                                    |  1 +
 include/lapi/quotactl.h                         | 16 +++++++++++++++-
 testcases/kernel/syscalls/quotactl/quotactl01.c |  2 +-
 testcases/kernel/syscalls/quotactl/quotactl04.c |  2 +-
 testcases/kernel/syscalls/quotactl/quotactl07.c |  2 +-
 5 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/configure.ac b/configure.ac
index 5bf3c52ec..859aa9857 100644
--- a/configure.ac
+++ b/configure.ac
@@ -122,6 +122,7 @@ AC_CHECK_FUNCS_ONCE([ \
     profil \
     pwritev \
     pwritev2 \
+    quotactl_fd \
     rand_r \
     readlinkat \
     recvmmsg \
diff --git a/include/lapi/quotactl.h b/include/lapi/quotactl.h
index 348b70b58..e265a6708 100644
--- a/include/lapi/quotactl.h
+++ b/include/lapi/quotactl.h
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
 /*
- * Copyright (c) 2017-2019 Fujitsu Ltd.
+ * Copyright (c) 2017-2021 FUJITSU LIMITED. All rights reserved
  * Author: Xiao Yang <yangx.jy@cn.fujitsu.com>
  * Author: Yang Xu <xuyang2018.jy@cn.jujitsu.com>
  */
@@ -9,6 +9,20 @@
 #define LAPI_QUOTACTL_H__
 
 #include <sys/quota.h>
+#include "lapi/syscalls.h"
+
+static inline void quotactl_fd_supported(void)
+{
+	/* allow the tests to fail early */
+	tst_syscall(__NR_quotactl_fd);
+}
+
+#ifndef HAVE_QUOTACTL_FD
+static inline int quotactl_fd(int fd, int cmd, int id, caddr_t addr)
+{
+	return tst_syscall(__NR_quotactl_fd, fd, cmd, id, addr);
+}
+#endif
 
 #ifdef HAVE_STRUCT_IF_NEXTDQBLK
 # include <linux/quota.h>
diff --git a/testcases/kernel/syscalls/quotactl/quotactl01.c b/testcases/kernel/syscalls/quotactl/quotactl01.c
index 4b791a03a..469c47437 100644
--- a/testcases/kernel/syscalls/quotactl/quotactl01.c
+++ b/testcases/kernel/syscalls/quotactl/quotactl01.c
@@ -63,8 +63,8 @@
 #include <string.h>
 #include <unistd.h>
 #include <stdio.h>
-#include "lapi/quotactl.h"
 #include "tst_test.h"
+#include "lapi/quotactl.h"
 
 #define USRPATH MNTPOINT "/aquota.user"
 #define GRPPATH MNTPOINT "/aquota.group"
diff --git a/testcases/kernel/syscalls/quotactl/quotactl04.c b/testcases/kernel/syscalls/quotactl/quotactl04.c
index ca6a94263..e01657de5 100644
--- a/testcases/kernel/syscalls/quotactl/quotactl04.c
+++ b/testcases/kernel/syscalls/quotactl/quotactl04.c
@@ -41,9 +41,9 @@
 #include <sys/stat.h>
 #include <sys/mount.h>
 #include "config.h"
+#include "tst_test.h"
 #include "lapi/quotactl.h"
 #include "tst_safe_stdio.h"
-#include "tst_test.h"
 
 #define FMTID QFMT_VFS_V1
 #define MNTPOINT	"mntpoint"
diff --git a/testcases/kernel/syscalls/quotactl/quotactl07.c b/testcases/kernel/syscalls/quotactl/quotactl07.c
index a55416f0e..f745e9b1c 100644
--- a/testcases/kernel/syscalls/quotactl/quotactl07.c
+++ b/testcases/kernel/syscalls/quotactl/quotactl07.c
@@ -16,8 +16,8 @@
 #include <unistd.h>
 #include <stdio.h>
 #include <sys/quota.h>
-#include "lapi/quotactl.h"
 #include "tst_test.h"
+#include "lapi/quotactl.h"
 
 #ifdef HAVE_XFS_XQM_H
 # include <xfs/xqm.h>
-- 
2.23.0


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

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2021-10-27  3:04 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-18 13:14 [LTP] [PATCH v1 06/11] lapi/quotactl.h: Add fallback for quotactl_fd Yang Xu
2021-10-18 13:14 ` [LTP] [PATCH v1 07/11] syscalls/quotactl08: Test quoatctl01 but quota info hidden in filesystem Yang Xu
2021-10-26 14:21   ` Cyril Hrubis
2021-10-27  3:04     ` xuyang2018.jy
2021-10-18 13:14 ` [LTP] [PATCH v1 08/11] syscalls/quotaclt02, 5: Add quotactl_fd test variant Yang Xu
2021-10-26 14:23   ` Cyril Hrubis
2021-10-18 13:14 ` [LTP] [PATCH v1 09/11] syscalls/quotactl03: " Yang Xu
2021-10-26 14:25   ` Cyril Hrubis
2021-10-18 13:14 ` [LTP] [PATCH v1 10/11] syscalls/quotactl04: " Yang Xu
2021-10-26 14:26   ` Cyril Hrubis
2021-10-26 14:13 ` [LTP] [PATCH v1 06/11] lapi/quotactl.h: Add fallback for quotactl_fd Cyril Hrubis
2021-10-27  2:58   ` xuyang2018.jy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox