[NET]: Use file->private_data to get socket pointer.

Avoid touching file->f_dentry on sockets, since file->private_data
directly gives us the socket pointer.

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Eric Dumazet
2005-09-06 14:42:45 -07:00
committed by David S. Miller
parent 4706df3d3c
commit b69aee04fb
2 changed files with 13 additions and 15 deletions

View File

@ -1535,8 +1535,7 @@ static unsigned int packet_poll(struct file * file, struct socket *sock,
static void packet_mm_open(struct vm_area_struct *vma)
{
struct file *file = vma->vm_file;
struct inode *inode = file->f_dentry->d_inode;
struct socket * sock = SOCKET_I(inode);
struct socket * sock = file->private_data;
struct sock *sk = sock->sk;
if (sk)
@ -1546,8 +1545,7 @@ static void packet_mm_open(struct vm_area_struct *vma)
static void packet_mm_close(struct vm_area_struct *vma)
{
struct file *file = vma->vm_file;
struct inode *inode = file->f_dentry->d_inode;
struct socket * sock = SOCKET_I(inode);
struct socket * sock = file->private_data;
struct sock *sk = sock->sk;
if (sk)