In the linux kernel, are there any data structures that automatically always hold the last written block number for a partition? I can't find any built-in kernel source that could be used to get this information. Any help is appreciated.
I have a struct defined with the structure as follows (names are different)
struct str1
{
int field1;
struct str2;
}
And I have a *str1 in a function. I'd like to get a pointer to str2.
So I tried &(str1->str2) and was hoping this would return a pointer to str2. Is this incorrect? It doesn't seem to be working. How would I get a pointer to str2 if given a pointer to str1?
Where in the linux kernel does the closing of a socket's file descriptor occur? I know for a file, the file's file descriptor is closed in fs/open.cs function sys_close(). However, for a socket file descriptor, is this the same location or somewhere else?
Also, do sockets utilize the file.c alloc_fd to allocate the file descriptor or do they utilize some other function?