X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?p=kvmfornfv.git;a=blobdiff_plain;f=kernel%2Fdrivers%2Fstaging%2Flustre%2Flustre%2Fptlrpc%2Fsec_gc.c;h=6e58d5f955d68690fc99753b85b0fbc0348eebaa;hp=81de68edb04e64561acd5f31948526e085d9d118;hb=e09b41010ba33a20a87472ee821fa407a5b8da36;hpb=f93b97fd65072de626c074dbe099a1fff05ce060 diff --git a/kernel/drivers/staging/lustre/lustre/ptlrpc/sec_gc.c b/kernel/drivers/staging/lustre/lustre/ptlrpc/sec_gc.c index 81de68edb..6e58d5f95 100644 --- a/kernel/drivers/staging/lustre/lustre/ptlrpc/sec_gc.c +++ b/kernel/drivers/staging/lustre/lustre/ptlrpc/sec_gc.c @@ -51,7 +51,6 @@ #define SEC_GC_INTERVAL (30 * 60) - static struct mutex sec_gc_mutex; static LIST_HEAD(sec_gc_list); static spinlock_t sec_gc_list_lock; @@ -62,14 +61,13 @@ static spinlock_t sec_gc_ctx_list_lock; static struct ptlrpc_thread sec_gc_thread; static atomic_t sec_gc_wait_del = ATOMIC_INIT(0); - void sptlrpc_gc_add_sec(struct ptlrpc_sec *sec) { LASSERT(sec->ps_policy->sp_cops->gc_ctx); LASSERT(sec->ps_gc_interval > 0); LASSERT(list_empty(&sec->ps_gc_list)); - sec->ps_gc_next = get_seconds() + sec->ps_gc_interval; + sec->ps_gc_next = ktime_get_real_seconds() + sec->ps_gc_interval; spin_lock(&sec_gc_list_lock); list_add_tail(&sec_gc_list, &sec->ps_gc_list); @@ -103,21 +101,6 @@ void sptlrpc_gc_del_sec(struct ptlrpc_sec *sec) } EXPORT_SYMBOL(sptlrpc_gc_del_sec); -void sptlrpc_gc_add_ctx(struct ptlrpc_cli_ctx *ctx) -{ - LASSERT(list_empty(&ctx->cc_gc_chain)); - - CDEBUG(D_SEC, "hand over ctx %p(%u->%s)\n", - ctx, ctx->cc_vcred.vc_uid, sec2target_str(ctx->cc_sec)); - spin_lock(&sec_gc_ctx_list_lock); - list_add(&ctx->cc_gc_chain, &sec_gc_ctx_list); - spin_unlock(&sec_gc_ctx_list_lock); - - thread_add_flags(&sec_gc_thread, SVC_SIGNAL); - wake_up(&sec_gc_thread.t_ctl_waitq); -} -EXPORT_SYMBOL(sptlrpc_gc_add_ctx); - static void sec_process_ctx_list(void) { struct ptlrpc_cli_ctx *ctx; @@ -154,17 +137,17 @@ static void sec_do_gc(struct ptlrpc_sec *sec) CDEBUG(D_SEC, "check on sec %p(%s)\n", sec, sec->ps_policy->sp_name); - if (cfs_time_after(sec->ps_gc_next, get_seconds())) + if (sec->ps_gc_next > ktime_get_real_seconds()) return; sec->ps_policy->sp_cops->gc_ctx(sec); - sec->ps_gc_next = get_seconds() + sec->ps_gc_interval; + sec->ps_gc_next = ktime_get_real_seconds() + sec->ps_gc_interval; } static int sec_gc_main(void *arg) { - struct ptlrpc_thread *thread = (struct ptlrpc_thread *) arg; - struct l_wait_info lwi; + struct ptlrpc_thread *thread = arg; + struct l_wait_info lwi; unshare_fs_struct();