return (key0 << 1);
}
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
-static int ll_nfs_test_inode(struct inode *inode, unsigned long ino, void *opaque)
-#else
static int ll_nfs_test_inode(struct inode *inode, void *opaque)
-#endif
{
struct ll_fid *iid = opaque;
{
struct inode *inode;
struct dentry *result;
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
- struct list_head *lp;
-#endif
ENTRY;
if (ino == 0)
RETURN(ERR_PTR(-ESTALE));
}
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
result = d_alloc_anon(inode);
if (!result) {
iput(inode);
RETURN(ERR_PTR(-ENOMEM));
}
-#else
- /* now to find a dentry.
- * If possible, get a well-connected one
- */
- spin_lock(&dcache_lock);
- for (lp = inode->i_dentry.next; lp != &inode->i_dentry ; lp=lp->next) {
- result = list_entry(lp,struct dentry, d_alias);
- lock_dentry(result);
- if (!(result->d_flags & DCACHE_DISCONNECTED)) {
- dget_locked(result);
- ll_set_dflags(result, DCACHE_REFERENCED);
- unlock_dentry(result);
- spin_unlock(&dcache_lock);
- iput(inode);
- RETURN(result);
- }
- unlock_dentry(result);
- }
- spin_unlock(&dcache_lock);
- result = d_alloc_root(inode);
- if (result == NULL) {
- iput(inode);
- RETURN(ERR_PTR(-ENOMEM));
- }
- result->d_flags |= DCACHE_DISCONNECTED;
-
-#endif
ll_dops_init(result, 1);
RETURN(result);
return 1;
}
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
struct dentry *ll_get_dentry(struct super_block *sb, void *data)
{
__u32 *inump = (__u32*)data;
.get_parent = ll_get_parent,
.get_dentry = ll_get_dentry,
};
-#endif