]) # LC_NEW_CANCEL_DIRTY_PAGE
#
+# LC_SYMLINK_OPS_USE_NAMEIDATA
+#
+# For the 4.2+ kernels the file system internal symlink api no
+# longer uses struct nameidata as a argument
+#
+AC_DEFUN([LC_SYMLINK_OPS_USE_NAMEIDATA], [
+LB_CHECK_COMPILE([if symlink inode operations have struct nameidata argument],
+symlink_use_nameidata, [
+ #include <linux/namei.h>
+ #include <linux/fs.h>
+],[
+ struct nameidata *nd = NULL;
+
+ ((struct inode_operations *)0)->follow_link(NULL, nd);
+ ((struct inode_operations *)0)->put_link(NULL, nd, NULL);
+],[
+ AC_DEFINE(HAVE_SYMLINK_OPS_USE_NAMEIDATA, 1,
+ [symlink inode operations need struct nameidata argument])
+])
+]) # LC_SYMLINK_OPS_USE_NAMEIDATA
+
+#
# LC_PROG_LINUX
#
# Lustre linux kernel checks
# 4.2
LC_NEW_CANCEL_DIRTY_PAGE
+ LC_SYMLINK_OPS_USE_NAMEIDATA
#
AS_IF([test "x$enable_server" != xno], [
RETURN (rc);
}
+#ifdef HAVE_SYMLINK_OPS_USE_NAMEIDATA
static void *ll_follow_link(struct dentry *dentry, struct nameidata *nd)
{
struct inode *inode = dentry->d_inode;
*/
RETURN(request);
}
+#else
+static const char *ll_follow_link(struct dentry *dentry, void **cookie)
+{
+ struct inode *inode = d_inode(dentry);
+ struct ptlrpc_request *request;
+ char *symname;
+ int rc;
+ ENTRY;
+
+ CDEBUG(D_VFSTRACE, "VFS Op\n");
+ ll_inode_size_lock(inode);
+ rc = ll_readlink_internal(inode, &request, &symname);
+ ll_inode_size_unlock(inode);
+ if (rc < 0) {
+ ptlrpc_req_finished(request);
+ return ERR_PTR(rc);
+ }
+
+ /* symname may contain a pointer to the request message buffer,
+ * we delay request releasing until ll_put_link then.
+ */
+ *cookie = request;
+ RETURN(symname);
+}
+#endif /* HAVE_SYMLINK_OPS_USE_NAMEIDATA */
+#ifdef HAVE_SYMLINK_OPS_USE_NAMEIDATA
static void ll_put_link(struct dentry *dentry, struct nameidata *nd, void *cookie)
+#else
+static void ll_put_link(struct inode *unused, void *cookie)
+#endif
{
ptlrpc_req_finished(cookie);
}