]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Linux: Fix fallout from path_lookup commit
authorMarc Dionne <marc.c.dionne@gmail.com>
Wed, 30 Mar 2011 22:32:04 +0000 (18:32 -0400)
committerDerrick Brashear <shadow@dementia.org>
Wed, 27 Apr 2011 11:58:25 +0000 (04:58 -0700)
Fix a few issues with the recent commit to deal withg the removal
of path_lookup, spotted on RHEL 5:
- the configure tests needs fs.h to be included before namei.h, to
get the definition of struct inode
- we need to avoid the use of struct path unless its needed; on
older kernels the structure doesn't exist

(cherry-picked from commit f2e91cc3fe61956e7661eae9da82ddf746e63824)

Change-Id: I752976dd5a68dd4212ad2c0088f799bd6a44ffc6
Reviewed-on: http://gerrit.openafs.org/4382
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-on: http://gerrit.openafs.org/4570

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

index 1f3e4981225b6083fb0d57e98148e65082fbce46..a51ec318179a0798d28fad98da3dd3e5c0422e55 100644 (file)
@@ -849,7 +849,8 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                                     [#include <linux/pagevec.h>],
                                     [__pagevec_lru_add_file(NULL);])
                 AC_CHECK_LINUX_FUNC([path_lookup],
-                                    [#include <linux/namei.h>],
+                                    [#include <linux/fs.h>
+                                     #include <linux/namei.h>],
                                     [path_lookup(NULL, 0, NULL);])
                 AC_CHECK_LINUX_FUNC([rcu_read_lock],
                                     [#include <linux/rcupdate.h>],
index e4f0735a8da9e47a206b5ce5a9c0d102b7e1f033..b94295c0635b665de9cf5bacd7e661039a1b7950 100644 (file)
@@ -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
+static inline int
+afs_kern_path(char *aname, int flags, struct path *path) {
     return kern_path(aname, flags, path);
-#endif
 }
+#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);
index 1158304abaf82783f4618f9a2dd2aef12d20c4e4..fb740db978e9c3138e3a5787dfb8c8af8de89e9c 100644 (file)
@@ -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;
 }