]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
LINUX: Use struct vfs_path on RHEL5
authorAndrew Deason <adeason@sinenomine.net>
Wed, 29 Aug 2012 16:39:01 +0000 (11:39 -0500)
committerStephan Wiesand <stephan.wiesand@desy.de>
Fri, 21 Dec 2012 10:14:55 +0000 (02:14 -0800)
Some revisions of the kernel from RHEL5 (2.6.18-308.* and possibly
others) renamed 'struct path' to 'struct vfs_path'. So, use
'struct vfs_path' when it exists.

This introduces the afs_linux_path_t typedef, which is defined as
either a struct path, or struct vfs_path.

Reviewed-on: http://gerrit.openafs.org/8019
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 74c1881dff1593f4a8920ba8d8a2400760899fa5)

Change-Id: I6eaf17ebe9a35b345c1fd5cebd490f8095a1b22b
Reviewed-on: http://gerrit.openafs.org/8789
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Paul Smeddle <paul.smeddle@gmail.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>
acinclude.m4
src/afs/LINUX/osi_compat.h
src/afs/LINUX/osi_misc.c
src/afs/LINUX/osi_vnodeops.c

index d80913cc46844619f36fb3e7414f2c8235c3f93c..76ae5976e4d3d786c9a7967f9082705716b02e06 100644 (file)
@@ -798,6 +798,9 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                 AC_CHECK_LINUX_HEADER([semaphore.h])
                 AC_CHECK_LINUX_HEADER([seq_file.h])
 
+                dnl Type existence checks
+                AC_CHECK_LINUX_TYPE([struct vfs_path], [dcache.h])
+
                 dnl Check for structure elements
                 AC_CHECK_LINUX_STRUCT([address_space_operations],
                                       [write_begin], [fs.h])
index c71384df875e4c0bb38f6769ada9bb8f61d36be1..942f1017601137500b50f9eefafcefe4e586913f 100644 (file)
 # endif
 #endif
 
+#ifdef HAVE_LINUX_STRUCT_VFS_PATH
+typedef struct vfs_path afs_linux_path_t;
+#else
+typedef struct path afs_linux_path_t;
+#endif
+
 #ifndef HAVE_LINUX_DO_SYNC_READ
 static inline int
 do_sync_read(struct file *fp, char *buf, size_t count, loff_t *offp) {
@@ -414,7 +420,7 @@ afs_kern_path(char *aname, int flags, struct nameidata *nd) {
 }
 #else
 static inline int
-afs_kern_path(char *aname, int flags, struct path *path) {
+afs_kern_path(char *aname, int flags, afs_linux_path_t *path) {
     return kern_path(aname, flags, path);
 }
 #endif
@@ -423,7 +429,7 @@ static inline void
 #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) {
+afs_get_dentry_ref(afs_linux_path_t *path, struct vfsmount **mnt, struct dentry **dpp) {
 #endif
 #if defined(STRUCT_NAMEIDATA_HAS_PATH)
 # if defined(HAVE_LINUX_PATH_LOOKUP)
@@ -449,7 +455,7 @@ afs_get_dentry_ref(struct path *path, struct vfsmount **mnt, struct dentry **dpp
 static inline struct file *
 afs_dentry_open(struct dentry *dp, struct vfsmount *mnt, int flags, const struct cred *creds) {
 #if defined(DENTRY_OPEN_TAKES_PATH)
-    struct path path;
+    afs_linux_path_t path;
     struct file *filp;
     path.mnt = mnt;
     path.dentry = dp;
index 6ae6c1b8cd6bc8bb42fdf94f84acb76dd181e736..879f7a12c1d9c174201ea8f556f705df9d168c47 100644 (file)
@@ -62,7 +62,7 @@ osi_lookupname_internal(char *aname, int followlink, struct vfsmount **mnt,
 #if defined(HAVE_LINUX_PATH_LOOKUP)
     struct nameidata path_data;
 #else
-    struct path path_data;
+    afs_linux_path_t path_data;
 #endif
     int flags = LOOKUP_POSITIVE;
     code = ENOENT;
@@ -117,7 +117,7 @@ int osi_abspath(char *aname, char *buf, int buflen,
     code = osi_lookupname_internal(afs_name_to_string(tname), followlink, &mnt, &dp);
     if (!code) {
 #if defined(D_PATH_TAKES_STRUCT_PATH)
-       struct path p = { mnt, dp };
+       afs_linux_path_t p = { mnt, dp };
        path = d_path(&p, buf, buflen);
 #else
        path = d_path(dp, mnt, buf, buflen);
index 844768a255875500b7c871fba40cb85c08a58535..1344d0ca0c82f1be8626144150ef6bcbd6c3cab6 100644 (file)
@@ -1146,7 +1146,7 @@ afs_dentry_delete(struct dentry *dp)
 
 #ifdef STRUCT_DENTRY_OPERATIONS_HAS_D_AUTOMOUNT
 static struct vfsmount *
-afs_dentry_automount(struct path *path)
+afs_dentry_automount(afs_linux_path_t *path)
 {
     struct dentry *target;