+ /* drop lookup or getattr locks immediately */
+ if (it->it_op == IT_LOOKUP || it->it_op == IT_GETATTR) {
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
+ /* on 2.6 there are situation when several lookups and
+ * revalidations may be requested during single operation.
+ * therefore, we don't release intent here -bzzz */
+ ll_intent_drop_lock(it);
+#else
+ ll_intent_release(it);
+#endif
+ }
+}
+
+void ll_frob_intent(struct lookup_intent **itp, struct lookup_intent *deft)
+{
+ struct lookup_intent *it = *itp;
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
+ if (it && it->it_magic != INTENT_MAGIC) {
+ CERROR("WARNING: uninitialized intent\n");
+ LBUG();
+ }
+ if (it && (it->it_op == IT_GETATTR || it->it_op == 0))
+ it->it_op = IT_LOOKUP;
+#endif
+
+ if (!it || it->it_op == IT_GETXATTR)
+ it = *itp = deft;
+
+ it->it_op_release = ll_intent_release;
+}
+
+int ll_revalidate_it(struct dentry *de, int flags, struct lookup_intent *it)
+{
+ int rc;
+ struct ll_fid pfid, cfid;
+ struct it_cb_data icbd;
+ struct ll_uctxt ctxt;
+ struct ptlrpc_request *req = NULL;
+ struct lookup_intent lookup_it = { .it_op = IT_LOOKUP };
+ struct obd_export *exp;
+
+ ENTRY;
+ CDEBUG(D_VFSTRACE, "VFS Op:name=%s,intent=%s\n", de->d_name.name,
+ LL_IT2STR(it));
+
+ /* Cached negative dentries are unsafe for now - look them up again */
+ if (de->d_inode == NULL)
+ RETURN(0);
+
+ CDEBUG(D_INODE, "revalidate 0x%p: %*s -> %lu/%lu\n",
+ de, de->d_name.len, de->d_name.name,
+ (unsigned long) de->d_inode->i_ino,
+ (unsigned long) de->d_inode->i_generation);
+
+ exp = ll_i2mdcexp(de->d_inode);
+ ll_inode2fid(&pfid, de->d_parent->d_inode);
+ ll_inode2fid(&cfid, de->d_inode);
+ icbd.icbd_parent = de->d_parent->d_inode;
+ icbd.icbd_childp = &de;