Linux 3.7: putname is no longer exported
authorMarc Dionne <marc.c.dionne@gmail.com>
Mon, 15 Oct 2012 16:26:09 +0000 (12:26 -0400)
committerDerrick Brashear <shadow@your-file-system.com>
Thu, 18 Oct 2012 07:53:15 +0000 (00:53 -0700)
putname is unexported in kernel 3.7.  Add a compatibility inline
afs_putname function and open code it if necessary.

Change-Id: I5416067566f6332d77e5d91ce2b9cf7bc0c96dce
Reviewed-on: http://gerrit.openafs.org/8237
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

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

index 28d60f9..05a933f 100644 (file)
@@ -908,6 +908,10 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                                     [#include <linux/fs.h>
                                      #include <linux/namei.h>],
                                     [path_lookup(NULL, 0, NULL);])
+                AC_CHECK_LINUX_FUNC([putname],
+                                    [#include <linux/fs.h>
+                                     #include <linux/namei.h>],
+                                    [putname(NULL);])
                 AC_CHECK_LINUX_FUNC([rcu_read_lock],
                                     [#include <linux/rcupdate.h>],
                                     [rcu_read_lock();])
index 0314a22..35eafc5 100644 (file)
@@ -524,4 +524,13 @@ afs_dentry_open(struct dentry *dp, struct vfsmount *mnt, int flags, const struct
 }
 #endif
 
+static inline void
+afs_putname(struct filename *name) {
+#if defined(HAVE_LINUX_PUTNAME)
+    putname(name);
+#else
+    kmem_cache_free(names_cachep, (void *)name);
+#endif
+}
+
 #endif /* AFS_LINUX_OSI_COMPAT_H */
index 9a8ccbe..0fe7484 100644 (file)
@@ -93,7 +93,7 @@ osi_lookupname(char *aname, uio_seg_t seg, int followlink,
     }
     code = osi_lookupname_internal(tname, followlink, NULL, dpp);   
     if (seg == AFS_UIOUSER) {
-        putname(tname);
+        afs_putname(tname);
     }
     return code;
 }
@@ -129,7 +129,7 @@ int osi_abspath(char *aname, char *buf, int buflen,
        mntput(mnt);
     }
 
-    putname(tname);
+    afs_putname(tname);
     return code;
 }