2 * Copyright (C) 2003 Sistina Software
4 * This file is released under the GPL.
13 struct block_device *bdev;
15 sector_t count; /* If this is zero the region is ignored. */
19 struct page_list *next;
23 typedef void (*io_notify_fn)(unsigned long error, void *context);
26 DM_IO_PAGE_LIST,/* Page list */
27 DM_IO_BVEC, /* Bio vector */
28 DM_IO_VMA, /* Virtual memory area */
29 DM_IO_KMEM, /* Kernel memory */
33 enum dm_io_mem_type type;
46 io_notify_fn fn; /* Callback for asynchronous requests */
47 void *context; /* Passed to callback */
51 * IO request structure
54 struct dm_io_request {
55 int bi_rw; /* READ|WRITE - not READA */
56 struct dm_io_memory mem; /* Memory to use for io */
57 struct dm_io_notify notify; /* Synchronous if notify.fn is NULL */
58 struct dm_io_client *client; /* Client memory handler */
62 * For async io calls, users can alternatively use the dm_io() function below
63 * and dm_io_client_create() to create private mempools for the client.
65 * Create/destroy may block.
67 struct dm_io_client *dm_io_client_create(unsigned num_pages);
68 int dm_io_client_resize(unsigned num_pages, struct dm_io_client *client);
69 void dm_io_client_destroy(struct dm_io_client *client);
72 * IO interface using private per-client pools.
73 * Each bit in the optional 'sync_error_bits' bitset indicates whether an
74 * error occurred doing io to the corresponding region.
76 int dm_io(struct dm_io_request *io_req, unsigned num_regions,
77 struct io_region *region, unsigned long *sync_error_bits);