* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
#include <upcall_cache.h>
static struct upcall_cache_entry *alloc_entry(struct upcall_cache *cache,
#include <upcall_cache.h>
static struct upcall_cache_entry *alloc_entry(struct upcall_cache *cache,
static int check_unlink_entry(struct upcall_cache *cache,
struct upcall_cache_entry *entry)
{
static int check_unlink_entry(struct upcall_cache *cache,
struct upcall_cache_entry *entry)
{
- if (UC_CACHE_IS_VALID(entry) &&
- cfs_time_before(cfs_time_current(), entry->ue_expire))
+ time64_t now = ktime_get_seconds();
+
+ if (UC_CACHE_IS_VALID(entry) && now < entry->ue_expire)
spin_unlock(&cache->uc_lock);
rc = refresh_entry(cache, entry);
spin_lock(&cache->uc_lock);
spin_unlock(&cache->uc_lock);
rc = refresh_entry(cache, entry);
spin_lock(&cache->uc_lock);
if (unlikely(rc == -EREMCHG)) {
put_entry(cache, entry);
GOTO(out, entry = ERR_PTR(rc));
if (unlikely(rc == -EREMCHG)) {
put_entry(cache, entry);
GOTO(out, entry = ERR_PTR(rc));
add_wait_queue(&entry->ue_waitq, &wait);
set_current_state(TASK_INTERRUPTIBLE);
spin_unlock(&cache->uc_lock);
add_wait_queue(&entry->ue_waitq, &wait);
set_current_state(TASK_INTERRUPTIBLE);
spin_unlock(&cache->uc_lock);
UC_CACHE_SET_VALID(entry);
CDEBUG(D_OTHER, "%s: created upcall cache entry %p for key %llu\n",
cache->uc_name, entry, entry->ue_key);
UC_CACHE_SET_VALID(entry);
CDEBUG(D_OTHER, "%s: created upcall cache entry %p for key %llu\n",
cache->uc_name, entry, entry->ue_key);
if (found) {
CWARN("%s: flush entry %p: key %llu, ref %d, fl %x, "
if (found) {
CWARN("%s: flush entry %p: key %llu, ref %d, fl %x, "
cache->uc_name, entry, entry->ue_key,
atomic_read(&entry->ue_refcount), entry->ue_flags,
cache->uc_name, entry, entry->ue_key,
atomic_read(&entry->ue_refcount), entry->ue_flags,