From: Marc Dionne Date: Mon, 15 Oct 2012 16:26:09 +0000 (-0400) Subject: Linux 3.7: putname is no longer exported X-Git-Tag: openafs-stable-1_8_0pre1~1920 X-Git-Url: http://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=fa3116567e2998af73eb116751032713850c9459 Linux 3.7: putname is no longer exported 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 Reviewed-by: Derrick Brashear --- diff --git a/acinclude.m4 b/acinclude.m4 index 28d60f9..05a933f 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -908,6 +908,10 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) [#include #include ], [path_lookup(NULL, 0, NULL);]) + AC_CHECK_LINUX_FUNC([putname], + [#include + #include ], + [putname(NULL);]) AC_CHECK_LINUX_FUNC([rcu_read_lock], [#include ], [rcu_read_lock();]) diff --git a/src/afs/LINUX/osi_compat.h b/src/afs/LINUX/osi_compat.h index 0314a22..35eafc5 100644 --- a/src/afs/LINUX/osi_compat.h +++ b/src/afs/LINUX/osi_compat.h @@ -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 */ diff --git a/src/afs/LINUX/osi_misc.c b/src/afs/LINUX/osi_misc.c index 9a8ccbe..0fe7484 100644 --- a/src/afs/LINUX/osi_misc.c +++ b/src/afs/LINUX/osi_misc.c @@ -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; }