|
@@ -386,6 +386,28 @@ void nfs_setsecurity(struct inode *inode, struct nfs_fattr *fattr,
|
|
|
#endif
|
|
|
EXPORT_SYMBOL_GPL(nfs_setsecurity);
|
|
|
|
|
|
+/* Search for inode identified by fh, fileid and i_mode in inode cache. */
|
|
|
+struct inode *
|
|
|
+nfs_ilookup(struct super_block *sb, struct nfs_fattr *fattr, struct nfs_fh *fh)
|
|
|
+{
|
|
|
+ struct nfs_find_desc desc = {
|
|
|
+ .fh = fh,
|
|
|
+ .fattr = fattr,
|
|
|
+ };
|
|
|
+ struct inode *inode;
|
|
|
+ unsigned long hash;
|
|
|
+
|
|
|
+ if (!(fattr->valid & NFS_ATTR_FATTR_FILEID) ||
|
|
|
+ !(fattr->valid & NFS_ATTR_FATTR_TYPE))
|
|
|
+ return NULL;
|
|
|
+
|
|
|
+ hash = nfs_fattr_to_ino_t(fattr);
|
|
|
+ inode = ilookup5(sb, hash, nfs_find_actor, &desc);
|
|
|
+
|
|
|
+ dprintk("%s: returning %p\n", __func__, inode);
|
|
|
+ return inode;
|
|
|
+}
|
|
|
+
|
|
|
/*
|
|
|
* This is our front-end to iget that looks up inodes by file handle
|
|
|
* instead of inode number.
|