I'm reading the Linux kernel implementation of the TCP/IP stack. Everything was ok till I encounter this figure
while reading TCP/IP architecture, design and implementation in Linux
As you may see there the author tries to describe the interaction between VFS and the socket layer on Linux. That left me with ton of doubts:
On the image it's shown a socket as a part of a file struct under a particular inode, thing is: that relationship doesn't exist anymore! (and tbh doesn't makes a ton of sense since only netlink and unix domain sockets might have inodes associated but not inet sockets isn't it?). See struct file definition; f_dentry dissapeared and while greping you can find
Documentation/filesystems/porting.rst 570: f_dentry is gone; use f_path.dentry, or, better yet, see if you can avoid it
Now same struct above does have a reachable dentry (as mentioned in docs) through f_path field but dentry is described as a two purpose struct, fist for describing a directory entry and second as a file system directory cache, so even if the relationship had not disappeared (as described in picture) this does not make a lot of sense to me, why to put the socket within an object that is intended to be ephemereal, see Dcache (maybe I'm misunderstanding dentry/dcache?).
Continuing looking at the code you can see socket struct definition. We can see that it still has the old file struct as field (makes more sense to clear VFS -> TCP/IP relationship but conserve TCP/IP -> VFS relationship in those directions for the reason above), but, question is, does it really dissapeared? I'm not seeing anything stopping for fd creation at any kind of socket, see sock_map_fd - sock_alloc_file - alloc_file_pseudo as well. Also this particular inode object socket->file->inode) should be existent only in memory since does not pertain to any device filesystem, but, who is its superblock?, see indode.sb.
This is not entirely TCP/IP-VFS interaction exactly, but, I can get an inode either from file->f_inode or through file->f_path->d_inode, what is the relation between both inodes?.
If someone can help me to understand it would be awesome folks, thanks in advance.