- rc = vfs_follow_link(nd, symname);
- out:
- up(&lli->lli_open_sem);
- ptlrpc_free_req(request);
-
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,8))
+ rc = vfs_follow_link(nd, symname);
+#else
+#ifdef HAVE_COOKIE_FOLLOW_LINK
+ nd_set_link(nd, symname);
+ /* @symname may contain a pointer to the request message buffer,
+ we delay request releasing until ll_put_link then. */
+ RETURN(request);
+#else
+ if (request != NULL) {
+ /* falling back to recursive follow link if the request
+ * needs to be cleaned up still. */
+ rc = vfs_follow_link(nd, symname);
+ GOTO(out, rc);
+ }
+ nd_set_link(nd, symname);
+ RETURN(0);
+#endif
+#endif
+out:
+ ptlrpc_req_finished(request);
+#ifdef HAVE_COOKIE_FOLLOW_LINK
+ RETURN(ERR_PTR(rc));
+#else