diff options
author | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2016-01-20 14:01:31 -0300 |
---|---|---|
committer | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2016-01-20 14:01:31 -0300 |
commit | b4b7ff4b08e691656c9d77c758fc355833128ac0 (patch) | |
tree | 82fcb00e6b918026dc9f2d1f05ed8eee83874cc0 /drivers/staging/lustre/lustre/ptlrpc/sec_gc.c | |
parent | 35acfa0fc609f2a2cd95cef4a6a9c3a5c38f1778 (diff) |
Linux-libre 4.4-gnupck-4.4-gnu
Diffstat (limited to 'drivers/staging/lustre/lustre/ptlrpc/sec_gc.c')
-rw-r--r-- | drivers/staging/lustre/lustre/ptlrpc/sec_gc.c | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec_gc.c b/drivers/staging/lustre/lustre/ptlrpc/sec_gc.c index cdad608bd..6e58d5f95 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/sec_gc.c +++ b/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,16 +137,16 @@ 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 ptlrpc_thread *thread = arg; struct l_wait_info lwi; unshare_fs_struct(); |