Commit 9fa54a82 authored by Alasdair G. Kergon's avatar Alasdair G. Kergon Committed by Linus Torvalds

[PATCH] Device-mapper: kcopyd

Add kcopyd - a daemon for copying regions of block devices around in an
efficient manner.  Multiple destinations can be specified for a copy.
Designed to perform well both with many small chunks or few large chunks.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent b2ce210e
......@@ -3,7 +3,7 @@
#
dm-mod-objs := dm.o dm-table.o dm-target.o dm-linear.o dm-stripe.o \
dm-ioctl.o dm-io.o
dm-ioctl.o dm-io.o kcopyd.o
raid6-objs := raid6main.o raid6algos.o raid6recov.o raid6tables.o \
raid6int1.o raid6int2.o raid6int4.o \
raid6int8.o raid6int16.o raid6int32.o \
......
......@@ -153,6 +153,7 @@ static struct {
xx(dm_target)
xx(dm_linear)
xx(dm_stripe)
xx(kcopyd)
xx(dm_interface)
#undef xx
};
......
......@@ -177,6 +177,9 @@ void dm_linear_exit(void);
int dm_stripe_init(void);
void dm_stripe_exit(void);
int kcopyd_init(void);
void kcopyd_exit(void);
void *dm_vcalloc(unsigned long nmemb, unsigned long elem_size);
#endif
This diff is collapsed.
/*
* Copyright (C) 2001 Sistina Software
*
* This file is released under the GPL.
*/
#ifndef DM_KCOPYD_H
#define DM_KCOPYD_H
#include "dm-io.h"
int kcopyd_init(void);
void kcopyd_exit(void);
/* FIXME: make this configurable */
#define KCOPYD_MAX_REGIONS 8
#define KCOPYD_IGNORE_ERROR 1
/*
* To use kcopyd you must first create a kcopyd client object.
*/
struct kcopyd_client;
int kcopyd_client_create(unsigned int num_pages, struct kcopyd_client **result);
void kcopyd_client_destroy(struct kcopyd_client *kc);
/*
* Submit a copy job to kcopyd. This is built on top of the
* previous three fns.
*
* read_err is a boolean,
* write_err is a bitset, with 1 bit for each destination region
*/
typedef void (*kcopyd_notify_fn)(int read_err,
unsigned int write_err, void *context);
int kcopyd_copy(struct kcopyd_client *kc, struct io_region *from,
unsigned int num_dests, struct io_region *dests,
unsigned int flags, kcopyd_notify_fn fn, void *context);
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment