-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
-struct dentry *ll_get_dentry(struct super_block *sb, void *data)
+#ifdef HAVE_FH_TO_DENTRY
+static struct dentry *ll_fh_to_dentry(struct super_block *sb, struct fid *fid,
+ int fh_len, int fh_type)
+{
+ struct lustre_nfs_fid *nfs_fid = (struct lustre_nfs_fid *)fid;
+
+ if (fh_type != LUSTRE_NFS_FID)
+ RETURN(ERR_PTR(-EPROTO));
+
+ RETURN(ll_iget_for_nfs(sb, &nfs_fid->lnf_child, &nfs_fid->lnf_parent));
+}
+
+static struct dentry *ll_fh_to_parent(struct super_block *sb, struct fid *fid,
+ int fh_len, int fh_type)
+{
+ struct lustre_nfs_fid *nfs_fid = (struct lustre_nfs_fid *)fid;
+
+ if (fh_type != LUSTRE_NFS_FID)
+ RETURN(ERR_PTR(-EPROTO));
+
+ RETURN(ll_iget_for_nfs(sb, &nfs_fid->lnf_parent, NULL));
+}
+
+#else
+
+/*
+ * This length is counted as amount of __u32,
+ * It is composed of a fid and a mode
+ */
+static struct dentry *ll_decode_fh(struct super_block *sb, __u32 *fh, int fh_len,
+ int fh_type,
+ int (*acceptable)(void *, struct dentry *),
+ void *context)