diff mbox series

[v2,06/13] lapi/quotactl.h: Add fallback for quotactl_fd

Message ID 1635337706-4788-1-git-send-email-xuyang2018.jy@fujitsu.com
State Changes Requested
Headers show
Series [v2,01/13] syscalls/quotactl01: Also test with vfsv1 format | expand

Commit Message

Yang Xu Oct. 27, 2021, 12:28 p.m. UTC
Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
---
 configure.ac            |  1 +
 include/lapi/quotactl.h | 12 ++++++++++--
 2 files changed, 11 insertions(+), 2 deletions(-)

Comments

Cyril Hrubis Nov. 8, 2021, 4:11 p.m. UTC | #1
Hi!
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
diff mbox series

Patch

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>