This procedure implements a system call which deletes a file name from the directory structure. (When all references to a file are deleted, the file itself will be deleted.)
Search for a file with the specified name, and if it exists, return a pointer to the “inode” of the immediate parent directory;
Unlock the parent directory;
Get an “inode” pointer to the file itself;
Unlinking directories is forbidden, except for super-users;
Rewrite the directory entry with the “inode” value set to zero;
Decrement the “link” count.
Note that there is no attempt to reduce the size of a directory below its “high water” mark.