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 <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
This commit is contained in:
Michael Laß 2016-01-18 19:58:00 +01:00 committed by Benjamin Kaduk
parent 5067ee3ae1
commit 58d82226a5
2 changed files with 7 additions and 0 deletions

View File

@ -1042,6 +1042,9 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
AC_CHECK_LINUX_FUNC([kernel_setsockopt],
[#include <linux/net.h>],
[kernel_setsockopt(NULL, 0, 0, NULL, 0);])
AC_CHECK_LINUX_FUNC([locks_lock_file_wait],
[#include <linux/fs.h>],
[locks_lock_file_wait(NULL, NULL);])
AC_CHECK_LINUX_FUNC([page_follow_link],
[#include <linux/fs.h>],
[page_follow_link(0,0);])

View File

@ -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) {