+static struct lu_object *htable_lookup_nowait(struct lu_site *s,
+ cfs_hash_bd_t *bd,
+ const struct lu_fid *f)
+{
+ cfs_hlist_node_t *hnode;
+ struct lu_object_header *h;
+
+ /* cfs_hash_bd_peek_locked is a somehow "internal" function
+ * of cfs_hash, it doesn't add refcount on object. */
+ hnode = cfs_hash_bd_peek_locked(s->ls_obj_hash, bd, (void *)f);
+ if (hnode == NULL) {
+ lprocfs_counter_incr(s->ls_stats, LU_SS_CACHE_MISS);
+ return ERR_PTR(-ENOENT);
+ }
+
+ h = container_of0(hnode, struct lu_object_header, loh_hash);
+ if (unlikely(lu_object_is_dying(h)))
+ return ERR_PTR(-ENOENT);
+
+ cfs_hash_get(s->ls_obj_hash, hnode);
+ lprocfs_counter_incr(s->ls_stats, LU_SS_CACHE_HIT);
+ cfs_list_del_init(&h->loh_lru);
+ return lu_object_top(h);
+}
+