[lustre-devel] [PATCH 2/8] staging: lustre: o2iblnd: use ktime_get_real_ns for ibn_incarnation

James Simmons jsimmons at infradead.org
Sun Jun 24 14:53:46 PDT 2018


Instead of getting the real time using ktime_get_real_ts64() and
turning it into usecs we can simplify the code and call
ktime_get_real_ns() instead.

Signed-off-by: James Simmons <uja.ornl at yahoo.com>
WC-bug-id: https://jira.whamcloud.com/browse/LU-9019
Reviewed-on: https://review.whamcloud.com/23267
Reviewed-by: Doug Oucharek <dougso at me.com>
Reviewed-by: Andreas Dilger <adilger at whamcloud.com>
Reviewed-by: Oleg Drokin <green at whamcloud.com>
Signed-off-by: James Simmons <jsimmons at infradead.org>
---
 drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c
index f0b4eb42..5761e3d 100644
--- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c
+++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c
@@ -2822,7 +2822,6 @@ static int kiblnd_startup(struct lnet_ni *ni)
 	char *ifname;
 	struct kib_dev *ibdev = NULL;
 	struct kib_net *net;
-	struct timespec64 tv;
 	unsigned long flags;
 	int rc;
 	int newdev;
@@ -2840,9 +2839,7 @@ static int kiblnd_startup(struct lnet_ni *ni)
 	if (!net)
 		goto net_failed;
 
-	ktime_get_real_ts64(&tv);
-	net->ibn_incarnation = tv.tv_sec * USEC_PER_SEC +
-			       tv.tv_nsec / NSEC_PER_USEC;
+	net->ibn_incarnation = ktime_get_real_ns() / NSEC_PER_USEC;
 
 	rc = kiblnd_tunables_setup(ni);
 	if (rc)
-- 
1.8.3.1



More information about the lustre-devel mailing list