Is vnode number also limit system-wide number of open file?

valdis.kletnieks at vt.edu valdis.kletnieks at vt.edu
Wed May 31 22:12:21 EDT 2017


On Thu, 01 Jun 2017 17:15:29 +0800, Yubin Ruan said:

> Regarding to inode number, I notice that nearly every filesystem has tree
> representation of the inode number:
>     1. on-disk inode number
>     2. in-memory inode number
>     3. VFS inode number
> How are these related? I mean, if they are all the same, then if filesystem A
> and filesystem B both have some identical inode number, the VFS inode numbers
> will conflict.

What's tracked is the pair (filesystem, inode).  So inode 3945 on /usr
is different from inode 3945 on /home.  (Strictly speaking, it tracks the
major,minor number for the device that has the filesystem on it - so if /usr is
on /dev/sda3, and /dev/sda3 looks like:

ls -l /dev/sda3
brw-rw----. 1 root disk 8, 3 May 31 19:47 /dev/sda3

What's really tracked is ((8,3),3945).  Although many places in the kernel will
equate "a pointer to the in-memory copy of the superblock for the filesystem on
8,3" with the actual major/minor - mostly because if you're looking at the
device node numbers for the filesystem, you're probably going to be needing
that superblock *anyhow*.

Similar games are played for the on-disk and in-memmory inode numbers - as long
as the system keeps track of what the mapping is, there's no need for them
to actually be identical...

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 486 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20170531/6adcc06a/attachment.bin 


More information about the Kernelnewbies mailing list