[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20070208.150009.92582755.davem@davemloft.net>
Date: Thu, 08 Feb 2007 15:00:09 -0800 (PST)
From: David Miller <davem@...emloft.net>
To: dada1@...mosbay.com
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH] NET : cleanup sock_from_file()
From: Eric Dumazet <dada1@...mosbay.com>
Date: Wed, 07 Feb 2007 00:03:25 +0100
> 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: Eric Dumazet <dada1@...mosbay.com>
Looks good to me, applied, thanks Eric.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists