In the latest kernels time_t has been removed since time_t has
been a 64 bit value just like time64_t so no need for it anymore.
Change ps_sepol_mtime to ktime_t which is the preferred time
format in the linux kernel. For the case of the Lustre GGS code
the fields marked as time_t are timestamps so just change it to
time64_t.
Change-Id: I9f40592d440cc8d68c7b73c0c31d88bcecb3723b
Signed-off-by: James Simmons <jsimmons@infradead.org>
Reviewed-on: https://review.whamcloud.com/37942
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Neil Brown <neilb@suse.de>
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
Tested-by: Sebastien Buisson <sbuisson@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
struct obd_import *ps_import;
spinlock_t ps_lock;
/** mtime of SELinux policy file */
struct obd_import *ps_import;
spinlock_t ps_lock;
/** mtime of SELinux policy file */
+ ktime_t ps_sepol_mtime;
/** next check time of SELinux policy file */
ktime_t ps_sepol_checknext;
/**
/** next check time of SELinux policy file */
ktime_t ps_sepol_checknext;
/**
char *buf = mesg;
int len;
struct rsi rsii, *rsip = NULL;
char *buf = mesg;
int len;
struct rsi rsii, *rsip = NULL;
int status = -EINVAL;
ENTRY;
int status = -EINVAL;
ENTRY;
char *buf = mesg;
int len, rv, tmp_int;
struct rsc rsci, *rscp = NULL;
char *buf = mesg;
int len, rv, tmp_int;
struct rsc rsci, *rscp = NULL;
int status = -EINVAL;
struct gss_api_mech *gm = NULL;
int status = -EINVAL;
struct gss_api_mech *gm = NULL;
CERROR("unable to get expire time, drop it\n");
GOTO(out, rc = -EINVAL);
}
CERROR("unable to get expire time, drop it\n");
GOTO(out, rc = -EINVAL);
}
- rsci.h.expiry_time = (time_t) ctx_expiry;
+ rsci.h.expiry_time = ctx_expiry;
switch (imp->imp_obd->u.cli.cl_sp_to) {
case LUSTRE_SP_MDT:
switch (imp->imp_obd->u.cli.cl_sp_to) {
case LUSTRE_SP_MDT:
sec->ps_import = class_import_get(imp);
spin_lock_init(&sec->ps_lock);
INIT_LIST_HEAD(&sec->ps_gc_list);
sec->ps_import = class_import_get(imp);
spin_lock_init(&sec->ps_lock);
INIT_LIST_HEAD(&sec->ps_gc_list);
- sec->ps_sepol_mtime = 0;
+ sec->ps_sepol_mtime = ktime_set(0, 0);
sec->ps_sepol_checknext = ktime_set(0, 0);
sec->ps_sepol[0] = '\0';
sec->ps_sepol_checknext = ktime_set(0, 0);
sec->ps_sepol[0] = '\0';
argv[2] = (char *)imp->imp_obd->obd_type->typ_name;
argv[4] = imp->imp_obd->obd_name;
spin_lock(&imp->imp_sec->ps_lock);
argv[2] = (char *)imp->imp_obd->obd_type->typ_name;
argv[4] = imp->imp_obd->obd_name;
spin_lock(&imp->imp_sec->ps_lock);
- if (imp->imp_sec->ps_sepol_mtime == 0 &&
+ if (ktime_to_ns(imp->imp_sec->ps_sepol_mtime) == 0 &&
imp->imp_sec->ps_sepol[0] == '\0') {
/* ps_sepol has not been initialized */
argv[5] = NULL;
argv[7] = NULL;
} else {
imp->imp_sec->ps_sepol[0] == '\0') {
/* ps_sepol has not been initialized */
argv[5] = NULL;
argv[7] = NULL;
} else {
- snprintf(mtime_str, sizeof(mtime_str), "%lu",
- imp->imp_sec->ps_sepol_mtime);
+ time64_t mtime_ms;
+
+ mtime_ms = ktime_to_ms(imp->imp_sec->ps_sepol_mtime);
+ snprintf(mtime_str, sizeof(mtime_str), "%lld",
+ mtime_ms / MSEC_PER_SEC);
mode_str[0] = imp->imp_sec->ps_sepol[0];
}
spin_unlock(&imp->imp_sec->ps_lock);
mode_str[0] = imp->imp_sec->ps_sepol[0];
}
spin_unlock(&imp->imp_sec->ps_lock);
spin_lock(&imp->imp_sec->ps_lock);
snprintf(imp->imp_sec->ps_sepol, param->sdd_sepol_len + 1, "%s",
param->sdd_sepol);
spin_lock(&imp->imp_sec->ps_lock);
snprintf(imp->imp_sec->ps_sepol, param->sdd_sepol_len + 1, "%s",
param->sdd_sepol);
- imp->imp_sec->ps_sepol_mtime = param->sdd_sepol_mtime;
+ imp->imp_sec->ps_sepol_mtime = ktime_set(param->sdd_sepol_mtime, 0);
spin_unlock(&imp->imp_sec->ps_lock);
out:
spin_unlock(&imp->imp_sec->ps_lock);
out: