提交 3126a42c 编写于 作者: J Josef Sipek 提交者: Linus Torvalds

[PATCH] struct path: convert net

Signed-off-by: NJosef Sipek <jsipek@fsl.cs.sunysb.edu>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 92e5baef
...@@ -362,20 +362,20 @@ static int sock_attach_fd(struct socket *sock, struct file *file) ...@@ -362,20 +362,20 @@ static int sock_attach_fd(struct socket *sock, struct file *file)
this.name = name; this.name = name;
this.hash = 0; this.hash = 0;
file->f_dentry = d_alloc(sock_mnt->mnt_sb->s_root, &this); file->f_path.dentry = d_alloc(sock_mnt->mnt_sb->s_root, &this);
if (unlikely(!file->f_dentry)) if (unlikely(!file->f_path.dentry))
return -ENOMEM; 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 dont want to push this dentry into global dentry hash table.
* We pretend dentry is already hashed, by unsetting DCACHE_UNHASHED * We pretend dentry is already hashed, by unsetting DCACHE_UNHASHED
* This permits a working /proc/$pid/fd/XXX on sockets * This permits a working /proc/$pid/fd/XXX on sockets
*/ */
file->f_dentry->d_flags &= ~DCACHE_UNHASHED; file->f_path.dentry->d_flags &= ~DCACHE_UNHASHED;
d_instantiate(file->f_dentry, SOCK_INODE(sock)); d_instantiate(file->f_path.dentry, SOCK_INODE(sock));
file->f_vfsmnt = mntget(sock_mnt); file->f_path.mnt = mntget(sock_mnt);
file->f_mapping = file->f_dentry->d_inode->i_mapping; file->f_mapping = file->f_path.dentry->d_inode->i_mapping;
sock->file = file; sock->file = file;
file->f_op = SOCK_INODE(sock)->i_fop = &socket_file_ops; file->f_op = SOCK_INODE(sock)->i_fop = &socket_file_ops;
...@@ -413,7 +413,7 @@ static struct socket *sock_from_file(struct file *file, int *err) ...@@ -413,7 +413,7 @@ static struct socket *sock_from_file(struct file *file, int *err)
if (file->f_op == &socket_file_ops) if (file->f_op == &socket_file_ops)
return file->private_data; /* set in sock_map_fd */ 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)) { if (!S_ISSOCK(inode->i_mode)) {
*err = -ENOTSOCK; *err = -ENOTSOCK;
return NULL; return NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册