Support inode defragmentation for sockets Reviewed-by: Rik van Riel Signed-off-by: Christoph Lameter --- net/socket.c | 8 ++++++++ 1 file changed, 8 insertions(+) Index: mm/net/socket.c =================================================================== --- mm.orig/net/socket.c 2007-11-28 12:28:01.311962427 -0800 +++ mm/net/socket.c 2007-11-28 12:31:46.383962876 -0800 @@ -269,6 +269,12 @@ static void init_once(struct kmem_cache inode_init_once(&ei->vfs_inode); } +static void *sock_get_inodes(struct kmem_cache *s, int nr, void **v) +{ + return fs_get_inodes(s, nr, v, + offsetof(struct socket_alloc, vfs_inode)); +} + static int init_inodecache(void) { sock_inode_cachep = kmem_cache_create("sock_inode_cache", @@ -280,6 +286,8 @@ static int init_inodecache(void) init_once); if (sock_inode_cachep == NULL) return -ENOMEM; + kmem_cache_setup_defrag(sock_inode_cachep, + sock_get_inodes, kick_inodes); return 0; } -- -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org