]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/nfs/client.c
Merge git://git.infradead.org/battery-2.6
[linux-2.6-omap-h63xx.git] / fs / nfs / client.c
index 5bd03b97002e1e9dd73f1d36aeecaaf76c94da5c..ccb455053ee48090ab21b4bdd55294d3f4694010 100644 (file)
@@ -12,7 +12,7 @@
 
 #include <linux/module.h>
 #include <linux/init.h>
-
+#include <linux/sched.h>
 #include <linux/time.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
@@ -27,7 +27,6 @@
 #include <linux/nfs_mount.h>
 #include <linux/nfs4_mount.h>
 #include <linux/lockd/bind.h>
-#include <linux/smp_lock.h>
 #include <linux/seq_file.h>
 #include <linux/mount.h>
 #include <linux/nfs_idmap.h>
@@ -103,19 +102,10 @@ static struct nfs_client *nfs_alloc_client(const char *hostname,
                                           int nfsversion)
 {
        struct nfs_client *clp;
-       int error;
 
        if ((clp = kzalloc(sizeof(*clp), GFP_KERNEL)) == NULL)
                goto error_0;
 
-       error = rpciod_up();
-       if (error < 0) {
-               dprintk("%s: couldn't start rpciod! Error = %d\n",
-                               __FUNCTION__, error);
-               goto error_1;
-       }
-       __set_bit(NFS_CS_RPCIOD, &clp->cl_res_state);
-
        if (nfsversion == 4) {
                if (nfs_callback_up() < 0)
                        goto error_2;
@@ -140,8 +130,6 @@ static struct nfs_client *nfs_alloc_client(const char *hostname,
 #ifdef CONFIG_NFS_V4
        init_rwsem(&clp->cl_sem);
        INIT_LIST_HEAD(&clp->cl_delegations);
-       INIT_LIST_HEAD(&clp->cl_state_owners);
-       INIT_LIST_HEAD(&clp->cl_unused);
        spin_lock_init(&clp->cl_lock);
        INIT_DELAYED_WORK(&clp->cl_renewd, nfs4_renew_state);
        rpc_init_wait_queue(&clp->cl_rpcwaitq, "NFS client");
@@ -155,9 +143,6 @@ error_3:
        if (__test_and_clear_bit(NFS_CS_CALLBACK, &clp->cl_res_state))
                nfs_callback_down();
 error_2:
-       rpciod_down();
-       __clear_bit(NFS_CS_RPCIOD, &clp->cl_res_state);
-error_1:
        kfree(clp);
 error_0:
        return NULL;
@@ -168,16 +153,7 @@ 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));
+       BUG_ON(!RB_EMPTY_ROOT(&clp->cl_state_owners));
        if (__test_and_clear_bit(NFS_CS_IDMAP, &clp->cl_res_state))
                nfs_idmap_delete(clp);
 #endif
@@ -199,9 +175,6 @@ static void nfs_free_client(struct nfs_client *clp)
        if (__test_and_clear_bit(NFS_CS_CALLBACK, &clp->cl_res_state))
                nfs_callback_down();
 
-       if (__test_and_clear_bit(NFS_CS_RPCIOD, &clp->cl_res_state))
-               rpciod_down();
-
        kfree(clp->cl_hostname);
        kfree(clp);