Take the 2-minute tour ×

In operating system, a file control block could be represented as inode or vnode.There are two integers refcount and opencount in this structure. What's the difference between them?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

The reference count refers to number of hard-link references to the inode, while the open count refers to the number of programs which have opened the inode.

These counts are important particularly when deleting. If we allow the OS to return the space previously occupied by the inode to the free list as soon as it is deleted, hard links will become orphaned. Similarly we don't want to delete something that is currently in use in another program.

See http://cgi.cse.unsw.edu.au/~cs3231/12s1/tutorials/week07-sol.php?print=1 for more information.

share|improve this answer

Your Answer


