From 58d82226a555d3781a5cb45e5cc177727628ebd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20La=C3=9F?= Date: Mon, 18 Jan 2016 19:58:00 +0100 Subject: [PATCH] Linux 4.4: Use locks_lock_file_wait The locks API was changed in Linux 4.4, introducing locks_lock_file_wait (e55c34a66f87e78fb1fc6b623b78c5ad74b475af) and removing flock_lock_file_wait (616fb38fa7a9599293e05ae1fa9acfaf73922434). locks_lock_file_wait can be used as a drop-in replacement so define flock_lock_file_wait as an alias for it. Change-Id: Iba89a43c651737c86cbf519a933289d97c25a467 Reviewed-on: https://gerrit.openafs.org/12170 Reviewed-by: Mark Vitale Reviewed-by: Benjamin Kaduk Tested-by: BuildBot --- acinclude.m4 | 3 +++ src/afs/LINUX/osi_compat.h | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/acinclude.m4 b/acinclude.m4 index 9b4d94ed0c..d8d7835e79 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1042,6 +1042,9 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) AC_CHECK_LINUX_FUNC([kernel_setsockopt], [#include ], [kernel_setsockopt(NULL, 0, 0, NULL, 0);]) + AC_CHECK_LINUX_FUNC([locks_lock_file_wait], + [#include ], + [locks_lock_file_wait(NULL, NULL);]) AC_CHECK_LINUX_FUNC([page_follow_link], [#include ], [page_follow_link(0,0);]) diff --git a/src/afs/LINUX/osi_compat.h b/src/afs/LINUX/osi_compat.h index e9f6ca11b6..5b3f12b8d8 100644 --- a/src/afs/LINUX/osi_compat.h +++ b/src/afs/LINUX/osi_compat.h @@ -47,6 +47,10 @@ typedef struct path afs_linux_path_t; # endif #endif +#if defined(HAVE_LINUX_LOCKS_LOCK_FILE_WAIT) +# define flock_lock_file_wait locks_lock_file_wait +#endif + #if !defined(HAVE_LINUX_DO_SYNC_READ) && !defined(STRUCT_FILE_OPERATIONS_HAS_READ_ITER) static inline int do_sync_read(struct file *fp, char *buf, size_t count, loff_t *offp) {