20.15 iput (7344)

This procedure is one of the most popular in UNIX (called from nearly thirty different places) and its use will have already been frequently observed.

In essence it simply decrements the reference count for the “inode” passed as a parameter, and then calls “prele” (7882) to reset the “inode” lock and to perform any necessary “wakeup”s.

“iput” has an important side effect. If the reference count is going to be reduced to zero, then a release of resources is indicated. This may be simply the core “inode”, or both that and the file itself, if the number of links is also zero.