Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 23bb80d2 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller
Browse files

[NET]: cleanup sock_from_file()



I believe dead code from sock_from_file() can be cleaned up.

All sockets are now built using sock_attach_fd(), that puts the 'sock' pointer 
into file->private_data and &socket_file_ops into file->f_op

I could not find a place where file->private_data could be set to NULL, 
keeping opened the file.

So to get 'sock' from a 'file' pointer, either :

- This is a socket file (f_op == &socket_file_ops), and we can directly get 
'sock' from private_data.
- This is not a socket, we return -ENOTSOCK and dont even try to find a socket 
via dentry/inode :)

Signed-off-by: default avatarEric Dumazet <dada1@cosmosbay.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent dbca9b27
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment