[LB_CHECK_FILE([$LINUX/include/linux/quotaio_v1.h],[
AC_DEFINE(HAVE_QUOTAIO_V1_H, 1,
[kernel has include/linux/quotaio_v1.h])
+],[LB_CHECK_FILE([$LINUX/fs/quotaio_v1.h],[
+ AC_DEFINE(HAVE_FS_QUOTAIO_V1_H, 1,
+ [kernel has fs/quotaio_v1.h])
],[LB_CHECK_FILE([$LINUX/fs/quota/quotaio_v1.h],[
AC_DEFINE(HAVE_FS_QUOTA_QUOTAIO_V1_H, 1,
[kernel has fs/quota/quotaio_v1.h])
])
])
])
+])
# sles10 sp2 need 5 parameter for vfs_symlink
AC_DEFUN([LC_VFS_SYMLINK_5ARGS],
#
# LC_QUOTA64
-# linux kernel have 64-bit limits support
+#
+# Check if kernel has been patched for 64-bit quota limits support.
+# The upstream version of this patch in RHEL6 2.6.32 kernels introduces
+# the constant QFMT_VFS_V1 in include/linux/quota.h, so we can check for
+# that in the absence of quotaio_v1.h in the kernel headers.
#
AC_DEFUN([LC_QUOTA64],[
AC_MSG_CHECKING([if kernel has 64-bit quota limits support])
# include <linux/quotaio_v2.h>
int versions[] = V2_INITQVERSIONS_R1;
struct v2_disk_dqblk_r1 dqblk_r1;
- #else
- # ifdef HAVE_FS_QUOTA_QUOTAIO_V1_H
- # include <quota/quotaio_v2.h>
- # else
- # include <quotaio_v2.h>
- # endif
+ #elif defined(HAVE_FS_QUOTA_QUOTAIO_V1_H)
+ # include <quota/quotaio_v2.h>
struct v2r1_disk_dqblk dqblk_r1;
+ #elif defined(HAVE_FS_QUOTAIO_V1_H)
+ # include <quotaio_v2.h>
+ struct v2r1_disk_dqblk dqblk_r1;
+ #else
+ #include <linux/quota.h>
+ int ver = QFMT_VFS_V1;
#endif
],[],[
AC_DEFINE(HAVE_QUOTA64, 1, [have quota64])
"admin_quotafile_v2.grp" /** group admin quotafile */\
}
+/*
+ * Definitions of structures for vfsv0 quota format
+ * Source linux/fs/quota/quotaio_v2.h
+ *
+ * The following definitions are normally found in private kernel headers.
+ * However, some sites build Lustre against kernel development headers rather
+ * than than full kernel source, so we provide them here for compatibility.
+ */
+#ifdef __KERNEL__
+# if !defined(HAVE_QUOTAIO_V1_H) && !defined(HAVE_FS_QUOTA_QUOTAIO_V1_H) && \
+ !defined(HAVE_FS_QUOTAIO_V1_H)
+
+#include <linux/types.h>
+#include <linux/quota.h>
+
+#define V2_INITQMAGICS {\
+ 0xd9c01f11, /* USRQUOTA */\
+ 0xd9c01927 /* GRPQUOTA */\
+}
+
+/* Header with type and version specific information */
+struct v2_disk_dqinfo {
+ __le32 dqi_bgrace; /* Time before block soft limit becomes hard limit */
+ __le32 dqi_igrace; /* Time before inode soft limit becomes hard limit */
+ __le32 dqi_flags; /* Flags for quotafile (DQF_*) */
+ __le32 dqi_blocks; /* Number of blocks in file */
+ __le32 dqi_free_blk; /* Number of first free block in the list */
+ __le32 dqi_free_entry; /* Number of block with at least one free entry */
+};
+
+/* First generic header */
+struct v2_disk_dqheader {
+ __le32 dqh_magic; /* Magic number identifying file */
+ __le32 dqh_version; /* File version */
+};
+#define V2_DQINFOOFF sizeof(struct v2_disk_dqheader) /* Offset of info header in file */
+#define QT_TREEOFF 1 /* Offset of tree in file in blocks */
+#define V2_DQTREEOFF QT_TREEOFF
+
+# endif /* !defined(HAVE_QUOTAIO_V1_H) ... */
+#endif /* __KERNEL__ */
+
/** @} quota */
#endif /* _LUSTRE_QUOTA_H */