From: Li Dongyang Date: Mon, 30 Apr 2018 19:06:51 +0000 (-0400) Subject: LU-10805 ldlm: convert ACCESS_ONCE() to READ_ONCE() X-Git-Tag: 2.11.52~25 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=da028f98ea11943ca15ea9ba7220cc24dbc775bd;hp=8020bf0cc8a055a9b5ae347b8b1ac582113686bc LU-10805 ldlm: convert ACCESS_ONCE() to READ_ONCE() Linux kernel 4.15 removed ACCESS_ONCE, use READ_ONCE instead. Linux-commit: b899a850431e2dd0943205a63a68573f3e312d0d Test-Parameters: trivial Signed-off-by: Li Dongyang Change-Id: I139e4cab95b99f362a85c37efe236137835f9c54 Reviewed-on: https://review.whamcloud.com/31789 Tested-by: Jenkins Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: James Simmons --- diff --git a/lustre/include/lustre_compat.h b/lustre/include/lustre_compat.h index 3b42151..158bbb3 100644 --- a/lustre/include/lustre_compat.h +++ b/lustre/include/lustre_compat.h @@ -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 */ diff --git a/lustre/ldlm/ldlm_lib.c b/lustre/ldlm/ldlm_lib.c index 45bbad4..27deb36 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.c @@ -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;