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);
* Drop FMD list reference so it will disappear when last reference is dropped
* to zero.
*
- * This function is called from ofd_object_destroy() and may only affect
+ * This function is called from ofd_destroy() and may only affect
* the one client that is doing the unlink and at worst we have an stale entry
* referencing an object that should never be used again.
*