diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2008-08-02 09:04:36 +0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2008-10-23 13:12:52 +0400 |
commit | 421748ecde8e69a6364e5ae66eb3bf87e1f995c0 (patch) | |
tree | 50ef878f8c46b1ec729625ed678d04aaeaaee6dd /net/unix/af_unix.c | |
parent | a63bb99660d82dfe7c51588e1f9aadefb756ba51 (diff) | |
download | linux-421748ecde8e69a6364e5ae66eb3bf87e1f995c0.tar.xz |
[PATCH] assorted path_lookup() -> kern_path() conversions
more nameidata eviction
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'net/unix/af_unix.c')
-rw-r--r-- | net/unix/af_unix.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index c647aab8d418..dc504d308ec0 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c @@ -711,28 +711,30 @@ static struct sock *unix_find_other(struct net *net, int type, unsigned hash, int *error) { struct sock *u; - struct nameidata nd; + struct path path; int err = 0; if (sunname->sun_path[0]) { - err = path_lookup(sunname->sun_path, LOOKUP_FOLLOW, &nd); + struct inode *inode; + err = kern_path(sunname->sun_path, LOOKUP_FOLLOW, &path); if (err) goto fail; - err = vfs_permission(&nd, MAY_WRITE); + inode = path.dentry->d_inode; + err = inode_permission(inode, MAY_WRITE); if (err) goto put_fail; err = -ECONNREFUSED; - if (!S_ISSOCK(nd.path.dentry->d_inode->i_mode)) + if (!S_ISSOCK(inode->i_mode)) goto put_fail; - u = unix_find_socket_byinode(net, nd.path.dentry->d_inode); + u = unix_find_socket_byinode(net, inode); if (!u) goto put_fail; if (u->sk_type == type) - touch_atime(nd.path.mnt, nd.path.dentry); + touch_atime(path.mnt, path.dentry); - path_put(&nd.path); + path_put(&path); err=-EPROTOTYPE; if (u->sk_type != type) { @@ -753,7 +755,7 @@ static struct sock *unix_find_other(struct net *net, return u; put_fail: - path_put(&nd.path); + path_put(&path); fail: *error=err; return NULL; |