[LTP] [PATCH v3 06/12] lapi/quotactl.h: Add fallback for quotactl_fd

Yang Xu xuyang2018.jy@fujitsu.com
Tue Nov 9 11:54:42 CET 2021


Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
---
 configure.ac            |  1 +
 include/lapi/quotactl.h | 12 ++++++++++--
 2 files changed, 11 insertions(+), 2 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 8e0315d03..739a85616 100644
--- a/include/lapi/quotactl.h
+++ b/include/lapi/quotactl.h
@@ -1,8 +1,8 @@
 // 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>
+ * Author: Yang Xu <xuyang2018.jy@fujitsu.com>
  */
 
 #ifndef LAPI_QUOTACTL_H__
@@ -10,6 +10,14 @@
 
 #include "config.h"
 #include <sys/quota.h>
+#include "lapi/syscalls.h"
+
+#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>
-- 
2.23.0



More information about the ltp mailing list