CC="$CC -m64"
])
-# UAPI headers, libcfs/include for util headers, lustre/include for liblustreapi and friends
-CPPFLAGS="-I$PWD/libcfs/include -I$PWD/lnet/utils/ -I$PWD/lnet/include/uapi -I$PWD/lustre/include -I$PWD/lustre/include/uapi $CPPFLAGS"
+# libcfs/include for util headers, lustre/include for liblustreapi and friends
+# UAPI headers from OpenSFS are included if modules support is enabled, otherwise
+# it will use the native kernel implementation.
+CPPFLAGS="-I$PWD/libcfs/include -I$PWD/lnet/utils/ -I$PWD/lustre/include $CPPFLAGS"
CCASFLAGS="-Wall -fPIC -D_GNU_SOURCE"
AC_SUBST(CCASFLAGS)
LC_GLIBC_SUPPORT_COPY_FILE_RANGE
LC_OPENSSL_SSK
LC_OPENSSL_GETSEPOL
+ LC_FID2PATH_ANON_UNION
+ LC_IOC_REMOVE_ENTRY
])
AS_IF([test "x$enable_tests" = xyes], [
LC_HAVE_LIBAIO
]) # LC_GLIBC_SUPPORT_COPY_FILE_RANGE
#
+# LC_FID2PATH_UNION
+#
+AC_DEFUN([LC_FID2PATH_ANON_UNION], [
+AC_MSG_CHECKING([if 'struct getinfo_fid2path' has anony•mous union])
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([
+ #include <linux/lustre/lustre_idl.h>
+
+ int main(void) {
+ struct getinfo_fid2path gf;
+ struct lu_fid root_fid;
+
+ *gf.gf_root_fid = root_fid;
+ return 0;
+ }
+])],[
+ AC_DEFINE(HAVE_FID2PATH_ANON_UNIONS, 1, [union is unnamed])
+ AC_MSG_RESULT("yes")
+])
+]) # LC_FID2PATH_ANON_UNION
+
+#
+# LC_IOC_REMOVE_ENTRY
+#
+AC_DEFUN([LC_IOC_REMOVE_ENTRY], [
+AC_MSG_CHECKING([if ioctl IOC_REMOVE_ENTRY' is supported])
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([
+ #include <sys/ioctl.h>
+ #include <linux/lustre/lustre_ioctl.h>
+
+ int main(void) {
+ return ioctl(0, LL_IOC_REMOVE_ENTRY, NULL);
+ }
+])],[
+ AC_DEFINE(HAVE_IOC_REMOVE_ENTRY, 1,
+ [IOC_REMOVE_ENTRY ioctl exists])
+])
+]) # LC_IOC_REMOVE_ENTRY
+
+#
# LC_STACK_SIZE
#
# Ensure the stack size is at least 8k in Lustre server (all kernels)
return rc;
}
+static inline char *get_gf_path(struct getinfo_fid2path *gf)
+{
+#ifndef HAVE_FID2PATH_ANON_UNIONS
+ return gf->gf_u.gf_path;
+#else
+ return gf->gf_path;
+#endif
+}
+
int llapi_fid2path_at(int mnt_fd, const struct lu_fid *fid,
char *path_buf, int path_buf_size,
long long *recno, int *linkno)
goto out;
}
- rc = copy_strip_dne_path(gf->gf_u.gf_path, path_buf, path_buf_size);
+ rc = copy_strip_dne_path(get_gf_path(gf), path_buf, path_buf_size);
if (recno != NULL)
*recno = gf->gf_recno;
int llapi_direntry_remove(char *dname)
{
+#ifdef HAVE_IOC_REMOVE_ENTRY
char *dirpath = NULL;
char *namepath = NULL;
char *dir;
if (fd != -1)
close(fd);
return rc;
+#else
+ return -ENOTSUP;
+#endif
}
int llapi_unlink_foreign(char *name)