+/**
+ * osd_lookup_one_len_unlocked
+ *
+ * @name: pathname component to lookup
+ * @base: base directory to lookup from
+ * @len: maximum length @len should be interpreted to
+ *
+ * This should be called without the parent
+ * i_mutex held, and will take the i_mutex itself.
+ */
+struct dentry *osd_lookup_one_len_unlocked(const char *name,
+ struct dentry *base, int len)
+{
+ struct dentry *dchild;
+
+ inode_lock(base->d_inode);
+ dchild = lookup_one_len(name, base, len);
+ inode_unlock(base->d_inode);
+
+ if (IS_ERR(dchild))
+ return dchild;
+
+ if (dchild->d_inode && unlikely(is_bad_inode(dchild->d_inode))) {
+ CERROR("bad inode returned %lu/%u\n",
+ dchild->d_inode->i_ino, dchild->d_inode->i_generation);
+ dput(dchild);
+ dchild = ERR_PTR(-ENOENT);
+ }
+
+ return dchild;
+}
+
+/**
+ * osd_ios_lookup_one_len - lookup single pathname component
+ *
+ * @name: pathname component to lookup
+ * @base: base directory to lookup from
+ * @len: maximum length @len should be interpreted to
+ */
+struct dentry *osd_ios_lookup_one_len(const char *name, struct dentry *base,
+ int len)
+{
+ return osd_lookup_one_len_unlocked(name, base, len);
+}
+