VServer 1.9.2 (patch-2.6.8.1-vs1.9.2.diff)
[linux-2.6.git] / drivers / md / kcopyd.c
index 40e4694..f296161 100644 (file)
@@ -24,9 +24,6 @@
 
 #include "kcopyd.h"
 
-/* FIXME: this is only needed for the DMERR macros */
-#include "dm.h"
-
 static struct workqueue_struct *_kcopyd_wq;
 static struct work_struct _kcopyd_work;
 
@@ -87,7 +84,7 @@ static int kcopyd_get_pages(struct kcopyd_client *kc,
                ;
 
        kc->pages = pl->next;
-       pl->next = 0;
+       pl->next = NULL;
 
        spin_unlock(&kc->lock);
 
@@ -576,12 +573,11 @@ int kcopyd_cancel(struct kcopyd_job *job, int block)
 static DECLARE_MUTEX(_client_lock);
 static LIST_HEAD(_clients);
 
-static int client_add(struct kcopyd_client *kc)
+static void client_add(struct kcopyd_client *kc)
 {
        down(&_client_lock);
        list_add(&kc->list, &_clients);
        up(&_client_lock);
-       return 0;
 }
 
 static void client_del(struct kcopyd_client *kc)
@@ -671,15 +667,7 @@ int kcopyd_client_create(unsigned int nr_pages, struct kcopyd_client **result)
                return r;
        }
 
-       r = client_add(kc);
-       if (r) {
-               dm_io_put(nr_pages);
-               client_free_pages(kc);
-               kfree(kc);
-               kcopyd_exit();
-               return r;
-       }
-
+       client_add(kc);
        *result = kc;
        return 0;
 }