]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
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>
Tue, 30 Oct 2012 09:56:47 +0000 (02:56 -0700)
putname is unexported in kernel 3.7.  Add a compatibility inline
afs_putname function and open code it if necessary.

Reviewed-on: http://gerrit.openafs.org/8237
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit fa3116567e2998af73eb116751032713850c9459)

Change-Id: Icf0e249f87bfe80a262e5599ab9958355ed9a90f
Reviewed-on: http://gerrit.openafs.org/8336
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 b61f55c6193522fafd69629e4575a5265b5e16f7..dec509ea6120609747ed9c2825e61fb68df6556a 100644 (file)
@@ -891,6 +891,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 84fcaa5d7a91c2e4b06696058d4af668ee61f5cc..8c0b8050e11d0b61a1de7fb68648f2be3279625b 100644 (file)
@@ -461,4 +461,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 fb740db978e9c3138e3a5787dfb8c8af8de89e9c..49da7f1a8dc52503f9f96e421bb450f85f6b6246 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;
 }