---
name: "find_inode_nowait"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/find_inode_nowait"
---

# find\_inode\_nowait(9)

find an inode in the inode cache

## NAME

find\_inode\_nowait - find an inode in the inode cache

## SYNOPSIS

**struct inode \* find\_inode\_nowait(struct super\_block \*** *sb***, unsigned long** *hashval***, int (\****match***) (struct inode \*, unsigned long, void \*), void \*** *data***);**

## ARGUMENTS

*sb*

super block of file system to search

*hashval*

hash value (usually inode number) to search for

*match*

callback used for comparisons between inodes

*data*

opaque data pointer to pass to *match*

## DESCRIPTION

Search for the inode specified by *hashval* and *data* in the inode cache, where the helper function *match* will return 0 if the inode does not match, 1 if the inode does match, and -1 if the search should be stopped. The *match* function must be responsible for taking the i\_lock spin\_lock and checking i\_state for an inode being freed or being initialized, and incrementing the reference count before returning 1. It also must not sleep, since it is called with the inode\_hash\_lock spinlock held.

This is a even more generalized version of **ilookup5** when the function must never block --- **find\_inode** can block in **\_\_wait\_on\_freeing\_inode** --- or when the caller can not increment the reference count because the resulting **iput** might cause an inode eviction. The tradeoff is that the *match* funtion must be very carefully implemented.

## COPYRIGHT
