Whamcloud - gitweb
LU-10805 ldlm: convert ACCESS_ONCE() to READ_ONCE()
[fs/lustre-release.git] / lustre / ldlm / ldlm_lib.c
index 5c122fb..27deb36 100644 (file)
@@ -39,6 +39,7 @@
 
 #define DEBUG_SUBSYSTEM S_LDLM
 
+#include <linux/jiffies.h>
 #include <linux/kthread.h>
 #include <libcfs/libcfs.h>
 #include <obd.h>
@@ -787,7 +788,8 @@ static int target_handle_reconnect(struct lustre_handle *conn,
        }
 
        now = ktime_get_seconds();
-       deadline = cfs_duration_sec(target->obd_recovery_timer.expires);
+       deadline = jiffies_to_msecs(target->obd_recovery_timer.expires) /
+                  MSEC_PER_SEC;
        if (now < deadline) {
                struct target_distribute_txn_data *tdtd;
                int size = 0;
@@ -1254,8 +1256,8 @@ no_export:
                        i = atomic_read(&target->obd_lock_replay_clients);
                        k = target->obd_max_recoverable_clients;
                        s = target->obd_stale_clients;
-                       t = target->obd_recovery_timer.expires;
-                       t = cfs_duration_sec(target->obd_recovery_timer.expires);
+                       t = jiffies_to_msecs(target->obd_recovery_timer.expires);
+                       t /= MSEC_PER_SEC;
                        t -= ktime_get_seconds();
                        LCONSOLE_WARN("%s: Denying connection for new client %s"
                                      "(at %s), waiting for %d known clients "
@@ -3218,7 +3220,7 @@ int target_bulk_io(struct obd_export *exp, struct ptlrpc_bulk_desc *desc,
                                  lwi);
                LASSERT(rc == 0 || rc == -ETIMEDOUT);
                /* Wait again if we changed rq_deadline. */
-               rq_deadline = ACCESS_ONCE(req->rq_deadline);
+               rq_deadline = READ_ONCE(req->rq_deadline);
                deadline = start + bulk_timeout;
                if (deadline > rq_deadline)
                        deadline = rq_deadline;