]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
staging: lustre: discard cfs_time_before_64()
authorNeilBrown <neilb@suse.com>
Thu, 29 Mar 2018 04:26:48 +0000 (15:26 +1100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 23 Apr 2018 12:52:52 +0000 (14:52 +0200)
cfs_time_before_64 is the same as time_before64()
similarly cfs_time_beforeq_64() matsches time_before_eq64()
So just use the standard interfaces.

Signed-off-by: NeilBrown <neilb@suse.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/include/linux/libcfs/linux/linux-time.h
drivers/staging/lustre/lustre/include/obd_class.h
drivers/staging/lustre/lustre/ptlrpc/import.c

index 9a353c6cb85a7972e1a2f67a52d737104a69afe1..ecdebccf2b44b24662d695216f56226b4aaaa43c 100644 (file)
 
 #include <linux/jiffies.h>
 
-/*
- * Generic kernel stuff
- */
-
-static inline int cfs_time_before_64(u64 t1, u64 t2)
-{
-       return (__s64)t2 - (__s64)t1 > 0;
-}
-
-static inline int cfs_time_beforeq_64(u64 t1, u64 t2)
-{
-       return (__s64)t2 - (__s64)t1 >= 0;
-}
-
 /*
  * One jiffy
  */
index 7cfc3c8d100c18c2c6e34675ef9fd13fe192a10c..176b63e2c9a7283e9034369431485acd20328a2b 100644 (file)
@@ -932,7 +932,7 @@ static inline int obd_statfs_async(struct obd_export *exp,
 
        CDEBUG(D_SUPER, "%s: osfs %p age %llu, max_age %llu\n",
               obd->obd_name, &obd->obd_osfs, obd->obd_osfs_age, max_age);
-       if (cfs_time_before_64(obd->obd_osfs_age, max_age)) {
+       if (time_before64(obd->obd_osfs_age, max_age)) {
                rc = OBP(obd, statfs_async)(exp, oinfo, max_age, rqset);
        } else {
                CDEBUG(D_SUPER,
@@ -992,7 +992,7 @@ static inline int obd_statfs(const struct lu_env *env, struct obd_export *exp,
 
        CDEBUG(D_SUPER, "osfs %llu, max_age %llu\n",
               obd->obd_osfs_age, max_age);
-       if (cfs_time_before_64(obd->obd_osfs_age, max_age)) {
+       if (time_before64(obd->obd_osfs_age, max_age)) {
                rc = OBP(obd, statfs)(env, exp, osfs, max_age, flags);
                if (rc == 0) {
                        spin_lock(&obd->obd_osfs_lock);
index dd4fd54128dd0529c33640b797b5cae8edb65d8f..537a9e2ed467558493470cd2aea5220a799a0d37 100644 (file)
@@ -463,7 +463,7 @@ static int import_select_connection(struct obd_import *imp)
                 * the last successful attempt, go with this one
                 */
                if ((conn->oic_last_attempt == 0) ||
-                   cfs_time_beforeq_64(conn->oic_last_attempt,
+                   time_before_eq64(conn->oic_last_attempt,
                                        imp->imp_last_success_conn)) {
                        imp_conn = conn;
                        tried_all = 0;
@@ -476,7 +476,7 @@ static int import_select_connection(struct obd_import *imp)
                 */
                if (!imp_conn)
                        imp_conn = conn;
-               else if (cfs_time_before_64(conn->oic_last_attempt,
+               else if (time_before64(conn->oic_last_attempt,
                                            imp_conn->oic_last_attempt))
                        imp_conn = conn;
        }