Whamcloud - gitweb
LU-5577 obdclass: change lu_site->ls_purge_start to unsigned
[fs/lustre-release.git] / lustre / obdclass / lu_object.c
index eda5e9c..cb19029 100644 (file)
@@ -343,8 +343,8 @@ int lu_site_purge(const struct lu_env *env, struct lu_site *s, int nr)
         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;
@@ -605,10 +605,13 @@ static struct lu_object *htable_lookup(struct lu_site *s,
          * 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);
 }
 
@@ -794,6 +797,12 @@ struct lu_object *lu_object_find_at(const struct lu_env *env,
        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;