Whamcloud - gitweb
LU-11697 ost: do not reuse T10PI guards of unaligned page write
[fs/lustre-release.git] / lustre / ofd / ofd_fmd.c
index b0fe098..859f894 100644 (file)
@@ -23,7 +23,7 @@
  * Copyright  2008 Sun Microsystems, Inc. All rights reserved
  * Use is subject to license terms.
  *
- * Copyright (c) 2012, 2015, Intel Corporation.
+ * Copyright (c) 2012, 2014, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -111,17 +111,16 @@ void ofd_fmd_put(struct obd_export *exp, struct ofd_mod_data *fmd)
 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;
 
@@ -162,11 +161,10 @@ void ofd_fmd_expire(struct obd_export *exp)
 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);
 
@@ -175,7 +173,7 @@ static struct ofd_mod_data *ofd_fmd_find_nolock(struct obd_export *exp,
                        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;
                }
        }
@@ -230,8 +228,7 @@ struct ofd_mod_data *ofd_fmd_get(struct obd_export *exp, const struct lu_fid *fi
        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);
 
@@ -251,7 +248,7 @@ struct ofd_mod_data *ofd_fmd_get(struct obd_export *exp, const struct lu_fid *fi
        }
        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);
@@ -264,7 +261,7 @@ struct ofd_mod_data *ofd_fmd_get(struct obd_export *exp, const struct lu_fid *fi
  * 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.
  *