cfs_hash_bd_t bd;
cfs_hash_bd_t bd2;
struct list_head dispose;
- int did_sth;
- int start;
+ int did_sth;
+ unsigned int start;
int count;
int bnr;
unsigned int i;
* drained), and moreover, lookup has to wait until object is freed.
*/
- init_waitqueue_entry_current(waiter);
- add_wait_queue(&bkt->lsb_marche_funebre, waiter);
- set_current_state(TASK_UNINTERRUPTIBLE);
- lprocfs_counter_incr(s->ls_stats, LU_SS_CACHE_DEATH_RACE);
+ if (likely(waiter != NULL)) {
+ init_waitqueue_entry_current(waiter);
+ add_wait_queue(&bkt->lsb_marche_funebre, waiter);
+ set_current_state(TASK_UNINTERRUPTIBLE);
+ lprocfs_counter_incr(s->ls_stats, LU_SS_CACHE_DEATH_RACE);
+ }
+
return ERR_PTR(-EAGAIN);
}
wait_queue_t wait;
while (1) {
+ if (conf != NULL && conf->loc_flags & LOC_F_NOWAIT) {
+ obj = lu_object_find_try(env, dev, f, conf, NULL);
+
+ return obj;
+ }
+
obj = lu_object_find_try(env, dev, f, conf, &wait);
if (obj != ERR_PTR(-EAGAIN))
return obj;