switch vfs_path_lookup() to struct path
[deliverable/linux.git] / net / sunrpc / clnt.c
index b91f8f943c5ea0f2dcf08610710e96224f18737f..304f403a04111eb3b3da9635bc3c365c5695299b 100644 (file)
  *     and need to be refreshed, or when a packet was damaged in transit.
  *     This may be have to be moved to the VFS layer.
  *
- *  NB: BSD uses a more intelligent approach to guessing when a request
- *  or reply has been lost by keeping the RTO estimate for each procedure.
- *  We currently make do with a constant timeout value.
- *
  *  Copyright (C) 1992,1993 Rick Sladkey <jrs@world.std.com>
  *  Copyright (C) 1995,1996 Olaf Kirch <okir@monad.swb.de>
  */
@@ -32,7 +28,9 @@
 #include <linux/slab.h>
 #include <linux/utsname.h>
 #include <linux/workqueue.h>
+#include <linux/in.h>
 #include <linux/in6.h>
+#include <linux/un.h>
 
 #include <linux/sunrpc/clnt.h>
 #include <linux/sunrpc/rpc_pipe_fs.h>
@@ -99,8 +97,7 @@ static int
 rpc_setup_pipedir(struct rpc_clnt *clnt, char *dir_name)
 {
        static uint32_t clntid;
-       struct nameidata nd;
-       struct path path;
+       struct path path, dir;
        char name[15];
        struct qstr q = {
                .name = name,
@@ -115,7 +112,7 @@ rpc_setup_pipedir(struct rpc_clnt *clnt, char *dir_name)
        path.mnt = rpc_get_mount();
        if (IS_ERR(path.mnt))
                return PTR_ERR(path.mnt);
-       error = vfs_path_lookup(path.mnt->mnt_root, path.mnt, dir_name, 0, &nd);
+       error = vfs_path_lookup(path.mnt->mnt_root, path.mnt, dir_name, 0, &dir);
        if (error)
                goto err;
 
@@ -123,7 +120,7 @@ rpc_setup_pipedir(struct rpc_clnt *clnt, char *dir_name)
                q.len = snprintf(name, sizeof(name), "clnt%x", (unsigned int)clntid++);
                name[sizeof(name) - 1] = '\0';
                q.hash = full_name_hash(q.name, q.len);
-               path.dentry = rpc_create_client_dir(nd.path.dentry, &q, clnt);
+               path.dentry = rpc_create_client_dir(dir.dentry, &q, clnt);
                if (!IS_ERR(path.dentry))
                        break;
                error = PTR_ERR(path.dentry);
@@ -134,11 +131,11 @@ rpc_setup_pipedir(struct rpc_clnt *clnt, char *dir_name)
                        goto err_path_put;
                }
        }
-       path_put(&nd.path);
+       path_put(&dir);
        clnt->cl_path = path;
        return 0;
 err_path_put:
-       path_put(&nd.path);
+       path_put(&dir);
 err:
        rpc_put_mount();
        return error;
@@ -298,6 +295,8 @@ struct rpc_clnt *rpc_create(struct rpc_create_args *args)
         * up a string representation of the passed-in address.
         */
        if (args->servername == NULL) {
+               struct sockaddr_un *sun =
+                               (struct sockaddr_un *)args->address;
                struct sockaddr_in *sin =
                                (struct sockaddr_in *)args->address;
                struct sockaddr_in6 *sin6 =
@@ -305,6 +304,10 @@ struct rpc_clnt *rpc_create(struct rpc_create_args *args)
 
                servername[0] = '\0';
                switch (args->address->sa_family) {
+               case AF_LOCAL:
+                       snprintf(servername, sizeof(servername), "%s",
+                                sun->sun_path);
+                       break;
                case AF_INET:
                        snprintf(servername, sizeof(servername), "%pI4",
                                 &sin->sin_addr.s_addr);
@@ -1057,7 +1060,7 @@ call_allocate(struct rpc_task *task)
 
        dprintk("RPC: %5u rpc_buffer allocation failed\n", task->tk_pid);
 
-       if (RPC_IS_ASYNC(task) || !signalled()) {
+       if (RPC_IS_ASYNC(task) || !fatal_signal_pending(current)) {
                task->tk_action = call_allocate;
                rpc_delay(task, HZ>>4);
                return;
@@ -1171,6 +1174,9 @@ call_bind_status(struct rpc_task *task)
                        status = -EOPNOTSUPP;
                        break;
                }
+               if (task->tk_rebind_retry == 0)
+                       break;
+               task->tk_rebind_retry--;
                rpc_delay(task, 3*HZ);
                goto retry_timeout;
        case -ETIMEDOUT:
This page took 0.02833 seconds and 5 git commands to generate.