Whamcloud - gitweb
Revert "LU-1013 obdclass: lu_object_find miss to unlink object from LRU"
authorOleg Drokin <green@whamcloud.com>
Wed, 15 Feb 2012 18:41:03 +0000 (13:41 -0500)
committerOleg Drokin <green@whamcloud.com>
Thu, 16 Feb 2012 16:12:52 +0000 (11:12 -0500)
Reverting because in fact it overlaps with LU-1017

This reverts commit b9ccecd1453c5c76fe135048c39f149c241650c6.

Signed-off-by: Oleg Drokin <green@whamcloud.com>
lustre/obdclass/lu_object.c

index 6057254..7d274d4 100644 (file)
@@ -618,7 +618,7 @@ static struct lu_object *lu_object_find_try(const struct lu_env *env,
         cfs_hash_bd_lock(hs, &bd, 1);
 
         shadow = htable_lookup(s, &bd, f, waiter, &version);
-        if (shadow == NULL) {
+        if (likely(shadow == NULL)) {
                 struct lu_site_bkt_data *bkt;
 
                 bkt = cfs_hash_bd_extra_get(hs, &bd);
@@ -626,14 +626,12 @@ static struct lu_object *lu_object_find_try(const struct lu_env *env,
                 bkt->lsb_busy++;
                 cfs_hash_bd_unlock(hs, &bd, 1);
                 return o;
-        } else {
-                if (!cfs_list_empty(&shadow->lo_header->loh_lru))
-                        cfs_list_del_init(&shadow->lo_header->loh_lru);
-                lprocfs_counter_incr(s->ls_stats, LU_SS_CACHE_RACE);
-                cfs_hash_bd_unlock(hs, &bd, 1);
-                lu_object_free(env, o);
-                return shadow;
         }
+
+        lprocfs_counter_incr(s->ls_stats, LU_SS_CACHE_RACE);
+        cfs_hash_bd_unlock(hs, &bd, 1);
+        lu_object_free(env, o);
+        return shadow;
 }
 
 /**