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 <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
This commit is contained in:
Marc Dionne 2012-10-15 12:26:09 -04:00 committed by Derrick Brashear
parent 1571e9b9f6
commit fa3116567e
3 changed files with 15 additions and 2 deletions

View 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();])

View 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 */

View 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;
}