diff options
author | Heinz Mauelshagen <hjm@redhat.com> | 2008-04-24 16:43:19 -0400 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2008-04-25 08:26:44 -0400 |
commit | eb69aca5d3370b81450d68edeebc2bb9a3eb9689 (patch) | |
tree | ddb4c6d52e963b0898a892aaaee3228680e36449 /drivers/md/kcopyd.h | |
parent | 22a1ceb1e6a7fbce95a1531ff10bb4fb036d4a37 (diff) |
dm kcopyd: clean interface
Clean up the kcopyd interface to prepare for publishing it in include/linux.
Signed-off-by: Heinz Mauelshagen <hjm@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md/kcopyd.h')
-rw-r--r-- | drivers/md/kcopyd.h | 43 |
1 files changed, 24 insertions, 19 deletions
diff --git a/drivers/md/kcopyd.h b/drivers/md/kcopyd.h index 588f05dffbe1..d3057846b0b0 100644 --- a/drivers/md/kcopyd.h +++ b/drivers/md/kcopyd.h | |||
@@ -1,29 +1,33 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2001 Sistina Software | 2 | * Copyright (C) 2001 - 2003 Sistina Software |
3 | * Copyright (C) 2004 - 2008 Red Hat, Inc. All rights reserved. | ||
3 | * | 4 | * |
4 | * This file is released under the GPL. | 5 | * kcopyd provides a simple interface for copying an area of one |
6 | * block-device to one or more other block-devices, either synchronous | ||
7 | * or with an asynchronous completion notification. | ||
5 | * | 8 | * |
6 | * Kcopyd provides a simple interface for copying an area of one | 9 | * This file is released under the GPL. |
7 | * block-device to one or more other block-devices, with an asynchronous | ||
8 | * completion notification. | ||
9 | */ | 10 | */ |
10 | 11 | ||
11 | #ifndef DM_KCOPYD_H | 12 | #ifndef _LINUX_DM_KCOPYD_H |
12 | #define DM_KCOPYD_H | 13 | #define _LINUX_DM_KCOPYD_H |
14 | |||
15 | #ifdef __KERNEL__ | ||
13 | 16 | ||
14 | #include "dm-io.h" | 17 | #include "dm-io.h" |
15 | 18 | ||
16 | /* FIXME: make this configurable */ | 19 | /* FIXME: make this configurable */ |
17 | #define KCOPYD_MAX_REGIONS 8 | 20 | #define DM_KCOPYD_MAX_REGIONS 8 |
18 | 21 | ||
19 | #define KCOPYD_IGNORE_ERROR 1 | 22 | #define DM_KCOPYD_IGNORE_ERROR 1 |
20 | 23 | ||
21 | /* | 24 | /* |
22 | * To use kcopyd you must first create a kcopyd client object. | 25 | * To use kcopyd you must first create a dm_kcopyd_client object. |
23 | */ | 26 | */ |
24 | struct kcopyd_client; | 27 | struct dm_kcopyd_client; |
25 | int kcopyd_client_create(unsigned int num_pages, struct kcopyd_client **result); | 28 | int dm_kcopyd_client_create(unsigned num_pages, |
26 | void kcopyd_client_destroy(struct kcopyd_client *kc); | 29 | struct dm_kcopyd_client **result); |
30 | void dm_kcopyd_client_destroy(struct dm_kcopyd_client *kc); | ||
27 | 31 | ||
28 | /* | 32 | /* |
29 | * Submit a copy job to kcopyd. This is built on top of the | 33 | * Submit a copy job to kcopyd. This is built on top of the |
@@ -32,11 +36,12 @@ void kcopyd_client_destroy(struct kcopyd_client *kc); | |||
32 | * read_err is a boolean, | 36 | * read_err is a boolean, |
33 | * write_err is a bitset, with 1 bit for each destination region | 37 | * write_err is a bitset, with 1 bit for each destination region |
34 | */ | 38 | */ |
35 | typedef void (*kcopyd_notify_fn)(int read_err, unsigned long write_err, | 39 | typedef void (*dm_kcopyd_notify_fn)(int read_err, unsigned long write_err, |
36 | void *context); | 40 | void *context); |
37 | 41 | ||
38 | int kcopyd_copy(struct kcopyd_client *kc, struct dm_io_region *from, | 42 | int dm_kcopyd_copy(struct dm_kcopyd_client *kc, struct dm_io_region *from, |
39 | unsigned num_dests, struct dm_io_region *dests, | 43 | unsigned num_dests, struct dm_io_region *dests, |
40 | unsigned int flags, kcopyd_notify_fn fn, void *context); | 44 | unsigned flags, dm_kcopyd_notify_fn fn, void *context); |
41 | 45 | ||
42 | #endif | 46 | #endif /* __KERNEL__ */ |
47 | #endif /* _LINUX_DM_KCOPYD_H */ | ||