diff options
| author | Wim Van Sebroeck <wim@iguana.be> | 2007-05-11 19:03:13 +0000 | 
|---|---|---|
| committer | Wim Van Sebroeck <wim@iguana.be> | 2007-05-11 19:03:13 +0000 | 
| commit | 5c34202b8bf942da411b6599668a76b07449bbfd (patch) | |
| tree | 5719c361321eaddc8e4f1b0c8a7994f0e9a6fdd3 /net/socket.c | |
| parent | 0d4804b31f91cfbcff6d62af0bc09a893a1c8ae0 (diff) | |
| parent | 1f8a6b658a943b4f04a1fc7b3a420360202c86cd (diff) | |
Merge /pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'net/socket.c')
| -rw-r--r-- | net/socket.c | 23 | 
1 files changed, 14 insertions, 9 deletions
diff --git a/net/socket.c b/net/socket.c index 1ad62c08377..98a8f67abbf 100644 --- a/net/socket.c +++ b/net/socket.c @@ -261,8 +261,7 @@ static void init_once(void *foo, struct kmem_cache *cachep, unsigned long flags)  {  	struct socket_alloc *ei = (struct socket_alloc *)foo; -	if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) -	    == SLAB_CTOR_CONSTRUCTOR) +	if (flags & SLAB_CTOR_CONSTRUCTOR)  		inode_init_once(&ei->vfs_inode);  } @@ -314,8 +313,19 @@ static int sockfs_delete_dentry(struct dentry *dentry)  	dentry->d_flags |= DCACHE_UNHASHED;  	return 0;  } + +/* + * sockfs_dname() is called from d_path(). + */ +static char *sockfs_dname(struct dentry *dentry, char *buffer, int buflen) +{ +	return dynamic_dname(dentry, buffer, buflen, "socket:[%lu]", +				dentry->d_inode->i_ino); +} +  static struct dentry_operations sockfs_dentry_operations = {  	.d_delete = sockfs_delete_dentry, +	.d_dname  = sockfs_dname,  };  /* @@ -355,14 +365,9 @@ static int sock_alloc_fd(struct file **filep)  static int sock_attach_fd(struct socket *sock, struct file *file)  { -	struct qstr this; -	char name[32]; - -	this.len = sprintf(name, "[%lu]", SOCK_INODE(sock)->i_ino); -	this.name = name; -	this.hash = 0; +	struct qstr name = { .name = "" }; -	file->f_path.dentry = d_alloc(sock_mnt->mnt_sb->s_root, &this); +	file->f_path.dentry = d_alloc(sock_mnt->mnt_sb->s_root, &name);  	if (unlikely(!file->f_path.dentry))  		return -ENOMEM;  | 
