LINUX_EXPORT_OP_ENCODE_FH_TAKES_INODES
LINUX_KMAP_ATOMIC_TAKES_NO_KM_TYPE
LINUX_DENTRY_OPEN_TAKES_PATH
+ LINUX_D_ALIAS_IS_HLIST
dnl If we are guaranteed that keyrings will work - that is
dnl a) The kernel has keyrings enabled
struct dentry *dentry;
struct inode *inode = AFSTOV(avc);
+#if defined(D_ALIAS_IS_HLIST)
+ struct hlist_node *cur, *head;
+#else
struct list_head *cur, *head;
+#endif
/* First, see if we can evict the inode from the dcache */
if (defersleep && avc != afs_globalVp && VREFCOUNT(avc) > 1 && avc->opens == 0) {
spin_unlock(&dcache_lock);
#else /* HAVE_DCACHE_LOCK */
spin_lock(&inode->i_lock);
+#if defined(D_ALIAS_IS_HLIST)
+ head = inode->i_dentry.first;
+#else
head = &inode->i_dentry;
+#endif
restart:
cur = head;
while ((cur = cur->next) != head) {
+#if defined(D_ALIAS_IS_HLIST)
+ dentry = hlist_entry(cur, struct dentry, d_alias);
+#else
dentry = list_entry(cur, struct dentry, d_alias);
+#endif
spin_lock(&dentry->d_lock);
if (d_unhashed(dentry)) {
{
struct vcache *vcp = VTOAFS(ip);
struct dentry *first = NULL, *ret = NULL, *cur;
+#if defined(D_ALIAS_IS_HLIST)
+ struct hlist_node *p;
+#endif
/* general strategy:
* if vcp->target_link is set, and can be found in ip->i_dentry, use that.
spin_lock(&ip->i_lock);
# endif
+#if defined(D_ALIAS_IS_HLIST)
+ hlist_for_each_entry(cur, p, &ip->i_dentry, d_alias) {
+#else
list_for_each_entry_reverse(cur, &ip->i_dentry, d_alias) {
+#endif
if (!vcp->target_link || cur == vcp->target_link) {
ret = cur;
spin_lock(&dp->d_lock);
#endif
#endif
+#if defined(D_ALIAS_IS_HLIST)
+ hlist_del_init(&dp->d_alias);
+ hlist_add_head(&dp->d_alias, &(AFSTOV(vcp)->i_dentry));
+#else
list_del_init(&dp->d_alias);
list_add(&dp->d_alias, &(AFSTOV(vcp)->i_dentry));
+#endif
dp->d_inode = AFSTOV(vcp);
#if defined(AFS_LINUX24_ENV)
#if defined(AFS_LINUX26_ENV)
[define if dentry_open takes a path argument],
[-Werror])
])
+
+
+AC_DEFUN([LINUX_D_ALIAS_IS_HLIST], [
+ AC_CHECK_LINUX_BUILD([whether dentry->d_alias is an hlist],
+ [ac_cv_linux_d_alias_is_hlist],
+ [#include <linux/fs.h>],
+ [struct dentry *d = NULL;
+ struct hlist_node *hn = NULL;
+ d->d_alias = *hn;],
+ [D_ALIAS_IS_HLIST],
+ [define if dentry->d_alias is an hlist],
+ [])
+])