Understanding the usage of fdtable entries in files_struct
by endofinvention from LinuxQuestions.org on (#6PCCT)
Hi, I've been looking at the files_struct in https://github.com/torvalds/linux/bl...inux/fdtable.h and am struggling to understand the relationship between files_struct, fdtable and file.
files_struct contains the following elements (some fields removed):
Code:struct fdtable __rcu *fdt;
struct fdtable fdtab;
...
struct file __rcu * fd_array[NR_OPEN_DEFAULT];My understanding is that the first fdtable struct (*fdt) acts as an overflow for open file descriptors when NR_OPEN_DEFAULT is exceeded.
The last file struct (fd_array) is the array of the tasks open file descriptors.
What I am unable to work out is what the second fdtable struct (fdtab) is used for?
Any insight would be greatly appreciated!
files_struct contains the following elements (some fields removed):
Code:struct fdtable __rcu *fdt;
struct fdtable fdtab;
...
struct file __rcu * fd_array[NR_OPEN_DEFAULT];My understanding is that the first fdtable struct (*fdt) acts as an overflow for open file descriptors when NR_OPEN_DEFAULT is exceeded.
The last file struct (fd_array) is the array of the tasks open file descriptors.
What I am unable to work out is what the second fdtable struct (fdtab) is used for?
Any insight would be greatly appreciated!