#include <linux/completion.h>
#include <linux/delay.h>
#include <linux/device-mapper.h>
+#include <linux/err.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/spinlock.h>
/* Make a copy completion if there isn't one */
if (vdo->partition_copier == NULL) {
vdo->partition_copier = dm_kcopyd_client_create(NULL);
- if (vdo->partition_copier == NULL)
- return -ENOMEM;
+ if (IS_ERR(vdo->partition_copier)) {
+ result = PTR_ERR(vdo->partition_copier);
+ vdo->partition_copier = NULL;
+ return result;
+ }
}
/* Free any unused preparation. */
#include <linux/atomic.h>
#include <linux/bio.h>
+#include <linux/err.h>
#include <linux/log2.h>
#include <linux/min_heap.h>
#include <linux/minmax.h>
handle_operation_error,
allocator->thread_id, NULL);
allocator->eraser = dm_kcopyd_client_create(NULL);
- if (allocator->eraser == NULL) {
- vdo_fail_completion(&allocator->completion, -ENOMEM);
+ if (IS_ERR(allocator->eraser)) {
+ vdo_fail_completion(&allocator->completion,
+ PTR_ERR(allocator->eraser));
+ allocator->eraser = NULL;
return;
}
allocator->slabs_to_erase = get_slab_iterator(allocator);