+
+ LASSERT(inode);
+ rc = md_find_cbdata(sbi->ll_md_exp, ll_inode2fid(inode),
+ return_if_equal, NULL);
+ if (rc != 0)
+ RETURN(rc);
+
+ lsm = ccc_inode_lsm_get(inode);
+ if (lsm == NULL)
+ RETURN(rc);
+
+ rc = obd_find_cbdata(sbi->ll_dt_exp, lsm, return_if_equal, NULL);
+ ccc_inode_lsm_put(inode, lsm);
+
+ RETURN(rc);
+}
+
+/**
+ * Called when last reference to a dentry is dropped and dcache wants to know
+ * whether or not it should cache it:
+ * - return 1 to delete the dentry immediately
+ * - return 0 to cache the dentry
+ * Should NOT be called with the dcache lock, see fs/dcache.c
+ */
+static int ll_ddelete(HAVE_D_DELETE_CONST struct dentry *de)
+{
+ ENTRY;
+ LASSERT(de);
+
+ CDEBUG(D_DENTRY, "%s dentry %.*s (%p, parent %p, inode %p) %s%s\n",
+ d_lustre_invalid((struct dentry *)de) ? "deleting" : "keeping",
+ de->d_name.len, de->d_name.name, de, de->d_parent, de->d_inode,
+ d_unhashed((struct dentry *)de) ? "" : "hashed,",
+ list_empty(&de->d_subdirs) ? "" : "subdirs");
+
+#ifdef HAVE_DCACHE_LOCK
+ LASSERT(d_refcount(de) == 0);
+#else
+ /* kernel >= 2.6.38 last refcount is decreased after this function. */
+ LASSERT(d_refcount(de) == 1);