]> err.no Git - linux-2.6/blobdiff - fs/nfs/client.c
Remove all inclusions of <linux/config.h>
[linux-2.6] / fs / nfs / client.c
index 12941a8a6d75245134fff12fa8e33acd7ce0dd13..6e4e48c5092afec39d716309ccccd5900105d4e3 100644 (file)
@@ -10,7 +10,6 @@
  */
 
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 
@@ -164,6 +163,26 @@ error_0:
        return NULL;
 }
 
+static void nfs4_shutdown_client(struct nfs_client *clp)
+{
+#ifdef CONFIG_NFS_V4
+       if (__test_and_clear_bit(NFS_CS_RENEWD, &clp->cl_res_state))
+               nfs4_kill_renewd(clp);
+       while (!list_empty(&clp->cl_unused)) {
+               struct nfs4_state_owner *sp;
+
+               sp = list_entry(clp->cl_unused.next,
+                               struct nfs4_state_owner,
+                               so_list);
+               list_del(&sp->so_list);
+               kfree(sp);
+       }
+       BUG_ON(!list_empty(&clp->cl_state_owners));
+       if (__test_and_clear_bit(NFS_CS_IDMAP, &clp->cl_res_state))
+               nfs_idmap_delete(clp);
+#endif
+}
+
 /*
  * Destroy a shared client record
  */
@@ -171,21 +190,7 @@ static void nfs_free_client(struct nfs_client *clp)
 {
        dprintk("--> nfs_free_client(%d)\n", clp->cl_nfsversion);
 
-#ifdef CONFIG_NFS_V4
-       if (__test_and_clear_bit(NFS_CS_IDMAP, &clp->cl_res_state)) {
-               while (!list_empty(&clp->cl_unused)) {
-                       struct nfs4_state_owner *sp;
-
-                       sp = list_entry(clp->cl_unused.next,
-                                       struct nfs4_state_owner,
-                                       so_list);
-                       list_del(&sp->so_list);
-                       kfree(sp);
-               }
-               BUG_ON(!list_empty(&clp->cl_state_owners));
-               nfs_idmap_delete(clp);
-       }
-#endif
+       nfs4_shutdown_client(clp);
 
        /* -EIO all pending I/O */
        if (!IS_ERR(clp->cl_rpcclient))
@@ -263,7 +268,7 @@ struct nfs_client *nfs_find_client(const struct sockaddr_in *addr, int nfsversio
        clp = __nfs_find_client(addr, nfsversion);
        spin_unlock(&nfs_client_lock);
 
-       BUG_ON(clp->cl_cons_state == 0);
+       BUG_ON(clp && clp->cl_cons_state == 0);
 
        return clp;
 }
@@ -454,7 +459,8 @@ static int nfs_start_lockd(struct nfs_server *server)
                goto out;
        if (server->flags & NFS_MOUNT_NONLM)
                goto out;
-       error = lockd_up();
+       error = lockd_up((server->flags & NFS_MOUNT_TCP) ?
+                       IPPROTO_TCP : IPPROTO_UDP);
        if (error < 0)
                server->flags |= NFS_MOUNT_NONLM;
        else
@@ -830,7 +836,9 @@ struct nfs_server *nfs_create_server(const struct nfs_mount_data *data,
        }
        memcpy(&server->fsid, &fattr.fsid, sizeof(server->fsid));
 
-       dprintk("Server FSID: %llx:%llx\n", server->fsid.major, server->fsid.minor);
+       dprintk("Server FSID: %llx:%llx\n",
+               (unsigned long long) server->fsid.major,
+               (unsigned long long) server->fsid.minor);
 
        BUG_ON(!server->nfs_client);
        BUG_ON(!server->nfs_client->rpc_ops);
@@ -996,7 +1004,9 @@ struct nfs_server *nfs4_create_server(const struct nfs4_mount_data *data,
        if (error < 0)
                goto error;
 
-       dprintk("Server FSID: %llx:%llx\n", server->fsid.major, server->fsid.minor);
+       dprintk("Server FSID: %llx:%llx\n",
+               (unsigned long long) server->fsid.major,
+               (unsigned long long) server->fsid.minor);
        dprintk("Mount FH: %d\n", mntfh->size);
 
        error = nfs_probe_fsinfo(server, mntfh, &fattr);
@@ -1049,6 +1059,8 @@ struct nfs_server *nfs4_create_referral_server(struct nfs_clone_mount *data,
                        parent_server->client->cl_xprt->prot,
                        parent_client->retrans_timeo,
                        parent_client->retrans_count);
+       if (error < 0)
+               goto error;
 
        /* Initialise the client representation from the parent server */
        nfs_server_copy_userdata(server, parent_server);
@@ -1068,7 +1080,8 @@ struct nfs_server *nfs4_create_referral_server(struct nfs_clone_mount *data,
                goto error;
 
        dprintk("Referral FSID: %llx:%llx\n",
-               server->fsid.major, server->fsid.minor);
+               (unsigned long long) server->fsid.major,
+               (unsigned long long) server->fsid.minor);
 
        spin_lock(&nfs_client_lock);
        list_add_tail(&server->client_link, &server->nfs_client->cl_superblocks);
@@ -1100,7 +1113,8 @@ struct nfs_server *nfs_clone_server(struct nfs_server *source,
        int error;
 
        dprintk("--> nfs_clone_server(,%llx:%llx,)\n",
-               fattr->fsid.major, fattr->fsid.minor);
+               (unsigned long long) fattr->fsid.major,
+               (unsigned long long) fattr->fsid.minor);
 
        server = nfs_alloc_server();
        if (!server)
@@ -1125,7 +1139,8 @@ struct nfs_server *nfs_clone_server(struct nfs_server *source,
                goto out_free_server;
 
        dprintk("Cloned FSID: %llx:%llx\n",
-               server->fsid.major, server->fsid.minor);
+               (unsigned long long) server->fsid.major,
+               (unsigned long long) server->fsid.minor);
 
        error = nfs_start_lockd(server);
        if (error < 0)
@@ -1369,7 +1384,8 @@ static int nfs_volume_list_show(struct seq_file *m, void *v)
                 MAJOR(server->s_dev), MINOR(server->s_dev));
 
        snprintf(fsid, 17, "%llx:%llx",
-                server->fsid.major, server->fsid.minor);
+                (unsigned long long) server->fsid.major,
+                (unsigned long long) server->fsid.minor);
 
        seq_printf(m, "v%d %02x%02x%02x%02x %4hx %-7s %-17s\n",
                   clp->cl_nfsversion,