LASSERT(ll_d_count(de) == 1);
#endif
- /* Disable this piece of code temproarily because this is called
- * inside dcache_lock so it's not appropriate to do lots of work
- * here. ATTENTION: Before this piece of code enabling, LU-2487 must be
- * resolved. */
-#if 0
- /* if not ldlm lock for this inode, set i_nlink to 0 so that
- * this inode can be recycled later b=20433 */
- if (de->d_inode && !find_cbdata(de->d_inode))
- clear_nlink(de->d_inode);
-#endif
-
if (d_lustre_invalid((struct dentry *)de))
RETURN(1);
RETURN(0);
return 1;
/* Symlink - always valid as long as the dentry was found */
+#ifdef HAVE_IOP_GET_LINK
+ if (dentry->d_inode && dentry->d_inode->i_op->get_link)
+#else
if (dentry->d_inode && dentry->d_inode->i_op->follow_link)
+#endif
return 1;
- /* Last path component lookup for open or create - we always
- * return 0 here to go through re-lookup and properly signal
- * MDS whenever we do or do not want an open-cache to be engaged.
- * For create we also ensure the entry is really created no matter
- * what races might have happened.
- * LU-4367 */
- if (lookup_flags & (LOOKUP_OPEN | LOOKUP_CREATE))
+ /*
+ * if open&create is set, talk to MDS to make sure file is created if
+ * necessary, because we can't do this in ->open() later since that's
+ * called on an inode. return 0 here to let lookup to handle this.
+ */
+ if ((lookup_flags & (LOOKUP_OPEN | LOOKUP_CREATE)) ==
+ (LOOKUP_OPEN | LOOKUP_CREATE))
return 0;
if (!dentry_may_statahead(dir, dentry))