summaryrefslogtreecommitdiffstats
path: root/net/packet/af_packet.c
diff options
context:
space:
mode:
authorEric Dumazet <dada1@cosmosbay.com>2005-09-06 14:42:45 -0700
committerDavid S. Miller <davem@davemloft.net>2005-09-06 14:42:45 -0700
commitb69aee04fbfc027fc4ddaddc809ea8711cef9511 (patch)
treec82406f856f60dd28cebfcb6da00510ebd641321 /net/packet/af_packet.c
parent4706df3d3c42af802597d82c8b1542c3d52eab23 (diff)
downloadop-kernel-dev-b69aee04fbfc027fc4ddaddc809ea8711cef9511.zip
op-kernel-dev-b69aee04fbfc027fc4ddaddc809ea8711cef9511.tar.gz
[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>
Diffstat (limited to 'net/packet/af_packet.c')
-rw-r--r--net/packet/af_packet.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index ba99709..8690f17 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -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)
OpenPOWER on IntegriCloud