Whamcloud - gitweb
LU-10805 ldlm: convert ACCESS_ONCE() to READ_ONCE() 89/31789/3
authorLi Dongyang <dongyangli@ddn.com>
Mon, 30 Apr 2018 19:06:51 +0000 (15:06 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Sun, 6 May 2018 03:41:46 +0000 (03:41 +0000)
Linux kernel 4.15 removed ACCESS_ONCE, use READ_ONCE instead.

Linux-commit: b899a850431e2dd0943205a63a68573f3e312d0d

Test-Parameters: trivial
Signed-off-by: Li Dongyang <dongyangli@ddn.com>
Change-Id: I139e4cab95b99f362a85c37efe236137835f9c54
Reviewed-on: https://review.whamcloud.com/31789
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
lustre/include/lustre_compat.h
lustre/ldlm/ldlm_lib.c

index 3b42151..158bbb3 100644 (file)
@@ -693,4 +693,8 @@ static inline struct timespec current_time(struct inode *inode)
 #define alloc_workqueue(name, flags, max_active) create_workqueue(name)
 #endif
 
+#ifndef READ_ONCE
+#define READ_ONCE ACCESS_ONCE
+#endif
+
 #endif /* _LUSTRE_COMPAT_H */
index 45bbad4..27deb36 100644 (file)
@@ -3220,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;