#define DEBUG_SUBSYSTEM S_CLASS
#include <libcfs/libcfs.h>
-
-#ifdef __KERNEL__
-# include <linux/module.h>
-#endif
-
-/* hash_long() */
-#include <libcfs/libcfs_hash.h>
+#include <linux/module.h>
+#include <libcfs/libcfs_hash.h> /* hash_long() */
#include <obd_class.h>
#include <obd_support.h>
#include <lustre_disk.h>
* 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;
}
}
-#ifdef __KERNEL__
static unsigned long lu_cache_shrink_count(struct shrinker *sk,
struct shrink_control *sc)
}
}
EXPORT_SYMBOL(lu_context_keys_dump);
-#endif /* __KERNEL__ */
/**
* Initialization of global lu_* data.