Linux 3.19: No more f_dentry
authorMarc Dionne <marc.dionne@your-file-system.com>
Mon, 5 Jan 2015 12:03:16 +0000 (07:03 -0500)
committerJeffrey Altman <jaltman@your-file-system.com>
Thu, 8 Jan 2015 11:43:22 +0000 (06:43 -0500)
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 <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

acinclude.m4
src/afs/LINUX/osi_compat.h

index 6e14777..4b09e75 100644 (file)
@@ -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])
index 497b1ef..c9bb0f7 100644 (file)
@@ -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) {