Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 43593
b: refs/heads/master
c: 3126a42
h: refs/heads/master
i:
  43591: 2637559
v: v3
  • Loading branch information
Josef Sipek authored and Linus Torvalds committed Dec 8, 2006
1 parent f2d35d6 commit 3573319
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 92e5baef8578a03335059a3dec933955c361edc1
refs/heads/master: 3126a42c4d40c2b963f880cd5c1e00f0b4fb0dc9
16 changes: 8 additions & 8 deletions trunk/net/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -362,20 +362,20 @@ static int sock_attach_fd(struct socket *sock, struct file *file)
this.name = name;
this.hash = 0;

file->f_dentry = d_alloc(sock_mnt->mnt_sb->s_root, &this);
if (unlikely(!file->f_dentry))
file->f_path.dentry = d_alloc(sock_mnt->mnt_sb->s_root, &this);
if (unlikely(!file->f_path.dentry))
return -ENOMEM;

file->f_dentry->d_op = &sockfs_dentry_operations;
file->f_path.dentry->d_op = &sockfs_dentry_operations;
/*
* We dont want to push this dentry into global dentry hash table.
* We pretend dentry is already hashed, by unsetting DCACHE_UNHASHED
* This permits a working /proc/$pid/fd/XXX on sockets
*/
file->f_dentry->d_flags &= ~DCACHE_UNHASHED;
d_instantiate(file->f_dentry, SOCK_INODE(sock));
file->f_vfsmnt = mntget(sock_mnt);
file->f_mapping = file->f_dentry->d_inode->i_mapping;
file->f_path.dentry->d_flags &= ~DCACHE_UNHASHED;
d_instantiate(file->f_path.dentry, SOCK_INODE(sock));
file->f_path.mnt = mntget(sock_mnt);
file->f_mapping = file->f_path.dentry->d_inode->i_mapping;

sock->file = file;
file->f_op = SOCK_INODE(sock)->i_fop = &socket_file_ops;
Expand Down Expand Up @@ -413,7 +413,7 @@ static struct socket *sock_from_file(struct file *file, int *err)
if (file->f_op == &socket_file_ops)
return file->private_data; /* set in sock_map_fd */

inode = file->f_dentry->d_inode;
inode = file->f_path.dentry->d_inode;
if (!S_ISSOCK(inode->i_mode)) {
*err = -ENOTSOCK;
return NULL;
Expand Down

0 comments on commit 3573319

Please sign in to comment.