diff --git a/acinclude.m4 b/acinclude.m4 index 8c92b66f4f..7452cbccd3 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -848,7 +848,8 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) [#include ], [__pagevec_lru_add_file(NULL);]) AC_CHECK_LINUX_FUNC([path_lookup], - [#include ], + [#include + #include ], [path_lookup(NULL, 0, NULL);]) AC_CHECK_LINUX_FUNC([rcu_read_lock], [#include ], diff --git a/src/afs/LINUX/osi_compat.h b/src/afs/LINUX/osi_compat.h index e4f0735a8d..b94295c063 100644 --- a/src/afs/LINUX/osi_compat.h +++ b/src/afs/LINUX/osi_compat.h @@ -403,17 +403,24 @@ afs_inode_setattr(struct osi_file *afile, struct iattr *newattrs) { return code; } -static inline int -afs_kern_path(char *aname, int flags, struct nameidata *nd, struct path *path) { #if defined(HAVE_LINUX_PATH_LOOKUP) +static inline int +afs_kern_path(char *aname, int flags, struct nameidata *nd) { return path_lookup(aname, flags, nd); -#else - return kern_path(aname, flags, path); -#endif } +#else +static inline int +afs_kern_path(char *aname, int flags, struct path *path) { + return kern_path(aname, flags, path); +} +#endif static inline void -afs_get_dentry_ref(struct nameidata *nd, struct path *path, struct vfsmount **mnt, struct dentry **dpp) { +#if defined(HAVE_LINUX_PATH_LOOKUP) +afs_get_dentry_ref(struct nameidata *nd, struct vfsmount **mnt, struct dentry **dpp) { +#else +afs_get_dentry_ref(struct path *path, struct vfsmount **mnt, struct dentry **dpp) { +#endif #if defined(STRUCT_NAMEIDATA_HAS_PATH) # if defined(HAVE_LINUX_PATH_LOOKUP) *dpp = dget(nd->path.dentry); diff --git a/src/afs/LINUX/osi_misc.c b/src/afs/LINUX/osi_misc.c index 1158304aba..fb740db978 100644 --- a/src/afs/LINUX/osi_misc.c +++ b/src/afs/LINUX/osi_misc.c @@ -59,17 +59,20 @@ osi_lookupname_internal(char *aname, int followlink, struct vfsmount **mnt, struct dentry **dpp) { int code; - struct nameidata nd; - struct path path; +#if defined(HAVE_LINUX_PATH_LOOKUP) + struct nameidata path_data; +#else + struct path path_data; +#endif int flags = LOOKUP_POSITIVE; code = ENOENT; if (followlink) flags |= LOOKUP_FOLLOW; - code = afs_kern_path(aname, flags, &nd, &path); + code = afs_kern_path(aname, flags, &path_data); if (!code) - afs_get_dentry_ref(&nd, &path, mnt, dpp); + afs_get_dentry_ref(&path_data, mnt, dpp); return code; }