Hello Dave, all,

Please consider the patch below which makes use of file->private_data to 
store the pointer to the socket, which avoids touching several unused 
cachelines in the dentry and inode in sockfd_lookup.

diff -purN 00_v2.6.13-rc6/net/socket.c 01_net_file/net/socket.c
--- 00_v2.6.13-rc6/net/socket.c 2005-08-04 15:56:11.000000000 -0400
+++ 01_net_file/net/socket.c    2005-08-10 11:13:18.000000000 -0400
@@ -404,6 +404,7 @@ int sock_map_fd(struct socket *sock)
                file->f_mode = FMODE_READ | FMODE_WRITE;
                file->f_flags = O_RDWR;
                file->f_pos = 0;
+               file->private_data = sock;
                fd_install(fd, file);
        }
 
@@ -436,6 +437,9 @@ struct socket *sockfd_lookup(int fd, int
                return NULL;
        }
 
+       if (file->f_op == &socket_file_ops)
+               return file->private_data;      /* set in sock_map_fd */
+
        inode = file->f_dentry->d_inode;
        if (!S_ISSOCK(inode->i_mode)) {
                *err = -ENOTSOCK;
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to