I'm doing some research of Linux kernel file descriptors maintenance. I'm trying to find out how the file descriptors are working from Linux kernel space perspective. I know that task_struct contains files_struct which contains in turn table of descriptors. So for given task_struct I can list the descriptors for this task. Each of descriptor is of type "struct file".
Now I'd like to know how to do reverse mapping - I mean having the pointer to "struct file" - how can I find out to which "task_struct" it belongs?