/**
* Show the maximum age of FMD data in seconds.
*
- * Though it is shown in seconds, it is stored internally in units
- * of jiffies for efficiency.
- *
* \param[in] m seq_file handle
* \param[in] data unused for single entry
*
struct obd_device *obd = m->private;
struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
- seq_printf(m, "%ld\n", jiffies_to_msecs(ofd->ofd_fmd_max_age) /
- MSEC_PER_SEC);
+ seq_printf(m, "%lld\n", ofd->ofd_fmd_max_age);
return 0;
}
* Set the maximum age of FMD data in seconds.
*
* This defines how long FMD data stays in the FMD list.
- * It is stored internally in units of jiffies for efficiency.
*
* \param[in] file proc file
* \param[in] buffer string which represents maximum number
if (val > 65536 || val < 1)
return -EINVAL;
- ofd->ofd_fmd_max_age = msecs_to_jiffies(val * MSEC_PER_SEC);
+ ofd->ofd_fmd_max_age = val;
return count;
}
LPROC_SEQ_FOPS(ofd_fmd_max_age);
}
}
if (diff > 0) {
- cfs_time_t enough_time = cfs_time_shift(DISK_TIMEOUT);
- u64 next_id;
- int created = 0;
- int count;
+ time64_t enough_time = ktime_get_seconds() + DISK_TIMEOUT;
+ u64 next_id;
+ int created = 0;
+ int count;
if (!(oa->o_valid & OBD_MD_FLFLAGS) ||
!(oa->o_flags & OBD_FL_DELORPHAN)) {
count, seq, next_id);
if (!(lustre_msg_get_flags(req->rq_reqmsg) & MSG_REPLAY)
- && cfs_time_after(jiffies, enough_time)) {
+ && ktime_get_seconds() > enough_time) {
CDEBUG(D_HA, "%s: Slow creates, %d/%lld objects"
" created at a rate of %d/s\n",
ofd_name(ofd), created, diff + created,
static void ofd_fmd_expire_nolock(struct obd_export *exp,
struct ofd_mod_data *keep)
{
- struct filter_export_data *fed = &exp->exp_filter_data;
- struct ofd_device *ofd = ofd_exp(exp);
- struct ofd_mod_data *fmd, *tmp;
-
- cfs_time_t now = cfs_time_current();
+ struct filter_export_data *fed = &exp->exp_filter_data;
+ struct ofd_device *ofd = ofd_exp(exp);
+ time64_t now = ktime_get_seconds();
+ struct ofd_mod_data *fmd, *tmp;
list_for_each_entry_safe(fmd, tmp, &fed->fed_mod_list, fmd_list) {
if (fmd == keep)
break;
- if (cfs_time_before(now, fmd->fmd_expire) &&
+ if (now < fmd->fmd_expire &&
fed->fed_mod_count < ofd->ofd_fmd_max_num)
break;
static struct ofd_mod_data *ofd_fmd_find_nolock(struct obd_export *exp,
const struct lu_fid *fid)
{
- struct filter_export_data *fed = &exp->exp_filter_data;
- struct ofd_mod_data *found = NULL, *fmd;
- struct ofd_device *ofd = ofd_exp(exp);
-
- cfs_time_t now = cfs_time_current();
+ struct filter_export_data *fed = &exp->exp_filter_data;
+ struct ofd_mod_data *found = NULL, *fmd;
+ struct ofd_device *ofd = ofd_exp(exp);
+ time64_t now = ktime_get_seconds();
assert_spin_locked(&fed->fed_lock);
found = fmd;
list_del(&fmd->fmd_list);
list_add_tail(&fmd->fmd_list, &fed->fed_mod_list);
- fmd->fmd_expire = cfs_time_add(now, ofd->ofd_fmd_max_age);
+ fmd->fmd_expire = now + ofd->ofd_fmd_max_age;
break;
}
}
struct filter_export_data *fed = &exp->exp_filter_data;
struct ofd_device *ofd = ofd_exp(exp);
struct ofd_mod_data *found = NULL, *fmd_new = NULL;
-
- cfs_time_t now = cfs_time_current();
+ time64_t now = ktime_get_seconds();
OBD_SLAB_ALLOC_PTR(fmd_new, ll_fmd_cachep);
}
if (found) {
found->fmd_refcount++; /* caller reference */
- found->fmd_expire = cfs_time_add(now, ofd->ofd_fmd_max_age);
+ found->fmd_expire = now + ofd->ofd_fmd_max_age;
}
spin_unlock(&fed->fed_lock);
struct list_head fmd_list; /* linked to fed_mod_list */
struct lu_fid fmd_fid; /* FID being written to */
__u64 fmd_mactime_xid; /* xid highest {m,a,c}time setattr */
- cfs_time_t fmd_expire; /* time when the fmd should expire */
+ time64_t fmd_expire; /* time when the fmd should expire */
int fmd_refcount; /* reference counter - list holds 1 */
};
#define OFD_FMD_MAX_NUM_DEFAULT 128
-#define OFD_FMD_MAX_AGE_DEFAULT msecs_to_jiffies((obd_timeout+10)*MSEC_PER_SEC)
+#define OFD_FMD_MAX_AGE_DEFAULT (obd_timeout + 10)
#define OFD_SOFT_SYNC_LIMIT_DEFAULT 16
/* ofd mod data: ofd_device wide values */
int ofd_fmd_max_num; /* per ofd ofd_mod_data */
- cfs_duration_t ofd_fmd_max_age; /* time to fmd expiry */
+ time64_t ofd_fmd_max_age; /* time to fmd expiry */
spinlock_t ofd_flags_lock;
unsigned long ofd_raid_degraded:1,