2 * Copyright (C) 2003 Sistina Software
4 * This file is released under the GPL.
13 struct block_device
*bdev
;
19 struct page_list
*next
;
25 * 'error' is a bitset, with each bit indicating whether an error
26 * occurred doing io to the corresponding region.
28 typedef void (*io_notify_fn
)(unsigned long error
, void *context
);
32 * Before anyone uses the IO interface they should call
33 * dm_io_get(), specifying roughly how many pages they are
34 * expecting to perform io on concurrently.
36 * This function may block.
38 int dm_io_get(unsigned int num_pages
);
39 void dm_io_put(unsigned int num_pages
);
44 * Please ensure that the rw flag in the next two functions is
45 * either READ or WRITE, ie. we don't take READA. Any
46 * regions with a zero count field will be ignored.
48 int dm_io_sync(unsigned int num_regions
, struct io_region
*where
, int rw
,
49 struct page_list
*pl
, unsigned int offset
,
50 unsigned long *error_bits
);
52 int dm_io_sync_bvec(unsigned int num_regions
, struct io_region
*where
, int rw
,
53 struct bio_vec
*bvec
, unsigned long *error_bits
);
55 int dm_io_sync_vm(unsigned int num_regions
, struct io_region
*where
, int rw
,
56 void *data
, unsigned long *error_bits
);
61 * The 'where' array may be safely allocated on the stack since
62 * the function takes a copy.
64 int dm_io_async(unsigned int num_regions
, struct io_region
*where
, int rw
,
65 struct page_list
*pl
, unsigned int offset
,
66 io_notify_fn fn
, void *context
);
68 int dm_io_async_bvec(unsigned int num_regions
, struct io_region
*where
, int rw
,
69 struct bio_vec
*bvec
, io_notify_fn fn
, void *context
);
71 int dm_io_async_vm(unsigned int num_regions
, struct io_region
*where
, int rw
,
72 void *data
, io_notify_fn fn
, void *context
);