Define HAVE_XFS_QUOTA to show if xfs quota is available.

Signed-off-by: DAN LI <[email protected]>
---
 configure.ac        |  1 +
 m4/ltp-xfs_quota.m4 | 39 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 40 insertions(+)
 create mode 100644 m4/ltp-xfs_quota.m4

diff --git a/configure.ac b/configure.ac
index f0fc6b0..1f95603 100644
--- a/configure.ac
+++ b/configure.ac
@@ -168,5 +168,6 @@ LTP_CHECK_ACL_SUPPORT
 LTP_CHECK_FS_IOC_FLAGS
 LTP_CHECK_MREMAP_FIXED
 LTP_CHECK_KERNEL_DEVEL
+LTP_CHECK_XFS_QUOTACTL

 AC_OUTPUT
diff --git a/m4/ltp-xfs_quota.m4 b/m4/ltp-xfs_quota.m4
new file mode 100644
index 0000000..bef7798
--- /dev/null
+++ b/m4/ltp-xfs_quota.m4
@@ -0,0 +1,39 @@
+dnl
+dnl Copyright (c) 2013 Fujitsu Ltd.
+dnl Author: DAN LI <[email protected]>
+dnl
+dnl This program is free software;  you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY;  without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+dnl the GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program;  if not, write to the Free Software
+dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 
USA
+dnl
+
+dnl
+dnl LTP_CHECK_XFS_QUOTACTL
+dnl ----------------------------
+dnl
+AC_DEFUN([LTP_CHECK_XFS_QUOTACTL],[dnl
+       AC_LINK_IFELSE([AC_LANG_SOURCE([
+#include <xfs/xqm.h>
+#include <sys/quota.h>
+int main(void) {
+       struct fs_quota_stat qstat;
+       return quotactl(QCMD(Q_XGETQSTAT, USRQUOTA), "/dev/null", geteuid(),
+                       (caddr_t) &qstat);
+}])],[has_xfs_quota="yes"])
+
+if test "x$has_xfs_quota" = xyes; then
+       AC_DEFINE(HAVE_XFS_QUOTA,1,[Define to 1 if you have xfs quota])
+else
+       AC_MSG_WARN(No xfs quota support)
+fi
+])
-- 
1.8.1

------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to