From f9ca302b7a10ffc36f2439e068333ab147791c5a 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 Change-Id: I4b05aa3d37f01e0e675c420cbf941d682c49c69c Reviewed-on: http://gerrit.openafs.org/11646 Reviewed-by: Daria Brashear Tested-by: BuildBot --- acinclude.m4 | 1 + src/afs/LINUX/osi_compat.h | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/acinclude.m4 b/acinclude.m4 index 6e14777bc..4b09e7561 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -908,6 +908,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 497b1efa4..c9bb0f7bd 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