- /* right now we're only interested in IT_OPEN and IT_LOOKUP */
- if (it) {
- CDEBUG(D_INFO, "name: %*s, intent: %s\n", de->d_name.len,
- de->d_name.name, ldlm_it2str(it->it_op));
- if (!(it->it_op & IT_OPEN))
- RETURN(0);
+ if (!request)
+ RETURN(0);
+
+ if (it_disposition(it, DISP_LOOKUP_NEG))
+ RETURN(-ENOENT);
+
+ sbi = ll_i2sbi(de->d_inode);
+ rc = ll_prep_inode(sbi->ll_osc_exp, sbi->ll_mdc_exp,
+ &de->d_inode, request, offset, NULL);
+
+ RETURN(rc);
+}
+
+void ll_lookup_finish_locks(struct lookup_intent *it, struct dentry *dentry)
+{
+ LASSERT(it != NULL);
+ LASSERT(dentry != NULL);
+
+ if (it->d.lustre.it_lock_mode && dentry->d_inode != NULL) {
+ struct inode *inode = dentry->d_inode;
+ CDEBUG(D_DLMTRACE, "setting l_data to inode %p (%lu/%u)\n",
+ inode, inode->i_ino, inode->i_generation);
+ mdc_set_lock_data(NULL, &it->d.lustre.it_lock_handle, inode);
+ }
+
+ /* 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