* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
- * Copyright (c) 2011, 2015, Intel Corporation.
+ * Copyright (c) 2011, 2017, Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
#include "mgs_internal.h"
-static unsigned int ir_timeout;
+static time64_t ir_timeout;
static int nidtbl_is_sane(struct mgs_nidtbl *tbl)
{
struct ldlm_res_id resid;
char name[sizeof(fsdb->fsdb_name) + 16];
- LASSERTF(sizeof(name) < 40, "name is too large to be in stack.\n");
+ CLASSERT(sizeof(name) < 40); /* name is too large to be on stack */
snprintf(name, sizeof(name) - 1, "mgs_%s_notify", fsdb->fsdb_name);
complete(&fsdb->fsdb_notify_comp);
struct task_struct *task;
if (!ir_timeout)
- ir_timeout = OBD_IR_MGS_TIMEOUT;
+ ir_timeout = (time64_t)OBD_IR_MGS_TIMEOUT;
fsdb->fsdb_ir_state = IR_FULL;
- if (cfs_time_before(cfs_time_current_sec(),
- mgs->mgs_start_time + ir_timeout))
+ if (mgs->mgs_start_time + ir_timeout > ktime_get_real_seconds())
fsdb->fsdb_ir_state = IR_STARTUP;
fsdb->fsdb_nonir_clients = 0;
/* start notify thread */
static inline void ir_state_graduate(struct fs_db *fsdb)
{
if (fsdb->fsdb_ir_state == IR_STARTUP) {
- if (cfs_time_before(fsdb->fsdb_mgs->mgs_start_time + ir_timeout,
- cfs_time_current_sec())) {
+ if (ktime_get_real_seconds() >
+ fsdb->fsdb_mgs->mgs_start_time + ir_timeout) {
fsdb->fsdb_ir_state = IR_FULL;
if (fsdb->fsdb_nonir_clients)
fsdb->fsdb_ir_state = IR_PARTIAL;
int lprocfs_ir_timeout_seq_show(struct seq_file *m, void *data)
{
- return lprocfs_uint_seq_show(m, &ir_timeout);
+ seq_printf(m, "%lld\n", ir_timeout);
+ return 0;
}
ssize_t lprocfs_ir_timeout_seq_write(struct file *file,
const char __user *buffer,
size_t count, loff_t *off)
{
- return lprocfs_wr_uint(file, buffer, count, &ir_timeout);
+ return kstrtoll_from_user(buffer, count, 0, &ir_timeout);
}
/* --------------- Handle non IR support clients --------------- */