From: NeilBrown <neilb@suse.com>
To: Oleg Drokin <oleg.drokin@intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
James Simmons <jsimmons@infradead.org>,
Andreas Dilger <andreas.dilger@intel.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Lustre Development List <lustre-devel@lists.lustre.org>
Subject: [PATCH 15/17] staging: lustre: discard cfs_time_before_64()
Date: Thu, 29 Mar 2018 15:26:48 +1100 [thread overview]
Message-ID: <152229760881.27689.10658125792259115083.stgit@noble> (raw)
In-Reply-To: <152229732768.27689.4800156943561963977.stgit@noble>
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>
---
.../lustre/include/linux/libcfs/linux/linux-time.h | 14 --------------
drivers/staging/lustre/lustre/include/obd_class.h | 4 ++--
drivers/staging/lustre/lustre/ptlrpc/import.c | 4 ++--
3 files changed, 4 insertions(+), 18 deletions(-)
diff --git a/drivers/staging/lustre/include/linux/libcfs/linux/linux-time.h b/drivers/staging/lustre/include/linux/libcfs/linux/linux-time.h
index 9a353c6cb85a..ecdebccf2b44 100644
--- a/drivers/staging/lustre/include/linux/libcfs/linux/linux-time.h
+++ b/drivers/staging/lustre/include/linux/libcfs/linux/linux-time.h
@@ -56,20 +56,6 @@
#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
*/
diff --git a/drivers/staging/lustre/lustre/include/obd_class.h b/drivers/staging/lustre/lustre/include/obd_class.h
index 7cfc3c8d100c..176b63e2c9a7 100644
--- a/drivers/staging/lustre/lustre/include/obd_class.h
+++ b/drivers/staging/lustre/lustre/include/obd_class.h
@@ -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);
diff --git a/drivers/staging/lustre/lustre/ptlrpc/import.c b/drivers/staging/lustre/lustre/ptlrpc/import.c
index dd4fd54128dd..537a9e2ed467 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/import.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/import.c
@@ -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;
}
next prev parent reply other threads:[~2018-03-29 4:26 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-29 4:26 [PATCH 00/17] staging: Assorted lustre cleanup NeilBrown
2018-03-29 4:26 ` [PATCH 09/17] staging: lustre: cfs_time_current() -> jiffies NeilBrown
2018-03-30 19:00 ` James Simmons
2018-03-29 4:26 ` [PATCH 17/17] staging: lustre: remove cruft from libcfs/linux/libcfs.h NeilBrown
2018-03-30 19:07 ` James Simmons
2018-03-29 4:26 ` NeilBrown [this message]
2018-03-30 19:03 ` [PATCH 15/17] staging: lustre: discard cfs_time_before_64() James Simmons
2018-03-29 4:26 ` [PATCH 12/17] staging: lustre: libcfs: discard cfs_time_after() NeilBrown
2018-03-30 19:01 ` James Simmons
2018-03-29 4:26 ` [PATCH 02/17] staging: lustre: remove unused ldlm_completion_ast_async() NeilBrown
2018-03-30 18:57 ` James Simmons
2018-03-29 4:26 ` [PATCH 08/17] staging: lustre: add container_of_safe() NeilBrown
2018-03-30 18:59 ` James Simmons
2018-04-23 13:16 ` Greg Kroah-Hartman
2018-03-29 4:26 ` [PATCH 06/17] staging: lustre: tidy up ldlm_resource_putref() NeilBrown
2018-03-30 18:58 ` James Simmons
2018-03-29 4:26 ` [PATCH 03/17] staging: lustre: LNET excludes USERIO NeilBrown
2018-03-30 19:09 ` James Simmons
2018-03-29 4:26 ` [PATCH 13/17] staging: lustre: libcfs: remove cfs_timeout_cap() NeilBrown
2018-03-30 19:03 ` James Simmons
2018-04-02 19:38 ` Dilger, Andreas
2018-04-02 22:34 ` NeilBrown
2018-03-29 4:26 ` [PATCH 10/17] staging: lustre: libcfs: discard cfs_time_add/sub NeilBrown
2018-03-30 19:00 ` James Simmons
2018-03-29 4:26 ` [PATCH 04/17] staging: lustre: remove unused hash tables NeilBrown
2018-03-30 18:57 ` James Simmons
2018-03-29 4:26 ` [PATCH 07/17] staging: lustre: ldlm: free resource when ldlm_lock_create() fails NeilBrown
2018-03-30 18:58 ` James Simmons
2018-03-29 4:26 ` [PATCH 05/17] staging: lustre: remove unneeded include NeilBrown
2018-03-30 18:57 ` James Simmons
2018-03-29 4:26 ` [PATCH 11/17] staging: lustre: libcfs: discard cfs_time_shift() NeilBrown
2018-03-30 19:02 ` James Simmons
2018-04-02 19:34 ` Dilger, Andreas
2018-04-02 22:26 ` NeilBrown
2018-04-04 8:10 ` [lustre-devel] " Dilger, Andreas
2018-04-04 22:00 ` NeilBrown
2018-03-29 4:26 ` [PATCH 16/17] staging: lustre: discard linux-time.h NeilBrown
2018-03-30 19:03 ` James Simmons
2018-03-29 4:26 ` [PATCH 01/17] staging: lustre: remove invariant in cl_io_read_ahead() NeilBrown
2018-03-30 18:56 ` James Simmons
2018-03-29 4:26 ` [PATCH 14/17] staging: lustre: discard cfs_duration_sec() NeilBrown
2018-03-30 19:02 ` James Simmons
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=152229760881.27689.10658125792259115083.stgit@noble \
--to=neilb@suse.com \
--cc=andreas.dilger@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=jsimmons@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lustre-devel@lists.lustre.org \
--cc=oleg.drokin@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®