From 7ba61dfa6cedc4e6e106bd2079e564e554720d7e Mon Sep 17 00:00:00 2001 From: Marc Dionne Date: Mon, 5 Jan 2015 07:03:16 -0500 Subject: [PATCH] Linux 3.19: No more f_dentry Back in kernel 2.6 .20 struct file lost its f_dentry field which was replaced by f_path.To ease transition f_dentry was defined as f_dpath.dentry in the same header.This define finally gets removed with kernel 3.19. Keep using f_dentry in the code, but add a configure test for the presence of f_path and the absence of the f_dentry macro so we can add it if its missing. Change - Id:I8e8a7e4d3ddd861018de50af1eb7315e730ad529 Reviewed-on: http://gerrit.openafs.org/11646 Reviewed-by: Daria Brashear Tested-by: BuildBot (cherry picked from commit f9ca302b7a10ffc36f2439e068333ab147791c5a) Change-Id: I179bf2fbc22e824e40c60c59e5d223d49343e7a5 Reviewed-on: http://gerrit.openafs.org/11660 Reviewed-by: Chas Williams - CONTRACTOR Tested-by: BuildBot Reviewed-by: Daria Brashear Reviewed-by: Stephan Wiesand --- acinclude.m4 | 1 + src/afs/LINUX/osi_compat.h | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/acinclude.m4 b/acinclude.m4 index fc665d58a..94f21530e 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -843,6 +843,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) AC_CHECK_LINUX_STRUCT([inode], [i_blksize], [fs.h]) AC_CHECK_LINUX_STRUCT([inode], [i_mutex], [fs.h]) AC_CHECK_LINUX_STRUCT([inode], [i_security], [fs.h]) + AC_CHECK_LINUX_STRUCT([file], [f_path], [fs.h]) AC_CHECK_LINUX_STRUCT([file_operations], [flock], [fs.h]) AC_CHECK_LINUX_STRUCT([file_operations], [iterate], [fs.h]) AC_CHECK_LINUX_STRUCT([file_operations], [read_iter], [fs.h]) diff --git a/src/afs/LINUX/osi_compat.h b/src/afs/LINUX/osi_compat.h index b98e9806b..53b78b7c7 100644 --- a/src/afs/LINUX/osi_compat.h +++ b/src/afs/LINUX/osi_compat.h @@ -41,6 +41,12 @@ typedef struct path afs_linux_path_t; # define d_alias d_u.d_alias #endif +#if defined(STRUCT_FILE_HAS_F_PATH) +# if !defined(f_dentry) +# define f_dentry f_path.dentry +# endif +#endif + #ifndef HAVE_LINUX_DO_SYNC_READ static inline int do_sync_read(struct file *fp, char *buf, size_t count, loff_t *offp) { -- 2.39.5